Search Drugs
GEThttps://api-drugs.dataandapis.com/v1/drugs
Search Drugs is an endpoint of the Drugs API. 135,000 FDA drug products by NDC, joined with 17,900 recall reports.
Send your key in the X-Api-Key header. Each call costs 1 token; a free key includes 500 tokens a month.
Request
Query parameters
| Parameter | Example | |
|---|---|---|
| brand | Lipitor | Optional |
| class | Optional | |
| form | Optional | |
| generic | atorvastatin | Optional |
| ingredient | atorvastatin | Optional |
| labeler | Optional | |
| limit | 20 | Optional |
| page | 1 | Optional |
| q | Optional | |
| route | ORAL | Optional |
| schedule | Optional | |
| type | PRESCRIPTION | Optional |
Example request
curl
curl "https://api-drugs.dataandapis.com/v1/drugs?brand=Lipitor&generic=atorvastatin&ingredient=atorvastatin&limit=20&page=1&route=ORAL&type=PRESCRIPTION" \
-H "X-Api-Key: YOUR_API_KEY"JavaScript / TypeScript (dataandapis package)
// npm install dataandapis
import { DataAndApis } from "dataandapis";
const client = new DataAndApis(); // reads DATAANDAPIS_API_KEY
const data = await client.drugs.searchDrugs({
brand: "Lipitor",
generic: "atorvastatin",
ingredient: "atorvastatin",
limit: 20,
page: 1,
route: "ORAL",
type: "PRESCRIPTION",
});Node.js (fetch)
const res = await fetch("https://api-drugs.dataandapis.com/v1/drugs?brand=Lipitor&generic=atorvastatin&ingredient=atorvastatin&limit=20&page=1&route=ORAL&type=PRESCRIPTION", {
headers: { "X-Api-Key": process.env.DATAANDAPIS_KEY },
});
const data = await res.json();Python (dataandapis package)
# pip install dataandapis
from dataandapis import DataAndApis
client = DataAndApis() # reads DATAANDAPIS_API_KEY
data = client.drugs.search_drugs(
brand="Lipitor",
generic="atorvastatin",
ingredient="atorvastatin",
limit=20,
page=1,
route="ORAL",
type="PRESCRIPTION",
)Python (requests)
import os, requests
r = requests.get(
"https://api-drugs.dataandapis.com/v1/drugs?brand=Lipitor&generic=atorvastatin&ingredient=atorvastatin&limit=20&page=1&route=ORAL&type=PRESCRIPTION",
headers={"X-Api-Key": os.environ["DATAANDAPIS_KEY"]},
)
data = r.json()Guide to the dataandapis npm package →Guide to the dataandapis Python package →
Example response
Example response{
"ok": true,
"total": 4,
"page": 1,
"limit": 20,
"count": 2,
"results": [
{
"product_ndc": "58151-155",
"brand_name": "Lipitor",
"generic_name": "atorvastatin calcium",
"labeler": "Viatris Specialty LLC",
"product_type": "HUMAN PRESCRIPTION DRUG",
"dosage_form": "TABLET, FILM COATED",
"routes": [
"ORAL"
],
"dea_schedule": null,
"active_ingredients": [
{
"name": "ATORVASTATIN CALCIUM TRIHYDRATE",
"strength": "10 mg/1"
}
]
},
{
"product_ndc": "58151-156",
"brand_name": "Lipitor",
…
Show full response
Example response
{
"ok": true,
"total": 4,
"page": 1,
"limit": 20,
"count": 2,
"results": [
{
"product_ndc": "58151-155",
"brand_name": "Lipitor",
"generic_name": "atorvastatin calcium",
"labeler": "Viatris Specialty LLC",
"product_type": "HUMAN PRESCRIPTION DRUG",
"dosage_form": "TABLET, FILM COATED",
"routes": [
"ORAL"
],
"dea_schedule": null,
"active_ingredients": [
{
"name": "ATORVASTATIN CALCIUM TRIHYDRATE",
"strength": "10 mg/1"
}
]
},
{
"product_ndc": "58151-156",
"brand_name": "Lipitor",
…{
"ok": true,
"total": 4,
"page": 1,
"limit": 20,
"count": 2,
"results": [
{
"product_ndc": "58151-155",
"brand_name": "Lipitor",
"generic_name": "atorvastatin calcium",
"labeler": "Viatris Specialty LLC",
"product_type": "HUMAN PRESCRIPTION DRUG",
"dosage_form": "TABLET, FILM COATED",
"routes": [
"ORAL"
],
"dea_schedule": null,
"active_ingredients": [
{
"name": "ATORVASTATIN CALCIUM TRIHYDRATE",
"strength": "10 mg/1"
}
]
},
{
"product_ndc": "58151-156",
"brand_name": "Lipitor",
"generic_name": "atorvastatin calcium",
"labeler": "Viatris Specialty LLC",
"product_type": "HUMAN PRESCRIPTION DRUG",
"dosage_form": "TABLET, FILM COATED",
"routes": [
"ORAL"
],
"dea_schedule": null,
"active_ingredients": [
{
"name": "ATORVASTATIN CALCIUM TRIHYDRATE",
"strength": "20 mg/1"
}
]
}
]
}