{
  "openapi": "3.0.1",
  "info": {
    "title": "openFDA API: FDA Recalls, Drug Labels & Device Reports",
    "description": "Query the official openFDA API in one actor: drug, device and food recall enforcement reports, SPL drug labels by generic or brand name, and device adverse-event (MAUDE) reports with detail links that open. Filter by keyword, recall class, status, state, event type and date. No API key.",
    "version": "0.1",
    "x-build-id": "DIcXkdpQjgg7PfUVm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yadroo~openfda-records/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yadroo-openfda-records",
        "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/yadroo~openfda-records/runs": {
      "post": {
        "operationId": "runs-sync-yadroo-openfda-records",
        "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/yadroo~openfda-records/run-sync": {
      "post": {
        "operationId": "run-sync-yadroo-openfda-records",
        "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": {
          "mode": {
            "title": "What to fetch",
            "enum": [
              "recalls",
              "drugLabels",
              "deviceEvents",
              "datasets"
            ],
            "type": "string",
            "description": "Which openFDA endpoint to read. `recalls` = /{drug|device|food}/enforcement, `drugLabels` = /drug/label, `deviceEvents` = /device/event, `datasets` = the export status of every openFDA dataset (one row per dataset, ignores the filters below).",
            "default": "recalls"
          },
          "productArea": {
            "title": "Recalls: product area",
            "enum": [
              "drug",
              "device",
              "food"
            ],
            "type": "string",
            "description": "Which enforcement-report dataset to read in `recalls` mode. Ignored by the other modes.",
            "default": "drug"
          },
          "query": {
            "title": "Search words",
            "type": "string",
            "description": "Words to search for, e.g. a drug name, a device type, a firm or a recall reason. Several words are treated as a phrase; leave empty to list everything that matches the filters. Which field is searched is set by `searchField`."
          },
          "searchField": {
            "title": "Search in",
            "enum": [
              "auto",
              "product",
              "reason",
              "firm",
              "brandName",
              "genericName",
              "manufacturer",
              "productCode",
              "identifier"
            ],
            "type": "string",
            "description": "Which field `query` is matched in. `identifier` looks up one exact record and returns a row with `found: false` when the id does not exist. Fields that an endpoint does not have fall back to `auto`.",
            "default": "auto"
          },
          "classifications": {
            "title": "Recall classes",
            "type": "array",
            "description": "Keep only recalls of these classes. Empty = all classes.",
            "items": {
              "type": "string",
              "enum": [
                "Class I",
                "Class II",
                "Class III"
              ],
              "enumTitles": [
                "Class I — reasonable probability of serious harm or death",
                "Class II — temporary or reversible harm",
                "Class III — unlikely to cause harm"
              ]
            }
          },
          "recallStatuses": {
            "title": "Recall status",
            "type": "array",
            "description": "Keep only recalls with these statuses. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "Ongoing",
                "Completed",
                "Terminated",
                "Pending"
              ],
              "enumTitles": [
                "Ongoing",
                "Completed",
                "Terminated",
                "Pending classification"
              ]
            }
          },
          "eventTypes": {
            "title": "Device event types",
            "type": "array",
            "description": "`deviceEvents` only: keep only reports of these event types. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "Death",
                "Injury",
                "Malfunction",
                "Other",
                "No answer provided"
              ],
              "enumTitles": [
                "Death",
                "Injury",
                "Malfunction",
                "Other",
                "No answer provided"
              ]
            }
          },
          "productCode": {
            "title": "Device product code",
            "type": "string",
            "description": "Three-letter FDA device product code (e.g. QFG for alternate-controller insulin pumps, DXT for infusion pumps). Applies to `deviceEvents` only (device reports). See README → Reference dictionaries."
          },
          "state": {
            "title": "Recalling firm state",
            "type": "string",
            "description": "Two-letter US state code of the recalling firm, e.g. NJ, CA, TX. `recalls` only."
          },
          "country": {
            "title": "Recalling firm country",
            "type": "string",
            "description": "Country of the recalling firm as openFDA spells it, e.g. \"United States\", \"India\", \"Germany\". `recalls` only."
          },
          "sinceDays": {
            "title": "Only the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Keep only records whose main date (report date for recalls, date received for device reports, effective date for labels) falls in the last N days. Use it for monitoring runs; leave empty for the whole archive. FDA publishes in weekly batches, so allow at least 30 days."
          },
          "fromDate": {
            "title": "From date (UTC)",
            "type": "string",
            "description": "Earliest date, YYYY-MM-DD, inclusive. Ignored when `sinceDays` is set."
          },
          "toDate": {
            "title": "To date (UTC)",
            "type": "string",
            "description": "Latest date, YYYY-MM-DD, inclusive. Ignored when `sinceDays` is set."
          },
          "onlyNew": {
            "title": "Only records not seen before",
            "type": "boolean",
            "description": "Keep a list of record ids in this actor's key-value store and output only records that were not in it on the previous run. Makes a scheduled task emit just the new recalls or reports. The first run outputs everything it finds.",
            "default": false
          },
          "sortOrder": {
            "title": "Sort",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Order by the record's main date.",
            "default": "newest"
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many rows. openFDA allows paging through roughly 25,000 hits per query; narrow the filters for bigger jobs.",
            "default": 25
          },
          "includeText": {
            "title": "Include long narrative text",
            "type": "boolean",
            "description": "Add the label sections (`drugLabels`) or the narrative text of the report (`deviceEvents`) to every row. Off by default because these fields can be tens of kilobytes each.",
            "default": false
          },
          "labelSections": {
            "title": "Label sections to include",
            "type": "array",
            "description": "Which SPL sections land in `sections` when `includeText` is on. Empty = purpose, indications and usage, and warnings. Sections a label does not have are left out.",
            "items": {
              "type": "string",
              "enum": [
                "purpose",
                "indicationsAndUsage",
                "dosageAndAdministration",
                "warnings",
                "adverseReactions",
                "contraindications",
                "activeIngredient",
                "inactiveIngredient",
                "description",
                "howSupplied"
              ],
              "enumTitles": [
                "Purpose",
                "Indications and usage",
                "Dosage and administration",
                "Warnings",
                "Adverse reactions",
                "Contraindications",
                "Active ingredient",
                "Inactive ingredient",
                "Description",
                "How supplied"
              ]
            }
          },
          "fields": {
            "title": "Output fields",
            "type": "array",
            "description": "Keep only these output fields, in this order, e.g. [\"recallNumber\", \"classification\", \"productDescription\", \"url\"]. Empty = all fields of the mode.",
            "items": {
              "type": "string"
            }
          },
          "customSearch": {
            "title": "Raw openFDA search expression",
            "type": "string",
            "description": "Advanced: a raw openFDA query string that is ANDed to everything above, e.g. `openfda.pharm_class_epc:\"Nonsteroidal+Anti-inflammatory+Drug\"` or `patient.patient_problems:\"Death\"`. Use the field names of the endpoint you selected; an invalid expression fails the run with the API's own message."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}