# ClinicalTrials.gov Scraper (`crawlerbros/clinicaltrials-scraper`) Actor

Search and extract clinical trial data from ClinicalTrials.gov - conditions, interventions, phases, enrollment, sponsors, locations and status. Free, no authentication required.

- **URL**: https://apify.com/crawlerbros/clinicaltrials-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Developer tools, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Medicaid Drug Spending & NADAC Scraper

Retrieve official drug pricing and prescription spending data from the US Medicaid program. Look up the **National Average Drug Acquisition Cost (NADAC)** — what pharmacies actually pay per pill or unit — or browse **State Drug Utilization** data showing Medicaid prescription counts and reimbursement by state, drug, and quarter. No login or API key required.

### What data you get

#### NADAC Mode (drug acquisition costs)

| Field | Description |
|---|---|
| `drugName` | Drug description including strength and form |
| `ndc` | National Drug Code (11-digit) |
| `nadacPerUnit` | Average acquisition cost per unit in USD (per pill, mL, etc.) |
| `pricingUnit` | Unit type (EA=each, ML=milliliter, GM=gram) |
| `effectiveDate` | Date the NADAC rate became effective |
| `asOfDate` | Date the data was published |
| `pharmacyType` | C/I (Community/Independent), C, I, or M (Mail-order) |
| `isOtc` | Whether the drug is available over-the-counter |
| `drugClassification` | Brand or Generic |
| `explanationCode` | Code describing how the NADAC was calculated |
| `explanationDescription` | Human-readable explanation of pricing method |
| `correspondingGenericCostPerUnit` | Generic equivalent cost (for brand drugs) |
| `scrapedAt` | ISO-8601 scrape timestamp |

#### State Drug Utilization Mode (Medicaid spending)

| Field | Description |
|---|---|
| `state` | 2-letter US state/territory code |
| `drugName` | Product name |
| `ndc` | National Drug Code |
| `year` | Program year |
| `quarter` | Quarter (1–4) |
| `utilizationType` | FFSU (Fee-for-Service Utilization) or MCU (Managed Care Utilization) |
| `numberOfPrescriptions` | Number of prescriptions reimbursed |
| `unitsReimbursed` | Units dispensed |
| `totalAmountReimbursedUsd` | Total Medicaid + non-Medicaid reimbursement in USD |
| `medicaidAmountReimbursedUsd` | Federal/state Medicaid share |
| `nonMedicaidAmountReimbursedUsd` | Non-Medicaid (e.g. MCO) share |
| `suppressionUsed` | Whether data was suppressed for privacy |
| `scrapedAt` | ISO-8601 scrape timestamp |

### Use cases

- **Healthcare cost research** — compare what pharmacies pay for generic vs brand-name drugs
- **PBM transparency analysis** — assess spread pricing between NADAC and reimbursement rates
- **Policy analysis** — track Medicaid drug spending trends by state, drug, and quarter
- **Drug pricing journalism** — identify the most expensive drugs by acquisition cost
- **Healthcare economics** — analyse brand-to-generic cost differentials
- **Compliance research** — review Medicaid utilization patterns for specific therapeutic areas

### Input parameters

| Parameter | Required | Default | Description |
|---|---|---|---|
| `mode` | Yes | `nadac` | `nadac` for acquisition costs, `stateUtilization` for spending data |
| `dataYear` | Yes | `2024` | Year of data: `2023` or `2024` |
| `drugNameQuery` | No | — | Filter by keyword in drug name (case-insensitive, e.g., `metformin`) |
| `pharmacyType` | No | all | NADAC mode: `C/I`, `C`, `I`, `M` |
| `otcOnly` | No | `false` | NADAC mode: return only OTC drugs |
| `state` | No | all | State Utilization mode: 2-letter state code (e.g., `TX`) |
| `quarter` | No | all | State Utilization mode: `1`–`4` |
| `maxItems` | No | `100` | Maximum records to return (up to 10,000) |

### Example input — NADAC drug pricing

```json
{
  "mode": "nadac",
  "dataYear": "2024",
  "drugNameQuery": "metformin",
  "pharmacyType": "C/I",
  "maxItems": 50
}
````

### Example input — State Drug Utilization

```json
{
  "mode": "stateUtilization",
  "dataYear": "2024",
  "state": "TX",
  "quarter": "4",
  "maxItems": 200
}
```

### Example output records

**NADAC record:**

```json
{
  "dataType": "nadac",
  "drugName": "METFORMIN HCL 500 MG TABLET",
  "ndc": "00093108601",
  "nadacPerUnit": 0.02838,
  "pricingUnit": "EA",
  "effectiveDate": "2024-01-10",
  "asOfDate": "2024-01-17",
  "pharmacyType": "C/I",
  "isOtc": false,
  "drugClassification": "Generic",
  "explanationCode": "1",
  "explanationDescription": "National Average Drug Acquisition Cost",
  "scrapedAt": "2026-06-04T00:00:00+00:00"
}
```

**State Utilization record:**

```json
{
  "dataType": "stateUtilization",
  "state": "TX",
  "drugName": "TRULICITY",
  "ndc": "00002143380",
  "year": "2024",
  "quarter": "4",
  "utilizationType": "FFSU",
  "numberOfPrescriptions": 108,
  "unitsReimbursed": 226.0,
  "totalAmountReimbursedUsd": 106607.76,
  "medicaidAmountReimbursedUsd": 103963.72,
  "nonMedicaidAmountReimbursedUsd": 2644.04,
  "suppressionUsed": false,
  "scrapedAt": "2026-06-04T00:00:00+00:00"
}
```

### Data source

Data is sourced from **data.medicaid.gov**, the official open data portal of the Centers for Medicare & Medicaid Services (CMS). Both datasets are public domain, freely accessible, and require no API key.

- **NADAC** is updated weekly by CMS and reflects actual pharmacy invoice costs surveyed from US pharmacies.
- **State Drug Utilization** is updated quarterly and covers all 50 states plus DC, Puerto Rico, and US territories.

### FAQ

**What is NADAC?**
NADAC (National Average Drug Acquisition Cost) is a weekly survey of what community pharmacies pay wholesalers and manufacturers for drugs. It is used as a reimbursement benchmark by many state Medicaid programs.

**Does this require login or an API key?**
No. All data is publicly available on data.medicaid.gov with no authentication required.

**How current is the NADAC data?**
The 2024 dataset contains weekly updates through the end of 2024. The most recent `asOfDate` in the data reflects the latest weekly survey.

**What is State Drug Utilization data?**
It tracks the volume and cost of drugs reimbursed by each state's Medicaid program, broken down by drug NDC, state, year, and quarter. Both fee-for-service (FFSU) and managed care utilization (MCU) types are included.

**What does "suppression" mean?**
When fewer than 11 beneficiaries used a drug in a state/quarter, the data is suppressed to protect patient privacy. These records still appear but with suppression flagged.

**Can I search by NDC code?**
Use `drugNameQuery` with the drug name — NDC-level filtering can be applied after download. The NADAC dataset uses 11-digit NDC codes as primary identifiers.

# Actor input Schema

## `condition` (type: `string`):

Disease or condition to search for. Example: diabetes, cancer, asthma, COVID-19.

## `intervention` (type: `string`):

Drug, treatment or intervention name to filter results. Example: metformin, aspirin, chemotherapy.

## `status` (type: `string`):

Filter trials by their current recruitment or study status.

## `phase` (type: `string`):

Filter by clinical trial phase.

## `maxItems` (type: `integer`):

Maximum number of clinical trial records to return.

## Actor input object example

```json
{
  "condition": "diabetes",
  "intervention": "metformin",
  "status": "RECRUITING",
  "phase": "all",
  "maxItems": 50
}
```

# Actor output Schema

## `drugRecords` (type: `string`):

Dataset containing all scraped drug pricing or utilization records.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "condition": "diabetes",
    "intervention": "metformin",
    "status": "RECRUITING",
    "phase": "all",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/clinicaltrials-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "condition": "diabetes",
    "intervention": "metformin",
    "status": "RECRUITING",
    "phase": "all",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/clinicaltrials-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "condition": "diabetes",
  "intervention": "metformin",
  "status": "RECRUITING",
  "phase": "all",
  "maxItems": 50
}' |
apify call crawlerbros/clinicaltrials-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crawlerbros/clinicaltrials-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "ClinicalTrials.gov Scraper",
        "description": "Search and extract clinical trial data from ClinicalTrials.gov - conditions, interventions, phases, enrollment, sponsors, locations and status. Free, no authentication required.",
        "version": "0.1",
        "x-build-id": "sg6kZZDS8wanfWzpz"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~clinicaltrials-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-clinicaltrials-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/crawlerbros~clinicaltrials-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-clinicaltrials-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/crawlerbros~clinicaltrials-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-clinicaltrials-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "condition"
                ],
                "properties": {
                    "condition": {
                        "title": "Condition / Disease",
                        "type": "string",
                        "description": "Disease or condition to search for. Example: diabetes, cancer, asthma, COVID-19.",
                        "default": "diabetes"
                    },
                    "intervention": {
                        "title": "Intervention / Drug (optional)",
                        "type": "string",
                        "description": "Drug, treatment or intervention name to filter results. Example: metformin, aspirin, chemotherapy."
                    },
                    "status": {
                        "title": "Trial Status",
                        "enum": [
                            "RECRUITING",
                            "ACTIVE_NOT_RECRUITING",
                            "COMPLETED",
                            "NOT_YET_RECRUITING",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter trials by their current recruitment or study status.",
                        "default": "RECRUITING"
                    },
                    "phase": {
                        "title": "Trial Phase",
                        "enum": [
                            "all",
                            "PHASE1",
                            "PHASE2",
                            "PHASE3",
                            "PHASE4"
                        ],
                        "type": "string",
                        "description": "Filter by clinical trial phase.",
                        "default": "all"
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Maximum number of clinical trial records to return.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
