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

Scrape public CMS Open Payments data for providers, teaching hospitals, and companies. Export entity results, profile details, and payment records with payer, recipient, amount, year, and source URLs.

- **URL**: https://apify.com/maximedupre/cms-open-payments-scraper.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Business, Developer tools, Education
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.90 / 1,000 results

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 scraper for payment records

CMS Open Payments Scraper collects public Open Payments data for individual providers, teaching hospitals, and companies. Use Open Payments URLs or search targets to export entity records, profile details, and payment records for General Payments, Research Payments, and Physician Ownership when available.

- Use a [CMS Open Payments scraper](https://apify.com/maximedupre/cms-open-payments-scraper/examples/cms-open-payments-scraper) to collect public payment records before compliance review.
- Run an [Open Payments provider search](https://apify.com/maximedupre/cms-open-payments-scraper/examples/open-payments-provider-search) to find physician or provider entity records and profile URLs.
- [Export CMS Open Payments data](https://apify.com/maximedupre/cms-open-payments-scraper/examples/export-cms-open-payments-data) with payer, recipient, amount, payment date, payment type, product names, and program year.
- Build [Open Payments teaching hospital data](https://apify.com/maximedupre/cms-open-payments-scraper/examples/open-payments-teaching-hospital-data) lists with organization details, locations, identifiers, and related payment facts.
- Monitor [Open Payments company payments](https://apify.com/maximedupre/cms-open-payments-scraper/examples/open-payments-company-payments) by year, state, specialty, payment category, or minimum payment amount.
- Collect [physician payment records](https://apify.com/maximedupre/cms-open-payments-scraper/examples/physician-payment-records) for audit, research, BI, or downstream Apify workflows.

#### 📦 What data you can collect

The actor returns one dataset row per successful Open Payments result. Depending on the target and public CMS data available, rows can include:

| Result type | Common fields |
| --- | --- |
| Entity result | `rowType`, `entityId`, `entityType`, `name`, `classification`, `specialty`, `profileUrl`, `location`, `identifiers` |
| Payment record | `rowType`, `paymentId`, `paymentCategory`, `programYear`, `paymentDate`, `amountUsd`, `natureOfPayment`, `formOfPayment`, `sourceUrl`, `recipient`, `payer`, `teachingHospital`, `productNames`, `products`, `research`, `ownership` |

Unavailable source fields are omitted from the saved row instead of being filled with guessed values.

#### ▶️ How to run it

1. Choose one target method: Open Payments URLs, entity search terms, or payment search terms.
2. Add optional filters such as program years, states, specialties, payment category, minimum payment amount, or maximum results.
3. Start the actor and open the default dataset when the run finishes.
4. Export results as JSON, CSV, Excel, XML, RSS, or HTML from Apify dataset tools.

#### ⚙️ Input options

| Input | Use it for |
| --- | --- |
| `sourceUrls` | Public CMS Open Payments search, profile, or detail URLs. |
| `entitySearchTerms` | Names or organizations to collect matching entity search-result records. |
| `paymentSearchTerms` | Providers, hospitals, or companies to collect matching payment records. |
| `programYears` | Limit results to selected Open Payments program years. |
| `states` | Filter by US state or territory abbreviation. |
| `specialties` | Filter provider results by specialty terms when available. |
| `paymentCategory` | Choose all, General Payments, Research Payments, or Physician Ownership. |
| `minPaymentAmount` | Keep payment records at or above a USD amount. |
| `maxResults` | Stop after a selected number of successful records. |

#### 🧾 Output example

```json
{
  "rowType": "payment",
  "paymentId": "123456789",
  "paymentCategory": "general",
  "programYear": 2025,
  "paymentDate": "2025-03-14",
  "amountUsd": 250.75,
  "natureOfPayment": "Food and Beverage",
  "formOfPayment": "Cash or cash equivalent",
  "sourceUrl": "https://openpaymentsdata.cms.gov/payment/general/2025/123456789",
  "recipient": {
    "name": "Jane A Smith",
    "entityId": "987654",
    "entityType": "Covered Recipient Physician",
    "specialty": "Internal Medicine",
    "city": "Boston",
    "state": "MA",
    "country": "United States"
  },
  "payer": {
    "name": "Example Medical LLC",
    "entityId": "456789",
    "state": "NJ",
    "country": "United States"
  },
  "teachingHospital": {
    "name": "Example Teaching Hospital",
    "entityId": "112233",
    "city": "Boston",
    "state": "MA"
  },
  "productNames": ["Example Device"],
  "products": [{ "name": "Example Device" }]
}
````

Entity rows use the same dataset and include `rowType: "entity"` with fields such as `entityId`, `entityType`, `name`, `classification`, `specialty`, `profileUrl`, `location`, and `identifiers`.

#### 💳 Pricing

This actor uses pay-per-event pricing. You are charged only when the actor saves an accepted result to the dataset. Empty runs and setup checks should not be described as charged unless the pricing handoff says otherwise.

The current event is **Result** at **$0.0009 per successful Open Payments result record**.

#### 🔌 Integrations

https://www.youtube.com/watch?v=bNACk1\_S\_6w\&list=PLObrtcm1Kw6MUrlLNDbK9QRg8VDJg0gOW\&index=4

Use this actor with Apify integrations, API clients, webhooks, scheduled runs, and dataset exports. Send results to spreadsheets, BI tools, databases, or your own app after each run.

#### ❓ FAQ

**🔎 Can I search by provider, hospital, or company name?**

Yes. Use entity search terms for Open Payments entity records, or payment search terms when you want detailed payment records for matching public targets.

**💳 Which payment categories are supported?**

The actor can collect public General Payments, Research Payments, and Physician Ownership records when those records are available from CMS Open Payments.

**🧭 Can I filter by year, state, specialty, and amount?**

Yes. The input supports program years, states, specialties, payment category, and minimum payment amount. Filters apply when the selected public Open Payments target supports the field.

**🔗 Can I start from an Open Payments URL?**

Yes. Add public CMS Open Payments search, profile, or detail URLs in `sourceUrls` to collect records from those pages.

**🧑‍⚕️ Does it require a CMS account or uploaded files?**

No. The standard workflow uses public CMS Open Payments data and does not require private CMS credentials or uploaded source files.

**📭 What happens if no records match?**

The run reports that no matching Open Payments records were found. No-result searches are not described as successful result records.

**🧪 Does the actor infer or enrich data with AI?**

No. It returns source-native CMS Open Payments facts and mechanical fields derived from the public source, without AI classification or scoring.

**🧾 Is this the official CMS Open Payments API?**

No. This is an Apify actor for collecting public CMS Open Payments data and exporting it through Apify datasets, API, schedules, and integrations.

### 📝 Changelog

- 0.0.1: Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~cms-open-payments-scraper/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Other actors

- [Hospital Price Transparency Scraper ↗](https://apify.com/maximedupre/hospital-price-transparency-scraper) - Use it for related cms and payer workflows.
- [World Bank Projects Scraper ↗](https://apify.com/maximedupre/world-bank-projects-scraper) - Use it for related amount and year workflows.
- [FEC Campaign Finance Scraper ↗](https://apify.com/maximedupre/fec-campaign-finance-scraper) - Use it for related recipient and amount workflows.
- [ICD-10 Codes Scraper ↗](https://apify.com/maximedupre/icd-10-codes-scraper) - Use it for related education workflows.
- [CMS Nursing Home Compare Scraper ↗](https://apify.com/maximedupre/cms-nursing-home-compare-scraper) - Use it for related cms and payment workflows.
  **Made with ❤️ by Maxime Dupré**

# Actor input Schema

## `sourceUrls` (type: `array`):

Add public CMS Open Payments search, profile, or detail URLs to collect records from those pages.

## `entitySearchTerms` (type: `array`):

Search for individual providers, teaching hospitals, or companies and collect matching entity records.

## `paymentSearchTerms` (type: `array`):

Search for providers, teaching hospitals, or companies and collect matching payment records when available.

## `programYears` (type: `array`):

Limit results to one or more Open Payments program years. Leave empty to use the source default coverage.

## `states` (type: `array`):

Filter by US state or territory abbreviation, such as CA, NY, or PR.

## `specialties` (type: `array`):

Filter provider results by specialty terms when available in the source.

## `paymentCategory` (type: `string`):

Choose which Open Payments payment family to collect for payment targets.

## `minPaymentAmount` (type: `number`):

Collect payment records at or above this USD amount. Leave empty to include all available amounts.

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

Stop after this many successful records. Use a smaller value for quick tests or broad searches.

## Actor input object example

```json
{
  "sourceUrls": [
    {
      "url": "https://openpaymentsdata.cms.gov/"
    }
  ],
  "paymentCategory": "all",
  "maxResults": 100
}
```

# Actor output Schema

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

View saved entity and payment records in the default dataset.

# 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 = {
    "sourceUrls": [
        {
            "url": "https://openpaymentsdata.cms.gov/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/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 = { "sourceUrls": [{ "url": "https://openpaymentsdata.cms.gov/" }] }

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/cms-open-payments-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 '{
  "sourceUrls": [
    {
      "url": "https://openpaymentsdata.cms.gov/"
    }
  ]
}' |
apify call maximedupre/cms-open-payments-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CMS Open Payments Scraper",
        "description": "Scrape public CMS Open Payments data for providers, teaching hospitals, and companies. Export entity results, profile details, and payment records with payer, recipient, amount, year, and source URLs.",
        "version": "0.1",
        "x-build-id": "BPvgieW9uArVSub5o"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maximedupre~cms-open-payments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maximedupre-cms-open-payments-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/maximedupre~cms-open-payments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-maximedupre-cms-open-payments-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/maximedupre~cms-open-payments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-maximedupre-cms-open-payments-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",
                "properties": {
                    "sourceUrls": {
                        "title": "Open Payments URLs",
                        "type": "array",
                        "description": "Add public CMS Open Payments search, profile, or detail URLs to collect records from those pages.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "entitySearchTerms": {
                        "title": "Entity search terms",
                        "type": "array",
                        "description": "Search for individual providers, teaching hospitals, or companies and collect matching entity records.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "paymentSearchTerms": {
                        "title": "Payment search terms",
                        "type": "array",
                        "description": "Search for providers, teaching hospitals, or companies and collect matching payment records when available.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "programYears": {
                        "title": "Program years",
                        "type": "array",
                        "description": "Limit results to one or more Open Payments program years. Leave empty to use the source default coverage.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "states": {
                        "title": "States",
                        "type": "array",
                        "description": "Filter by US state or territory abbreviation, such as CA, NY, or PR.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "specialties": {
                        "title": "Specialties",
                        "type": "array",
                        "description": "Filter provider results by specialty terms when available in the source.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "paymentCategory": {
                        "title": "Payment category",
                        "enum": [
                            "all",
                            "general",
                            "research",
                            "ownership"
                        ],
                        "type": "string",
                        "description": "Choose which Open Payments payment family to collect for payment targets.",
                        "default": "all"
                    },
                    "minPaymentAmount": {
                        "title": "Minimum payment amount",
                        "type": "number",
                        "description": "Collect payment records at or above this USD amount. Leave empty to include all available amounts."
                    },
                    "maxResults": {
                        "title": "Maximum results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Stop after this many successful records. Use a smaller value for quick tests or broad searches.",
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
