# OSV Package Vulnerability Query API

Find OSV vulnerabilities for a package version or Git commit via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Osv, pass parameters such as package, version, and retrieve structured data including matched vulnerability identifier, advisory summary, and affected package ecosystem for release checks and commit investigation, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/market/apis/osv/osv-package-vulnerability-query-api/?offering=a2510498-4401-4086-88c8-a9459e172820
API ID: a2510498-4401-4086-88c8-a9459e172820
Provider: osv
Contract revision: 2
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/osv/v1/query
Page update time: 2026-12-03T02:49:10.506Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.005 / call
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract. Price update time: not supplied.
Contract update time: 2026-12-03T02:49:09.843Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "5000",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "OSV Package Vulnerability Query API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {}
    },
    "headers": {
      "type": "object",
      "properties": {}
    },
    "body": {
      "description": "Query format.",
      "properties": {
        "commit": {
          "description": "The commit hash to query for. If specified, `version` should not be set.",
          "type": "string"
        },
        "package": {
          "description": "The package to query against. When a `commit` hash is given, this is\noptional. Use name AND ecosystem OR purl. Do not combine purl with name or ecosystem. OSV validates these semantic combinations.",
          "properties": {
            "ecosystem": {
              "description": "Required. The ecosystem for this package.\nFor the complete list of valid ecosystem names, see\n<https://ossf.github.io/osv-schema/#affectedpackage-field>.",
              "type": "string"
            },
            "name": {
              "description": "Required. Name of the package. Should match the name used in the package\necosystem (e.g. the npm package name). For C/C++ projects integrated in\nOSS-Fuzz, this is the name used for the integration.",
              "type": "string"
            },
            "purl": {
              "description": "Optional. The package URL for this package.",
              "type": "string"
            }
          },
          "type": "object"
        },
        "page_token": {
          "description": "Continuation token from the prior result. In a batch, use the token belonging to the same query item.",
          "type": "string"
        },
        "version": {
          "description": "The version string to query for. A fuzzy match is done against upstream\nversions. If specified, `commit` should not be set. Do not combine top-level version with a version embedded in package.purl; OSV returns 400 for that combination.",
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "vulns": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "affected": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "database_specific": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string"
                    }
                  }
                },
                "ecosystem_specific": {
                  "type": "object",
                  "properties": {
                    "severity": {
                      "type": "string"
                    }
                  }
                },
                "package": {
                  "type": "object",
                  "properties": {
                    "ecosystem": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "purl": {
                      "type": "string"
                    }
                  }
                },
                "ranges": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "events": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "introduced": {
                              "type": "string"
                            },
                            "fixed": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "repo": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    }
                  }
                },
                "versions": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "details": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "modified": {
            "type": "string"
          },
          "published": {
            "type": "string"
          },
          "references": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "schema_version": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        }
      }
    }
  }
}
```

## Request example
Scenario: Official example · Live OSV paired capture - 2026-11-19
```bash
curl \
  'https://api.openany.si/v1/agent-apis/osv/v1/query' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "package": {
    "ecosystem": "OSS-Fuzz",
    "name": "mruby"
  },
  "version": "2.1.2"
}'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
````json
{
  "vulns": [
    {
      "affected": [
        {
          "database_specific": {
            "source": "https://github.com/google/oss-fuzz-vulns/blob/main/vulns/mruby/OSV-2020-744.yaml"
          },
          "ecosystem_specific": {
            "severity": "HIGH"
          },
          "package": {
            "ecosystem": "OSS-Fuzz",
            "name": "mruby",
            "purl": "pkg:generic/mruby"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "9cdf439db52b66447b4e37c61179d54fad6c8f33"
                },
                {
                  "fixed": "97319697c8f9f6ff27b32589947e1918e3015503"
                }
              ],
              "repo": "https://github.com/mruby/mruby",
              "type": "GIT"
            }
          ],
          "versions": [
            "2.1.2",
            "2.1.2-rc",
            "2.1.2-rc2"
          ]
        }
      ],
      "details": "OSS-Fuzz report: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23801\n\n```\nCrash type: Heap-double-free\nCrash state:\nmrb_default_allocf\nmrb_free\nobj_free\n```\n",
      "id": "OSV-2020-744",
      "modified": "2022-04-13T03:04:39.780694Z",
      "published": "2020-07-04T00:00:01.948828Z",
      "references": [
        {
          "type": "REPORT",
          "url": "https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23801"
        }
      ],
      "schema_version": "1.7.3",
      "summary": "Heap-double-free in mrb_default_allocf"
    }
  ]
}
````

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Available implementations
- osv: https://openany.si/market/apis/osv/osv-package-vulnerability-query-api/?offering=a2510498-4401-4086-88c8-a9459e172820

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
