{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenFDA Scraper",
    "description": "Scrape the FDA's openFDA API with drug labels, adverse events (FAERS), drug recalls, NDC directory, drugs@FDA, device events, and food enforcement. Layers in RxNorm (RxNav) drug-equivalence lookups and DailyMed label URLs.",
    "version": "1.0",
    "x-build-id": "y7KI8xB0GIKE5eMZB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~openfda-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-openfda-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/crawlerbros~openfda-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-openfda-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/crawlerbros~openfda-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-openfda-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "searchLabels",
              "searchEvents",
              "searchRecalls",
              "searchNdcs",
              "byBrandName",
              "byGenericName",
              "byNdcCode",
              "rxNormLookup",
              "deviceEvents",
              "foodEnforcement"
            ],
            "type": "string",
            "description": "Which openFDA endpoint to query.",
            "default": "searchLabels"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Free-text term searched across brand/generic/substance fields.",
            "default": "ibuprofen"
          },
          "brandName": {
            "title": "Brand name",
            "type": "string",
            "description": "Exact brand-name lookup (mode=byBrandName)."
          },
          "genericName": {
            "title": "Generic name",
            "type": "string",
            "description": "Exact generic-name lookup (mode=byGenericName)."
          },
          "ndcCode": {
            "title": "NDC code (mode=byNdcCode)",
            "type": "string",
            "description": "National Drug Code identifier, e.g. 0573-0164."
          },
          "rxnormName": {
            "title": "RxNorm name (mode=rxNormLookup)",
            "type": "string",
            "description": "Drug name to resolve into an RxCUI and related concepts."
          },
          "dataset": {
            "title": "Datasets (for byBrandName / byGenericName)",
            "type": "array",
            "description": "Which openFDA datasets to query when looking up by brand / generic name. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "labels",
                "events",
                "recalls",
                "ndc",
                "shortages",
                "deviceEvents",
                "foodEnforcement"
              ],
              "enumTitles": [
                "Drug labels (SPL)",
                "Adverse events (FAERS)",
                "Drug recalls / enforcement",
                "NDC directory",
                "Drugs@FDA (approvals)",
                "Device adverse events",
                "Food enforcement"
              ]
            },
            "default": []
          },
          "manufacturerName": {
            "title": "Manufacturer name",
            "type": "string",
            "description": "Filter to records whose manufacturer / labeler matches this substring."
          },
          "dosageForm": {
            "title": "Dosage form",
            "type": "array",
            "description": "Filter to selected dosage forms.",
            "items": {
              "type": "string",
              "enum": [
                "TABLET",
                "CAPSULE",
                "SOLUTION",
                "INJECTION",
                "INJECTABLE",
                "SYRUP",
                "SUSPENSION",
                "POWDER",
                "CREAM",
                "OINTMENT",
                "GEL",
                "PATCH",
                "SPRAY",
                "LOZENGE",
                "AEROSOL",
                "SUPPOSITORY",
                "LIQUID",
                "GRANULE"
              ],
              "enumTitles": [
                "Tablet",
                "Capsule",
                "Solution",
                "Injection",
                "Injectable",
                "Syrup",
                "Suspension",
                "Powder",
                "Cream",
                "Ointment",
                "Gel",
                "Patch",
                "Spray",
                "Lozenge",
                "Aerosol",
                "Suppository",
                "Liquid",
                "Granule"
              ]
            },
            "default": []
          },
          "route": {
            "title": "Route of administration",
            "type": "array",
            "description": "Filter to selected administration routes.",
            "items": {
              "type": "string",
              "enum": [
                "ORAL",
                "TOPICAL",
                "INTRAVENOUS",
                "INTRAMUSCULAR",
                "SUBCUTANEOUS",
                "OPHTHALMIC",
                "OTIC",
                "NASAL",
                "INHALATION",
                "RECTAL",
                "VAGINAL",
                "TRANSDERMAL",
                "SUBLINGUAL",
                "BUCCAL",
                "INTRATHECAL",
                "EPIDURAL"
              ],
              "enumTitles": [
                "Oral",
                "Topical",
                "Intravenous",
                "Intramuscular",
                "Subcutaneous",
                "Ophthalmic (eye)",
                "Otic (ear)",
                "Nasal",
                "Inhalation",
                "Rectal",
                "Vaginal",
                "Transdermal",
                "Sublingual",
                "Buccal",
                "Intrathecal",
                "Epidural"
              ]
            },
            "default": []
          },
          "marketingStatus": {
            "title": "Marketing status / product type",
            "type": "array",
            "description": "Filter by prescription/OTC status or marketing category.",
            "items": {
              "type": "string",
              "enum": [
                "HUMAN PRESCRIPTION DRUG",
                "HUMAN OTC DRUG",
                "NDA",
                "ANDA",
                "BLA",
                "OTC monograph final",
                "OTC monograph not final",
                "DISCONTINUED"
              ],
              "enumTitles": [
                "Prescription drug",
                "OTC drug",
                "NDA (New Drug Application)",
                "ANDA (Abbreviated NDA / generic)",
                "BLA (Biologic License Application)",
                "OTC monograph final",
                "OTC monograph not final",
                "Discontinued"
              ]
            },
            "default": []
          },
          "dateFrom": {
            "title": "Date from (events / recalls)",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD) lower bound for receive/initiation dates."
          },
          "dateTo": {
            "title": "Date to (events / recalls)",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD) upper bound for receive/initiation dates."
          },
          "seriousnessOnly": {
            "title": "Serious adverse events only",
            "type": "boolean",
            "description": "Limit FAERS results to reports flagged as serious.",
            "default": false
          },
          "recallClass": {
            "title": "Recall classification",
            "enum": [
              "ALL",
              "I",
              "II",
              "III"
            ],
            "type": "string",
            "description": "Filter recalls by FDA classification class.",
            "default": "ALL"
          },
          "voluntaryMandated": {
            "title": "Voluntary or Mandated recalls",
            "enum": [
              "",
              "Voluntary: Firm Initiated",
              "FDA Mandated"
            ],
            "type": "string",
            "description": "Filter recall records by initiator type.",
            "default": ""
          },
          "recallStatus": {
            "title": "Recall status",
            "enum": [
              "",
              "Ongoing",
              "Completed",
              "Terminated",
              "Pending"
            ],
            "type": "string",
            "description": "Filter recalls by status.",
            "default": ""
          },
          "containsKeyword": {
            "title": "Contains keyword",
            "type": "string",
            "description": "Final post-filter substring match against any text field on each record."
          },
          "apiKey": {
            "title": "openFDA API key (optional)",
            "type": "string",
            "description": "Optional api_key value to bump rate limits past the 240/min anonymous quota. Get one for free at https://open.fda.gov/apis/authentication/"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}