{
  "openapi": "3.0.1",
  "info": {
    "title": "Prescription Drug Prices Scraper — Cost Plus Drugs & NADAC",
    "description": "Look up US prescription drug prices by drug name, strength, form, NDC or treatment category: Cost Plus Drugs per-unit and per-fill prices with fees and stock, plus optional Medicaid NADAC pharmacy acquisition cost per NDC.",
    "version": "1.0",
    "x-build-id": "mDzeDYfCPlPTYXvaL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhammadafzal~prescription-drug-prices-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhammadafzal-prescription-drug-prices-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/muhammadafzal~prescription-drug-prices-scraper/runs": {
      "post": {
        "operationId": "runs-sync-muhammadafzal-prescription-drug-prices-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/muhammadafzal~prescription-drug-prices-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-muhammadafzal-prescription-drug-prices-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": {
          "drugNames": {
            "title": "Drug names",
            "maxItems": 50,
            "type": "array",
            "description": "Use this to search by drug name, one per row, for example atorvastatin, metformin or Lipitor. Generic and brand names both work, upper or lower case, and part of a name is enough (at least 3 letters). Up to 50 names per run.",
            "items": {
              "type": "string"
            }
          },
          "ndcs": {
            "title": "NDC codes",
            "maxItems": 200,
            "type": "array",
            "description": "Use this to look up drugs by National Drug Code, one per row, for example 00093-1174-01. 10-digit and 11-digit codes work, with or without hyphens. On Cost Plus Drugs an NDC matches the product that can be dispensed as its equivalent. Up to 200 codes per run.",
            "items": {
              "type": "string"
            }
          },
          "strengths": {
            "title": "Strengths",
            "maxItems": 20,
            "type": "array",
            "description": "Use this to keep only certain strengths, one per row, for example 20mg, 500 mg or 0.05%. Spaces and case do not matter; 500mg does not match 1500mg.",
            "items": {
              "type": "string"
            }
          },
          "forms": {
            "title": "Dosage forms",
            "maxItems": 20,
            "type": "array",
            "description": "Use this to keep only certain dosage forms, one per row, for example tablet, capsule, cream or solution. Part of the form name is enough.",
            "items": {
              "type": "string"
            }
          },
          "treatmentCategories": {
            "title": "Treatment categories",
            "maxItems": 20,
            "type": "array",
            "description": "Use this to keep only drugs in a treatment category of the Cost Plus Drugs price list, one per row, for example High Cholesterol, Diabetes, High Blood Pressure or Infection. Part of the category name is enough. NADAC records have no categories.",
            "items": {
              "type": "string"
            }
          },
          "brandOrGeneric": {
            "title": "Brand or generic",
            "enum": [
              "any",
              "generic",
              "brand"
            ],
            "type": "string",
            "description": "Use this to keep only generic drugs or only brand-name drugs. The default keeps both.",
            "default": "any"
          },
          "inStockOnly": {
            "title": "In stock only",
            "type": "boolean",
            "description": "Use this to leave out Cost Plus Drugs products that are currently out of stock. NADAC records have no stock status.",
            "default": false
          },
          "source": {
            "title": "Price source",
            "enum": [
              "costPlusDrugs",
              "nadac",
              "both"
            ],
            "type": "string",
            "description": "Use this to choose the price source. Cost Plus Drugs is a mail-order pharmacy price list (price per unit, price per fill, dispensing fee, shipping). NADAC is the Medicaid National Average Drug Acquisition Cost from data.medicaid.gov: what pharmacies pay per unit, per NDC, not a retail price. Both returns the two record types side by side; NADAC needs a drug name or an NDC.",
            "default": "costPlusDrugs"
          },
          "maxResults": {
            "title": "Maximum records per source",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Use this to cap the number of price records saved from each price source. Each saved record is one billed result. The default is 50 and the limit is 5,000.",
            "default": 50
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}