{
  "openapi": "3.0.1",
  "info": {
    "title": "openFDA Recalls, Enforcement & Adverse Events",
    "description": "Search the U.S. openFDA public feeds in one actor: device, food and drug recalls and enforcement reports, device PMAs, food and drug adverse events. Filter by firm, state, classification, product or date; aggregate enforcement corpora by any facet. No API key.",
    "version": "0.0",
    "x-build-id": "BQN94yjlS4WVHkSyR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~openfda-compliance/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-openfda-compliance",
        "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/j0401~openfda-compliance/runs": {
      "post": {
        "operationId": "runs-sync-j0401-openfda-compliance",
        "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/j0401~openfda-compliance/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-openfda-compliance",
        "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": {
          "corpus": {
            "title": "Corpus",
            "enum": [
              "device-enforcement",
              "food-enforcement",
              "drug-enforcement",
              "device-recall",
              "device-pma",
              "food-event",
              "drug-event"
            ],
            "type": "string",
            "description": "device/food/drug-enforcement = recall enforcement reports; device-recall = device recall events; device-pma = premarket approvals; food-event / drug-event = adverse event reports.",
            "default": "device-enforcement"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "",
              "search",
              "aggregate"
            ],
            "type": "string",
            "description": "search = matching records. aggregate = one row per group (enforcement corpora only). Leave blank to auto-route: filters -> search, no filters -> aggregate."
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Free text over firm, product description and reason (case-insensitive)."
          },
          "firm": {
            "title": "Firm",
            "type": "string",
            "description": "Recalling firm or PMA applicant, e.g. \"Medtronic\"."
          },
          "reason": {
            "title": "Reason",
            "type": "string",
            "description": "Text inside the reason-for-recall field (device, food and drug enforcement corpora)."
          },
          "classification": {
            "title": "Classification",
            "enum": [
              "",
              "Class I",
              "Class II",
              "Class III",
              "Not Yet Classified"
            ],
            "type": "string",
            "description": "FDA enforcement class (the three enforcement corpora only). Class I is the most serious."
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "Enforcement: Ongoing / Completed / Terminated. Device recall: recall status. Device PMA: decision code (e.g. OK30)."
          },
          "state": {
            "title": "State",
            "type": "string",
            "description": "Two-letter US state of the firm, e.g. \"MA\"."
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Firm country as published, e.g. \"United States\"."
          },
          "productType": {
            "title": "Product type",
            "type": "string",
            "description": "Enforcement corpora only: Devices / Food / Drugs."
          },
          "serious": {
            "title": "Seriousness",
            "enum": [
              "",
              "Serious",
              "Non-serious"
            ],
            "type": "string",
            "description": "Drug adverse events only: filter serious vs non-serious reports."
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Inclusive lower bound on the corpus date field (report, event, decision or date posted, depending on the corpus)."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Inclusive upper bound on the corpus date field."
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "",
              "classification",
              "status",
              "state",
              "country",
              "productType"
            ],
            "type": "string",
            "description": "Enforcement corpora only. Blank defaults to classification."
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "maximum": 25000,
            "type": "integer",
            "description": "Cap the number of search records pushed (0 = the default 50, maximum 25000). Aggregate returns every group.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}