{"uid":"cap_WAMnzK0x27s4BTlWzuJn1","slug":"saylor-innovations-semver-compare-8018cc04","name":"Saylor Innovations Semver Compare","description":"Semver comparison - which version is newer and the kind of difference","url":"https://saylorinnovations.com/api/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","queryParams"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["a","b"],"properties":{"a":{"type":"string","description":"required first version, e.g. 1.2.3 (query)"},"b":{"type":"string","description":"required second version, e.g. 2.0.0-rc.1 (query)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["a","b","comparison","result","difference"],"properties":{"a":{"type":"string"},"b":{"type":"string"},"result":{"type":"string","description":"Result of the operation"},"comparison":{"type":"number"},"difference":{"type":"string"},"scope_note":{"type":"string","description":"What this data covers and what it leaves out"}},"additionalProperties":true},"description":{"type":"string"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_3SvT8cGjDsgoPbMGvDgPy","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two semantic version strings and returns which is newer, a numeric comparison result, and the type of version difference (major, minor, patch, etc.)","exampleAgentPrompt":"Which is newer, version 1.4.2 or 2.0.0-rc.1, and is it a major, minor, or patch difference?","exampleUseCases":[{"title":"Dependency upgrade impact check","prompt":"I'm looking at upgrading a library from version 3.2.1 to 3.3.0 — is that a major or minor change, and which version is actually newer?"},{"title":"CI pipeline version gate","prompt":"Before I deploy, tell me which is greater: the current release 2.1.0 or the candidate 2.1.1, and what kind of bump it is."},{"title":"Pre-release vs stable comparison","prompt":"Is 4.0.0-beta.3 considered newer or older than 3.9.5 in semver terms, and what's the difference type?"}],"resultDescription":"Returns a JSON object containing both input versions (a, b), a numeric comparison value (negative if a < b, zero if equal, positive if a > b), a human-readable result indicating which version is newer, and a difference field classifying the change type (e.g. major, minor, patch, pre-release). An optional scope_note may clarify edge cases.","failureModes":["Invalid semver string for either parameter returns an error response","Missing required query parameter a or b causes a 400-level error","Pre-release or build-metadata strings that don't conform to semver spec may produce unexpected results","Network timeout if the upstream service is unavailable"],"whenToPreferThis":"Use this endpoint when you need a definitive, spec-compliant semver comparison including the type of version difference (major/minor/patch), especially when processing package dependency versions, release automation, or CI/CD gating logic. Prefer this over simple string comparison or custom logic when pre-release identifiers (e.g. -rc.1, -beta.3) need to be handled correctly per the semver spec.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-03T12:50:02.943Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-semver-compare-8018cc04"}