{
  "openapi": "3.0.1",
  "info": {
    "title": "openFDA Enforcement Recalls Scraper",
    "description": "Drug, device and food recall and enforcement reports from the official openFDA API: classification, firm, reason, dates, distribution.",
    "version": "0.1",
    "x-build-id": "hdawYXHSFaedivNpD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/knotty_mistveil~openfda-enforcement-recalls/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-knotty_mistveil-openfda-enforcement-recalls",
        "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/knotty_mistveil~openfda-enforcement-recalls/runs": {
      "post": {
        "operationId": "runs-sync-knotty_mistveil-openfda-enforcement-recalls",
        "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/knotty_mistveil~openfda-enforcement-recalls/run-sync": {
      "post": {
        "operationId": "run-sync-knotty_mistveil-openfda-enforcement-recalls",
        "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": {
          "productType": {
            "title": "Product type",
            "enum": [
              "all",
              "drug",
              "device",
              "food"
            ],
            "type": "string",
            "description": "Which openFDA enforcement endpoint to query: drug, device or food recalls, or all three.",
            "default": "all"
          },
          "dateFrom": {
            "title": "Date from (report_date)",
            "type": "string",
            "description": "YYYY-MM-DD. Keep only recalls whose FDA report_date (the date the recall was classified and added to the enforcement report, not the day the problem happened) is on or after this date. Leave empty to use \"Days back\" instead."
          },
          "dateTo": {
            "title": "Date to (report_date)",
            "type": "string",
            "description": "YYYY-MM-DD. Keep only recalls reported on or before this date. Leave empty to use today (or \"Days back\" from it)."
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 366,
            "type": "integer",
            "description": "Used only when Date from/Date to are empty: look back this many days from today (or from Date to). Defaults to 14, not 7, because openFDA's enforcement data updates weekly but can sit for over a week before a given recall's report_date is actually current (measured 5 October 2026: the newest report_date available was 12 days behind the calendar date) - a 14-day window reliably covers at least one full update cycle. That window held 11 drug, 88 device and 49 food recalls nationwide (148 total) when measured 5 October 2026.",
            "default": 14
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Case-insensitive OR match against the product description AND the reason for recall, e.g. [\"lead\", \"listeria\"]. Several keywords are ORed; each keyword is matched in either field. Empty = no keyword filter.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two-letter USPS codes for the recalling firm's state, e.g. [\"CA\"], [\"NY\",\"TX\"]. Several codes are ORed. A foreign recalling firm has no US state and is excluded by this filter. Empty = every state (including foreign firms).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "classification": {
            "title": "Classification",
            "enum": [
              "Class I",
              "Class II",
              "Class III"
            ],
            "type": "string",
            "description": "FDA's recall-severity class: Class I (reasonable probability of serious harm or death), Class II (temporary or reversible harm) or Class III (unlikely to cause harm). Empty = every classification."
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Stop after this many recall records. You are charged per record delivered, so this is also the cost cap. Defaults low (20, not this series' usual 500) because the default 7-day/all-types window already matches roughly 150 records nationwide, and a Store \"Try it\" run should be cheap and fast. Results are ordered by ascending report_date, then event_id, within each product type queried.",
            "default": 20
          },
          "apiKey": {
            "title": "openFDA API key (optional)",
            "type": "string",
            "description": "A free openFDA API key raises your daily quota from 1,000 to 120,000 requests (the per-minute cap, 240, is the same with or without a key) - get one at https://open.fda.gov/apis/authentication/. Leave empty to run unauthenticated; also falls back to the OPENFDA_API_KEY environment variable so an operator can test without pasting a key into the input."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}