GoodRx API endpoint
Lists the drug classes in GoodRx's class directory, such as ACE Inhibitors, with each class name, GoodRx URL and the `slug` used to look up that class. If GoodRx is unreachable, a retained copy up to about a day old is returned and flagged with an `X-Availability-Mode: stale` header.
/goodrx/classesNo query parameters.
Returns every drug class in GoodRx's class directory with the slug to pass to /api/v1/goodrx/class.
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 658 checked | Values in the sample |
|---|---|---|
| name | 500 | “A2A Receptor Antagonists” and 499 other values |
| slug | 500 | |
| url | 500 | goodrx.com |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/goodrx/classes" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 0,
"message": "success",
"data": {
"classes": [
{
"name": "ACE Inhibitors",
"slug": "ace-inhibitors",
"url": "https://www.goodrx.com/classes/ace-inhibitors"
}
]
}
}Request schema
No body schema
Response schema
#/definitions/goodrx.classesResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| data | goodrx.ClassesResponse | No | ||||
| data.classes | array | No | ||||
| data.classes[].name | string | No | ||||
| data.classes[].slug | string | No | ||||
| data.classes[].url | string | No |
| Status | Description | Schema |
|---|---|---|
| 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/classes" \
-H "x-api-key: $CRAWLORA_API_KEY"