# Drugs.com — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search for drugs and pill identifications, get detailed information about FDA approvals and drug interactions, and find medications by condition or letter. Look up side effects, dosages, and potential drug interactions to make informed health decisions.

**Category:** Healthcare | **Website:** [drugs.com/](https://drugs.com/) | **Docs:** [parse.bot/marketplace/f61f3c3a-9d6e-4204-ae83-e8e044c39783/drugs-com-api](https://parse.bot/marketplace/f61f3c3a-9d6e-4204-ae83-e8e044c39783/drugs-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-drugs-com-api-f61f3c3a/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_drug_by_letter

List drugs alphabetically by first letter. Returns all drug names and their page URLs for drugs starting with the specified letter. Covers the full Drugs.com A-Z index.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `letter` | string | No | Single letter a-z to filter drugs by first character. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-drugs-com-api-f61f3c3a/get_drug_by_letter \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"letter":"<string>"}'
```

### get_drug_details

Get comprehensive drug details from a specific drug page. Returns the drug name, generic name, drug class, content sections (keyed by section title), and the interaction ID needed for the get_drug_interactions endpoint. Sections include uses, side effects, warnings, dosage, and more depending on the drug.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Drug page path starting with / (e.g. '/abilify.html', '/lisinopril.html') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-drugs-com-api-f61f3c3a/get_drug_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### get_drug_interactions

Check interactions between drugs using their interaction IDs obtained from get_drug_details. Returns each interaction with its severity level (Major, Moderate, Minor), the drug pair involved, and a description of the interaction. Includes both drug-drug and drug-food/lifestyle interactions. Requires at least two comma-separated interaction IDs to produce results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `drug_ids` | string | Yes | Comma-separated interaction IDs for drugs (e.g. '233-109,11-0'). Interaction IDs are obtained from the get_drug_details endpoint's interaction_id field. At least two IDs are needed to check interactions. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-drugs-com-api-f61f3c3a/get_drug_interactions \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"drug_ids":"<string>"}'
```

### get_drugs_by_condition

List drugs prescribed for a specific medical condition, sorted by popularity. Returns drug names, page URLs, user ratings, review counts, Rx/OTC status, pregnancy category, CSA schedule, and alcohol interaction flag. Returns a stale_input error if the condition slug is not recognized.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `condition` | string | Yes | Condition slug as used in the Drugs.com URL path (e.g. 'pain', 'depression', 'anxiety', 'insomnia', 'acne', 'diabetes-type-2') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-drugs-com-api-f61f3c3a/get_drugs_by_condition \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"condition":"<string>"}'
```

### get_new_drug_approvals

Retrieve the latest FDA drug approvals listed on Drugs.com. Returns a single page of the most recent approvals including drug name, manufacturer, approval date, treatment indication, and description. No pagination; the response reflects the site's current listing (typically 15-25 recent approvals).

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-drugs-com-api-f61f3c3a/get_new_drug_approvals \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_pill_detail

Get detailed information for a specific pill by its detail page path. Returns structured metadata including imprint, strength, color, shape, size, drug class, availability, pregnancy category, CSA schedule, labeler, NDC code, and inactive ingredients.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Pill detail page path (e.g. '/imprints/l484-10944.html'). Obtained from pill_identifier_search results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-drugs-com-api-f61f3c3a/get_pill_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### pill_identifier_search

Search the pill identifier by imprint code and optionally filter by color or shape. Returns matching pills with their drug name, detail page URL, and structured details (Strength, Imprint, Color, Shape). At least one filter parameter should be provided for meaningful results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `color` | string | No | Pill color filter |
| `imprint` | string | No | Imprint text on the pill (e.g. 'L484', 'M365', 'IP 203') |
| `shape` | string | No | Pill shape filter |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-drugs-com-api-f61f3c3a/pill_identifier_search \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"color":"<string>","imprint":"<string>","shape":"<string>"}'
```

### search_drugs

Search for drugs by keyword across the Drugs.com index. Returns matching drug pages with titles, URLs, and description snippets. Results include consumer info pages, prescribing information, dosage guides, comparisons, side effects, and Q&A. Single page of results; no pagination.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword (e.g. 'lisinopril', 'aspirin', 'metformin') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-drugs-com-api-f61f3c3a/search_drugs \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
