Semver
GET/v0/semver
Validates a semantic version string according to the Semver 2.0.0 specification and parses it into its components: major, minor, patch, pre-release identifiers, and build metadata.
Try it
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| value | string | Yes | The version string to validate, e.g. 1.2.3-alpha.1+build.456 |
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.isvalid.dev/v0/semver?value=1.2.3-alpha.1%2Bbuild.456"
Response Fields
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the string is a valid Semver 2.0.0 version |
| major | number | Major version number. Only present when valid is true. |
| minor | number | Minor version number. Only present when valid is true. |
| patch | number | Patch version number. Only present when valid is true. |
| prerelease | string[] | null | Pre-release identifiers split by ., e.g. ["alpha", "1"]. null when absent. Only present when valid is true. |
| build | string[] | null | Build metadata identifiers split by ., e.g. ["build", "456"]. null when absent. Only present when valid is true. |
Example Response
{
"valid": true,
"major": 1,
"minor": 2,
"patch": 3,
"prerelease": ["alpha", "1"],
"build": ["build", "456"]
}