Skip to content
POST AI agent ready /v1/semver/validate

Semver Validator API - Parse & Check Version Strings

Check whether a string conforms to the semver 2.0.0 specification. If valid, returns the parsed major, minor, patch, pre-release, and build metadata components.

Parameters

stringrequired

The version string to validate.

Code examples

curl -X POST https://api.botoi.com/v1/semver/validate \
  -H "Content-Type: application/json" \
  -d '{"version":"3.2.1-beta.1+build.456"}'

When to use this API

CI/CD version gate

Validate that the version tag in your package.json or Cargo.toml is a valid semver string before publishing to a registry.

API request validation

Validate version strings in X-API-Version headers or query parameters before routing to the correct handler.

Frequently asked questions

Is a leading "v" accepted?
A leading "v" (e.g., "v1.2.3") is stripped before validation. The underlying version 1.2.3 is then evaluated.
Are partial versions like "1.2" valid?
No. Semver 2.0.0 requires exactly three numeric components: major.minor.patch. "1.2" is not valid.
What characters are allowed in pre-release identifiers?
Pre-release identifiers can contain alphanumeric characters and hyphens (e.g., alpha, beta.1, rc-1). They must not be empty.
Does this validate version ranges or constraints?
No. This endpoint validates single version strings only. Range expressions like ">=1.0.0 <2.0.0" are not supported.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.