{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Recalls: Food, Drug & Device Scraper",
    "description": "Search and export FDA food, drug, and medical-device recalls from official openFDA enforcement data. Filter by classification, state, date, status, brand or ingredient watchlists, and get normalized records with deduplication, quality checks, and transparent 0–100 priority scoring.",
    "version": "1.0",
    "x-build-id": "fxdc5bhz1Vu0S4chi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/johnatan029~fda-recall-intelligence-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-johnatan029-fda-recall-intelligence-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/johnatan029~fda-recall-intelligence-scraper/runs": {
      "post": {
        "operationId": "runs-sync-johnatan029-fda-recall-intelligence-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/johnatan029~fda-recall-intelligence-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-johnatan029-fda-recall-intelligence-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": {
          "productTypes": {
            "title": "Product types",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "FDA recall datasets to search.",
            "items": {
              "type": "string",
              "enum": [
                "food",
                "drug",
                "device"
              ],
              "enumTitles": [
                "Food",
                "Drugs",
                "Medical devices"
              ]
            },
            "default": [
              "food",
              "drug",
              "device"
            ]
          },
          "query": {
            "title": "Search text",
            "type": "string",
            "description": "Optional text searched safely across relevant recall fields."
          },
          "recallingFirms": {
            "title": "Recalling firms",
            "type": "array",
            "description": "Optional exact company names.",
            "items": {
              "type": "string"
            }
          },
          "classifications": {
            "title": "Classifications",
            "type": "array",
            "description": "FDA recall classifications to match exactly.",
            "items": {
              "type": "string",
              "enum": [
                "Class I",
                "Class II",
                "Class III",
                "Not Yet Classified"
              ],
              "enumTitles": [
                "Class I",
                "Class II",
                "Class III",
                "Not Yet Classified"
              ]
            }
          },
          "statuses": {
            "title": "Statuses",
            "type": "array",
            "description": "Public status values to match; values are not restricted to a fixed enum.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "US states",
            "type": "array",
            "description": "Two-letter US state codes.",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            }
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Country value to match exactly in the published source metadata."
          },
          "dateFrom": {
            "title": "Report date from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "YYYY-MM-DD"
          },
          "dateTo": {
            "title": "Report date to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "YYYY-MM-DD"
          },
          "watchlistTerms": {
            "title": "Watchlist terms",
            "type": "array",
            "description": "Terms checked against category-compatible recall and product fields.",
            "items": {
              "type": "string"
            }
          },
          "onlyWatchlistMatches": {
            "title": "Only watchlist matches",
            "type": "boolean",
            "description": "When enabled, returns only records that pass both the openFDA query and local watchlist validation.",
            "default": false
          },
          "activeOnly": {
            "title": "Exclude clearly terminated source records",
            "type": "boolean",
            "description": "Excludes records whose published source status is clearly Terminated, Completed, or Closed. FDA enforcement status should not be treated as a real-time lifecycle tracker.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "reportDateDesc",
              "reportDateAsc",
              "recallInitiationDateDesc",
              "recallInitiationDateAsc"
            ],
            "type": "string",
            "description": "Sort order applied by openFDA and again to the combined final result.",
            "default": "reportDateDesc"
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Global final output cap after filtering, deduplication, and sorting.",
            "default": 100
          },
          "includeRawOpenFda": {
            "title": "Include raw openFDA object",
            "type": "boolean",
            "description": "Includes the public raw openfda object in each output record when available.",
            "default": false
          },
          "includeSummary": {
            "title": "Write summary to STATS",
            "type": "boolean",
            "description": "Writes run statistics to the STATS key on success; fatal failures always force diagnostic statistics.",
            "default": true
          },
          "debug": {
            "title": "Debug logs",
            "type": "boolean",
            "description": "Enables additional operational logs without exposing API keys or keyed URLs.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}