{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Recalls & Enforcement Monitor: openFDA Reports",
    "description": "Track FDA food, drug and medical device recalls from the official openFDA enforcement reports. Filter by class, status, firm, product, reason and state; get all four dates and see which recalls are new or updated since your last run.",
    "version": "0.1",
    "x-build-id": "5vVEl1wtlj9uDjH4N"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cliqtomedia~fda-recalls-enforcement-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cliqtomedia-fda-recalls-enforcement-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/cliqtomedia~fda-recalls-enforcement-monitor/runs": {
      "post": {
        "operationId": "runs-sync-cliqtomedia-fda-recalls-enforcement-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/cliqtomedia~fda-recalls-enforcement-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-cliqtomedia-fda-recalls-enforcement-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": "Product categories",
            "uniqueItems": true,
            "type": "array",
            "description": "Which openFDA enforcement reports to search: food (also cosmetics and dietary supplements), drug, device. Each category is one request. Default: food.",
            "items": {
              "type": "string",
              "enum": [
                "food",
                "drug",
                "device"
              ],
              "enumTitles": [
                "Food, cosmetics, supplements",
                "Drugs",
                "Medical devices"
              ]
            },
            "default": [
              "food"
            ]
          },
          "classifications": {
            "title": "Recall class",
            "uniqueItems": true,
            "type": "array",
            "description": "FDA recall class. Class I: reasonable probability of serious health consequences or death. Class II: temporary or medically reversible consequences. Class III: unlikely to cause adverse health consequences. Not yet classified: newest recalls FDA has listed before assigning a class and a recall number. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "I",
                "II",
                "III",
                "unclassified"
              ],
              "enumTitles": [
                "Class I",
                "Class II",
                "Class III",
                "Not yet classified"
              ]
            },
            "default": [
              "I",
              "II",
              "III",
              "unclassified"
            ]
          },
          "statuses": {
            "title": "Recall status",
            "uniqueItems": true,
            "type": "array",
            "description": "Ongoing, Completed or Terminated. Empty = all statuses.",
            "items": {
              "type": "string",
              "enum": [
                "Ongoing",
                "Completed",
                "Terminated"
              ]
            },
            "default": [
              "Ongoing",
              "Completed",
              "Terminated"
            ]
          },
          "lookbackDays": {
            "title": "Look back (days)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Date range ending today (or dateTo), 1–90 days. Ignored when dateFrom is set. Default 30.",
            "default": 30
          },
          "dateField": {
            "title": "Date the range applies to",
            "enum": [
              "report_date",
              "recall_initiation_date",
              "center_classification_date",
              "termination_date"
            ],
            "type": "string",
            "description": "report_date: when FDA published the recall in its weekly Enforcement Report (default, best for monitoring). recall_initiation_date: when the firm started the recall. center_classification_date: when FDA classified it. termination_date: when FDA terminated it (use to catch closed recalls).",
            "default": "report_date"
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Optional start date (YYYY-MM-DD). The whole range may span at most 90 days; split longer periods into several runs."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Optional end date (YYYY-MM-DD). Default: today (UTC)."
          },
          "firmNames": {
            "title": "Recalling firm names",
            "maxItems": 10,
            "type": "array",
            "description": "Up to 10 firm names, matched as a phrase in the recalling firm name, e.g. Whole Foods matches Whole Foods Market Group Inc.",
            "items": {
              "type": "string"
            }
          },
          "productQuery": {
            "title": "Product contains",
            "maxLength": 120,
            "type": "string",
            "description": "Optional phrase searched in the product description, e.g. ice cream or insulin pump. 2–120 characters."
          },
          "reasonQuery": {
            "title": "Reason contains",
            "maxLength": 120,
            "type": "string",
            "description": "Optional phrase searched in the reason for recall, e.g. Listeria, undeclared peanut, sterility. 2–120 characters."
          },
          "firmStates": {
            "title": "Firm states",
            "maxItems": 20,
            "type": "array",
            "description": "Up to 20 two-letter US state codes of the recalling firm, e.g. CA, TX. This is where the firm is, not where the product was distributed.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max recalls per category",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Newest first, 1–1000 per category. Each recall row is one charged result. Default 100.",
            "default": 100
          },
          "monitorKey": {
            "title": "Monitor key (for scheduled runs)",
            "maxLength": 40,
            "type": "string",
            "description": "Optional name, 1–40 letters, digits or dashes, e.g. food-class-1. The Actor stores the recalls it saw under this key in your account, and the next run with the same key marks each recall new, updated (for example a status change) or unchanged. The first run marks rows initial. Use one key per saved search."
          },
          "previousDatasetId": {
            "title": "Compare with dataset",
            "type": "string",
            "description": "Alternative to monitorKey: ID of an earlier run's default Dataset from this Actor. Rows are compared with it."
          },
          "onlyChanges": {
            "title": "Only write new and updated recalls",
            "type": "boolean",
            "description": "With a monitorKey or previousDatasetId, skip unchanged recalls (they are not written and not charged). Default true.",
            "default": true
          },
          "openFdaApiKey": {
            "title": "openFDA API key (optional)",
            "type": "string",
            "description": "Optional free key from open.fda.gov/apis/authentication. Without it openFDA allows a limited number of requests per IP address per day, shared with other users of the same IP. The key is never written to the output or logs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}