> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pav.bio/llms.txt
> Use this file to discover all available pages before exploring further.

# Search

> Find companies, drugs, programs, targets and indications by name and get the `id` to pass as a filter elsewhere (`company_id=`, `drug_id=`, `program_id=`, `target=`, `indication=`).



## OpenAPI

````yaml /openapi.json get /v1/search
openapi: 3.1.0
info:
  title: Pav Enterprise API
  description: >-
    Read-only API over Pav's biopharma data: programs, drugs, companies, trials,
    deals, patents, FDA records and changes. Send `Authorization: Bearer
    <api_key>`. Lists return `{data, next_cursor, total}`; errors return
    `{error: {code, message, request_id}}`. Parameter rules:
    [Conventions](https://docs.pav.bio/conventions).
  version: 2.0.0
servers:
  - url: https://api.pav.bio
    description: Production
security: []
tags:
  - name: search
    description: Find the id of a company, drug, program, target or indication.
    x-group: Search
  - name: programs
    description: 'Drug programs: one drug in one indication at one company.'
    x-group: Programs
  - name: drugs
    description: >-
      One drug product across every company that develops it, under all its
      names, with its programs.
    x-group: Drugs
  - name: companies
    description: Biopharma companies, their owners and their trials.
    x-group: Companies
  - name: trials
    description: ClinicalTrials.gov trials linked to programs and companies.
    x-group: Trials
  - name: deals
    description: M&A, licensing and collaboration deals with terms and sources.
    x-group: Deals
  - name: patents
    description: US patent families with owners, members and term.
    x-group: Patents
  - name: fda
    description: FDA records, one endpoint per record type.
    x-group: FDA
  - name: changes
    description: Program and trial changes, newest first.
    x-group: Changes
  - name: stats
    description: Dataset counts.
    x-group: Stats
paths:
  /v1/search:
    get:
      tags:
        - search
      summary: Search
      description: >-
        Find companies, drugs, programs, targets and indications by name and get
        the `id` to pass as a filter elsewhere (`company_id=`, `drug_id=`,
        `program_id=`, `target=`, `indication=`).
      operationId: search
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            minLength: 2
            maxLength: 200
            description: Name or text.
            examples:
              - TL1A
            title: Q
          description: Name or text.
        - name: types
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: >-
              Types to search, comma-separated: `company`, `drug`, `program`,
              `target`, `indication`. Default all.
            examples:
              - company,target
            title: Types
          description: >-
            Types to search, comma-separated: `company`, `drug`, `program`,
            `target`, `indication`. Default all.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 20
            minimum: 1
            description: Matches per type (1-20).
            examples:
              - 5
            default: 5
            title: Limit
          description: Matches per type (1-20).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '400':
          description: Invalid parameter (`validation_error`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Missing or invalid API key (`unauthorized`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Unknown id or route (`not_found`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Rate limit exceeded (`rate_limited`); honor `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - EnterpriseApiKey: []
components:
  schemas:
    SearchResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/SearchMatch'
          type: array
          title: Data
          description: Matches, best first within each type.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Pass as `cursor` to get the next page. Null on the last page. See
            [Conventions](https://docs.pav.bio/conventions).
          examples:
            - eyJyIjoicHJvZ3JhbXMiLCJzIjoiY29tcGFueSJ9
        total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total
          description: Rows matching the filters. Null for relevance-ranked `q` results.
          examples:
            - 1284
      type: object
      required:
        - data
      title: SearchResponse
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
          description: Error detail. Present only on 4xx/5xx responses.
      required:
        - error
      title: ErrorEnvelope
      type: object
    SearchMatch:
      properties:
        type:
          type: string
          enum:
            - company
            - drug
            - program
            - target
            - indication
          title: Type
          description: What matched.
          examples:
            - target
        id:
          type: string
          title: Id
          description: >-
            The id to filter by: `company_id`, `drug_id` or `program_id` for
            those types; the ontology term id for `target` and `indication`.
          examples:
            - NCIT:C18289
        name:
          type: string
          title: Name
          description: Display name.
          examples:
            - TL1A
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: 'Short context: a program''s company and indication, a drug''s phase.'
          examples:
            - Merck & Co. · ulcerative colitis
        program_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Program Count
          description: Active programs this company, drug, target or indication has.
          examples:
            - 14
      type: object
      required:
        - type
        - id
        - name
      title: SearchMatch
      description: >-
        One typed match from `GET /v1/search`; use `id` as that type's filter
        value.
    ErrorBody:
      properties:
        code:
          description: >-
            Stable, machine-readable error code (e.g. `unauthorized`,
            `not_found`, `validation_error`, `error`).
          examples:
            - not_found
          title: Code
          type: string
        message:
          description: Human-readable explanation of the error.
          examples:
            - program 999999 not found
          title: Message
          type: string
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Correlation id echoed in the `X-Request-ID` response header. Quote
            it when contacting Pav support about a failed request.
          examples:
            - 3f2b9c1d8a7e4f6b9c0d1e2f3a4b5c6d
          title: Request Id
      required:
        - code
        - message
      title: ErrorBody
      type: object
  securitySchemes:
    EnterpriseApiKey:
      type: http
      description: >-
        Use a personal or organization Pav API key from Pav developer settings.
        Send it as Authorization: Bearer <api_key>.
      scheme: bearer
      bearerFormat: Pav API key

````