{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Warning Letters, Recalls & Import Alerts Monitor",
    "description": "Get new FDA warning letters, recalls, enforcement reports and import alerts in one dataset. Watch suppliers by name or FEI. Schedule it daily.",
    "version": "0.1",
    "x-build-id": "wgcDfjaNMhFsLGg6D"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tenable_kaleidoscopist~fda-enforcement-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tenable_kaleidoscopist-fda-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/tenable_kaleidoscopist~fda-enforcement-monitor/runs": {
      "post": {
        "operationId": "runs-sync-tenable_kaleidoscopist-fda-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/tenable_kaleidoscopist~fda-enforcement-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-tenable_kaleidoscopist-fda-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "monitor",
              "import_alert_changes",
              "firm_check"
            ],
            "type": "string",
            "description": "monitor returns recent records from the selected sources (default). import_alert_changes reports firms and products added to or removed from the selected FDA import alerts since the previous run; the first run only saves a baseline. firm_check looks up firm names or FEI numbers across all sources.",
            "default": "monitor"
          },
          "sources": {
            "title": "Sources",
            "uniqueItems": true,
            "type": "array",
            "description": "(monitor mode) Public FDA sources to read. warning_letters is the fda.gov Warning Letters listing. import_alerts is the Import Alerts index (alert level). drug, device and food enforcement are FDA Enforcement Reports via openFDA. device_recalls is CDRH device recalls via openFDA. fda.gov and accessdata.fda.gov are read 30 seconds apart, as their robots.txt asks. accessdata.fda.gov (import alerts) is read only from 11 PM to 5 AM US Eastern, per its robots.txt; outside that window it is skipped.",
            "items": {
              "type": "string",
              "enum": [
                "warning_letters",
                "import_alerts",
                "drug_enforcement",
                "device_enforcement",
                "food_enforcement",
                "device_recalls"
              ],
              "enumTitles": [
                "Warning letters (fda.gov)",
                "Import alerts (index)",
                "Drug enforcement reports (openFDA)",
                "Device enforcement reports (openFDA)",
                "Food enforcement reports (openFDA)",
                "Device recalls (openFDA)"
              ]
            },
            "default": [
              "warning_letters",
              "food_enforcement"
            ]
          },
          "lookbackDays": {
            "title": "Lookback (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "(monitor mode) How many days back from today (UTC) to include, by the date FDA posted the record. Ignored if 'Date from' is set.",
            "default": 7
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Optional start date (YYYY-MM-DD), matched against the date FDA posted or reported the record."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Optional end date (YYYY-MM-DD). Defaults to today (UTC)."
          },
          "watchlist": {
            "title": "Watchlist terms",
            "type": "array",
            "description": "Company names, products, FEI numbers or keywords. Case-insensitive match on firm, title, reason, FEI number and record ID.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyWatchlistMatches": {
            "title": "Only watchlist matches",
            "type": "boolean",
            "description": "Return only records that match at least one watchlist term.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new records",
            "type": "boolean",
            "description": "Skip records that earlier runs of this Actor in your account already returned. IDs are remembered in a named key-value store. Useful for scheduled runs.",
            "default": false
          },
          "maxItems": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "The most records this run returns.",
            "default": 25
          },
          "firms": {
            "title": "Firms to check (firm_check mode)",
            "type": "array",
            "description": "Firm names or FEI numbers (7 to 10 digits), one per line, up to 25 per run. Names are matched on normalized words, ignoring case, punctuation and suffixes such as Inc, LLC and Ltd. FEI numbers can only be matched in device recalls and in warning letter text; enforcement reports and import alert pages do not show FEI numbers.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "importAlertNumbers": {
            "title": "Import alert numbers (import_alert_changes and firm_check)",
            "type": "array",
            "description": "FDA import alert numbers, such as 66-80 (GLP-1 APIs) or 66-40 (drug CGMP Red List). Up to 10 per run; alert pages are read 30 seconds apart. Defaults to [\"66-80\"] for import_alert_changes and [\"66-80\", \"66-40\"] for firm_check.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerSource": {
            "title": "Max matches per firm per source (firm_check)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "The most matches returned for each firm from each source.",
            "default": 10
          },
          "checkWarningLetters": {
            "title": "Check warning letters (firm_check)",
            "type": "boolean",
            "description": "Search the fda.gov warning letter listing for each firm (one request per firm, 30 seconds apart).",
            "default": true
          },
          "checkImportAlerts": {
            "title": "Check import alerts (firm_check)",
            "type": "boolean",
            "description": "Check firm lists on the selected import alerts plus any alerts saved by import_alert_changes runs.",
            "default": true
          },
          "openFdaApiKey": {
            "title": "openFDA API key (optional)",
            "type": "string",
            "description": "Optional free key from open.fda.gov for higher openFDA rate limits. Not required."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}