{
  "openapi": "3.0.1",
  "info": {
    "title": "openFDA — Drug Labels, Adverse Events, Recalls, Devices",
    "description": "Query the FDA's own open data: prescribing information from drug labels, adverse event reports from FAERS, drug, food and device recalls, and 510(k) device clearances. Field-scoped searches, date ranges, no API key.",
    "version": "0.1",
    "x-build-id": "QmG5jchH36gfYqY2W"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dalbian~openfda-drug-device-food-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dalbian-openfda-drug-device-food-data",
        "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/dalbian~openfda-drug-device-food-data/runs": {
      "post": {
        "operationId": "runs-sync-dalbian-openfda-drug-device-food-data",
        "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/dalbian~openfda-drug-device-food-data/run-sync": {
      "post": {
        "operationId": "run-sync-dalbian-openfda-drug-device-food-data",
        "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": {
          "datasets": {
            "title": "Datasets",
            "type": "array",
            "description": "Which openFDA endpoints to query. Every filter below is applied to each dataset you pick, mapped to that dataset's own field names — a manufacturer becomes openfda.manufacturer_name on a drug label and recalling_firm on a recall.",
            "items": {
              "type": "string",
              "enum": [
                "drugLabel",
                "adverseEvent",
                "drugEnforcement",
                "foodEnforcement",
                "deviceEnforcement",
                "deviceClearance"
              ],
              "enumTitles": [
                "Drug labels (prescribing information)",
                "Adverse event reports (FAERS)",
                "Drug recalls",
                "Food recalls",
                "Device recalls",
                "Device clearances (510k)"
              ]
            },
            "default": [
              "drugLabel"
            ]
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Free text, one term per line. Each term is matched against the fields that carry a name in the chosen dataset: brand, generic and substance names on labels, drug and reaction terms on adverse events, product description and recall reason on recalls, device name on clearances. Terms are combined with OR, so two lines widen the search.",
            "items": {
              "type": "string"
            }
          },
          "brandNames": {
            "title": "Brand names",
            "type": "array",
            "description": "Exact brand names, one per line — Lipitor, Ozempic, Advil PM. More precise than a free-text term because it is matched only against the brand field.",
            "default": [
              "Ozempic"
            ],
            "items": {
              "type": "string"
            }
          },
          "genericNames": {
            "title": "Generic or substance names",
            "type": "array",
            "description": "Active ingredient names, one per line — atorvastatin calcium, semaglutide.",
            "items": {
              "type": "string"
            }
          },
          "manufacturers": {
            "title": "Manufacturers or recalling firms",
            "type": "array",
            "description": "Company names, one per line. Matched against the labeller on drug labels, the recalling firm on recalls and the applicant on device clearances.",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Start of the date range, as YYYY-MM-DD or YYYYMMDD. Applied to the date field that dataset actually publishes: label effective date, adverse event receipt date, recall initiation date, or clearance decision date."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End of the date range, as YYYY-MM-DD or YYYYMMDD. Inclusive."
          },
          "seriousOnly": {
            "title": "Serious adverse events only",
            "type": "boolean",
            "description": "Restrict adverse event reports to those the reporter flagged as serious — death, hospitalisation, disability, life-threatening or congenital anomaly. Ignored by the other datasets.",
            "default": false
          },
          "classification": {
            "title": "Recall classification",
            "enum": [
              "",
              "Class I",
              "Class II",
              "Class III"
            ],
            "type": "string",
            "description": "Restrict recalls to one FDA hazard class. Ignored by the other datasets.",
            "default": ""
          },
          "maxResultsPerQuery": {
            "title": "Maximum records per dataset",
            "minimum": 1,
            "maximum": 12000,
            "type": "integer",
            "description": "Cap on records returned per dataset. openFDA pages 1000 at a time and refuses to skip past 25 000, so 26 000 is the hard ceiling for any one search. The summary row says when that ceiling was reached.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}