OSV Package Vulnerability Query API
Use the OSV Package Vulnerability Query API to find known vulnerabilities affecting an open source package version or Git commit. Identify a package with its name and ecosystem or a Package URL, or provide a commit hash, then continue with a page token when more results are available. Review affected version ranges, published advisories, and available fix references to check dependency updates, investigate a vulnerable release, or add checks to a build workflow. Results reflect the indexed database rather than a scan of your source code. The detail page includes request and response examples, supported parameters, and per-request pricing.
- Selected price
- $0.005 / callPublished pricing
- Sellers / APIs
- 1 / 1
- Requests · 30d
- —Loading...
- Success rate · 30d
- —Loading...
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
Use the OSV Package Vulnerability Query API to find known vulnerabilities affecting an open source package version or Git commit. Identify a package with its name and ecosystem or a Package URL, or provide a commit hash, then continue with a page token when more results are available. Review affected version ranges, published advisories, and available fix references to check dependency updates, investigate a vulnerable release, or add checks to a build workflow. Results reflect the indexed database rather than a scan of your source code. The detail page includes request and response examples, supported parameters, and per-request pricing.
What this API returns
Check a particular package release or Git commit against the OSV vulnerability index. A matching response can include advisory descriptions, affected package records, version ranges, fix events, severity information, and reference links when the underlying source supplies them.
When to use it
- Check a pinned dependency before approving an update.
- Investigate whether a specific release falls in a known affected range.
- Attach structured vulnerability information to a build or release review.
Inputs and result handling
The JSON body accepts commit, version, package, and page_token. Identify package with name plus ecosystem, or with purl. A commit query may omit package. Do not combine commit with version. A versioned purl must not be combined with top-level version. Do not combine purl with name/ecosystem. These semantic rules are validated by OSV; the preserved OpenAPI schema is not a complete local semantic validator. Ecosystem spelling is case-sensitive, such as PyPI. Git tags can be queried with ecosystem GIT, the repository URL as name, and the tag as version.
Read vulns for advisory records and next_page_token for continuation. OSV may paginate above approximately 1,000 vulnerabilities or after a query exceeds 20 seconds. In rare cases a page contains only next_page_token: continue until no token remains before treating the query as complete. A page without vulnerabilities does not certify that software is safe.
Large queries: batch pagination plus details
A single response through this configuration is limited to 8 MiB (8,388,608 bytes). This is an OpenAny configuration limit, not the OSV source response limit. Large /v1/query pages can exceed it: a recorded Debian:12 linux 6.1.27-1 query produced four pages from 10,027,844 to 12,420,820 bytes. Such pages are unsupported by this configuration even when OSV responds with HTTP 200.
- Submit the package/version or commit as an item in POST /v1/querybatch. This returns compact vulnerability IDs and modification timestamps, not full advisories.
- Keep each result associated with its input query. For each result with next_page_token, resubmit that same query with its token in page_token. Only unfinished queries need to be sent again.
- Continue until all result items have no next_page_token. A response containing only a token is unfinished, even if vulns is absent. Use tokens rather than an assumed page size or fixed page count.
- Deduplicate the collected IDs, then call GET /v1/vulns/{id} for the full records you need. Each detail response is also subject to the 8 MiB limit.
These are separate client requests; this API does not automatically combine pages or fetch details. Each successful batch page and each successful detail lookup costs USD 0.005. One batch containing several package queries is charged once per successful HTTP request, not once per package. Deduplicate IDs before detail lookups to avoid unnecessary requests.
In the recorded Debian example, querybatch completed in 10 pages of about 65–72 KB and returned the same 9,910 IDs as five direct single-query pages. For that observed dataset, 10 successful batch requests cost USD 0.050; requesting all 9,910 unique details would add USD 49.550, for USD 49.600 in total. Actual cost depends on pages and details requested. The source has no page_size parameter that can guarantee a single-query response below 8 MiB, and compact batch responses remain subject to the same platform limit.
{
"queries": [
{
"package": {
"name": "linux",
"ecosystem": "Debian:12"
},
"version": "6.1.27-1"
}
]
}Quick start
For OpenAny access, use the request builder and OpenAny authentication instructions on this page. The curl below is a direct OSV contract reference, not an OpenAny gateway URL. Source-direct OSV access uses no API key or Authorization header.
curl 'https://api.osv.dev/v1/query' -H 'Content-Type: application/json' --data '{"package":{"name":"mruby","ecosystem":"OSS-Fuzz"},"version":"2.1.2"}'Complete paired live response
This complete response was recorded directly from OSV on 2026-11-19 using the request above. The response is a historical capture; current records and result counts may differ. Additional live and official documentation examples are retained in the Examples section.
{
"vulns": [
{
"id": "OSV-2020-744",
"summary": "Heap-double-free in mrb_default_allocf",
"details": "OSS-Fuzz report: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23801
```
Crash type: Heap-double-free
Crash state:
mrb_default_allocf
mrb_free
obj_free
```
",
"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"
}
],
"affected": [
{
"package": {
"name": "mruby",
"ecosystem": "OSS-Fuzz",
"purl": "pkg:generic/mruby"
},
"ranges": [
{
"type": "GIT",
"repo": "https://github.com/mruby/mruby",
"events": [
{
"introduced": "9cdf439db52b66447b4e37c61179d54fad6c8f33"
},
{
"fixed": "97319697c8f9f6ff27b32589947e1918e3015503"
}
]
}
],
"versions": [
"2.1.2",
"2.1.2-rc",
"2.1.2-rc2"
],
"ecosystem_specific": {
"severity": "HIGH"
},
"database_specific": {
"source": "https://github.com/google/oss-fuzz-vulns/blob/main/vulns/mruby/OSV-2020-744.yaml"
}
}
],
"schema_version": "1.7.3"
}
]
}Price and usage
The configured OpenAny price is USD 0.005 per successful HTTP 200 request. The amount is fixed per request, including an empty result, and does not decrease with fewer returned records. Each continuation request and each separate advisory-detail lookup is another request at the same price. A batch is charged once per successful HTTP request, not once per package. HTTP success does not imply that all pages have been retrieved.
Coverage and limits
Requests are synchronous. This configuration accepts at most 1 MiB per request, permits responses up to 8 MiB, and uses a 120-second timeout. Oversized responses are unsupported; the service does not silently truncate them into a complete result. Preserve continuation tokens and missing or optional fields. The API searches indexed known vulnerabilities and does not replace source scanning or guarantee absence of security issues.
Data is aggregated from multiple databases with different licenses. Preserve source references and attribution, and check the applicable source terms before downstream redistribution. This API does not apply a license-based data filter.
Documentation
Playground
Run sends a real API request. Charges follow the published API contract.
Response structure
vulnsobject[]affectedobject[]database_specificobjectsourcestring
ecosystem_specificobjectseveritystring
packageobjectecosystemstringnamestringpurlstring
rangesobject[]eventsobject[]introducedstringfixedstring
repostringtypestring
versionsstring[]
detailsstringidstringmodifiedstringpublishedstringreferencesobject[]typestringurlstring
schema_versionstringsummarystring
// Inferred from response examples. Fields are optional and other fields may be returned.
export type ApiResponse = {
vulns?: Array<{
affected?: Array<{
database_specific?: {
source?: string;
};
ecosystem_specific?: {
severity?: string;
};
package?: {
ecosystem?: string;
name?: string;
purl?: string;
};
ranges?: Array<{
events?: Array<{
introduced?: string;
fixed?: string;
}>;
repo?: string;
type?: string;
}>;
versions?: Array<string>;
}>;
details?: string;
id?: string;
modified?: string;
published?: string;
references?: Array<{
type?: string;
url?: string;
}>;
schema_version?: string;
summary?: string;
}>;
};Sellers
| Seller | Pricing | Requests · 30d | Performance | Access |
|---|---|---|---|---|
osvCurrent OSV Package Vulnerability Query API · POST · View API reference | $0.005 / call | — | —successP50— |
- 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: 1. Price update time: not supplied.
Total $0.5
API
- Method
- POST
- Endpoint
https://api-dev.openany.si/v1/agent-apis/osv/v1/query- Content type
- application/json
- Authentication
Authorization: Bearer $OPENANY_API_KEY
curl \
'https://api-dev.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"
}'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.
Sample response
Sample response · Documented HTTP 200 Example from the provider's documentation. Field values in your results will differ.
{
"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"
}
]
}Agent integration
Copy the resource contract without sharing an API key.
View API Markdown
# OSV Package Vulnerability Query API
Use the OSV Package Vulnerability Query API to find known vulnerabilities affecting an open source package version or Git commit. Identify a package with its name and ecosystem or a Package URL, or provide a commit hash, then continue with a page token when more results are available. Review affected version ranges, published advisories, and available fix references to check dependency updates, investigate a vulnerable release, or add checks to a build workflow. Results reflect the indexed database rather than a scan of your source code. The detail page includes request and response examples, supported parameters, and per-request pricing.
## Available implementations
osv · OSV Package Vulnerability Query API: https://openany.si/markets/apis/capabilities/osv-package-vulnerability-query-api?offering=3f12dec1-83ec-41ac-93c2-88dd449f70bb · $0.005 / call
## Selected API contract
Documentation: https://openany.si/markets/apis/capabilities/osv-package-vulnerability-query-api
Method: POST
Endpoint: https://api-dev.openany.si/v1/agent-apis/osv/v1/query
Price: $0.005 / call
Provider: osv
Contract revision: 1
Price source: OpenAny public API contract and documented provider unit rates. Price update time: not supplied.
Use OPENANY_API_KEY from the environment. API Key calls use your shared balance.
## Prepared request
```bash
curl \
'https://api-dev.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"
}'
```
## API contract
```json
{
"resource_type": "api",
"name": "OSV Package Vulnerability Query API",
"endpoint": "https://api-dev.openany.si/v1/agent-apis/osv/v1/query",
"method": "POST",
"content_type": "application/json",
"execution_mode": "sync",
"authentication": {
"type": "bearer",
"environment_variable": "OPENANY_API_KEY"
},
"inputs": [
{
"description": "Query format.",
"json_schema": {
"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"
},
"location": "body",
"name": "body",
"nullable": false,
"pointer": "",
"required": true,
"type": "object"
}
],
"billing": {
"currency": "USD",
"mode": "fixed",
"priceMicroUsd": "5000",
"rounding": null,
"unit": "call",
"unitQuantity": null
},
"examples": [
{
"http_status": 200,
"name": "Official example · Live OSV paired capture - 2026-11-19",
"request": {
"body": {
"package": {
"ecosystem": "OSS-Fuzz",
"name": "mruby"
},
"version": "2.1.2"
},
"headers": {},
"path": {},
"query": {}
},
"response_body": {
"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"
}
]
}
},
{
"http_status": 200,
"name": "Official example · Historical official documentation response",
"request": {
"body": {
"package": {
"ecosystem": "OSS-Fuzz",
"name": "mruby"
},
"version": "2.1.2"
},
"headers": {},
"path": {},
"query": {}
},
"response_body": {
"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.4.0",
"summary": "Heap-double-free in mrb_default_allocf"
}
]
}
}
]
}
```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-dev.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" } ] }