# OSV.dev API reference

> 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…

Source: https://osinttools.io/apis/osv-dev/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

Compiled by OSINTtools.io editors from the vendor's docs, updated Nov 29, 2026. Listing: https://osinttools.io/tools/osv-dev/

- Base URL: https://api.osv.dev
- Authentication: No key needed.
- Free tier: yes
- Pricing: Free
- Rate limits: The docs state there are currently no limits on the API.
- Vendor docs: https://google.github.io/osv.dev/api/
- OpenAPI spec: https://google.github.io/osv.dev/docs/osv_service_v1.swagger.json

## Overview

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.

## Errors

| Status | Meaning |
| --- | --- |
| 400 | Bad request, for example both a top-level version and a versioned purl |

## Vulnerability queries

### List vulnerabilities affecting a package version or a commit.

`POST /v1/query`

- Footprint: 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.

Response fields:

- `vulns[]` (object): Matching vulnerability records
- `vulns[].id` (string): Record ID in the form DB-ENTRYID
- `vulns[].summary` (string): One-line summary
- `vulns[].details` (string): Longer human-readable description
- `vulns[].published` (string): Publish time (RFC 3339)
- `vulns[].modified` (string): Last modified time (RFC 3339)
- `vulns[].references[]` (object): Links with type and url
- `vulns[].affected[]` (object): Affected package, ranges and versions
- `next_page_token` (string): Present only when more results remain

```bash
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"}'
```

Example response (200):

```json
{
  "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"
          ]
        }
      ]
    }
  ]
}
```

### Run many package or commit queries in one request.

`POST /v1/querybatch`

- Footprint: 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.

Response fields:

- `results[]` (object): One vulnerability list per query
- `results[].vulns[]` (object): Matching vulnerabilities for that query
- `results[].next_page_token` (string): Token for more results of that query

```bash
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"}]}'
```

Example response (200):

```json
{
  "results": [
    {
      "vulns": [
        {
          "id": "EXAMPLE-2024-0001",
          "modified": "2024-01-02T03:04:05Z"
        }
      ]
    }
  ]
}
```

## Vulnerability records

### Fetch one vulnerability record by its OSV ID.

`GET /v1/vulns/{id}`

- Footprint: passive (the target is not contacted)

Returns the full record in the OSV schema.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | OSV ID in the form DB-ENTRYID Example: EXAMPLE-2024-0001 |

Response fields:

- `schema_version` (string): OSV schema version
- `id` (string): Unique ID, DB-ENTRYID
- `published` (string): When published (RFC 3339)
- `modified` (string): When last modified (RFC 3339)
- `withdrawn` (string): 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
- `summary` (string): One-line summary
- `details` (string): 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

```bash
curl 'https://api.osv.dev/v1/vulns/EXAMPLE-2024-0001'
```

Example response (200):

```json
{
  "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"
    }
  ]
}
```

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
