{
  "openapi": "3.0.1",
  "info": {
    "title": "openFDA Scraper: Drug Safety, Recalls, Labels",
    "description": "Scrape openFDA for drug safety profiles, adverse event reports, drug and device and food recalls, label warnings, product codes, approvals and device clearances. Get outcomes, top reactions, recall class and risk flags per drug. Filter by drug, company or date. Export to CSV or Excel.",
    "version": "1.0",
    "x-build-id": "KmShfr75EEx3jiaP6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parselab~openfda-drug-safety-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parselab-openfda-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/parselab~openfda-drug-safety-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parselab-openfda-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/parselab~openfda-drug-safety-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parselab-openfda-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": {
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000."
          },
          "mode": {
            "title": "What to collect",
            "enum": [
              "profile",
              "adverseEvents",
              "recalls",
              "labels",
              "ndc",
              "approvals",
              "deviceClearances"
            ],
            "type": "string",
            "description": "Safety profile returns one row per drug with report counts, outcomes, top reactions, recalls and label warnings. The other modes return one row per adverse event report, recall, label, product code listing, approval or device clearance.",
            "default": "profile"
          },
          "drugNames": {
            "title": "Drug names",
            "type": "array",
            "description": "Generic or brand names, for example ibuprofen, Ozempic or metformin. In the device clearances mode they are searched in the device name.",
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Free words searched in the product description and reason for recalls, in the device name for clearances, and in the drug name for labels, directory and approvals.",
            "items": {
              "type": "string"
            }
          },
          "reactions": {
            "title": "Reactions",
            "type": "array",
            "description": "Adverse events mode. Medical terms such as Nausea, Hepatotoxicity or Anaphylactic reaction.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries of the event",
            "type": "array",
            "description": "Adverse events mode. Two letter country codes, for example US, GB, DE.",
            "items": {
              "type": "string"
            }
          },
          "companies": {
            "title": "Companies",
            "type": "array",
            "description": "Recalling firm for recalls, manufacturer for labels, labeler for the directory, sponsor for approvals, applicant for device clearances.",
            "items": {
              "type": "string"
            }
          },
          "productCodes": {
            "title": "Device product codes",
            "type": "array",
            "description": "Device clearances mode. Three letter FDA product codes such as NAY or DQA.",
            "items": {
              "type": "string"
            }
          },
          "recallCategory": {
            "title": "Recall category",
            "enum": [
              "drug",
              "device",
              "food"
            ],
            "type": "string",
            "description": "Recalls mode. Which kind of product recalls to read.",
            "default": "drug"
          },
          "classifications": {
            "title": "Recall classes",
            "type": "array",
            "description": "Recalls mode. Class I is the most serious, Class III the least.",
            "items": {
              "type": "string",
              "enum": [
                "I",
                "II",
                "III"
              ]
            }
          },
          "recallStatus": {
            "title": "Recall status",
            "enum": [
              "any",
              "ongoing",
              "terminated"
            ],
            "type": "string",
            "description": "Recalls mode. Ongoing recalls are still open, terminated ones are closed.",
            "default": "any"
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Recalls and device clearances. Two letter US state codes of the firm, for example CA, TX.",
            "items": {
              "type": "string"
            }
          },
          "suspectDrugOnly": {
            "title": "Searched drug is the suspect drug",
            "type": "boolean",
            "description": "Adverse events mode. Keep only reports where the drug you searched is listed as the suspect drug, not just a medicine the patient also took.",
            "default": false
          },
          "seriousOnly": {
            "title": "Only serious reports",
            "type": "boolean",
            "description": "Adverse events mode. Keep reports with a serious outcome.",
            "default": false
          },
          "outcomes": {
            "title": "Outcomes",
            "type": "array",
            "description": "Adverse events mode. Keep reports with one of these outcomes.",
            "items": {
              "type": "string",
              "enum": [
                "death",
                "hospitalization",
                "lifeThreatening",
                "disability",
                "congenitalAnomaly",
                "other"
              ]
            }
          },
          "patientSex": {
            "title": "Patient sex",
            "enum": [
              "any",
              "female",
              "male"
            ],
            "type": "string",
            "description": "Adverse events mode.",
            "default": "any"
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "First date, in the form 2025-01-31. Applies to the received date of reports, the report date of recalls, the label date and the decision date of clearances."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Last date, in the form 2026-09-30."
          },
          "onlyWithBoxedWarning": {
            "title": "Only labels with a boxed warning",
            "type": "boolean",
            "description": "Labels mode. Keep labels that have the strongest FDA warning box.",
            "default": false
          },
          "sectionMaxChars": {
            "title": "Label text length limit",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Labels mode. Maximum number of characters kept per label section.",
            "default": 1500
          },
          "openFdaApiKey": {
            "title": "FDA access code (optional)",
            "type": "string",
            "description": "Free code from open.fda.gov. Without it the FDA allows 40 requests per minute and about 1,000 per day for each address, and runs are slower. With it runs are about five times faster."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}