{
  "openapi": "3.0.1",
  "info": {
    "title": "CMS Open Payments Scraper - Pharma Payments & Doctor Leads",
    "description": "Scrape CMS Open Payments (Sunshine Act): pharma & device payments to physicians & teaching hospitals. Detailed transactions plus per-physician, per-manufacturer & per-hospital rollups with KOL & lead scores. Filter by state, specialty, NPI, company, year. Keyless US-gov API, no browser, monitoring.",
    "version": "0.1",
    "x-build-id": "vymHWxPb9kspLay7y"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~open-payments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-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/scrapesage~open-payments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-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/scrapesage~open-payments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "payments",
              "physicians",
              "manufacturers",
              "teachingHospitals"
            ],
            "type": "string",
            "description": "What to output. 'Payments' streams detailed transaction records (one row per payment). 'Physicians' aggregates payments into a rich profile per physician (totals, top payers, KOL & lead score) — the lead-gen / KOL engine. 'Manufacturers' rolls payments up per drug/device company (competitive intelligence). 'Teaching hospitals' rolls payments up per teaching hospital.",
            "default": "payments"
          },
          "years": {
            "title": "Program years",
            "type": "array",
            "description": "One or more CMS Open Payments program years to include. The latest published year is 2024. Combine multiple years to total a physician's or company's payments across time.",
            "items": {
              "type": "string",
              "enum": [
                "2024",
                "2023",
                "2022",
                "2021",
                "2020",
                "2019",
                "2018"
              ]
            },
            "default": [
              "2023"
            ]
          },
          "paymentTypes": {
            "title": "Payment books",
            "type": "array",
            "description": "Which Open Payments books to read. 'General' = the main transfers of value (meals, travel, consulting, speaking, gifts) — the largest and most useful. 'Research' = research/clinical-trial payments (carries the principal investigator + study name). 'Ownership' = physician ownership/investment interests.",
            "items": {
              "type": "string",
              "enum": [
                "general",
                "research",
                "ownership"
              ],
              "enumTitles": [
                "General payments",
                "Research payments",
                "Ownership interests"
              ]
            },
            "default": [
              "general"
            ]
          },
          "state": {
            "title": "State",
            "type": "string",
            "description": "Filter by the recipient's state. 2-letter code (e.g. TX, CA) or full name. Leave empty for all states. Great for building a geographic target list."
          },
          "specialty": {
            "title": "Specialty contains",
            "type": "string",
            "description": "Filter by physician specialty (matched anywhere in the CMS specialty string). Examples: Dermatology, Cardiology, Oncology, Orthopaedic Surgery, Psychiatry. Leave empty for all specialties."
          },
          "physicianNpi": {
            "title": "Physician NPI",
            "type": "string",
            "description": "Look up a single physician by their 10-digit NPI number. Combine with multiple years to see their full payment history."
          },
          "physicianFirstName": {
            "title": "Physician first name",
            "type": "string",
            "description": "Filter by physician first name (partial match). Pair with last name to find a specific provider."
          },
          "physicianLastName": {
            "title": "Physician last name",
            "type": "string",
            "description": "Filter by physician last name (exact match)."
          },
          "manufacturer": {
            "title": "Manufacturer / GPO contains",
            "type": "string",
            "description": "Filter by the paying drug/device company or GPO name (partial match). Examples: Pfizer, AbbVie, Stryker, Medtronic, Allergan. The key filter for competitive intelligence — see every physician a competitor pays."
          },
          "natureOfPayment": {
            "title": "Nature of payment",
            "type": "string",
            "description": "Filter to one nature of payment (general payments only). Leave empty for all. Use the exact CMS label, e.g. 'Consulting Fee', 'Food and Beverage', 'Travel and Lodging', 'Honoraria', 'Royalty or License'."
          },
          "drugOrDevice": {
            "title": "Drug / device contains",
            "type": "string",
            "description": "Filter to payments associated with a drug, biological or device name (partial match), e.g. Humira, Botox, Ozempic. Best with general payments."
          },
          "minAmount": {
            "title": "Minimum amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep payments of at least this many dollars. In aggregation modes this filters the underlying payments before they are rolled up. Leave empty for no minimum."
          },
          "maxAmount": {
            "title": "Maximum amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep payments of at most this many dollars. Leave empty for no maximum."
          },
          "sortBy": {
            "title": "Sort scan by",
            "enum": [
              "amount",
              "date",
              "none"
            ],
            "type": "string",
            "description": "How to order rows as they are scanned. 'Amount' (default) surfaces the largest payments first — ideal for finding top-paid KOLs. 'Date' returns most recent first. 'None' is fastest.",
            "default": "amount"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Maximum number of records emitted this run (payment rows, or aggregated profiles in physicians/manufacturers/teachingHospitals modes).",
            "default": 1000
          },
          "scanLimit": {
            "title": "Scan limit (aggregation modes)",
            "minimum": 500,
            "maximum": 1000000,
            "type": "integer",
            "description": "In physicians / manufacturers / teachingHospitals modes, the maximum number of underlying payment rows scanned PER program-year book before rolling up. Higher = more complete totals on broad queries (use a tighter state/specialty/manufacturer filter to make totals exact). Ignored in payments mode.",
            "default": 20000
          },
          "includeProfileEnrichment": {
            "title": "Enrich physician profiles (taxonomy)",
            "type": "boolean",
            "description": "In physicians mode, enrich each emitted profile with NUCC taxonomy codes and a fallback address from the CMS Covered Recipient Profile Supplement. Adds one fast lookup per physician.",
            "default": true
          },
          "deduplicateResults": {
            "title": "Deduplicate results",
            "type": "boolean",
            "description": "Emit each payment record / profile only once per run.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitoring mode — only new records",
            "type": "boolean",
            "description": "Remember records already returned and emit ONLY records not seen in previous runs. Pair with Apify Schedules to capture newly published payments, or to track a specific manufacturer / physician for new disclosures over time.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Named key-value store holding the 'already seen' ids for monitoring mode. Use a different name per tracked scope (lowercase letters, digits and hyphens only).",
            "default": "open-payments-monitor"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Maximum parallel fetches across the selected year/book datasets (aggregation modes).",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. CMS Open Payments is a clean keyless US-gov API that serves the Apify platform directly, so a proxy is NOT required (leave it off for the fastest runs). The actor retries and rides out occasional server blips on its own; enable a proxy only if you specifically want IP rotation.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}