GoodRx API endpoint
Returns the drugs GoodRx lists for one drug class, with each drug's lowest displayed price and summary. Use a slug from /goodrx/classes.
/goodrx/classQuery parameters:
slug (required): class slug from /api/v1/goodrx/classes (for example statins).Returns the class name, its overview text, and the drugs GoodRx lists for the class, with each drug's lowest displayed price, summary, and price-page slug. Some classes (for example imipridones) currently list no drugs; they return an empty drugs list with the overview.
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 13 checked | Values in the sample |
|---|---|---|
| name | 13 | “Lipitor (atorvastatin)” and 12 other values |
| slug | 13 | |
| url | 13 | goodrx.com |
| lowest_price | 13 | 15 to 1,187, median 306 |
| description | 13 | median 383 characters |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| slug | string | Yes | Class slug from /goodrx/classes | statins | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/goodrx/class?slug=statins" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 0,
"message": "success",
"data": {
"slug": "statins",
"name": "Statins",
"url": "https://www.goodrx.com/classes/statins",
"drugs": [
{
"name": "Lipitor (atorvastatin)",
"slug": "lipitor",
"url": "https://www.goodrx.com/lipitor",
"lowest_price": 765,
"description": "Atorvastatin (Lipitor) is an inexpensive drug that lowers levels of cholesterol..."
}
]
}
}Request schema
No body schema
Response schema
#/definitions/goodrx.classResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| data | goodrx.ClassResponse | No | ||||
| data.drugs | array | No | ||||
| data.drugs[].description | string | No | ||||
| data.drugs[].info_url | string | No | ||||
| data.drugs[].lowest_price | number | No | ||||
| data.drugs[].name | string | No | ||||
| data.drugs[].slug | string | No | ||||
| data.drugs[].url | string | No | ||||
| data.name | string | No | ||||
| data.overview | string | No | Overview is the class description ("Why are ... prescribed?"). | |||
| data.slug | string | No | ||||
| data.url | string | No |
| 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/class?slug=statins" \
-H "x-api-key: $CRAWLORA_API_KEY"