# Medicare Formulary Change Tracker (`springstea/medicare-formulary-change-tracker`) Actor

Tracks Medicare Part D formulary changes for the drugs you care about: tier moves, prior authorization added or removed, step therapy, quantity limits, drugs dropped from formularies. Official CMS data, plan-level context, structured output.

- **URL**: https://apify.com/springstea/medicare-formulary-change-tracker.md
- **Developed by:** [Kasım Genç](https://apify.com/springstea) (community)
- **Categories:** Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 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/docs.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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

## Medicare Formulary Change Tracker

Tracks **Medicare Part D formulary changes** for the drugs you care about and reports every change as structured data:

- "Ozempic moved from Tier 2 to Tier 3 on this formulary (39 plans)." (`tier_changed`)
- "Prior authorization is now required." (`prior_auth_added`)
- "Step therapy added." / "Quantity limit changed from 2/28d to 1/28d."
- "The drug was dropped from this formulary entirely." (`drug_removed_from_formulary`)

**Source:** the official CMS *Monthly Prescription Drug Plan Formulary* files — the authoritative, complete record of every Part D formulary in the US, refreshed monthly. Drug names are resolved through the National Library of Medicine's RxNorm, so you can track by brand name ("Ozempic"), generic name ("semaglutide") or RXCUI — all dose forms are covered automatically.

### Who uses this

- **Pharma market-access teams** — know the day your product (or a competitor's) gets a tier bump, PA or ST anywhere in Part D.
- **Specialty pharmacies** — anticipate reimbursement friction before prescriptions start bouncing.
- **Benefit consultants & brokers** — advise clients with plan-level facts.
- **Healthcare analytics & investors** — formulary positioning changes as a clean data feed.

### How it works

Each run finds the newest CMS monthly release, extracts the formulary and plan-information files (a few MB via targeted range requests — not the full multi-GB archive), filters to your drugs' product RXCUIs, and diffs the coverage state of every (formulary × product) pair against the previous run's snapshot. Each change is enriched with plan context: how many plans use that formulary, sample plan names, contract ids and the states they operate in.

CMS publishes monthly — schedule the Actor **weekly or monthly**; runs between releases simply report zero changes.

### Input

```json
{
    "drugs": ["Ozempic", "Eliquis", "Jardiance"],
    "states": ["TX", "FL"],
    "contractIds": [],
    "emitBaselineRecords": false
}
````

| Field | Type | Description |
|---|---|---|
| `drugs` \* | `string[]` | Brand/generic names or RXCUIs, max 200. All product dose forms are tracked per drug. |
| `states` | `string[]` | Optional: only formularies used by plans operating in these states. |
| `contractIds` | `string[]` | Optional: only formularies used by these CMS contracts (e.g. `H0028`). |
| `emitBaselineRecords` | `boolean` | Push the full current coverage picture on the first run. A nationwide drug can span 500+ formularies × dose forms — thousands of records. Default `false`. |
| `snapshotStoreName` | `string` | Named key-value store for snapshots between runs. |

### Output

One dataset record per (formulary × drug product) change:

```json
{
    "drug": "Eliquis",
    "product": "apixaban 5 MG Oral Tablet [Eliquis]",
    "rxcui": "1364445",
    "formularyId": "00026000",
    "planCount": 39,
    "samplePlans": ["Humana Gold Plus SNP-DE H0028-007 (HMO D-SNP)"],
    "contracts": ["H0028", "H1036"],
    "states": ["FL", "GA", "NE", "TX"],
    "changeType": "tier_changed",
    "previousTier": 4,
    "currentTier": 3,
    "priorAuthorization": false,
    "stepTherapy": false,
    "quantityLimit": "2/28d",
    "changes": [
        { "field": "tier", "kind": "tier_changed", "old": 4, "new": 3, "description": "Tier 4 -> 3 (more favorable)" }
    ],
    "sourceFileDate": "20260630",
    "detectedAt": "2026-07-10T18:08:50.965Z",
    "source": "CMS Monthly Prescription Drug Plan Formulary (Medicare Part D)"
}
```

#### `changeType` values

| Value | Meaning |
|---|---|
| `baseline` | First run — current coverage state (opt-in). |
| `tier_changed` | Cost-sharing tier moved (see `previousTier`/`currentTier`). |
| `prior_auth_added` / `prior_auth_removed` | PA requirement toggled. |
| `step_therapy_added` / `step_therapy_removed` | ST requirement toggled. |
| `quantity_limit_added` / `quantity_limit_removed` / `quantity_limit_changed` | QL toggled or amount/days changed. |
| `drug_added_to_formulary` | Product newly covered by a formulary. |
| `drug_removed_from_formulary` | Product no longer on a formulary. |

A run summary (CMS release processed, counts per change type) is stored under the `OUTPUT` key of the default key-value store.

### Notes & limitations

- **Scope: Medicare Part D** (and MA-PD) formularies — the segment CMS publishes completely and machine-readably. Commercial/employer formularies are not included.
- Changes are detected at **formulary level** (CMS's unit of truth); the `planCount`/`contracts`/`states` fields tell you the blast radius of each change.
- The first run after the annual plan-year rollover (January file) naturally produces a large wave of changes — that's real (plans reset formularies yearly), not noise.
- This is data, not advice: verify critical decisions against the CMS files and plan documents.

# Actor input Schema

## `drugs` (type: `array`):

Brand or generic drug names (resolved via RxNorm, e.g. <code>Ozempic</code>, <code>apixaban</code>) or raw RxNorm RXCUIs. Max 200.

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

Optional. Only track formularies used by plans operating in these states (2-letter codes). Empty = nationwide.

## `contractIds` (type: `array`):

Optional. Only track formularies used by these CMS contract ids (e.g. <code>H0028</code>, <code>S5884</code>). Empty = all contracts.

## `emitBaselineRecords` (type: `boolean`):

On the first run there is nothing to compare against. When enabled, every (formulary × drug product) coverage state is pushed with changeType <code>baseline</code>. <b>Caution:</b> a nationwide drug can appear on 500+ formularies × several dose forms — thousands of records. Default off.

## `snapshotStoreName` (type: `string`):

Named key-value store keeping coverage snapshots between runs.

## `proxyConfiguration` (type: `object`):

Optional proxies (rarely needed — CMS and RxNorm are open APIs).

## Actor input object example

```json
{
  "drugs": [
    "Ozempic",
    "Eliquis",
    "Jardiance"
  ],
  "states": [],
  "contractIds": [],
  "emitBaselineRecords": false,
  "snapshotStoreName": "medicare-formulary-tracker"
}
```

# 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 = {
    "drugs": [
        "Ozempic",
        "Eliquis",
        "Jardiance"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("springstea/medicare-formulary-change-tracker").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 = { "drugs": [
        "Ozempic",
        "Eliquis",
        "Jardiance",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("springstea/medicare-formulary-change-tracker").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 '{
  "drugs": [
    "Ozempic",
    "Eliquis",
    "Jardiance"
  ]
}' |
apify call springstea/medicare-formulary-change-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=springstea/medicare-formulary-change-tracker",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Medicare Formulary Change Tracker",
        "description": "Tracks Medicare Part D formulary changes for the drugs you care about: tier moves, prior authorization added or removed, step therapy, quantity limits, drugs dropped from formularies. Official CMS data, plan-level context, structured output.",
        "version": "0.1",
        "x-build-id": "NqZNiBOSKp3OuN0SV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/springstea~medicare-formulary-change-tracker/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-springstea-medicare-formulary-change-tracker",
                "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/springstea~medicare-formulary-change-tracker/runs": {
            "post": {
                "operationId": "runs-sync-springstea-medicare-formulary-change-tracker",
                "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/springstea~medicare-formulary-change-tracker/run-sync": {
            "post": {
                "operationId": "run-sync-springstea-medicare-formulary-change-tracker",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "drugs"
                ],
                "properties": {
                    "drugs": {
                        "title": "Drugs to track",
                        "type": "array",
                        "description": "Brand or generic drug names (resolved via RxNorm, e.g. <code>Ozempic</code>, <code>apixaban</code>) or raw RxNorm RXCUIs. Max 200.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "states": {
                        "title": "State filter",
                        "type": "array",
                        "description": "Optional. Only track formularies used by plans operating in these states (2-letter codes). Empty = nationwide.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "contractIds": {
                        "title": "Contract filter",
                        "type": "array",
                        "description": "Optional. Only track formularies used by these CMS contract ids (e.g. <code>H0028</code>, <code>S5884</code>). Empty = all contracts.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "emitBaselineRecords": {
                        "title": "Emit baseline records on first run",
                        "type": "boolean",
                        "description": "On the first run there is nothing to compare against. When enabled, every (formulary × drug product) coverage state is pushed with changeType <code>baseline</code>. <b>Caution:</b> a nationwide drug can appear on 500+ formularies × several dose forms — thousands of records. Default off.",
                        "default": false
                    },
                    "snapshotStoreName": {
                        "title": "Snapshot store name",
                        "type": "string",
                        "description": "Named key-value store keeping coverage snapshots between runs.",
                        "default": "medicare-formulary-tracker"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional proxies (rarely needed — CMS and RxNorm are open APIs)."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
