{
  "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": "ybT5xxSalhNK9j3Pv"
  },
  "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": "Drug, product or company names",
            "type": "array",
            "description": "One per line, for example metformin, insulin or Pfizer. Matches product, generic name, brand and recalling firm.",
            "items": {
              "type": "string"
            }
          },
          "includeDrugRecalls": {
            "title": "Drug recalls",
            "type": "boolean",
            "description": "FDA drug recall reports: class, reason, firm, distribution and dates.",
            "default": true
          },
          "includeAdverseEvents": {
            "title": "Drug adverse events (FAERS)",
            "type": "boolean",
            "description": "Patient reports: seriousness, age and sex, drugs involved and reactions.",
            "default": false
          },
          "includeDrugIdentifiers": {
            "title": "Add drug identifiers to adverse events",
            "type": "boolean",
            "description": "Adds a per-drug list (role, indication, dosage, NDC, RxCUI, UNII, class, brand). Free. Only works when Drug adverse events is on.",
            "default": false
          },
          "includeDrugLabels": {
            "title": "Drug labels",
            "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",
            "type": "boolean",
            "description": "Medical device recall reports.",
            "default": false
          },
          "includeDeviceEvents": {
            "title": "Device adverse events (MDR)",
            "type": "boolean",
            "description": "Reports with brand, manufacturer, model, product code, problems and a narrative excerpt.",
            "default": false
          },
          "include510k": {
            "title": "510(k) device clearances",
            "type": "boolean",
            "description": "Premarket clearances: K number, device, applicant, decision, product code, class and specialty.",
            "default": false
          },
          "includeFoodRecalls": {
            "title": "Food and supplement recalls",
            "type": "boolean",
            "description": "Food and dietary supplement recall reports.",
            "default": false
          },
          "dateFrom": {
            "title": "From date (YYYY-MM-DD)",
            "type": "string",
            "description": "Only records on or after this date, for example 2024-01-01. The date used depends on the dataset (report, receive or decision date). Adverse event data lags by months.",
            "default": ""
          },
          "dateTo": {
            "title": "To date (YYYY-MM-DD)",
            "type": "string",
            "description": "Only records on or before this date, for example 2024-12-31.",
            "default": ""
          },
          "recallClassification": {
            "title": "Recall class",
            "enum": [
              "",
              "Class I",
              "Class II",
              "Class III"
            ],
            "type": "string",
            "description": "Only recalls of this class. Class I is the most serious.",
            "default": ""
          },
          "seriousOnly": {
            "title": "Serious adverse events only",
            "type": "boolean",
            "description": "Keep only drug adverse events with serious outcomes (death, hospitalization, disability).",
            "default": false
          },
          "openFdaQuery": {
            "title": "Advanced: raw openFDA query",
            "type": "string",
            "description": "An openFDA clause added with AND to every dataset, for example classification:\"Class I\". Use only fields that exist on every dataset you picked. The characters & # ? are not allowed.",
            "default": ""
          },
          "maxItems": {
            "title": "Max records to return",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum records across all datasets, for example 10. Free plans are capped at 10 (preview); paid plans up to 1,000,000."
          },
          "maxItemsPerSurface": {
            "title": "Max records per dataset and term",
            "minimum": 1,
            "maximum": 25000,
            "type": "integer",
            "description": "Cap per dataset per search term so one huge dataset does not use the whole run, for example 100.",
            "default": 100
          },
          "onlyNew": {
            "title": "Only new records",
            "type": "boolean",
            "description": "Skip FDA records this same search already returned and do not charge for them. Max records then means N new rows. State is kept in a named key-value store in your account.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional label for several monitors on the same search, for example \"pfizer-recalls\". Leave empty for the default monitor.",
            "default": ""
          },
          "resetSeen": {
            "title": "Forget seen records",
            "type": "boolean",
            "description": "Clear the stored list of seen records for this search and monitor name before the run.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}