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.
- Selected price
- $0.005 / callPublished pricing
- Sellers / APIs
- 1 / 1
- Requests · 30d
- 2Selected implementation · last 30 days
- Success rate · 30d
- 100.00%Selected implementation · last 30 days
OSV Package Vulnerability Query API
Prepare your request, then continue with your agent.
Selected price
$0.005 / call
- Provider
- Pricing
On this page
Overview
OSV Package Vulnerability Query API
POST a package identity and version, a PURL, or a commit-based query. Results contain vulnerability records rather than the compact batch projection. If a next_page_token is returned, repeat the same query with page_token until pagination is complete.
Quick Facts
| Fact | Value |
|---|---|
| Access | OpenAny REST |
| Authentication | OpenAny API key in the Authorization header |
| Core inputs | JSON body: package/version, PURL, or commit; optional page_token for continuation. |
| Selected implementation | osv · OSV Package Vulnerability Query API |
| Billing | See the pricing area for the selected implementation and request options |
What You Can Build
- Release checks: Look up known advisories for a specific package version.
- Commit investigation: Link a selected Git commit to matching vulnerability records.
Documented Response Fields
| Field | Meaning |
|---|---|
vulns[].id |
Matched vulnerability identifier |
vulns[].summary |
Advisory summary |
vulns[].affected[].package.ecosystem |
Affected package ecosystem |
vulns[].affected[].ranges[].type |
Type used to interpret affected ranges |
vulns[].references[].url |
Source report or advisory link |
Quick Start
- Set OPENANY_API_KEY to your OpenAny API key.
- Review the selected implementation and pricing, then adapt the request below to your target.
- Check the HTTP response and business result before reading optional fields.
curl --request POST \
https://api.openany.si/v1/agent-apis/osv/v1/query \
-H "Authorization: Bearer ${OPENANY_API_KEY}" \
-H "Content-Type: application/json" \
--data-raw '{"package":{"ecosystem":"OSS-Fuzz","name":"mruby"},"version":"2.1.2"}'
Request and Response Examples
The saved examples include a prior package-query capture and a historical documentation response. The calling template is independent; use the returned package identity, affected ranges and modification time when reviewing matches.
Published OSV Package Vulnerability Query API implementation contract.
Pricing and Billing
The pricing area reflects the selected API implementation. Review its billing unit and any request-dependent rules before calling; a source service's public availability does not determine OpenAny billing.
Frequently Asked Questions
Related APIs
Playground
Run sends a real API request. Charges follow the published API contract.
Sellers
| Seller | Pricing | Requests · 30d | Performance | Access |
|---|---|---|---|---|
osvCurrent OSV Package Vulnerability Query API · POST · View API reference | $0.005 / call | 2 | 100.00%successP50612.5ms |
- Unit price
- $0.005
Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 2. Price update time: not supplied.
Total $0.5
API
- Method
- POST
- Endpoint
https://api.openany.si/v1/agent-apis/osv/v1/query- Content type
- application/json
- Authentication
Authorization: Bearer $OPENANY_API_KEY
Input parameters
Fields in this listing; additional options and input encoding can vary by provider.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
commit | JSON request bodybody | string | No | The commit hash to query for. If specified, `version` should not be set. |
package | JSON request bodybody | object | No | The package to query against. When a `commit` hash is given, this is optional. Use name AND ecosystem OR purl. Do not combine purl with name or ecosystem. OSV validates these semantic combinations. Nested fields and variants
|
page_token | JSON request bodybody | string | No | Continuation token from the prior result. In a batch, use the token belonging to the same query item. |
version | JSON request bodybody | string | No | The version string to query for. A fuzzy match is done against upstream versions. 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. |
Required markers inside a nested object or variant apply when that object or variant is used.
Response structure
vulnsobject[]affectedobject[]database_specificobjectsourcestring
ecosystem_specificobjectseveritystring
packageobjectecosystemstringnamestringpurlstring
rangesobject[]eventsobject[]introducedstringfixedstring
repostringtypestring
versionsstring[]
detailsstringidstringmodifiedstringpublishedstringreferencesobject[]typestringurlstring
schema_versionstringsummarystring
Agent integration
Copy the resource contract without sharing an API key.
Error handling
| Status | Next step |
|---|---|
400 | Check the offering and request fields. |
401 / 403 | Verify your credentials and access permissions. |
402 | Inspect the selected access mode and returned payment requirements. |
429 | Respect the returned rate limit and retry guidance. |
5xx | Inspect the error and usage record before retrying a paid operation. |
Examples
Official example · Live OSV paired capture - 2026-11-19
Example from the provider's documentation. Field values in your results will differ.
Prepare your environment
Use a terminal with cURL installed.
Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.
Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.
Terminal · macOS / Linuxprintf 'OpenAny API key: ' read -r -s OPENANY_API_KEY export OPENANY_API_KEY printf '\n'Run the request
Paste the complete command below into your terminal.
Values to replace before running 1
Review these request fields before running. Keep the published provider and request method unchanged.
body- Query format.
Terminal · cURLcurl \ '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" }'Check the response
Sample response · Documented HTTP 200
Sample response{ "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" } ] }