{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Scraper: Recalls, Adverse Events & Shortages",
    "description": "Scrape openFDA drug recalls, FAERS adverse events, labels with boxed warnings, drug shortages, plus device and food recalls. Search by drug or company, filter Class I-III or serious events. Export CSV, Excel, JSON or XML. No login or API key. Not charged for empty searches.",
    "version": "0.1",
    "x-build-id": "XnarZeLPLJwterweQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~fda-drug-safety-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-fda-drug-safety-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/recordsdata~fda-drug-safety-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-fda-drug-safety-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/recordsdata~fda-drug-safety-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-fda-drug-safety-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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Drug, product or company names to search in openFDA, for example metformin, insulin or Pfizer. Matches product, generic name, brand and recalling firm. Leave empty to pull the most recent records of each enabled surface.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of FDA records to return across all surfaces. Free users are limited to 10 records (preview). Paid users: optional, up to 1,000,000."
          },
          "maxItemsPerSurface": {
            "title": "Max items per surface",
            "minimum": 1,
            "maximum": 25000,
            "type": "integer",
            "description": "Cap per data surface (recalls, events, labels...) per search term, so one huge surface does not eat the whole run.",
            "default": 100
          },
          "includeDrugRecalls": {
            "title": "Drug recalls (enforcement)",
            "type": "boolean",
            "description": "FDA drug recall enforcement reports: classification, reason, firm, distribution and dates.",
            "default": true
          },
          "includeAdverseEvents": {
            "title": "Adverse events (FAERS)",
            "type": "boolean",
            "description": "Adverse event reports: seriousness, patient age/sex, drugs involved and MedDRA reactions.",
            "default": false
          },
          "includeDrugLabels": {
            "title": "Drug labels (SPL)",
            "type": "boolean",
            "description": "Official labels: brand, generic, manufacturer, route, boxed warning, indications and warnings.",
            "default": false
          },
          "includeDrugShortages": {
            "title": "Drug shortages",
            "type": "boolean",
            "description": "Current and resolved shortages: status, company, dosage form, therapeutic category.",
            "default": false
          },
          "includeDeviceRecalls": {
            "title": "Device recalls (enforcement)",
            "type": "boolean",
            "description": "Medical device recall enforcement reports.",
            "default": false
          },
          "includeFoodRecalls": {
            "title": "Food recalls (enforcement)",
            "type": "boolean",
            "description": "Food and dietary supplement recall enforcement reports.",
            "default": false
          },
          "includeDeviceEvents": {
            "title": "Medical device adverse events",
            "type": "boolean",
            "description": "Add medical device adverse event reports (MDR): brand, manufacturer, model, product code, problems and a narrative excerpt. Billed per report as a device event record.",
            "default": false
          },
          "include510k": {
            "title": "510(k) device clearances",
            "type": "boolean",
            "description": "Add FDA 510(k) premarket clearances: K number, device, applicant, decision, product code, device class and specialty. Billed per clearance as a 510(k) record.",
            "default": false
          },
          "includeDrugIdentifiers": {
            "title": "Drug identifiers in adverse events",
            "type": "boolean",
            "description": "On drug adverse event rows, add a drugDetails list per drug: role (suspect, concomitant), indication, dosage, NDC, RxCUI, UNII, pharmacologic class, generic and brand names. Free, no extra charge. Only applies when Drug adverse events is on.",
            "default": false
          },
          "dateFrom": {
            "title": "Date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only records on or after this date: report date for recalls, receive date for adverse events, label effective date, decision date for 510(k), date received for device events, update date for drug shortages. openFDA data lags by months for adverse events.",
            "default": ""
          },
          "dateTo": {
            "title": "Date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Only records on or before this date. Same date field per surface as Date from.",
            "default": ""
          },
          "openFdaQuery": {
            "title": "Raw openFDA query (advanced)",
            "type": "string",
            "description": "An openFDA search clause added with AND to every selected surface, for example patient.reaction.reactionmeddrapt:\"NAUSEA\" or classification:\"Class I\". Use only fields that exist on every surface you switch on. Characters & # ? are not allowed.",
            "default": ""
          },
          "recallClassification": {
            "title": "Recall classification",
            "enum": [
              "",
              "Class I",
              "Class II",
              "Class III"
            ],
            "type": "string",
            "description": "Only recalls of this class (I = most serious).",
            "default": ""
          },
          "seriousOnly": {
            "title": "Serious adverse events only",
            "type": "boolean",
            "description": "Limit FAERS adverse-event reports to serious outcomes (death, hospitalization, disability...).",
            "default": false
          },
          "onlyNew": {
            "title": "Only new results (monitor mode)",
            "type": "boolean",
            "description": "Only new results: skip every FDA record this same search already returned in an earlier run, so scheduled runs return just what is new, and you are not charged for skipped records. Max Items then means N new rows.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Optional label to keep several independent monitors for the same search. Runs that share the same search filters and the same name share one list of seen records. Leave empty to use the default monitor.",
            "default": ""
          },
          "resetSeen": {
            "title": "Reset seen records",
            "type": "boolean",
            "description": "Clear the stored list of already-seen records for this search and monitor name before the run, so every matching record counts as new again.",
            "default": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}