Semantic Versioning
The /semver endpoint parses, bumps, and compares semantic versions following the semver.org specification.
How it works?
A version must match the official grammar MAJOR.MINOR.PATCH, optionally followed by -prerelease and +build. Leading zeros are rejected, so 01.2.3 is invalid.
Comparison follows semver precedence: numeric parts first, then the prerelease. A version carrying a prerelease ranks below the same version without one, numeric prerelease identifiers are compared as numbers (alpha.2 is lower than alpha.10), and build metadata is ignored entirely.
A bump resets the lower parts to zero and drops both the prerelease and the build metadata, so 1.0.0-alpha+build.1 bumped on patch gives 1.0.1.
A + sign decodes as a space in a query string, so the API restores it before parsing — build metadata can be sent as-is or percent-encoded.
curl -X GET \ "https://api.moxon.dev/v6/semver"Send the request to see the response here.
versionstringrequiredVersion to work with (e.g.
1.2.3-beta.1+build.42)action"parse" | "bump" | "compare"optionalAction to perform:
parse,bumporcompare. Default:parsepart"major" | "minor" | "patch"optionalbumponly: part to increment,major,minororpatch. Default:patchotherstringconditionalSecond version to compare against (required for
compare)
| Action | Description |
|---|---|
parse | Splits the version into its components |
bump | Increments part and resets the lower parts to zero |
compare | Compares version against other using semver precedence |
parse action:
versionstringThe original input version
majornumberMajor number
minornumberMinor number
patchnumberPatch number
prereleasestring|nullPrerelease identifiers without the leading
-,nullif absentbuildstring|nullBuild metadata without the leading
+,nullif absent
bump action:
versionstringThe original input version
actionstringbumppartstringPart that was incremented
resultstringThe bumped version
compare action:
versionstringThe original input version
actionstringcompareotherstringThe version compared against
resultnumber-1ifversionis lower,0if equal,1if higherdescriptionstringHuman-readable comparison (e.g.
1.2.3 < 1.3.0)
If parameters are missing or invalid, the API will return an error:
- 400
Please provide a version (?version={version})Theversionparameter is missing - 400
Action must be one of: parse, bump, compareTheactionvalue is not valid - 400
Version must be 256 characters or fewerTheversionorothervalue exceeds the maximum length - 400
Invalid semver versionTheversionorothervalue does not match the semver grammar - 400
Part must be one of: major, minor, patchThepartvalue is not valid forbump - 400
Please provide a second version (&other={version})Theotherparameter is missing forcompare
Last updated on September 12, 2026