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

> Turn a company, drug, program, target or indication name into its id.

`GET /v1/search` finds entities by name and returns the id to pass as a
filter everywhere else. Start here.

## Key fields

| Field | Description |
| - | - |
| `type` | `company`, `drug`, `program`, `target` or `indication`. |
| `id` | Pass as `company_id`, `drug_id`, `program_id`, `target` or `indication`. |
| `name` | Display name. |
| `detail` | Country, highest phase, or company and indication. |
| `program_count` | Programs linked to the match. |

## Parameters

| Name | Values | Example |
| - | - | - |
| `q` | Name or text, 2+ characters | `tirzepatide` |
| `types` | `company`, `drug`, `program`, `target`, `indication`; default all | `drug,program` |
| `limit` | Matches per type, 1–20, default 5 | `2` |

Results are not paginated. See [Conventions](/conventions).

<CodeGroup>
  ```bash cURL theme={"system"}
  curl -G https://api.pav.bio/v1/search \
    -H "Authorization: Bearer $PAV_API_KEY" \
    --data-urlencode "q=tirzepatide" \
    --data-urlencode "types=drug,program" \
    --data-urlencode "limit=2"
  ```

  ```python Python theme={"system"}
  import os
  import requests

  resp = requests.get(
      "https://api.pav.bio/v1/search",
      headers={"Authorization": f"Bearer {os.environ['PAV_API_KEY']}"},
      params={"q": "tirzepatide", "types": "drug,program", "limit": 2},
  )
  resp.raise_for_status()
  for hit in resp.json()["data"]:
      print(hit["type"], hit["id"], hit["name"])
  ```
</CodeGroup>

```json Example response theme={"system"}
{
  "data": [
    { "type": "drug", "id": "4781", "name": "Tirzepatide", "detail": "Approved", "program_count": 8 },
    { "type": "program", "id": "6012", "name": "DehydraTECH-Tirzepatide", "detail": "Lexaria Bioscience · Diabetes / Weight Loss" },
    { "type": "program", "id": "35015", "name": "Tirzepatide", "detail": "Eli Lilly · Obesity" }
  ]
}
```

Then filter by the id: `GET /v1/programs?drug_id=4781`.
