{"uid":"cap_o4ry8XXsUJWHmZrlFauPu","slug":"cheap-utilities-semver-compare-9d6c9933","name":"Cheap Utilities Semver Compare","description":"Compare two semver versions by precedence and test whether a version satisfies a range like ^1.2.0 or >=2 <3.","url":"https://cheap-utilities.x402tookit.com/semver-compare?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["a"],"properties":{"a":{"type":"string","description":"Version, e.g. 1.4.2 or 2.0.0-beta.1"},"b":{"type":"string","description":"Second version to compare with"},"range":{"type":"string","description":"Range to test a against, e.g. ^1.2.0 || >=3"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"a":{"type":["null","string"]},"asOf":{"type":["null","string"]},"order":{"type":["null","number"]},"range":{"type":["null","string"]},"parsed":{"type":["null","object"],"properties":{"major":{"type":["null","number"]},"minor":{"type":["null","number"]},"patch":{"type":["null","number"]},"prerelease":{}}},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"comparison":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"satisfiesRange":{"type":["boolean","null"]},"majorDifference":{"type":["boolean","null"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_T_w26q215T34LC9CZBMv9","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compare two semantic version strings by precedence and/or test whether a version satisfies a semver range expression like ^1.2.0 or >=2 <3.","exampleAgentPrompt":"Is version 2.3.0 greater than 2.11.0 in semver precedence, and does 2.11.0 satisfy the range ^2.3.0?","exampleUseCases":[{"title":"Dependency compatibility check","prompt":"Does version 3.1.4 of this library satisfy the peer dependency range >=3.0.0 <4.0.0?"},{"title":"Release candidate ordering","prompt":"Which version has higher semver precedence: 1.0.0-rc.2 or 1.0.0-beta.11?"},{"title":"Breaking change detection","prompt":"Compare 1.9.3 and 2.0.0 — is there a major version difference, and does 2.0.0 satisfy ^1.9.3?"}],"resultDescription":"Returns a JSON object with: the order field (-1, 0, or 1 indicating which version is greater), a satisfiesRange boolean if a range was provided, parsed version components (major, minor, patch, prerelease), a human-readable summary and verdict, a majorDifference boolean, comparison string, and optional reasons or disclaimer fields.","failureModes":["Missing required 'a' query parameter returns an error","Malformed semver string (e.g. 'v.x.y') may return a parse error or null parsed fields","Invalid range expression returns an error or null satisfiesRange","'b' omitted when only range check is needed — range-only mode works without b","Network or service unavailability returns a non-200 response"],"whenToPreferThis":"Choose this endpoint when you need programmatic semver comparison or range satisfaction checks without setting up a local semver library — ideal for CI/CD agents, dependency auditors, or any workflow that needs to evaluate version compatibility at runtime via a simple HTTP GET.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T00:34:47.933Z","isFirstParty":false,"canonicalSlug":"cheap-utilities-semver-compare-9d6c9933"}