# GoodRx API

> GoodRx returns nearby pharmacy coupon prices for medicines and prescriptions as a workflow and API.

GoodRx compares medicine coupon prices near a US ZIP code; provide the medicine and ZIP code, with prescription details optional.

- Page: https://fous.com/tools/goodrx
- Handle: `@goodrx`
- Category: [Health](https://fous.com/tools/category/health)
- Source website: https://goodrx.com
- Last verified: Sep 28, 2026

## Methods

### Compare drug prices

Operation `compare_drug_prices`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Compare standard GoodRx coupon prices at pharmacies near a US ZIP code for a medicine and prescription. Prices may change and some pharmacies may not offer coupons.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `form` | string | no | `"tablet"` | Prescription form, for example tablet; omit for GoodRx’s most common choice. |
| `medicine` | string | yes | `"amoxicillin"` | Brand or generic medicine name, for example amoxicillin. |
| `quantity` | integer | no | `30` | Number of units, for example 30; omit for GoodRx’s most common choice. |
| `strength` | string | no | `"500 mg"` | Prescription strength, for example 500 mg; omit for GoodRx’s most common choice. |
| `zip_code` | string | yes | `"60614"` | Five-digit US ZIP code, for example 60614. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "medicine",
    "zip_code"
  ],
  "properties": {
    "form": {
      "type": "string",
      "default": "",
      "description": "Prescription form, for example tablet; omit for GoodRx’s most common choice.",
      "examples": [
        "tablet"
      ]
    },
    "medicine": {
      "type": "string",
      "description": "Brand or generic medicine name, for example amoxicillin.",
      "examples": [
        "amoxicillin",
        "atorvastatin"
      ]
    },
    "quantity": {
      "type": "integer",
      "minimum": 1,
      "description": "Number of units, for example 30; omit for GoodRx’s most common choice.",
      "examples": [
        30
      ]
    },
    "strength": {
      "type": "string",
      "default": "",
      "description": "Prescription strength, for example 500 mg; omit for GoodRx’s most common choice.",
      "examples": [
        "500 mg"
      ]
    },
    "zip_code": {
      "type": "string",
      "pattern": "^[0-9]{5}$",
      "description": "Five-digit US ZIP code, for example 60614.",
      "examples": [
        "60614",
        "10001"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "form": "tablet",
      "medicine": "amoxicillin",
      "quantity": 30,
      "strength": "500 mg",
      "zip_code": "60614"
    },
    {
      "medicine": "atorvastatin",
      "zip_code": "10001"
    },
    {
      "medicine": "amoxicillin",
      "zip_code": "60614"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `form` | string or null | `"tablet"` | Prescription form used. |
| `medicine` | string | `"Amoxicillin"` | Medicine shown by GoodRx. |
| `quantity` | integer or null | `30` | Number of units used. |
| `strength` | string or null | `"500mg"` | Prescription strength used. |
| `pharmacies` | array |  | Nearby pharmacies sorted by standard GoodRx coupon price. |
| `pharmacies[].goodrx_link` | string | `"https://www.goodrx.com/amoxicillin?form=tablet&dosage=500mg&quantity=30&pharmacyId=49222"` |  |
| `pharmacies[].pharmacy_name` | string | `"Aurora Pharmacy"` |  |
| `pharmacies[].savings_percent` | number or null | `58.8` |  |
| `pharmacies[].coupon_price_usd` | number | `12.2` |  |
| `pharmacies[].retail_price_usd` | number or null | `29.63` |  |

**Example input**

```json
{
  "form": "tablet",
  "medicine": "amoxicillin",
  "quantity": 30,
  "strength": "500 mg",
  "zip_code": "60614"
}
```

**Example output**

```json
{
  "form": "tablet",
  "medicine": "Amoxicillin",
  "quantity": 30,
  "strength": "500mg",
  "pharmacies": [
    {
      "goodrx_link": "https://www.goodrx.com/amoxicillin?form=tablet&dosage=500mg&quantity=30&pharmacyId=49222",
      "pharmacy_name": "Aurora Pharmacy",
      "savings_percent": 58.8,
      "coupon_price_usd": 12.2,
      "retail_price_usd": 29.63
    },
    {
      "goodrx_link": "https://www.goodrx.com/amoxicillin?form=tablet&dosage=500mg&quantity=30&pharmacyId=49499",
      "pharmacy_name": "Sams Club",
      "savings_percent": 31.1,
      "coupon_price_usd": 12.4,
      "retail_price_usd": 18.01
    },
    {
      "goodrx_link": "https://www.goodrx.com/amoxicillin?form=tablet&dosage=500mg&quantity=30&pharmacyId=3",
      "pharmacy_name": "Walgreens",
      "savings_percent": 52.4,
      "coupon_price_usd": 12.84,
      "retail_price_usd": 26.97
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@goodrx",
  "visibility": "public",
  "operation": "compare_drug_prices",
  "version": 1,
  "input": {
    "form": "tablet",
    "medicine": "amoxicillin",
    "quantity": 30,
    "strength": "500 mg",
    "zip_code": "60614"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@goodrx\",\n  \"visibility\": \"public\",\n  \"operation\": \"compare_drug_prices\",\n  \"version\": 1,\n  \"input\": {\n    \"form\": \"tablet\",\n    \"medicine\": \"amoxicillin\",\n    \"quantity\": 30,\n    \"strength\": \"500 mg\",\n    \"zip_code\": \"60614\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@goodrx",
  "visibility": "public",
  "operation": "compare_drug_prices",
  "version": 1,
  "input": {
    "form": "tablet",
    "medicine": "amoxicillin",
    "quantity": 30,
    "strength": "500 mg",
    "zip_code": "60614"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/goodrx`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `compare_drug_prices`: Compare drug prices. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-goodrx https://api.fous.com/mcp/tools/goodrx --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Compare coupon prices for a medicine near a customer’s ZIP code
- Identify nearby pharmacies with lower coupon prices
- Estimate savings against listed retail prices

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this GoodRx tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a GoodRx account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from goodrx.com when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 28, 2026.

### What are nearby pharmacies charging for a medicine?

Use Compare drug prices with the medicine and five-digit US ZIP code. Prescription form, quantity, and strength are optional.

### Which nearby pharmacy has the lowest coupon price?

Compare drug prices returns nearby pharmacies sorted by standard GoodRx coupon price.

### How much could a coupon save versus retail price?

Compare drug prices returns coupon price, retail price, and savings percentage for nearby pharmacies.

## Related

- [Drugs.com API](https://fous.com/tools/drugs-com.md): Drugs.com provides public medicine guides, interaction and food or lifestyle warnings for 2–10 medicines, pill matches by imprint, color, or shape, and listed US cash prices by strength, form, and quantity.
- [Cost Plus Drugs API](https://fous.com/tools/cost-plus-drugs.md): Transparent medicine prices from Mark Cuban Cost Plus Drug Company.
- [Costco API](https://fous.com/tools/costco.md): Costco returns US product prices/details and warehouse hours/services/gas prices; delivery affects availability, member prices may be hidden, and posted gas and holiday hours may differ.
- [NHS API](https://fous.com/tools/nhs.md): NHS provides condition and medicine guidance, with condition dates reflecting the latest pages used, and nearby England service listings ordered by distance; availability details may be missing.
- [RetailMeNot API](https://fous.com/tools/retailmenot.md): Store coupons, promo codes and shopping deals.
- [Aldi API](https://fous.com/tools/aldi.md): Search groceries and prices at ALDI US.
- [Medicare Care Compare API](https://fous.com/tools/medicare-care-compare.md): Medicare Care Compare provides public Medicare quality ratings and details for U.S. hospitals and nursing homes; nursing home results include active facilities in the current public listing and fines from the past three years.
- [Best Buy API](https://fous.com/tools/best-buy.md): Best Buy returns US electronics and appliance listings, prices, deals, specifications, images, reviews, and nearby store pickup and shipping details; prices and availability can change by location and before checkout.
- [All Health tools](https://fous.com/tools/category/health)
