- Passive: the target is not contacted
Send either a commit hash, or a package with a version. For a git tag set ecosystem to GIT and use the repository URL as the name. Results are paginated when there are more than 1,000 vulnerabilities or the query exceeds 20 seconds: keep sending next_page_token as page_token until none is returned.
Request body (JSON) · 6ShowHide
commit
Commit hash to query. Do not set together with version.
version
Version to query, fuzzy-matched against upstream versions. Do not set together with commit or a versioned purl.
name
Package name. Requires ecosystem; do not set purl with it.
ecosystem
Ecosystem such as PyPI or RubyGems. Case-sensitive.
purl
Package URL. Do not set name or ecosystem with it.
page_token
Token from a previous response, to fetch the next page.
Response fields · 9ShowHide
vulns[]
Matching vulnerability records
id
Record ID in the form DB-ENTRYID
summary
One-line summary
details
Longer human-readable description
published
Publish time (RFC 3339)
modified
Last modified time (RFC 3339)
references[]
Links with type and url
affected[]
Affected package, ranges and versions
next_page_token
Present only when more results remain
curl -X POST 'https://api.osv.dev/v1/query' \
-H 'Content-Type: application/json' \
-d '{"package":{"name":"example-lib","ecosystem":"PyPI"},"version":"1.0.0"}'{
"vulns": [
{
"id": "EXAMPLE-2024-0001",
"summary": "Example heap overflow in example-lib",
"details": "Made-up description of an example vulnerability.",
"modified": "2024-01-02T03:04:05Z",
"published": "2024-01-01T00:00:00Z",
"references": [
{
"type": "WEB",
"url": "https://example.com/advisory/1"
}
],
"affected": [
{
"package": {
"name": "example-lib",
"ecosystem": "PyPI"
},
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.0.1"
}
]
}
],
"versions": [
"1.0.0"
]
}
]
}
]
}