Semver Checker Online
Parse and validate semantic versions, compare them, check npm-style ranges (^, ~, x, ||), sort lists and compute the next major / minor / patch / pre-release.
Result
Press “Run” to see the result.
The semver API applies the rules of npm’s semver package, the reference implementation of Semantic Versioning 2.0.0. With version it parses a version (major, minor, patch, pre-release and build parts), compares it with compare= (lower / higher / equal and which part differs), tests it against a range such as ^1.2.0, ~3.4, >=2 <3, 1.x || 2.x or 1.2.3 - 2.0.0, and lists the next version for every release type.
With versions (an array or a comma-separated list) it sorts them, reports invalid entries, returns the latest and latest stable version and, with a range, the versions that satisfy it and the highest and lowest matches, which is how package managers pick a version.
coerce=true turns loose input such as v2, 1.2 or release-3.4.1 into a valid version; pre-releases only match ranges that mention them unless include_prerelease=true.
Use this in your code
curl "https://apibox.io.vn/v1/semver?versions=1.0.0,2.0.0-rc.1,1.10.0,1.2.0&range=>=1.2 <2" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch('https://apibox.io.vn/v1/semver?versions=1.0.0,2.0.0-rc.1,1.10.0,1.2.0&range=>=1.2 <2', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const data = await res.json();
console.log(data);import requests
res = requests.get(
"https://apibox.io.vn/v1/semver?versions=1.0.0,2.0.0-rc.1,1.10.0,1.2.0&range=>=1.2 <2",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/semver?versions=1.0.0,2.0.0-rc.1,1.10.0,1.2.0&range=>=1.2 <2');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
What does ^1.2.3 allow?
Any version >=1.2.3 and <2.0.0. For 0.x versions the caret is stricter: ^0.2.3 means >=0.2.3 <0.3.0.
Why does 2.0.0-rc.1 not satisfy >=1.0.0?
By npm rules pre-releases only match comparators that have a pre-release on the same version. Use include_prerelease=true to include them.
Why is 1.10.0 after 1.9.0?
Each part is compared as a number, unlike plain string sorting.