OpenSSF Querybatch API

The Querybatch API from OpenSSF — 1 operation(s) for querybatch.

OpenAPI Specification

openssf-querybatch-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OSV (Open Source Vulnerabilities) Projects Querybatch API
  description: OSV is a distributed open source vulnerability database and triage infrastructure project hosted by the Open Source Security Foundation (OpenSSF). The OSV API exposes vulnerability records keyed to specific package versions or commits across multiple ecosystems (npm, PyPI, Maven, Go, NuGet, RubyGems, Cargo, Packagist, Hex, OSS-Fuzz, Linux, Android, GitHub Actions, etc.).
  version: '1'
  contact:
    name: OSV
    url: https://osv.dev/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://api.osv.dev
  description: OSV production API
tags:
- name: Querybatch
paths:
  /v1/querybatch:
    post:
      operationId: queryVulnerabilitiesBatch
      summary: Batched vulnerability query
      description: Batched query for multiple package versions or commit hashes in a single request. Returns vulnerability ID lists per query that can be hydrated via /v1/vulns/{id}.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                queries:
                  type: array
                  items:
                    $ref: '#/components/schemas/QueryRequest'
      responses:
        '200':
          description: Per-query vulnerability ID lists.
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        vulns:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              modified:
                                type: string
                                format: date-time
      tags:
      - Querybatch
components:
  schemas:
    QueryRequest:
      type: object
      properties:
        commit:
          type: string
          description: Commit hash to query.
        version:
          type: string
          description: Package version.
        package:
          type: object
          properties:
            name:
              type: string
            ecosystem:
              type: string
              description: e.g., npm, PyPI, Maven, Go, crates.io, RubyGems, NuGet, Packagist, Hex, GitHub Actions, Linux, Android, OSS-Fuzz.
            purl:
              type: string
              description: Package URL (purl).
        page_token:
          type: string
externalDocs:
  description: OSV API documentation
  url: https://google.github.io/osv.dev/api/