Skip to content
OSINTtools.io

OSV.dev API

Open, distributed vulnerability database for open-source packages, searchable by package or ID across dozens of ecosystems.

Base URL
https://api.osv.dev
Sign-in
No key
Free tier
Free tier
Pricing
Free
Format
REST
Endpoints
3

Compiled by OSINTtools.io editors from google.github.io · updated Nov 29, 2026Work on this API? Claim it to keep these docs currentReport a mistake

Introduction

OSV.dev is a vulnerability database and API for open-source packages. You ask which known vulnerabilities affect a package version, a commit hash or a git tag, or fetch one vulnerability record by its ID, and you get records in the OSV schema.

Calls are plain HTTPS to https://api.osv.dev. The docs mention no API key. They state "Currently there are no limits on the API". Responses over HTTP/1.1 are capped at 32 MiB; the docs recommend HTTP/2 for large results.

Three stable endpoints are documented here. The experimental endpoints (import findings, determine version, Ubuntu binary-to-source) are not covered.

Quick start

  1. No key needed

    The OSV.dev API answers without an account or key.

  2. Make your first request

    Fetch one vulnerability record by its OSV ID.. Replace the example values and run it in a terminal, or use Try it on the endpoint.

    curl 'https://api.osv.dev/v1/vulns/EXAMPLE-2024-0001'
  3. Read the response

    A 200 response looks like this, shortened.

    {
      "schema_version": "1.6.0",
      "id": "EXAMPLE-2024-0001",
      "published": "2024-01-01T00:00:00Z",
      "modified": "2024-01-02T03:04:05Z",
      "aliases": [
        "CVE-0000-0000"
      ],
      "summary": "Example heap overflow in example-lib",
      "details": "Made-up description of an example vulnerability.",
      "affected": [
        {
          "package": {
            "name": "example-lib",
            "ecosystem": "PyPI"
          },
          "versions": [
            "1.0.0"
          ]
        }
      ],
      "references": [
        {
          "type": "WEB",
    …

Authentication

No key or account: every endpoint answers without one.

Rate limits and pricing

The docs state there are currently no limits on the API.

Free tier. Pricing: free.

Errors

StatusMeaning
400Bad request, for example both a top-level version and a versioned purl

Vulnerability queries

  • 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) · 6Show

commitstring

Commit hash to query. Do not set together with version.

versionstring

Version to query, fuzzy-matched against upstream versions. Do not set together with commit or a versioned purl.

namestring

Package name. Requires ecosystem; do not set purl with it.

ecosystemstring

Ecosystem such as PyPI or RubyGems. Case-sensitive.

purlstring

Package URL. Do not set name or ecosystem with it.

page_tokenstring

Token from a previous response, to fetch the next page.

Response fields · 9Show

vulns[]object

Matching vulnerability records

idstring

Record ID in the form DB-ENTRYID

summarystring

One-line summary

detailsstring

Longer human-readable description

publishedstring

Publish time (RFC 3339)

modifiedstring

Last modified time (RFC 3339)

references[]object

Links with type and url

affected[]object

Affected package, ranges and versions

next_page_tokenstring

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"}'
No key needed
Response
{
  "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"
          ]
        }
      ]
    }
  ]
}
  • Passive: the target is not contacted

Each entry in queries has the same shape as a /v1/query body. The docs limit a batch to 1000 package versions. The response holds one result list per query, in order.

Request body (JSON) · 1Show

queries[]objectalways present

Queries, each shaped like a /v1/query body

Response fields · 3Show

results[]object

One vulnerability list per query

vulns[]object

Matching vulnerabilities for that query

next_page_tokenstring

Token for more results of that query

curl -X POST 'https://api.osv.dev/v1/querybatch' \
  -H 'Content-Type: application/json' \
  -d '{"queries":[{"package":{"name":"example-lib","ecosystem":"PyPI"},"version":"1.0.0"}]}'
No key needed
Response
{
  "results": [
    {
      "vulns": [
        {
          "id": "EXAMPLE-2024-0001",
          "modified": "2024-01-02T03:04:05Z"
        }
      ]
    }
  ]
}

Vulnerability records

  • Passive: the target is not contacted

Returns the full record in the OSV schema.

Path parameters

idstringrequired

OSV ID in the form DB-ENTRYID

Example: EXAMPLE-2024-0001
Response fields · 14Show

schema_versionstring

OSV schema version

idstring

Unique ID, DB-ENTRYID

publishedstring

When published (RFC 3339)

modifiedstring

When last modified (RFC 3339)

withdrawnstring

When withdrawn, if it was

aliases[]string

IDs for the same vulnerability in other databases

related[]string

IDs of closely related vulnerabilities

upstream[]string

IDs of upstream vulnerabilities

summarystring

One-line summary

detailsstring

Human-readable details

affected[]object

Affected commit ranges and versions

references[]object

URLs with more information

severity[]object

Severity scores

credits[]object

Credits for the finding

curl 'https://api.osv.dev/v1/vulns/EXAMPLE-2024-0001'
No key needed
Response
{
  "schema_version": "1.6.0",
  "id": "EXAMPLE-2024-0001",
  "published": "2024-01-01T00:00:00Z",
  "modified": "2024-01-02T03:04:05Z",
  "aliases": [
    "CVE-0000-0000"
  ],
  "summary": "Example heap overflow in example-lib",
  "details": "Made-up description of an example vulnerability.",
  "affected": [
    {
      "package": {
        "name": "example-lib",
        "ecosystem": "PyPI"
      },
      "versions": [
        "1.0.0"
      ]
    }
  ],
  "references": [
    {
      "type": "WEB",
      "url": "https://example.com/advisory/1"
    }
  ]
}