GoodRx API endpoint
Returns GoodRx coupon, membership, and mail-order prices by pharmacy for one drug and prescription (brand/generic label, form, dosage, quantity), plus the drug summary, the priced configuration, the location prices were computed for, and every available label/form/dosage/quantity. Omit label/form/dosage/quantity for GoodRx's default prescription; values must come from /goodrx/drug-options. Pass latitude and longitude (optionally zip_code and state) to price at a US location; otherwise prices reflect a US location chosen by GoodRx. Requests use US egress because GoodRx is US-only.
/goodrx/drug-pricesQuery parameters:
slug (required): drug slug from /api/v1/goodrx/drugs, /api/v1/goodrx/class, or /api/v1/goodrx/condition-drugs (for example atorvastatin).label (optional): brand or generic label slug from /api/v1/goodrx/drug-options.form (optional): form slug from /api/v1/goodrx/drug-options (for example tablet).dosage (optional): dosage slug from /api/v1/goodrx/drug-options (for example 20mg).quantity (optional): 1-999999; /api/v1/goodrx/drug-options lists GoodRx's standard quantities.latitude, longitude (optional, together): a US location to price at.zip_code (optional): five-digit ZIP code of that location; requires latitude/longitude.state (optional): two-letter state code of that location; requires latitude/longitude.Omitting label/form/dosage/quantity returns GoodRx's default prescription. A label, form, or dosage that the drug does not offer, including an invalid combination of otherwise available values, returns 400 listing the accepted values. Missing pricing data or prices for a prescription that differs from an explicitly requested label, form, dosage, or quantity returns 503. Without a location, prices reflect a US location GoodRx chooses; location reports the place priced.
Each offer has the pharmacy name, ID, type (PharmacyChain retail or PharmacyOnlineStore mail order, observed values), and the pricing kind: COUPON (free GoodRx coupon, with retail_price), UPSELL (a paid membership price; membership names the program, for example COMPANION), or HOME_DELIVERY (mail order, with order_url). These pricing values are observed and returned as data. options lists every label, form, dosage, and quantity. Requests use US egress because GoodRx is US-only.
Recent results are reused: a verified response is served for up to 10 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 2 hours 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 before treating prices as current. A response returned as stale is billed 1 credit instead of the endpoint's full price.
| Field | Filled in, of 15 checked | Values in the sample |
|---|---|---|
| pharmacy_id | 15 | |
| pharmacy_name | 15 | “Springmeds” and 14 other values |
| pharmacy_type | 15 | PharmacyChain (13), PharmacyOnlineStore (2) |
| logo_url | 15 | grxstatic.com |
| pricing_type | 15 | UPSELL (10), COUPON (3), HOME_DELIVERY (2) |
| price | 15 | 0 to 26.66, median 9 |
| order_url | 2 | goodrx.com |
| membership | 10 | COMPANION in all 10 |
| lowest_price | 13 | 0 to 26.66, median 9 |
| retail_price | 11 | 10.93 to 119.45, median 58.19 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| slug | string | Yes | Drug slug from /goodrx/drugs, /goodrx/class, or /goodrx/condition-drugs | atorvastatin | |
| label | string | No | Brand or generic label slug from /goodrx/drug-options | atorvastatin | |
| form | string | No | Form slug from /goodrx/drug-options | tablet | |
| dosage | string | No | Dosage slug from /goodrx/drug-options | 20mg | |
| quantity | integer | No | Quantity (1-999999); /goodrx/drug-options lists GoodRx's standard quantities | 30 | |
| latitude | number | No | Latitude of a US location to price at (requires longitude) | 40.7506 | |
| longitude | number | No | Longitude of a US location to price at (requires latitude) | -73.9972 | |
| zip_code | string | No | Five-digit ZIP code of that location | 10001 | |
| state | string | No | Two-letter state code of that location | NY | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/goodrx/drug-prices?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",
"alternate_name": "Generic Lipitor",
"non_proprietary_name": "atorvastatin",
"drug_class": {
"name": "Statins",
"slug": "statins",
"url": "https://www.goodrx.com/classes/statins"
},
"administration_route": "Oral",
"prescription_status": "PrescriptionOnly"
},
"configuration": {
"drug_id": "33396",
"label": "atorvastatin",
"form": "tablet",
"dosage": "20mg",
"quantity": 30,
"summary": "20mg 30 tablets"
},
"location": {
"city": "Los Angeles",
"state": "CA",
"zip_code": "90017"
},
"offers": [
{
"pharmacy_id": "31240",
"pharmacy_name": "Kroger Pharmacy",
"pharmacy_type": "PharmacyChain",
"pricing_type": "COUPON",
"price": 24.99,
"retail_price": 53.73,
"lowest_price": 24.99
}
],
"options": [
{
"name": "Atorvastatin",
"slug": "atorvastatin",
"type": "GENERIC",
"forms": [
{
"name": "tablet",
"slug": "tablet",
"dosages": [
{
"name": "20mg",
"slug": "20mg",
"drug_id": "33396",
"quantities": [
30,
60,
90,
100,
180
],
"default_quantity": 30
}
]
}
]
}
]
}
}Request schema
No body schema
Response schema
#/definitions/goodrx.drugPricesResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| data | goodrx.DrugPricesResponse | No | ||||
| data.configuration | goodrx.Configuration | No | ||||
| data.configuration.dosage | string | No | ||||
| data.configuration.drug_id | string | No | ||||
| data.configuration.form | string | No | ||||
| data.configuration.label | string | No | ||||
| data.configuration.quantity | integer | No | ||||
| data.configuration.summary | string | No | ||||
| data.drug | goodrx.DrugInfo | No | ||||
| data.drug.administration_route | string | No | ||||
| data.drug.alternate_name | string | No | ||||
| data.drug.description | string | No | ||||
| data.drug.drug_class | goodrx.ClassRef | No | ||||
| data.drug.drug_class.name | string | No | ||||
| data.drug.drug_class.slug | string | No | ||||
| data.drug.drug_class.url | string | No | ||||
| data.drug.image_url | string | No | ||||
| data.drug.legal_status | string | No | ||||
| data.drug.name | string | No | ||||
| data.drug.non_proprietary_name | string | No | ||||
| data.drug.prescription_status | string | No | ||||
| data.drug.slug | string | No | ||||
| data.drug.url | string | No | ||||
| data.location | goodrx.Location | No | ||||
| data.location.city | string | No | ||||
| data.location.latitude | number | No | ||||
| data.location.longitude | number | No | ||||
| data.location.state | string | No | ||||
| data.location.zip_code | string | No | ||||
| data.offers | array | No | ||||
| data.offers[].logo_url | string | No | ||||
| data.offers[].lowest_price | number | No | ||||
| data.offers[].membership | string | No | Membership names the paid program behind an UPSELL price, for example "COMPANION" (observed value; returned as data). | |||
| data.offers[].order_url | string | No | ||||
| data.offers[].pharmacy_id | string | No | ||||
| data.offers[].pharmacy_name | string | No | ||||
| data.offers[].pharmacy_type | string | No | PharmacyType is "PharmacyChain" (retail) or "PharmacyOnlineStore" (mail order) as observed; returned as data. | |||
| data.offers[].price | number | No | ||||
| data.offers[].pricing_type | string | No | PricingType is GoodRx's pricing kind, for example "COUPON", "UPSELL", or "HOME_DELIVERY" (observed values; returned as data). | |||
| data.offers[].retail_price | number | No | ||||
| data.options | array | No | ||||
| data.options[].forms | array | No | ||||
| data.options[].forms[].dosages | array | No | ||||
| data.options[].forms[].dosages[].default_quantity | integer | No | DefaultQuantity is GoodRx's default quantity for this dosage. | |||
| data.options[].forms[].dosages[].drug_id | string | No | ||||
| data.options[].forms[].dosages[].name | string | No | ||||
| data.options[].forms[].dosages[].quantities | array | No | ||||
| data.options[].forms[].dosages[].slug | string | No | ||||
| data.options[].forms[].name | string | No | ||||
| data.options[].forms[].slug | string | No | ||||
| data.options[].name | string | No | ||||
| data.options[].slug | string | No | ||||
| data.options[].type | 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/drug-prices?slug=atorvastatin" \
-H "x-api-key: $CRAWLORA_API_KEY"