GoodRx API endpoint
Returns every brand and generic label, dosage form, strength, and quantity GoodRx prices for one drug, with GoodRx's default prescription. Use these values for /goodrx/drug-prices.
/goodrx/drug-optionsQuery parameters:
slug (required): drug slug from /api/v1/goodrx/drugs (for example atorvastatin).Returns every brand/generic label (type is BRAND or GENERIC as observed), dosage form, strength, and standard quantity GoodRx prices for the drug, plus GoodRx's default prescription. Pass these slugs and quantities to /api/v1/goodrx/drug-prices.
Recent results are reused: a verified response is served for up to 30 minutes, and GoodRx refuses automated traffic for an hour or more at times. When every live attempt is refused, the last verified response (at most about a day old) is returned instead of an error, with X-Availability-Mode: stale and its age in X-Availability-Last-Success-Age-Seconds. Check those headers to tell a retained copy from a live one. A response returned as stale is billed 1 credit instead of the endpoint's full price.
| Field | Filled in, of 2 checked | Values in the sample |
|---|---|---|
| name | 2 | “Lipitor” and 1 other value |
| slug | 2 | |
| type | 2 | “BRAND” and 1 other value |
| forms | 2 | median 1 entry |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| slug | string | Yes | Drug slug from /goodrx/drugs | atorvastatin | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/goodrx/drug-options?slug=atorvastatin" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 0,
"message": "success",
"data": {
"drug": {
"slug": "atorvastatin",
"name": "Atorvastatin",
"url": "https://www.goodrx.com/atorvastatin"
},
"default": {
"drug_id": "33396",
"label": "atorvastatin",
"form": "tablet",
"dosage": "20mg",
"quantity": 30
},
"options": [
{
"name": "Lipitor",
"slug": "lipitor",
"type": "BRAND",
"forms": [
{
"name": "tablet",
"slug": "tablet",
"dosages": [
{
"name": "10mg",
"slug": "10mg",
"drug_id": "1537",
"quantities": [
30,
36,
60,
90
],
"default_quantity": 90
}
]
}
]
}
]
}
}Request schema
No body schema
Response schema
#/definitions/goodrx.drugOptionsResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| data | goodrx.DrugOptionsResponse | No | ||||
| data.default | goodrx.Configuration | No | Configuration record, 6 fields: dosage, drug_id, form, label, quantity, summary. Described under GoodRx drug prices API. | |||
| data.drug | goodrx.DrugInfo | No | DrugInfo record, 14 fields: administration_route, alternate_name, description, drug_class, image_url, legal_status, name, non_proprietary_name, prescription_status, slug, url. Described under GoodRx drug prices API. | |||
| data.options | array | No | LabelOption record, 12 fields: forms, name, slug, type. Described under GoodRx drug prices API. |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/goodrx/drug-options?slug=atorvastatin" \
-H "x-api-key: $CRAWLORA_API_KEY"