GoodRx API endpoint
Returns a GoodRx head-to-head drug comparison's key takeaways and the two drugs compared, with their price-page and information slugs. Use a slug from /goodrx/comparisons or /goodrx/drug-info alternatives.
/goodrx/comparisonQuery parameters:
slug (required): comparison slug of the form <drug>-vs-<drug> from /api/v1/goodrx/comparisons or a drug's alternatives in /api/v1/goodrx/drug-info.Returns the comparison title, key_takeaways paragraphs, and the two drugs (name, price-page slug, information URL, and the prescription GoodRx compares, for example 30 tablets / 40mg). The detailed side-effect and warning table on the page is loaded by the browser after render and is not included. Unknown comparisons return 404.
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 | “Atorvastatin” and 1 other value |
| slug | 2 | |
| url | 2 | goodrx.com |
| info_url | 2 | goodrx.com |
| prescription | 2 | “30 tablets / 40mg” and 1 other value |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| slug | string | Yes | Comparison slug | lipitor-vs-zetia | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/goodrx/comparison?slug=lipitor-vs-zetia" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 0,
"message": "success",
"data": {
"slug": "lipitor-vs-zetia",
"title": "Lipitor vs. Zetia for High Cholesterol: Important Differences and Potential Risks.",
"url": "https://www.goodrx.com/compare/lipitor-vs-zetia",
"key_takeaways": [
"Atorvastatin (Lipitor) and Ezetimibe (Zetia) are both medications used to manage high cholesterol..."
],
"drugs": [
{
"name": "Atorvastatin",
"slug": "atorvastatin",
"url": "https://www.goodrx.com/atorvastatin",
"info_url": "https://www.goodrx.com/atorvastatin/what-is",
"prescription": "30 tablets / 40mg"
}
]
}
}Request schema
No body schema
Response schema
#/definitions/goodrx.comparisonResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| data | goodrx.ComparisonResponse | No | ||||
| data.drugs | array | No | ||||
| data.drugs[].info_url | string | No | ||||
| data.drugs[].name | string | No | ||||
| data.drugs[].prescription | string | No | ||||
| data.drugs[].slug | string | No | ||||
| data.drugs[].url | string | No | ||||
| data.key_takeaways | array | No | ||||
| data.slug | string | No | ||||
| data.title | 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/comparison?slug=lipitor-vs-zetia" \
-H "x-api-key: $CRAWLORA_API_KEY"