{
  "openapi": "3.0.1",
  "info": {
    "title": "FAERS Adverse Events Scraper - FDA Drugs and MAUDE Devices",
    "description": "Search openFDA FAERS drug reports and MAUDE device events, export reactions, seriousness, demographics and trend counts, and connect suspect medicines to drug labels and recalls.",
    "version": "0.1",
    "x-build-id": "ZCcZU5ilPUeXqHJL7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s-r~fda-adverse-events/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s-r-fda-adverse-events",
        "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/s-r~fda-adverse-events/runs": {
      "post": {
        "operationId": "runs-sync-s-r-fda-adverse-events",
        "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/s-r~fda-adverse-events/run-sync": {
      "post": {
        "operationId": "run-sync-s-r-fda-adverse-events",
        "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": {
          "source": {
            "title": "Source",
            "enum": [
              "drug",
              "device"
            ],
            "type": "string",
            "description": "Report database to search.",
            "default": "drug"
          },
          "report_id": {
            "title": "Report id",
            "type": "string",
            "description": "One report number or an array of report numbers; drug safetyreportid or device report_number."
          },
          "drug_names": {
            "title": "Drug names",
            "type": "array",
            "description": "Drug names, matched as phrases against medicinal product, brand and generic names; OR across names.",
            "items": {
              "type": "string"
            }
          },
          "device_names": {
            "title": "Device names",
            "type": "array",
            "description": "Device generic or brand names; OR across names. Requires source device.",
            "items": {
              "type": "string"
            }
          },
          "country_codes": {
            "title": "Country codes",
            "type": "array",
            "description": "Two-letter country codes; OR across countries.",
            "items": {
              "type": "string"
            }
          },
          "ndc": {
            "title": "Ndc",
            "type": "string",
            "description": "Hyphenated package NDC, for example 0259-5010-60. Product NDCs are rejected."
          },
          "reaction": {
            "title": "Reaction",
            "type": "string",
            "description": "MedDRA preferred-term phrase. Requires source drug."
          },
          "manufacturer": {
            "title": "Manufacturer",
            "type": "string",
            "description": "Manufacturer name phrase."
          },
          "serious": {
            "title": "Serious",
            "type": "boolean",
            "description": "Filter serious reports. FAERS uses codes 1/2; device Death/Injury versus Malfunction."
          },
          "date_from": {
            "title": "Date from",
            "type": "string",
            "description": "Inclusive lower date, YYYY-MM-DD."
          },
          "date_to": {
            "title": "Date to",
            "type": "string",
            "description": "Inclusive upper date, YYYY-MM-DD."
          },
          "date_field": {
            "title": "Date field",
            "enum": [
              "received",
              "event"
            ],
            "type": "string",
            "description": "Date to filter; event is available only for devices.",
            "default": "received"
          },
          "max_items": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum delivered rows across all continuation requests. Count mode supports up to 999 buckets.",
            "default": 100
          },
          "count": {
            "title": "Count",
            "type": "string",
            "description": "Trend mode: receivedate, receiptdate, occurcountry, serious, patient.reaction.reactionmeddrapt, patient.drug.medicinalproduct, patient.drug.openfda.brand_name or patient.drug.openfda.generic_name for drugs; date_received, date_of_event, event_type, manufacturer_name, device.brand_name or device.generic_name for devices. Text fields are automatically normalized to .exact (also accepted explicitly); count_field returns this canonical name. Dates and serious do not accept .exact. Device reporter_country_code cannot be counted; use country_codes to filter reports."
          },
          "outputMode": {
            "title": "Outputmode",
            "enum": [
              "slim",
              "full"
            ],
            "type": "string",
            "description": "slim normalizes selected fields; full also includes the original report.",
            "default": "slim"
          },
          "exclude_duplicates": {
            "title": "Exclude duplicates",
            "type": "boolean",
            "description": "Exclude FAERS reports marked duplicate by the source.",
            "default": false
          },
          "deduplicate": {
            "title": "Deduplicate",
            "type": "boolean",
            "description": "Deliver each report identifier at most once across pages.",
            "default": true
          },
          "enrich": {
            "title": "Enrich",
            "type": "boolean",
            "description": "Join the first suspect SPL set ID to its label and all suspect package NDCs to recalls. Drug reports only.",
            "default": false
          },
          "cursor": {
            "title": "Cursor",
            "type": "string",
            "description": "Opaque next_cursor from a previous request; retain all other input values."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}