{
  "openapi": "3.0.1",
  "info": {
    "title": "openFDA Drug Adverse Events (FAERS), Recalls & Labels Feed",
    "description": "Search FDA drug adverse event reports (FAERS) by drug, reaction, seriousness, country and date window, plus drug recalls and labels. Flat rows, delta mode for daily drug safety alerts. Official free openFDA API.",
    "version": "1.0",
    "x-build-id": "c7Crw9kTLpirXWHxp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datacrate~openfda-drug-adverse-events-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datacrate-openfda-drug-adverse-events-feed",
        "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/datacrate~openfda-drug-adverse-events-feed/runs": {
      "post": {
        "operationId": "runs-sync-datacrate-openfda-drug-adverse-events-feed",
        "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/datacrate~openfda-drug-adverse-events-feed/run-sync": {
      "post": {
        "operationId": "run-sync-datacrate-openfda-drug-adverse-events-feed",
        "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": {
          "dataset": {
            "title": "What to return",
            "enum": [
              "adverse_events",
              "recalls",
              "labels"
            ],
            "type": "string",
            "description": "Adverse event reports (FAERS), drug recalls (enforcement reports) or drug labels (SPL).",
            "default": "adverse_events"
          },
          "drugs": {
            "title": "Drug names",
            "type": "array",
            "description": "Brand name, generic name or active substance, e.g. ibuprofen, Ozempic, semaglutide. Several names are combined with OR. Leave empty for the newest records.",
            "items": {
              "type": "string"
            }
          },
          "reactions": {
            "title": "Reactions (MedDRA terms)",
            "type": "array",
            "description": "Adverse events only. Reaction terms such as Nausea, Pancreatitis, Anaphylactic reaction. Several terms are combined with OR.",
            "items": {
              "type": "string"
            }
          },
          "suspectDrugOnly": {
            "title": "Drug must be the suspect drug",
            "type": "boolean",
            "description": "Adverse events only. Skip reports where your drug is only a concomitant medicine. Recommended when you search by drug.",
            "default": false
          },
          "seriousOnly": {
            "title": "Serious reports only",
            "type": "boolean",
            "description": "Adverse events only. Keep reports flagged serious by the reporter.",
            "default": false
          },
          "seriousOutcomes": {
            "title": "Specific serious outcomes",
            "type": "array",
            "description": "Adverse events only. Keep reports with any of the selected outcomes. Overrides 'Serious reports only'.",
            "items": {
              "type": "string",
              "enum": [
                "death",
                "lifeThreatening",
                "hospitalization",
                "disabling",
                "congenitalAnomaly",
                "other"
              ],
              "enumTitles": [
                "Death",
                "Life-threatening",
                "Hospitalization",
                "Disability",
                "Congenital anomaly",
                "Other serious"
              ]
            }
          },
          "country": {
            "title": "Country / state",
            "type": "string",
            "description": "Adverse events: two-letter country of the primary reporter (US, GB, DE, JP). Recalls: two-letter US state of the recalling firm (CA, NJ). Ignored for labels."
          },
          "manufacturer": {
            "title": "Manufacturer or recalling firm",
            "type": "string",
            "description": "Optional, e.g. Pfizer, Novo Nordisk."
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "YYYY-MM-DD. Adverse events: date FDA received the report. Recalls: report date. Labels: label effective date."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "YYYY-MM-DD. Leave empty for up to today."
          },
          "receivedWithinDays": {
            "title": "Or: within the last N days",
            "minimum": 0,
            "maximum": 36500,
            "type": "integer",
            "description": "Relative window ending today, used when 'From date' is empty. FAERS data is published with a delay of several weeks, so use 90 or more for adverse events. 0 = off.",
            "default": 0
          },
          "recallClassification": {
            "title": "Recall class",
            "enum": [
              "",
              "Class I",
              "Class II",
              "Class III"
            ],
            "type": "string",
            "description": "Recalls only. Class I = most serious.",
            "default": ""
          },
          "recallStatus": {
            "title": "Recall status",
            "enum": [
              "",
              "Ongoing",
              "Completed",
              "Terminated",
              "Pending"
            ],
            "type": "string",
            "description": "Recalls only.",
            "default": ""
          },
          "hasBoxedWarning": {
            "title": "Only labels with a boxed warning",
            "type": "boolean",
            "description": "Labels only.",
            "default": false
          },
          "includeLabelText": {
            "title": "Include label text sections",
            "type": "boolean",
            "description": "Labels only. Adds shortened indications, boxed warning, warnings, contraindications, adverse reactions and dosage text.",
            "default": true
          },
          "textMaxChars": {
            "title": "Max characters per label section",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Labels only.",
            "default": 1500
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 25000,
            "type": "integer",
            "description": "Upper bound on rows (and on cost). openFDA allows at most 25,000 records per query; narrow the date window to go deeper.",
            "default": 25
          },
          "onlyNewSinceLastRun": {
            "title": "Delta mode (only new since last run)",
            "type": "boolean",
            "description": "Skip report IDs already returned by an earlier run with the same state name. Recalls and labels are returned again when their status or version changes. The first run sets the baseline.",
            "default": false
          },
          "stateKey": {
            "title": "State name (delta mode)",
            "type": "string",
            "description": "Use different names to keep separate watchlists.",
            "default": "default"
          },
          "apiKey": {
            "title": "openFDA API key (optional)",
            "type": "string",
            "description": "Free key from open.fda.gov/apis/authentication. Without a key openFDA allows about 1,000 requests per day per IP, which is plenty for most runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}