{
  "openapi": "3.0.1",
  "info": {
    "title": "openFDA Scraper · Drug Events, Recalls, Labels & Devices",
    "description": "Scrape FDA drug adverse events, drug and food recalls, product labels, the NDC directory, device events, device recalls and 510(k) clearances from the public openFDA API. No key required, no browser.",
    "version": "1.0",
    "x-build-id": "eMUsOGQPyi1qI6AVB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/reapx~openfda-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-reapx-openfda-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/reapx~openfda-scraper/runs": {
      "post": {
        "operationId": "runs-sync-reapx-openfda-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/reapx~openfda-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-reapx-openfda-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": {
          "dataset": {
            "title": "FDA dataset",
            "enum": [
              "drug-recalls",
              "drug-adverse-events",
              "drug-labels",
              "drug-ndc-directory",
              "device-recalls",
              "device-adverse-events",
              "device-510k-clearances",
              "food-recalls"
            ],
            "type": "string",
            "description": "Which openFDA endpoint to read. Each one returns a different kind of record, all keyed by their own FDA identifier.<br><br>Options: <code>drug-recalls</code>, <code>drug-adverse-events</code>, <code>drug-labels</code>, <code>drug-ndc-directory</code>, <code>device-recalls</code>, <code>device-adverse-events</code>."
          },
          "searchTerm": {
            "title": "Product or brand name",
            "type": "string",
            "description": "Matches the product, brand or device name fields of the chosen dataset.<br><br>Leave this field empty to skip this filter."
          },
          "firmName": {
            "title": "Company or firm",
            "type": "string",
            "description": "Recalling firm, labeler, applicant or manufacturer, depending on the dataset.<br><br>Leave this field empty to skip this filter."
          },
          "maxRecords": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 25000,
            "type": "integer",
            "description": "Hard cap on how many records the run returns. This is also your cost cap: you are charged once per record returned. openFDA serves at most 25,000 records for one query.<br><br>The higher the number, the longer the run takes and the more you are charged, because you pay per row returned."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "newest",
              "oldest",
              "none"
            ],
            "type": "string",
            "description": "Ordering on the dataset's main date field.<br><br>Options: <code>newest</code>, <code>oldest</code>, <code>none</code>."
          },
          "lastNDays": {
            "title": "In the last N days",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Rolling window on the dataset's main date - recall initiation, report received, decision date or marketing start. Ignored if you set an explicit \"From date\". Note the adverse event datasets lag: FAERS is usually 3-5 months behind and MAUDE 1-2 months, so windows under 180 days can come back empty.<br><br>The higher the number, the longer the run takes and the more you are charged, because you pay per row returned."
          },
          "dateFrom": {
            "title": "From date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Earliest date, YYYY-MM-DD."
          },
          "dateTo": {
            "title": "To date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Latest date, YYYY-MM-DD."
          },
          "classification": {
            "title": "Recall classification",
            "enum": [
              "Class I",
              "Class II",
              "Class III"
            ],
            "type": "string",
            "description": "Class I is the most serious (reasonable probability of serious harm), Class III the least. Applies to drug and food recalls.<br><br>Options: <code>Class I</code>, <code>Class II</code>, <code>Class III</code>."
          },
          "recallStatus": {
            "title": "Recall status",
            "enum": [
              "Ongoing",
              "Completed",
              "Terminated",
              "Pending",
              "Open, Classified"
            ],
            "type": "string",
            "description": "Where the recall stands today. Drug and food recalls use Ongoing/Completed/Terminated; device recalls use Open, Classified/Terminated/Completed.<br><br>Options: <code>Ongoing</code>, <code>Completed</code>, <code>Terminated</code>, <code>Pending</code>, <code>Open, Classified</code>."
          },
          "state": {
            "title": "US state",
            "type": "string",
            "description": "Two-letter state code of the recalling firm or applicant.<br><br>Leave this field empty to skip this filter."
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Country of the recalling firm or applicant.<br><br>Leave this field empty to skip this filter."
          },
          "seriousOnly": {
            "title": "Serious outcomes only",
            "type": "boolean",
            "description": "Keep only adverse event reports FDA flagged as serious. Applies to drug adverse events."
          },
          "deathsOnly": {
            "title": "Reports involving death only",
            "type": "boolean",
            "description": "Keep only adverse event reports where death was an outcome."
          },
          "reaction": {
            "title": "Reaction term",
            "type": "string",
            "description": "MedDRA reaction term as FDA records it, in capitals, e.g. <code>HEADACHE</code>, NAUSEA, ANAPHYLACTIC REACTION.<br><br>Leave this field empty to skip this filter."
          },
          "searchQuery": {
            "title": "Raw openFDA query",
            "type": "string",
            "description": "Advanced. A raw openFDA search expression, combined with every other filter using AND. Example: openfda.pharm_class_epc:\"Antibacterial\". Full syntax at open.fda.gov/apis/query-syntax.<br><br>Leave this field empty to skip this filter."
          },
          "apiKey": {
            "title": "openFDA API key (optional)",
            "type": "string",
            "description": "Optional and free from open.fda.gov/apis/authentication. Without one, openFDA allows 1,000 requests per day per IP; with one, 120,000. Only needed for very large runs.<br><br>Leave this field empty to skip this filter."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}