Api Endpoint

Semver Parser and Compare

Semver parser and comparator: parse a semantic version into major, minor, patch, prerelease and build parts; compare two versions by precedence including prerelease ordering; or test whether a version satisfies a range expression using caret, tilde, hyphen, x-ranges and comparator sets. Returns the parsed structure, the comparison result and the reason a range did not match.

Open interactive test console

Offering

Provider
api.duoleads.com
Method
GET
Offering type
Api Endpoint
Transport type
http
Category
Development
Delivery
Not provided
Pricing model
Not provided
x402 version
2

Endpoint context

URL
https://api.duoleads.com/v1/code/semver
MIME type
application/json
First seen
2026-10-16T01:50:38.788Z
Last seen
Tags
semver, semantic-version, version-compare, versions, code

Payment pricing

x402 payment terms are the authoritative price for calling this endpoint.

Payment option 1
0.05 USDC
Atomic price: 50000 · Network: eip155:8453 · Asset: USDC · Scheme: exact
Raw x402 terms
[
  {
    "scheme": "exact",
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": "50000",
    "payTo": "0xCD673f7e1daD254347AEab6be0DEFe8b9C6b3A39"
  }
]

Observed health

Status
Healthy
Latest latency
55 ms
Average latency
578 ms
HTTP status
402
Last checked
Reachability
100% over 14 checks

Latency is measured to the first response headers. A reachable result does not verify response accuracy or merchant identity.

Input schema

{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "const": "http"
    },
    "method": {
      "type": "string",
      "enum": [
        "GET"
      ]
    },
    "queryParams": {
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "description": "parse (default), compare, satisfies or sort.",
          "enum": [
            "parse",
            "compare",
            "satisfies",
            "sort"
          ],
          "maxLength": 64,
          "default": "parse"
        },
        "version": {
          "type": "string",
          "description": "Version to parse (op=parse) or test (op=satisfies).",
          "maxLength": 256
        },
        "a": {
          "type": "string",
          "description": "First version for op=compare.",
          "maxLength": 256
        },
        "b": {
          "type": "string",
          "description": "Second version for op=compare.",
          "maxLength": 256
        },
        "range": {
          "type": "string",
          "description": "Range expression for op=satisfies, e.g. ^1.2.0.",
          "maxLength": 256
        },
        "versions": {
          "type": "string",
          "description": "Comma-separated versions for op=sort, at most 100.",
          "maxLength": 2048
        }
      },
      "required": []
    }
  },
  "required": [
    "type",
    "method"
  ],
  "additionalProperties": false
}

Output schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "input": {
      "additionalProperties": false,
      "properties": {
        "method": {
          "enum": [
            "GET"
          ],
          "type": "string"
        },
        "queryParams": {
          "properties": {
            "a": {
              "description": "First version for op=compare.",
              "maxLength": 256,
              "type": "string"
            },
            "b": {
              "description": "Second version for op=compare.",
              "maxLength": 256,
              "type": "string"
            },
            "op": {
              "default": "parse",
              "description": "parse (default), compare, satisfies or sort.",
              "enum": [
                "parse",
                "compare",
                "satisfies",
                "sort"
              ],
              "maxLength": 64,
              "type": "string"
            },
            "range": {
              "description": "Range expression for op=satisfies, e.g. ^1.2.0.",
              "maxLength": 256,
              "type": "string"
            },
            "version": {
              "description": "Version to parse (op=parse) or test (op=satisfies).",
              "maxLength": 256,
              "type": "string"
            },
            "versions": {
              "description": "Comma-separated versions for op=sort, at most 100.",
              "maxLength": 2048,
              "type": "string"
            }
          },
          "required": [],
          "type": "object"
        },
        "type": {
          "const": "http",
          "type": "string"
        }
      },
      "required": [
        "type",
        "method"
      ],
      "type": "object"
    },
    "output": {
      "properties": {
        "example": {
          "properties": {
            "data": {
              "properties": {
                "a": {
                  "type": "string"
                },
                "b": {
                  "type": "string"
                },
                "build": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "canonical": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "comparators": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "invalid": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "is_prerelease": {
                  "type": "boolean"
                },
                "major": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "minor": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "patch": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "precedence_note": {
                  "type": "string"
                },
                "prerelease": {
                  "items": {
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "type": "array"
                },
                "range": {
                  "type": "string"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "result": {
                  "type": "integer"
                },
                "satisfies": {
                  "type": "boolean"
                },
                "sorted": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "valid": {
                  "type": "boolean"
                }
              },
              "type": "object"
            },
            "meta": {
              "properties": {
                "computed_at": {
                  "description": "RFC 3339 UTC with milliseconds",
                  "type": "string"
                },
                "deterministic": {
                  "type": "boolean"
                },
                "disclaimer": {
                  "type": "string"
                },
                "price_usd": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "sources": {
                  "items": {
                    "required": [
                      "id",
                      "version",
                      "published"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "required": [
                "request_id",
                "computed_at",
                "price_usd",
                "deterministic",
                "disclaimer"
              ],
              "type": "object"
            },
            "ok": {
              "const": true
            },
            "route": {
              "const": "/v1/code/semver"
            },
            "version": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "route",
            "version",
            "data",
            "meta"
          ],
          "type": "object"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "input"
  ],
  "type": "object"
}