# CMS Open Payments Scraper (`thetatech-data/cms-open-payments-scraper`) Actor

Query the official CMS Open Payments (Sunshine Act) API for general, research, and ownership payments to physicians and teaching hospitals. Filter by state, NPI, manufacturer, nature, and amount. No login. Free.

- **URL**: https://apify.com/thetatech-data/cms-open-payments-scraper.md
- **Developed by:** [Theta Tech](https://apify.com/thetatech-data) (community)
- **Categories:** Business, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does CMS Open Payments Scraper do?

**CMS Open Payments Scraper** queries the official [CMS Open Payments](https://openpaymentsdata.cms.gov/) (Sunshine Act) public API and returns structured **general**, **research**, and **ownership** payment records made by drug and device manufacturers to physicians, non-physician practitioners, and teaching hospitals.

This Actor does **not** scrape HTML pages. It calls the documented CMS datastore query API and maps each row into a clean JSON dataset — no CMS login and no multi-gigabyte CSV downloads.

### CMS Open Payments API alternative

Looking for a **CMS Open Payments API** without downloading multi-GB CSVs? This Actor wraps the official Open Payments datastore query endpoints and returns filtered JSON ready for compliance, Sunshine Act research, and AI pipelines.

### Why use this Actor?

Use cases for compliance teams, health-systems analysts, journalists, and competitive-intelligence researchers:

- Look up payments to providers in a specific **state**, **city**, or by **NPI**
- Filter by **manufacturer / GPO**, **nature of payment**, and **dollar amount**
- Pull **General**, **Research**, or **Ownership** datasets for program years **2019–2025**
- Export to JSON, CSV, Excel, or HTML from Apify dataset storage
- Schedule recurring pulls and integrate via the Apify API

### What data can it extract?

| Field | Type | Description |
| --- | --- | --- |
| `recipientNpi` | string | National Provider Identifier |
| `recipientLastName` / `recipientFirstName` | string | Covered recipient name |
| `recipientState` / `recipientCity` | string | Business address location |
| `manufacturerMakingPaymentName` | string | Manufacturer or GPO that made the payment |
| `totalAmountUsd` | number | Payment amount in USD |
| `dateOfPayment` | string | Payment date as published by CMS |
| `natureOfPayment` | string | e.g. Food and Beverage, Consulting Fee |
| `productName1` | string | Related drug / device / supply name |
| `programYear` | integer | Open Payments program year |
| `paymentType` | string | `general`, `research`, or `ownership` |

### How to query CMS Open Payments

1. Open this Actor in Apify Console and go to the **Input** tab.
2. Choose **payment type** and **program year**.
3. Add filters (state, NPI, manufacturer, nature, amount) as needed.
4. Set **Maximum records** (start small, e.g. 100).
5. Click **Start** and download results from the **Dataset** tab (JSON, CSV, Excel, or HTML).

#### Example input

```json
{
  "paymentType": "general",
  "year": 2024,
  "recipientState": "RI",
  "natureOfPayment": "Consulting Fee",
  "maxItems": 100,
  "pageSize": 100,
  "delayMs": 250
}
```

### How much does it cost?

This Actor is currently **free to use** (no pay-per-result charge from the publisher). You only pay Apify platform usage for the run. It uses lightweight HTTP calls only (no browser), so compute cost per 1,000 rows is typically a fraction of a cent on the free plan.

Tip: set `maxItems` and at least one geographic or manufacturer filter so you only process the rows you need.

### Input

See the **Input** tab for the full form. Important fields:

- `paymentType` — `general` (default), `research`, or `ownership`
- `year` — 2019–2025 (default 2024)
- `recipientState` — two-letter USPS code (e.g. `RI`)
- `recipientNpi`, `recipientLastName`, `recipientCity`
- `manufacturerName` — substring match
- `natureOfPayment` — exact CMS nature string
- `minAmount` / `maxAmount` — USD filters (applied client-side; CMS stores amounts as text)
- `maxItems` — hard stop (default 1000, max 50,000)

### Output

You can download the dataset in JSON, HTML, CSV, or Excel. Example item:

```json
{
  "programYear": 2024,
  "paymentType": "general",
  "recordId": "1000000001",
  "recipientNpi": "1234567890",
  "recipientFirstName": "Jordan",
  "recipientLastName": "Example",
  "recipientCity": "Providence",
  "recipientState": "RI",
  "manufacturerMakingPaymentName": "Example Pharma Inc",
  "totalAmountUsd": 32.0,
  "dateOfPayment": "09/03/2024",
  "natureOfPayment": "Food and Beverage",
  "productName1": "EXAMPLEDRUG",
  "sourceUrl": "https://openpaymentsdata.cms.gov/dataset/e6b17c6a-2534-4207-a4a1-6746a14911ff"
}
```

### Tips

- Always set `recipientState` or `manufacturerName` for large years — unfiltered 2024 general payments are tens of millions of rows.
- Use `pageSize` 100–200 and keep `delayMs` ≥ 250 to stay polite to the CMS API.
- Prefer combining `minAmount` / `maxAmount` with state, nature, or NPI filters so the Actor does not scan too many pages.
- Research and ownership datasets use the same filters where those columns exist.

### FAQ and disclaimer

**Is this official CMS data?**\
Yes. Records come from the public CMS Open Payments datastore API. Government works published by CMS are generally usable under U.S. government works rules; review [CMS Open Payments](https://openpaymentsdata.cms.gov/) and applicable law for your use case.

**Does this Actor collect private data?**\
It only returns fields CMS already publishes for transparency. Results can include provider names, NPIs, and business addresses. Personal data is protected by GDPR and other regulations — scrape or process it only with a legitimate purpose.

**Why are some fields empty?**\
CMS leaves many columns blank when not applicable (e.g. travel fields on a food-and-beverage payment).

**Support**\
Open an issue on the Actor's Issues tab, or contact the publisher (thetatech-data). For programmatic runs, see the API tab.

### Related

- [CMS Hospital Quality / Care Compare Scraper](https://apify.com/thetatech-data/cms-hospital-quality-scraper)
- [CMS Nursing Home Care Compare Scraper](https://apify.com/thetatech-data/cms-nursing-home-scraper)
- [CMS Medicare Physician & Other Practitioners Scraper](https://apify.com/thetatech-data/cms-medicare-physician-scraper)
- [Medicaid NADAC Drug Pricing Scraper](https://apify.com/thetatech-data/cms-nadac-drug-pricing-scraper)

# Actor input Schema

## `paymentType` (type: `string`):

Which Open Payments dataset to query.

## `year` (type: `integer`):

Open Payments program year. Supported: 2019–2025.

## `recipientState` (type: `string`):

Two-letter US state code for the covered recipient (e.g. RI, MA, CA).

## `recipientCity` (type: `string`):

City of the covered recipient's primary business address (exact match, case-insensitive).

## `recipientNpi` (type: `string`):

National Provider Identifier of the covered recipient (exact match).

## `recipientLastName` (type: `string`):

Last name of the covered recipient (exact match).

## `manufacturerName` (type: `string`):

Substring match on the manufacturer or GPO that made the payment (e.g. Janssen).

## `natureOfPayment` (type: `string`):

Exact nature of payment / transfer of value (e.g. Food and Beverage, Consulting Fee, Travel and Lodging, Royalty or License).

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

Only include payments with total USD amount greater than or equal to this value. Applied client-side after the CMS API returns rows (CMS stores amounts as text).

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

Only include payments with total USD amount less than or equal to this value. Applied client-side after the CMS API returns rows (CMS stores amounts as text).

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

Stop after this many records. Hard cap 50,000 per run.

## `pageSize` (type: `integer`):

Rows requested per CMS API call (1–500).

## `delayMs` (type: `integer`):

Polite delay between CMS API page requests.

## Actor input object example

```json
{
  "paymentType": "general",
  "year": 2024,
  "recipientState": "RI",
  "maxItems": 100,
  "pageSize": 100,
  "delayMs": 250
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing CMS Open Payments records matching the input filters.

# 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 = {
    "year": 2024,
    "recipientState": "RI",
    "recipientCity": "",
    "recipientNpi": "",
    "recipientLastName": "",
    "manufacturerName": "",
    "natureOfPayment": "",
    "minAmount": 0,
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("thetatech-data/cms-open-payments-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 = {
    "year": 2024,
    "recipientState": "RI",
    "recipientCity": "",
    "recipientNpi": "",
    "recipientLastName": "",
    "manufacturerName": "",
    "natureOfPayment": "",
    "minAmount": 0,
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("thetatech-data/cms-open-payments-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "year": 2024,
  "recipientState": "RI",
  "recipientCity": "",
  "recipientNpi": "",
  "recipientLastName": "",
  "manufacturerName": "",
  "natureOfPayment": "",
  "minAmount": 0,
  "maxItems": 100
}' |
apify call thetatech-data/cms-open-payments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thetatech-data/cms-open-payments-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/S6TWLh9NwL8FHQcyz/builds/SkIhw278cMduqnZ3b/openapi.json
