{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Recalls Watch & API: Food, Drug & Device (openFDA)",
    "description": "FDA recalls API and food recall monitor: new and changed food, drug and medical device recalls from the official openFDA API since your last run, or every match; failed or unchanged rows are never charged. Not affiliated with or endorsed by the U.S. FDA.",
    "version": "0.1",
    "x-build-id": "LEmLh1c1uVcar5qVk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mouadapi~openfda-recalls/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mouadapi-openfda-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/mouadapi~openfda-recalls/runs": {
      "post": {
        "operationId": "runs-sync-mouadapi-openfda-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/mouadapi~openfda-recalls/run-sync": {
      "post": {
        "operationId": "run-sync-mouadapi-openfda-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "watch",
              "export"
            ],
            "type": "string",
            "description": "watch: per named watch list, return only recalls that are new or changed since the last run (the first run returns every recall as a baseline row). export: return every recall that matches the filters. If you leave it empty: a watch list name means watch, no name means export (the same call returns data every time)."
          },
          "stateName": {
            "title": "Watch list name",
            "type": "string",
            "description": "Name of your watch list. Giving a name turns on watch mode (unless mode says otherwise). Runs with the same name compare with each other; the list is kept in your own Apify storage. Use one name per set of filters (e.g. \"food-class-1\"). Watch mode without a name uses the list \"default\"."
          },
          "productTypes": {
            "title": "Product types",
            "type": "array",
            "description": "Which FDA enforcement reports to search: food (incl. dietary supplements and cosmetics reported with food), drug, device. Leave empty to check only the recall numbers you list.",
            "items": {
              "type": "string",
              "enum": [
                "food",
                "drug",
                "device"
              ],
              "enumTitles": [
                "Food",
                "Drug",
                "Device"
              ]
            },
            "default": [
              "food"
            ]
          },
          "classifications": {
            "title": "Classifications",
            "type": "array",
            "description": "Only these classes (empty = all). Class I is the most serious (a reasonable chance of serious harm).",
            "items": {
              "type": "string",
              "enum": [
                "Class I",
                "Class II",
                "Class III"
              ]
            }
          },
          "statuses": {
            "title": "Recall status",
            "type": "array",
            "description": "Only recalls with these statuses (empty = all).",
            "items": {
              "type": "string",
              "enum": [
                "Ongoing",
                "Completed",
                "Terminated",
                "Pending"
              ]
            }
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Recalls whose date (see Date field) is within the last N days. Ignored when you set Date from or Date to.",
            "default": 30
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Fixed start date (YYYY-MM-DD), instead of Days back."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Fixed end date (YYYY-MM-DD), instead of Days back."
          },
          "dateField": {
            "title": "Date field",
            "enum": [
              "reportDate",
              "recallInitiationDate"
            ],
            "type": "string",
            "description": "Which date Days back / Date from / Date to apply to: reportDate (the date FDA published the enforcement report) or recallInitiationDate (the date the firm started the recall).",
            "default": "reportDate"
          },
          "states": {
            "title": "Firm's US state",
            "type": "array",
            "description": "Only recalls by firms in these states (two-letter codes, e.g. CA, NY).",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Firm's country",
            "type": "array",
            "description": "Only recalls by firms in these countries (as FDA writes them, e.g. United States, Canada).",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword in product or reason",
            "type": "string",
            "description": "A word or phrase to find in the product description or the reason for recall (e.g. peanut, listeria, pacemaker)."
          },
          "recallingFirm": {
            "title": "Recalling firm",
            "type": "string",
            "description": "Only recalls by this firm (a word or phrase of its name)."
          },
          "recallNumbers": {
            "title": "Recall numbers",
            "type": "array",
            "description": "Specific recalls to return or watch, one per line (e.g. H-0123-2026 food, D-0456-2026 drug, Z-0789-2026 device). Each gives one row; an unknown number gives a free no_data row, an invalid one a free failed row.",
            "items": {
              "type": "string"
            }
          },
          "includeUnchanged": {
            "title": "Include unchanged recalls (free)",
            "type": "boolean",
            "description": "Watch mode: also return recalls that did not change since the last run, as free rows (changeType unchanged).",
            "default": false
          },
          "maxItems": {
            "title": "Max charged rows",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Most charged rows (baseline, new, changed or exported recalls) per run. In watch mode, the rest come in the next run.",
            "default": 100
          },
          "apiKey": {
            "title": "Your openFDA API key (optional)",
            "type": "string",
            "description": "Optional: your own free openFDA API key (open.fda.gov/apis/authentication). It runs without one; for large or frequent runs, add your key. Without a key the limit is 1,000 requests a day per IP address, shared with other users of the same IP; with your key it is 120,000 a day. Stored as a secret; never logged or output."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}