# CMS Open Payments Search (`ryanclinton/cms-open-payments`) Actor

Search the **CMS Open Payments** database for payments made by pharmaceutical and medical device companies to physicians and teaching hospitals across the United States. Access **15 million+ general payment records** and **750,000+ research payment records** per year, covering 2018 through 2024.

- **URL**: https://apify.com/ryanclinton/cms-open-payments.md
- **Developed by:** [ryan clinton](https://apify.com/ryanclinton) (community)
- **Categories:** Other, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 result returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## CMS Open Payments Search (Sunshine Act)

Search the **CMS Open Payments** database for payments made by pharmaceutical and medical device companies to physicians and teaching hospitals across the United States. Access **15 million+ general payment records** and **750,000+ research payment records** per year, covering 2018 through 2024.

No API key required. Just enter a company name like `Pfizer` or a physician's last name and get back structured payment data in seconds.

### Why Use CMS Open Payments Search?

The CMS Open Payments portal is designed for looking up one physician at a time. Extracting bulk data means navigating a clunky interface, dealing with massive CSV downloads, and parsing 91+ columns of inconsistently formatted fields. This actor handles the API complexity, amount filtering (the CMS API stores dollars as text strings), pagination, and field normalization — giving you clean, sorted JSON with associated drug/device product details.

### Features

- **Physician name lookup** — search by last name, first name, or both for precise results
- **NPI search** — look up a specific physician by National Provider Identifier (the most precise identifier)
- **Company search** — find all payments from a specific manufacturer with partial name matching (e.g., "Pfizer" matches "PFIZER INC.")
- **State filtering** — focus on payments in a specific US state
- **Payment type filter** — filter by 16 payment categories: consulting fees, food and beverage, travel, royalties, research, speaking fees, and more
- **Amount range filtering** — set minimum and/or maximum dollar amounts with accurate numeric comparison (not string-based)
- **Seven years of data** — search payment records from 2018 through 2024
- **Dual data types** — search general payments, research payments, or both simultaneously
- **Product associations** — each record includes up to 5 associated drugs, devices, or medical supplies with NDC/PDI codes
- **Research payment details** — research records include study name, clinical trial ID, and principal investigator information
- **Sorted output** — results are sorted by payment amount (highest first) for immediate insight into the largest transactions

### How to Use

1. **Enter search criteria** — provide at least one filter: physician name/NPI, company name, state, payment type, or amount range. Broader searches return more results but take longer.

2. **Choose the data type** — select General Payments (consulting, food, travel, gifts), Research Payments (clinical trials, grants), or Both.

3. **Select the program year** — choose from 2018–2024. Each year is a separate CMS dataset. Defaults to 2024.

4. **Run and download** — click "Start" and wait for the run to complete (typically 10–60 seconds). Download the structured JSON dataset.

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `physicianName` | String | No* | — | Physician last name, exact match, case-insensitive (e.g., "SMITH") |
| `physicianFirstName` | String | No | — | Physician first name, combine with last name for precision |
| `physicianNpi` | String | No* | — | National Provider Identifier (10-digit, most precise lookup) |
| `companyName` | String | No* | — | Paying company name, partial match (e.g., "Pfizer", "Abbott") |
| `state` | String | No | — | Two-letter US state code (e.g., "CA", "NY", "TX") |
| `paymentNature` | Select | No | All | Payment type category (16 options) |
| `minAmount` | Number | No | — | Minimum payment amount in USD |
| `maxAmount` | Number | No | — | Maximum payment amount in USD |
| `programYear` | Select | No | `2024` | Reporting year (2018–2024) |
| `dataType` | Select | No | `general` | General Payments, Research Payments, or Both |
| `maxResults` | Integer | No | `100` | Maximum records to return (1–10,000) |

*At least one search parameter is recommended for meaningful results.

#### Input Examples

**Find all Pfizer payments to physicians in California:**

```json
{
    "companyName": "Pfizer",
    "state": "CA",
    "maxResults": 200
}
````

**Look up a specific physician by NPI:**

```json
{
    "physicianNpi": "1234567890",
    "dataType": "both",
    "maxResults": 500
}
```

**High-value consulting fees in New York:**

```json
{
    "paymentNature": "Consulting Fee",
    "state": "NY",
    "minAmount": 10000,
    "maxResults": 100
}
```

**Research payments from Johnson & Johnson in 2022:**

```json
{
    "companyName": "Johnson",
    "dataType": "research",
    "programYear": "2022",
    "maxResults": 200
}
```

**All payments above $100,000 in 2024:**

```json
{
    "minAmount": 100000,
    "programYear": "2024",
    "maxResults": 500
}
```

#### Input Tips

- Use `physicianNpi` for the most precise physician lookup — it uniquely identifies a single provider.
- Company name search uses SQL LIKE wildcards internally, so "Pfizer" matches "PFIZER INC.", "Pfizer Pharmaceuticals", etc.
- Physician name matching is exact and case-insensitive against the API. Use ALL CAPS to match the CMS data format.
- Amount filters (`minAmount` / `maxAmount`) are applied client-side for numeric accuracy. The CMS API stores dollar amounts as text strings, which causes server-side comparisons to fail (e.g., "$19.79" appears greater than "$10,000" in string comparison).
- When searching for both general and research payments, set `dataType` to "both" — the actor queries both datasets and merges results.

### Output

#### General Payment Record

```json
{
    "recordId": "1234567",
    "dataType": "General",
    "programYear": "2024",
    "recipientType": "Covered Recipient Physician",
    "physicianName": "SMITH, JOHN A",
    "physicianFirstName": "JOHN",
    "physicianLastName": "SMITH",
    "physicianNpi": "1234567890",
    "physicianProfileId": "98765",
    "specialty": "Allopathic & Osteopathic Physicians|Internal Medicine|Cardiovascular Disease",
    "physicianType": "Medical Doctor",
    "teachingHospitalName": "",
    "addressLine1": "123 Medical Center Dr",
    "city": "New York",
    "state": "NY",
    "zipCode": "10001",
    "country": "United States",
    "payerName": "PFIZER INC.",
    "submittingCompany": "Pfizer Inc.",
    "payerState": "NY",
    "payerCountry": "United States",
    "totalAmount": 2500.00,
    "paymentDate": "2024-03-15",
    "numberOfPayments": 1,
    "paymentForm": "Cash or cash equivalent",
    "paymentNature": "Consulting Fee",
    "physicianOwnership": false,
    "thirdPartyPayment": "No Third Party Payment",
    "thirdPartyEntityName": "",
    "charityIndicator": false,
    "contextualInfo": "",
    "disputeStatus": "No",
    "products": [
        {
            "coveredOrNoncovered": "Covered",
            "type": "Drug",
            "category": "ELIQUIS",
            "name": "ELIQUIS",
            "ndcCode": "0003-0893",
            "pdiCode": ""
        }
    ],
    "changeType": "NEW",
    "publicationDate": "2025-01-15"
}
```

#### Research Payment Record (additional fields)

Research payment records include all general payment fields plus:

```json
{
    "principalInvestigatorName": "SMITH, JOHN A",
    "principalInvestigatorNpi": "1234567890",
    "studyName": "Phase III Clinical Trial of Novel Cardiac Device",
    "clinicalTrialId": "NCT04567890",
    "researchContextualInfo": "Multicenter randomized controlled trial"
}
```

#### Output Fields

**Physician / recipient fields:**

| Field | Type | Description |
|-------|------|-------------|
| `recipientType` | String | "Covered Recipient Physician" or "Covered Recipient Teaching Hospital" |
| `physicianName` | String | Full name (LAST, FIRST MIDDLE) |
| `physicianFirstName` | String | First name |
| `physicianLastName` | String | Last name |
| `physicianNpi` | String | National Provider Identifier (10-digit) |
| `physicianProfileId` | String | CMS-assigned physician profile ID |
| `specialty` | String | Physician specialty (pipe-delimited hierarchy) |
| `physicianType` | String | Doctor of Medicine, Doctor of Osteopathy, etc. |
| `teachingHospitalName` | String | Hospital name (when recipient is a teaching hospital) |

**Location fields:**

| Field | Type | Description |
|-------|------|-------------|
| `addressLine1` | String | Recipient street address |
| `city` | String | Recipient city |
| `state` | String | Recipient two-letter state code |
| `zipCode` | String | Recipient ZIP code |
| `country` | String | Recipient country |

**Payment fields:**

| Field | Type | Description |
|-------|------|-------------|
| `totalAmount` | Number | Payment amount in USD |
| `paymentDate` | String | Date of payment (YYYY-MM-DD) |
| `numberOfPayments` | Integer | Number of individual payments in this record |
| `paymentForm` | String | Cash, in-kind, stock, etc. |
| `paymentNature` | String | Purpose category (Consulting Fee, Food and Beverage, etc.) |
| `physicianOwnership` | Boolean | Whether physician has ownership interest in payer |
| `disputeStatus` | String | Whether the record is disputed |

**Payer fields:**

| Field | Type | Description |
|-------|------|-------------|
| `payerName` | String | Name of the paying company |
| `submittingCompany` | String | Company that submitted the report |
| `payerState` | String | Payer state |
| `payerCountry` | String | Payer country |

**Product fields (array, up to 5):**

| Field | Type | Description |
|-------|------|-------------|
| `products[].type` | String | Drug, Device, Biological, or Medical Supply |
| `products[].name` | String | Product name (e.g., "ELIQUIS") |
| `products[].category` | String | Product category |
| `products[].ndcCode` | String | National Drug Code (for drugs) |
| `products[].pdiCode` | String | Product Device Identifier (for devices) |

### Use Cases

- **Healthcare compliance officers** tracking physician-industry financial relationships to identify potential conflicts of interest and ensure disclosure compliance
- **Investigative journalists** following the money trail from pharmaceutical manufacturers to prescribing physicians to expose potential influence on medical practice
- **Pharmaceutical competitive intelligence teams** analyzing which companies spend the most on physician outreach, which KOLs are engaged by competitors, and what therapeutic areas receive the most investment
- **Academic researchers** studying the relationship between industry payments and prescribing patterns, geographic distribution of pharma spending, and trends over time
- **Medical device sales teams** identifying which hospitals and physicians are already receiving payments from competitors in their therapeutic area
- **Due diligence and credentialing teams** verifying physician financial relationships with industry as part of hiring, credentialing, or compliance reviews
- **Policy analysts** examining Sunshine Act data to evaluate the effectiveness of transparency regulations on industry-physician relationships

### How to Use the API

#### Python

```python
import requests
import time

run = requests.post(
    "https://api.apify.com/v2/acts/ryanclinton~cms-open-payments/runs",
    params={"token": "YOUR_APIFY_TOKEN"},
    json={
        "companyName": "Pfizer",
        "state": "CA",
        "minAmount": 1000,
        "maxResults": 200
    },
    timeout=30,
).json()

run_id = run["data"]["id"]
while True:
    status = requests.get(
        f"https://api.apify.com/v2/actor-runs/{run_id}",
        params={"token": "YOUR_APIFY_TOKEN"},
        timeout=10,
    ).json()
    if status["data"]["status"] in ("SUCCEEDED", "FAILED", "ABORTED"):
        break
    time.sleep(5)

dataset_id = status["data"]["defaultDatasetId"]
items = requests.get(
    f"https://api.apify.com/v2/datasets/{dataset_id}/items",
    params={"token": "YOUR_APIFY_TOKEN"},
    timeout=30,
).json()

for item in items:
    print(f"${item['totalAmount']:,.2f} | {item['physicianName']} | {item['payerName']} | {item['paymentNature']}")
```

#### JavaScript

```javascript
const response = await fetch(
    "https://api.apify.com/v2/acts/ryanclinton~cms-open-payments/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN",
    {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
            companyName: "Pfizer",
            state: "CA",
            minAmount: 1000,
            maxResults: 200,
        }),
    }
);

const payments = await response.json();
payments.forEach(p =>
    console.log(`$${p.totalAmount} | ${p.physicianName} | ${p.paymentNature}`)
);
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/ryanclinton~cms-open-payments/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "companyName": "Pfizer",
    "state": "CA",
    "minAmount": 1000,
    "maxResults": 200
  }'
```

### How It Works

```
Input (physician, company, state, amount, year, type)
  │
  ▼
┌──────────────────────────────────────────────────┐
│  Step 1: Resolve Dataset IDs                     │
│  Map programYear + dataType to CMS dataset IDs.  │
│  7 years × 2 types = 14 datasets available.      │
│  2024 General alone has 15M+ records.            │
└──────────────────────────────────────────────────┘
  │
  ▼
┌──────────────────────────────────────────────────┐
│  Step 2: Build API Query                         │
│  Construct CMS datastore query with conditions.  │
│  Company name uses LIKE with % wildcards.        │
│  Physician name uses exact match (=).            │
│  NPI, state, payment nature use exact match.     │
└──────────────────────────────────────────────────┘
  │
  ▼
┌──────────────────────────────────────────────────┐
│  Step 3: Paginated Fetch with Retry              │
│  Fetch 500 records per page from CMS API.        │
│  120-second timeout per request.                 │
│  Retry with exponential backoff (3 attempts).    │
│  Continue until maxResults reached.              │
└──────────────────────────────────────────────────┘
  │
  ▼
┌──────────────────────────────────────────────────┐
│  Step 4: Client-Side Amount Filtering            │
│  CMS stores amounts as text strings, so          │
│  server-side >= / <= comparisons are broken.     │
│  Parse totalAmount as float and filter locally.  │
│  Fetch extra pages to compensate for filtering.  │
└──────────────────────────────────────────────────┘
  │
  ▼
┌──────────────────────────────────────────────────┐
│  Step 5: Transform & Sort                        │
│  Normalize 91+ raw fields → clean camelCase.     │
│  Extract up to 5 associated products per record. │
│  Sort by totalAmount descending.                 │
│  Add research fields for research payments.      │
└──────────────────────────────────────────────────┘
  │
  ▼
Structured payment records pushed to dataset
```

#### Data Sources

| Source | API Endpoint | Auth Required |
|--------|-------------|---------------|
| CMS Open Payments | `https://openpaymentsdata.cms.gov/api/1/datastore/query/{dataset-id}/0` | No |

#### Payment Nature Categories

| Category | Description |
|----------|-------------|
| Consulting Fee | Advisory or consulting services |
| Food and Beverage | Meals at meetings, conferences, etc. |
| Travel and Lodging | Transportation and hotel costs |
| Education | Medical education programs |
| Honoraria | Speaking or presentation fees |
| Gift | Non-cash items of value |
| Entertainment | Event tickets, recreation |
| Research | Research-related funding |
| Royalty or License | IP licensing payments |
| Grant | Research or educational grants |
| Ownership/Investment | Equity or ownership interests |
| CE Speaking (Accredited) | Continuing education speaking (accredited) |
| CE Speaking (Non-Accredited) | Continuing education speaking (non-accredited) |
| Other Services/Speaking | Non-CE speaking and services |
| Charitable Contribution | Donations on behalf of physician |
| Space Rental | Facility fees (teaching hospitals only) |

### How Much Does It Cost?

| Scenario | Results | Est. Time | Est. Cost |
|----------|---------|-----------|-----------|
| Single physician NPI lookup | 10–50 | 5 sec | < $0.01 |
| Company + state search (200 results) | 200 | 15 sec | ~$0.01 |
| Broad search with amount filter (1,000 results) | 1,000 | 45 sec | ~$0.03 |
| Both data types, full year (10,000 results) | 10,000 | 3 min | ~$0.10 |

The actor uses 256 MB memory and makes lightweight API calls with no browser rendering. The Apify free tier covers hundreds of runs per month.

### Tips

- **Use NPI for precision** — a physician's NPI uniquely identifies them across all CMS databases. It's the most reliable lookup method.
- **Start with small maxResults** — test your search with 50–100 results first, then scale up once you've confirmed the filters return what you need.
- **Company name is partial match** — "Abbott" will match "Abbott Laboratories", "Abbott Medical Devices", etc. Be as specific as needed.
- **Check both data types** — general and research payments are stored in separate CMS datasets. Set `dataType` to "both" to get the complete picture.
- **Use amount filters for high-value analysis** — setting `minAmount: 10000` quickly surfaces the largest financial relationships.
- **Cross-reference with products** — the `products` array reveals which specific drugs or devices are associated with each payment, linking financial data to product-level competitive intelligence.

### Limitations

- **Amount filtering is client-side** — the CMS API stores dollar amounts as text strings. Server-side numeric comparisons produce incorrect results (e.g., "$19.79" > "$10,000" in string comparison). This actor filters client-side for accuracy, which means broad searches with amount filters may take longer.
- **No server-side sort** — sorting 15M+ text-stored amount fields causes the CMS API to hang indefinitely. Results are sorted client-side after fetch.
- **Physician name is exact match** — the CMS API does not support partial physician name matching. You must provide the exact last name as it appears in the database (typically ALL CAPS).
- **120-second timeout** — very broad queries on the 15M+ record general payment dataset may approach the CMS API timeout. Adding state, payment type, or company filters significantly improves response times.
- **One year at a time** — each program year is a separate CMS dataset. To analyze multi-year trends, run the actor once per year and merge results.
- **Up to 5 products per record** — the CMS API provides up to 5 associated drug/device products per payment record. Some payments may have additional unlisted products.
- **Data publication lag** — each year's data is typically published in January of the following year. The 2024 data became available in early 2025.

### Responsible Use

- **All data is public** — CMS Open Payments data is published under the Affordable Care Act's Sunshine Act provisions and is freely available for public use.
- **Respect CMS API rate limits** — the actor includes built-in retry with exponential backoff. Avoid launching many concurrent runs against the same CMS endpoint.
- **Handle physician data responsibly** — payment records include physician names, NPIs, specialties, and addresses. Use this data for legitimate compliance, research, and business purposes.
- **Payments do not imply wrongdoing** — the Sunshine Act requires disclosure of financial relationships but does not prohibit them. Many payments are for legitimate consulting, research, and education.

### FAQ

**Is an API key required?**
No. The CMS Open Payments API is free and does not require authentication.

**How often is the data updated?**
CMS publishes each program year's data in January of the following year. The 2024 data was published in early 2025. Once published, the data is static for that year.

**Why do some amounts seem wrong when I search the CMS website directly?**
The CMS API stores dollar amounts as text strings. Their own portal handles this internally, but raw API queries using >= or <= operators do string comparison, not numeric. This actor solves this by filtering amounts client-side after parsing them as numbers.

**Can I search for payments to teaching hospitals?**
Yes. Teaching hospital payments appear when you search by company name, state, or amount range. Hospital names appear in the `teachingHospitalName` field.

**What is the difference between General and Research payments?**
General payments cover consulting fees, food, travel, gifts, speaking fees, and other transfers of value. Research payments cover funding for clinical trials, research grants, and study-related payments. Research records include additional fields like study name and clinical trial ID.

**Can I search across multiple years at once?**
Not in a single run. Each program year is a separate CMS dataset. Run the actor once per year and merge the results for multi-year analysis.

**Why is the search slow for broad queries?**
The CMS general payment dataset has over 15 million records per year. Adding filters (company, state, payment type) dramatically reduces the data the API must scan and improves response times.

### Integrations

- **Apify API** — trigger runs programmatically for automated compliance monitoring pipelines
- **Zapier** — automatically run payment searches when new physician records are added to your compliance database
- **Make (Integromat)** — build workflows that cross-reference payment data with prescribing patterns
- **Google Sheets** — export payment data directly for compliance team review and audit trails
- **Webhooks** — receive payment data as soon as the run completes for real-time compliance alerts
- **Scheduled Runs** — run annually after each year's data publication to update your payment database

### Related Actors

| Actor | What it does | Use with CMS Open Payments |
|-------|-------------|---------------------------|
| [Clinical Trial Tracker](https://apify.com/ryanclinton/clinical-trial-tracker) | Search ClinicalTrials.gov | Cross-reference research payments with active clinical trials |
| [openFDA Drug Event Monitor](https://apify.com/ryanclinton/openfda-drug-events) | FDA adverse event reports | Analyze safety signals for drugs with high physician payment volumes |
| [FDA 510(k) Clearances](https://apify.com/ryanclinton/fda-510k-clearances) | Medical device clearances | Match device payments with device clearance data |
| [SEC EDGAR Filing Analyzer](https://apify.com/ryanclinton/sec-edgar-filing-analyzer) | SEC filing analysis | Research pharma companies' financial disclosures alongside payment data |
| [Congress Stock Tracker](https://apify.com/ryanclinton/congress-stock-tracker) | Congressional stock trades | Cross-reference pharma payments with congressional investment activity |
| [Senate Lobbying Search](https://apify.com/ryanclinton/senate-lobbying-search) | Federal lobbying filings | Compare pharma lobbying spending with physician payment patterns |

# Actor input Schema

## `physicianName` (type: `string`):

Filter by physician last name (exact match, case-insensitive). Example: SMITH

## `physicianFirstName` (type: `string`):

Filter by physician first name (exact match). Combine with last name for precise results.

## `physicianNpi` (type: `string`):

Filter by National Provider Identifier (10-digit number). Most precise physician lookup.

## `companyName` (type: `string`):

Filter by the pharmaceutical or device company making the payment. Example: Pfizer

## `state` (type: `string`):

Two-letter US state code. Example: CA, NY, TX

## `paymentNature` (type: `string`):

Filter by payment type

## `minAmount` (type: `number`):

Only return payments at or above this dollar amount

## `maxAmount` (type: `number`):

Only return payments at or below this dollar amount

## `programYear` (type: `string`):

Which reporting year to search. Defaults to latest (2024).

## `dataType` (type: `string`):

General payments (food, travel, consulting, etc.) or Research payments (clinical trial funding)

## `maxResults` (type: `integer`):

Maximum number of payment records to return

## Actor input object example

```json
{
  "programYear": "2024",
  "dataType": "general",
  "maxResults": 100
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("ryanclinton/cms-open-payments").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("ryanclinton/cms-open-payments").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 '{}' |
apify call ryanclinton/cms-open-payments --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CMS Open Payments Search",
        "description": "Search the **CMS Open Payments** database for payments made by pharmaceutical and medical device companies to physicians and teaching hospitals across the United States. Access **15 million+ general payment records** and **750,000+ research payment records** per year, covering 2018 through 2024.",
        "version": "1.0",
        "x-build-id": "PaCw6yDlRo0VuRfeK"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ryanclinton~cms-open-payments/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ryanclinton-cms-open-payments",
                "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/ryanclinton~cms-open-payments/runs": {
            "post": {
                "operationId": "runs-sync-ryanclinton-cms-open-payments",
                "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/ryanclinton~cms-open-payments/run-sync": {
            "post": {
                "operationId": "run-sync-ryanclinton-cms-open-payments",
                "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",
                "properties": {
                    "physicianName": {
                        "title": "Physician Last Name",
                        "type": "string",
                        "description": "Filter by physician last name (exact match, case-insensitive). Example: SMITH"
                    },
                    "physicianFirstName": {
                        "title": "Physician First Name",
                        "type": "string",
                        "description": "Filter by physician first name (exact match). Combine with last name for precise results."
                    },
                    "physicianNpi": {
                        "title": "Physician NPI",
                        "type": "string",
                        "description": "Filter by National Provider Identifier (10-digit number). Most precise physician lookup."
                    },
                    "companyName": {
                        "title": "Paying Company Name",
                        "type": "string",
                        "description": "Filter by the pharmaceutical or device company making the payment. Example: Pfizer"
                    },
                    "state": {
                        "title": "Recipient State",
                        "maxLength": 2,
                        "type": "string",
                        "description": "Two-letter US state code. Example: CA, NY, TX"
                    },
                    "paymentNature": {
                        "title": "Nature of Payment",
                        "enum": [
                            "",
                            "Consulting Fee",
                            "Compensation for services other than consulting, including serving as faculty or as a speaker at a venue other than a continuing education program",
                            "Honoraria",
                            "Gift",
                            "Entertainment",
                            "Food and Beverage",
                            "Travel and Lodging",
                            "Education",
                            "Research",
                            "Charitable Contribution",
                            "Royalty or License",
                            "Current or prospective ownership or investment interest",
                            "Compensation for serving as faculty or as a speaker for a non-accredited and noncertified continuing education program",
                            "Compensation for serving as faculty or as a speaker for an accredited or certified continuing education program",
                            "Grant",
                            "Space rental or facility fees (teaching hospital only)"
                        ],
                        "type": "string",
                        "description": "Filter by payment type"
                    },
                    "minAmount": {
                        "title": "Minimum Payment Amount ($)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Only return payments at or above this dollar amount"
                    },
                    "maxAmount": {
                        "title": "Maximum Payment Amount ($)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Only return payments at or below this dollar amount"
                    },
                    "programYear": {
                        "title": "Program Year",
                        "enum": [
                            "2024",
                            "2023",
                            "2022",
                            "2021",
                            "2020",
                            "2019",
                            "2018"
                        ],
                        "type": "string",
                        "description": "Which reporting year to search. Defaults to latest (2024).",
                        "default": "2024"
                    },
                    "dataType": {
                        "title": "Payment Data Type",
                        "enum": [
                            "general",
                            "research",
                            "both"
                        ],
                        "type": "string",
                        "description": "General payments (food, travel, consulting, etc.) or Research payments (clinical trial funding)",
                        "default": "general"
                    },
                    "maxResults": {
                        "title": "Maximum Results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of payment 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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
