GoodRx API endpoint
Lists GoodRx's head-to-head drug comparisons grouped by health topic, for example ADHD. Each comparison has a name, a `slug` for the comparison lookup and its GoodRx URL. 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/comparisonsNo query parameters.
Returns every comparison on GoodRx's comparison index grouped by health topics (topic names are returned as data). Pass a comparison slug to /api/v1/goodrx/comparison.
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 22 checked | Values in the sample |
|---|---|---|
| name | 22 | “ADHD” and 21 other values |
| comparisons | 22 | median 2 entries |
| 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/comparisons" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 0,
"message": "success",
"data": {
"topics": [
{
"name": "ADHD",
"comparisons": [
{
"name": "Ritalin vs. Adderall",
"slug": "ritalin-vs-adderall",
"url": "https://www.goodrx.com/compare/ritalin-vs-adderall"
}
]
}
]
}
}Request schema
No body schema
Response schema
#/definitions/goodrx.comparisonsResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| data | goodrx.ComparisonsResponse | No | ||||
| data.topics | array | No | ||||
| data.topics[].comparisons | array | No | ||||
| data.topics[].comparisons[].name | string | No | ||||
| data.topics[].comparisons[].slug | string | No | ||||
| data.topics[].comparisons[].url | string | No | ||||
| data.topics[].name | 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/comparisons" \
-H "x-api-key: $CRAWLORA_API_KEY"