{
  "openapi": "3.0.1",
  "info": {
    "title": "Food, Drug & Device Recalls Monitor (from openFDA data)",
    "description": "Food, drug and medical device recalls from the official openFDA enforcement API in one uniform format. Filter by company, product words, class I/II/III, state, country and dates, and get only new recalls since the last run.",
    "version": "0.1",
    "x-build-id": "0RANXbb7jiZDg6Zqb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/br_data_hub~fda-recalls-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-br_data_hub-fda-recalls-monitor",
        "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/br_data_hub~fda-recalls-monitor/runs": {
      "post": {
        "operationId": "runs-sync-br_data_hub-fda-recalls-monitor",
        "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/br_data_hub~fda-recalls-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-br_data_hub-fda-recalls-monitor",
        "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": {
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Pick the openFDA enforcement endpoints to search: food, drugs and medical devices. Leave all three for every recall.",
            "items": {
              "type": "string",
              "enum": [
                "food",
                "drug",
                "device"
              ],
              "enumTitles": [
                "Food",
                "Drugs",
                "Medical devices"
              ]
            },
            "default": [
              "food",
              "drug",
              "device"
            ]
          },
          "companies": {
            "title": "Companies",
            "type": "array",
            "description": "Enter recalling firm names, one per line, e.g. Abbott or Tyson Foods. Any name matches (phrase search, case ignored). Leave empty for all companies.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "productKeywords": {
            "title": "Product words",
            "type": "array",
            "description": "Enter words or phrases from the product description, one per line, e.g. peanut, insulin pump or ibuprofen. Any of them matches. Leave empty for all products.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "classifications": {
            "title": "Recall class",
            "type": "array",
            "description": "Pick FDA hazard classes: I (serious health risk or death), II (temporary or reversible health problems), III (unlikely to cause harm). Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "I",
                "II",
                "III"
              ],
              "enumTitles": [
                "Class I",
                "Class II",
                "Class III"
              ]
            },
            "default": []
          },
          "states": {
            "title": "US states",
            "type": "array",
            "description": "Enter two-letter US state codes where the recalling firm is located, one per line, e.g. CA or NY. Leave empty for all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Enter the recalling firm's country, one per line, e.g. United States, Canada or India (US and USA also work). Leave empty for all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "statuses": {
            "title": "Recall status",
            "type": "array",
            "description": "Pick the statuses to keep, e.g. Ongoing. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "Ongoing",
                "Completed",
                "Terminated",
                "Pending"
              ]
            },
            "default": []
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Type the first date as YYYY-MM-DD for the date field below. Leave empty to use the last 'Lookback days'.",
            "default": ""
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Type the last date as YYYY-MM-DD. Leave empty for today.",
            "default": ""
          },
          "dateField": {
            "title": "Date field",
            "enum": [
              "report_date",
              "recall_initiation_date",
              "center_classification_date",
              "termination_date"
            ],
            "type": "string",
            "description": "Pick which date the range applies to. Keep report_date (when FDA published the recall in its weekly Enforcement Report) for monitoring.",
            "default": "report_date"
          },
          "lookbackDays": {
            "title": "Lookback days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Set how many days back to search when no From date is given, e.g. 30. With 'Only new' the window starts this many days before the previous run, to catch late FDA updates.",
            "default": 30
          },
          "onlyNew": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Turn on for scheduled alerts: only recalls not returned by a previous run with the same filters are returned. The memory is kept in a named key-value store.",
            "default": false
          },
          "skipExistingOnFirstRun": {
            "title": "First run is baseline",
            "type": "boolean",
            "description": "Turn on so the first 'Only new' run saves the recalls already in the window as seen and returns nothing (no charge); alerts start from the next run.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Type the key-value store that keeps the 'Only new' memory. Each filter combination gets its own key; change the name to keep separate alert lists.",
            "default": "fda-recalls-monitor-state"
          },
          "maxItems": {
            "title": "Max recalls",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Set the maximum number of recalls to return, newest first, e.g. 100. You pay only for recalls returned.",
            "default": 100
          },
          "apiKey": {
            "title": "openFDA API key",
            "type": "string",
            "description": "Paste a free key from open.fda.gov/apis/authentication to raise the limit from 1,000 requests per day per IP (shared on Apify servers) to 120,000. Optional."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}