CMS Medicare Part B Drug Spending Scraper API
Pricing
from $1.60 / 1,000 cms medicare part b drug spending scraper api evidence items
CMS Medicare Part B Drug Spending Scraper API
Search CMS Medicare Part B drug spending by brand, generic name, HCPCS, manufacturer when reported, year, spending, beneficiaries, claims, dosage units, averages, and growth. Get normalized annual series plus retained raw CMS fields.
Pricing
from $1.60 / 1,000 cms medicare part b drug spending scraper api evidence items
Rating
0.0
(0)
Developer
Ava Torres
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
0
Monthly active users
10 days ago
Last modified
Categories
Features
Share
Search CMS's official 2024 Medicare Part B Spending by Drug dataset by brand, generic name, HCPCS, manufacturer where reported, annual spending, beneficiaries, claims, dosage units, average costs, and growth.
Empty input returns one verified Keytruda / J9271 record with a normalized 2020-2024 annual series. Maximum first-run charge: $0.0021 ($0.0001 start + $0.002/item).
{}
{"genericName":"Pembrolizumab","year":2024,"minTotalSpending":1000000000,"maxResults":10}
Output preserves raw CMS fields while normalizing changing year-suffixed columns into bounded annualMetrics, calculates annual growth, retains blanks/suppressed values as null, and discloses candidate/page/year/result bounds, source vintage, retrieval time, and source URLs.
CMS Part B spending is lagged aggregate claims/program evidence—not list price, rebate/net cost, prescribing advice, efficacy, safety, current market share, endorsement, or a complete/current utilization view. A bounded no-match does not prove absence.
How to use
- Open CMS Medicare Part B Drug Spending Scraper API in Apify Console and click Start (or Try for free).
- Fill in the input form - start with Sort By, Sort Direction, Maximum Source Candidates. Every field is optional unless marked required, and the form is prefilled with a working example.
- Set Maximum results to cap your cost, then run the Actor.
- Download the results as JSON, CSV, Excel, XML or HTML, or pull them with the Apify API.
Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
brandName | string | no | Exact CMS brand name, such as Keytruda. | |
genericName | string | no | Exact CMS generic name, such as Pembrolizumab. | |
hcpcsCode | string | no | Exact five-character HCPCS code, such as J9271. | |
manufacturer | string | no | Local case-insensitive manufacturer filter when a CMS row exposes a manufacturer field. The current Keytruda row does not include one. | |
year | integer | no | 0 | Return and apply thresholds to one annual metric year. Leave 0 for the latest available year. |
minTotalSpending | number | no | 0 | Optional minimum total spending (usd) filter or result-control setting. See the README for exact source semantics, bounds, and examples. |
minBeneficiaries | integer | no | 0 | Optional minimum beneficiaries filter or result-control setting. See the README for exact source semantics, bounds, and examples. |
minClaims | integer | no | 0 | Optional minimum claims filter or result-control setting. See the README for exact source semantics, bounds, and examples. |
minDosageUnits | number | no | 0 | Optional minimum dosage units filter or result-control setting. See the README for exact source semantics, bounds, and examples. |
minAverageSpendingPerUnit | number | no | 0 | Optional minimum average spending per dosage unit filter or result-control setting. See the README for exact source semantics, bounds, an... |
minAverageSpendingPerBeneficiary | number | no | 0 | Optional minimum average spending per beneficiary filter or result-control setting. See the README for exact source semantics, bounds, an... |
minSpendingGrowth | number | no | 0 | Decimal year-over-year rate; 0.10 means 10%. Applied to the selected/latest year. |
sortBy | string | no | "totalSpending" | Optional sort by filter or result-control setting. See the README for exact source semantics, bounds, and examples. |
sortDirection | string | no | "desc" | Optional sort direction filter or result-control setting. See the README for exact source semantics, bounds, and examples. |
maxCandidates | integer | no | 500 | Total source rows checked across all pages before local thresholds and sorting. |
maxPages | integer | no | 3 | Optional maximum cms pages filter or result-control setting. See the README for exact source semantics, bounds, and examples. |
maxAnnualSeriesLength | integer | no | 10 | Optional maximum annual observations per drug filter or result-control setting. See the README for exact source semantics, bounds, and ex... |
maxResults | integer | no | 1 | Total paid output records after filters. The default is one record for a maximum first-run charge of $0.0021 including start. |
maxTotalChargeUsd | number | no | 0 | Optional ceiling used to reduce maxResults before querying at $0.002 per output item. |
Example input
{"year": 0,"minTotalSpending": 0,"minBeneficiaries": 0,"minClaims": 0,"minDosageUnits": 0,"minAverageSpendingPerUnit": 0,"minAverageSpendingPerBeneficiary": 0,"minSpendingGrowth": 0,"sortBy": "totalSpending","sortDirection": "desc","maxCandidates": 500,"maxPages": 3,"maxAnnualSeriesLength": 10,"maxResults": 1,"maxTotalChargeUsd": 0}
Output example
One record from a real run (long values shortened, contact details partly masked):
{"annualMetrics": [{"year": 2020,"totalSpendingUsd": 3501098225,"dosageUnits": 77275004.6,"claims": 355708,"beneficiaries": 58703,"averageSpendingPerDosageUnitUsd": 45.30699472,"averageSpendingPerClaimUsd": 9842.618735,"averageSpendingPerBeneficiaryUsd": 59640.87398,"outlierFlag": "0"},{"year": 2021,"totalSpendingUsd": 3966530837,"dosageUnits": 85837941,"claims": 373954,"beneficiaries": 62830,"averageSpendingPerDosageUnitUsd": 46.20952915,"averageSpendingPerClaimUsd": 10607.00203,"averageSpendingPerBeneficiaryUsd": 63131.16086,"outlierFlag": "0","spendingGrowthRate": 0.13293903286589454,"unitSpendingGrowthRate": 0.019920421462021946,"beneficiarySpendingGrowthRate": 0.0585217259084842},{"year": 2022,"totalSpendingUsd": 4935971049,"dosageUnits": 94600572,"claims": 407389,"beneficiaries": 67022,"averageSpendingPerDosageUnitUsd": 52.17696833,"averageSpendingPerClaimUsd": 12116.11273,"averageSpendingPerBeneficiaryUsd": 73647.02708,"outlierFlag": "0","spendingGrowthRate": 0.24440506120789804,"unitSpendingGrowthRate": 0.1291387142385544,"beneficiarySpendingGrowthRate": 0.16657172269206386}],"averageDay24ASPPriceUsd": 56.97775,"brandName": "Keytruda","candidateLimitApplied": false,"candidateRowsRetrieved": 1,"evidenceStatus": "CMS_PART_B_DRUG_SPENDING_RECORD_FOUND","filterSummary": "default=Keytruda / HCPCS J9271; maxResults=1; maxCandidates=10; maxPages=1; annualSeriesCap=10","genericName": "Pembrolizumab","hcpcsCode": "J9271","hcpcsDescription": "Injection, pembrolizumab, 1 mg","latestAverageSpendingPerBeneficiaryUsd": 79464.46084,"latestAverageSpendingPerDosageUnitUsd": 55.71920754,"latestBeneficiaries": 75361,"latestClaims": 455858,"latestDosageUnits": 107476784,"latestMetricYear": 2024,"latestSpendingGrowthRate": 0.10213082048132209,"latestTotalSpendingUsd": 5988521233,"manufacturer": "","queryBounds": "At most 10 candidates across 1 pages, 10 annual years per record, and 1 output records","rawSourceFields": {"Avg_DY24_ASP_Price": "56.97775","Avg_Spndng_Per_Bene_2020": "59640.87398","Avg_Spndng_Per_Bene_2021": "63131.16086","Avg_Spndng_Per_Bene_2022": "73647.02708","Avg_Spndng_Per_Bene_2023": "76088.90455","Avg_Spndng_Per_Bene_2024": "79464.46084","Avg_Spndng_Per_Clm_2020": "9842.618735","Avg_Spndng_Per_Clm_2021": "10607.00203","Avg_Spndng_Per_Clm_2022": "12116.11273","Avg_Spndng_Per_Clm_2023": "12595.32348","Avg_Spndng_Per_Clm_2024": "13136.81285","Avg_Spndng_Per_Dsg_Unt_2020": "45.30699472","Avg_Spndng_Per_Dsg_Unt_2021": "46.20952915","Avg_Spndng_Per_Dsg_Unt_2022": "52.17696833","Avg_Spndng_Per_Dsg_Unt_2023": "53.94741438","Avg_Spndng_Per_Dsg_Unt_2024": "55.71920754","Brnd_Name": "Keytruda","CAGR_Avg_Spnd_Per_Dsg_Unt_20_24": "0.053076494","Chg_Avg_Spndng_Per_Dsg_Unt_23_24": "0.032842967","Gnrc_Name": "Pembrolizumab","HCPCS_Cd": "J9271","HCPCS_Desc": "Injection, pembrolizumab, 1 mg","Outlier_Flag_2020": "0","Outlier_Flag_2021": "0","Outlier_Flag_2022": "0"},"reported2020To2024UnitSpendingCAGR": 0.053076494,"reported2023To2024UnitSpendingChangeRate": 0.032842967,"sourceApiUrl": "https
Pricing
Pay per event: $0.002 per cms medicare part b drug spending scraper api evidence item plus $0.0001 per run start. No subscription to this Actor is needed. Apify Store discounts apply, so the price per result is lower on Silver, Gold and higher Apify plans. Use Maximum results to cap the cost of each run.
FAQ
How much does CMS Medicare Part B Drug Spending Scraper API cost?
$0.002 per cms medicare part b drug spending scraper api evidence item plus $0.0001 per run. For example, 1,000 results cost about $2.00. Higher Apify plans get a Store discount.
Do I need an API key or login?
No. Just configure the input and run it.
Can I run it on a schedule or from code?
Yes. Use Apify Schedules for recurring runs, or call it from the Apify API, the JavaScript or Python client, Make, Zapier, n8n, or any MCP-compatible AI agent.
Why did my run return no results?
Your filters are probably too narrow. Remove a filter or broaden the search, then run again. You only pay the result price for records that are actually saved.
Is the data accurate and up to date?
Each run fetches live data from the source described above, so results are as current as that source. Verify critical records with the original source before acting on them.