# GoodRx Pharmacy Prices API Documentation

Scrappa's `GET /api/goodrx/drug` endpoint returns public pharmacy price cards for a drug slug and US ZIP. Each offer has the pharmacy chain, store, distance, coupon price, list price, savings percent and coupon link. Set `deliveryType=mail_order` for mail-order offers only. Prices are numbers with currency USD. A successful request costs 59 credits. Failed requests are not charged.

- **Documentation:** [https://scrappa.co/docs/goodrx-api/goodrx_drug](https://scrappa.co/docs/goodrx-api/goodrx_drug)
- **API group:** GoodRx API
- **Endpoint:** `GET https://scrappa.co/api/goodrx/drug`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `slug` | string | Yes | Pass-through slug from a search result, e.g. atorvastatin. |
| `form` | string | No | Dosage form such as tablet. Optional. |
| `dosage` | string | No | Strength such as 20mg. Optional. |
| `quantity` | integer | No | Quantity, from 1 to 100000. Defaults to 30. |
| `location` | string | Yes | Required five-digit US ZIP. The zip parameter is an alias. |
| `radius` | integer | No | Search radius in miles: 5, 10, 15 or 25. |
| `sort_type` | string | No | lowest_price, distance or pharmacy_name. |
| `deliveryType` | string | No | pickup or mail_order. Defaults to pickup. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/goodrx/drug?slug=atorvastatin&location=10001&quantity=30"
```

## Example response

```json
{
    "success": true,
    "currency": "USD",
    "total": 1,
    "offers": [
        {
            "pharmacyChain": "CVS",
            "storeName": "CVS #123",
            "address": "100 Main St, New York, NY 10001",
            "distanceMiles": 1.2,
            "couponPrice": 12.5,
            "listPrice": 40,
            "savingsPercent": 68.8,
            "goldPrice": null,
            "couponUrl": "https://www.goodrx.com/coupon/atorvastatin",
            "pharmacyDeepLink": null,
            "quantity": 30,
            "radiusMiles": null,
            "deliveryType": "pickup",
            "scrapedAt": "2026-11-17T10:00:00Z",
            "status": "available"
        }
    ],
    "slug": "atorvastatin",
    "delivery_type": "pickup",
    "meta": {
        "duration_ms": 13200,
        "attempts": 1,
        "source": "goodrx"
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | One or more query parameters failed validation. |
| 503 | Upstream Unavailable | GoodRx returned a blocked, empty or malformed page on every attempt. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
