{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA NDC Directory: Drug Products & National Drug Code",
    "description": "Search the FDA National Drug Code (NDC) directory for marketed US drug products: product NDC, labeler/manufacturer, active ingredients, dosage form, route, marketing category and status, DEA schedule, pharm class and packaging-level NDCs. Export to JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "eUoTzkqnznICyoaZ6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapers_lat~fda-ndc-drug-directory-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapers_lat-fda-ndc-drug-directory-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/scrapers_lat~fda-ndc-drug-directory-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapers_lat-fda-ndc-drug-directory-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/scrapers_lat~fda-ndc-drug-directory-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapers_lat-fda-ndc-drug-directory-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": {
          "genericName": {
            "title": "Generic name",
            "type": "string",
            "description": "Filter by the drug's generic (non-proprietary) name, for example ibuprofen, atorvastatin or amoxicillin. Matches the FDA generic_name field."
          },
          "brandName": {
            "title": "Brand name",
            "type": "string",
            "description": "Filter by the drug's brand (proprietary) name, for example Advil, Lipitor or Tylenol."
          },
          "labeler": {
            "title": "Labeler / manufacturer",
            "type": "string",
            "description": "Filter by the labeler or manufacturer name, for example Pfizer, Teva or Johnson & Johnson."
          },
          "ndc": {
            "title": "Product NDC (exact)",
            "type": "string",
            "description": "Look up one product by its exact product NDC, for example 0069-2587 or 83324-014. Use this for a precise single-product lookup."
          },
          "productType": {
            "title": "Product type",
            "enum": [
              "",
              "prescription",
              "otc"
            ],
            "type": "string",
            "description": "Restrict to prescription or over-the-counter (OTC) products. Leave as Any to include both.",
            "default": ""
          },
          "route": {
            "title": "Route of administration",
            "type": "string",
            "description": "Restrict to a route of administration, for example ORAL, TOPICAL, INTRAVENOUS, OPHTHALMIC or NASAL. Leave empty for all routes."
          },
          "dosageForm": {
            "title": "Dosage form",
            "type": "string",
            "description": "Restrict to a dosage form, for example TABLET, CAPSULE, SOLUTION, INJECTION or SUSPENSION. Leave empty for all forms."
          },
          "marketingCategory": {
            "title": "Marketing category",
            "type": "string",
            "description": "Restrict to a marketing/approval category, for example NDA, ANDA, BLA, OTC MONOGRAPH FINAL or UNAPPROVED DRUG OTHER. Leave empty for all categories."
          },
          "deaSchedule": {
            "title": "DEA schedule",
            "type": "string",
            "description": "Restrict to a controlled-substance DEA schedule, for example CII, CIII, CIV or CV. Leave empty for all products."
          },
          "searchQuery": {
            "title": "Raw search expression (advanced)",
            "type": "string",
            "description": "Optional raw openFDA search expression, added on top of the filters above. Example: openfda.pharm_class_epc:\"Nonsteroidal Anti-inflammatory Drug [EPC]\" or marketing_start_date:[20240101 TO 20241231]. Leave empty unless you know the openFDA query syntax."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of drug products to collect. Large pulls are paginated (up to 25000 records per query), so narrow with a filter for bigger datasets. Free Apify plans are capped at 10 per run."
          },
          "includeAlternatives": {
            "title": "Include therapeutic alternatives (paid add-on)",
            "type": "boolean",
            "description": "For each product, look up other marketed products with the same generic name from a different labeler (generic/therapeutic alternatives for formulary and competitive analysis). Charged as a separate 'alternatives' event only when alternatives are found. Requires a paid Apify plan.",
            "default": false
          },
          "withAiSummary": {
            "title": "AI plain-English summary (paid add-on)",
            "type": "boolean",
            "description": "Generate a short AI summary of each product (what it is, drug class, common uses, prescription or OTC) from its ingredients and pharmacologic class. Informational only, not medical advice. Charged as a separate 'ai_summary' event only on usable output. Requires a paid Apify plan.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy. The FDA NDC directory is a public, keyless API and normally needs no proxy.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}