{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Recall Checker API — Food, Drug & Device Recalls",
    "description": "Check products (keywords, brands, UPC, NDC) against official FDA food, drug and device recalls, or get only new recalls on a schedule. Also drug labels, NDC directory, 510(k) and adverse-event counts. openFDA data, no API key needed.",
    "version": "0.0",
    "x-build-id": "4dUpzkNIHwbculcck"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/smartmoney-data~openfda/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-smartmoney-data-openfda",
        "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/smartmoney-data~openfda/runs": {
      "post": {
        "operationId": "runs-sync-smartmoney-data-openfda",
        "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/smartmoney-data~openfda/run-sync": {
      "post": {
        "operationId": "run-sync-smartmoney-data-openfda",
        "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": [
              "watchlist",
              "monitor",
              "search",
              "adverseEventCounts"
            ],
            "type": "string",
            "description": "watchlist = check your product list (keywords, brand:..., upc:..., ndc:...) against FDA recalls. monitor = only NEW recalls since the last run (state kept in a named key-value store). search = filtered query across endpoints. adverseEventCounts = aggregated adverse-event counts per product (no patient-level data).",
            "default": "watchlist"
          },
          "products": {
            "title": "Product watchlist",
            "type": "array",
            "description": "One item per line. Plain text = keyword phrase. Prefix to force a type: `brand:Trader Joe's`, `upc:632687615989`, `ndc:27241-255-01`. 12–14 digit numbers are treated as UPC/GTIN, NNNNN-NNNN(-NN) as NDC. Used by watchlist mode.",
            "items": {
              "type": "string"
            }
          },
          "endpoints": {
            "title": "openFDA datasets",
            "type": "array",
            "description": "Which official api.fda.gov datasets to query. Default: the four recall/enforcement datasets.",
            "items": {
              "type": "string",
              "enum": [
                "food/enforcement",
                "drug/enforcement",
                "device/enforcement",
                "device/recall",
                "drug/label",
                "drug/ndc",
                "device/510k"
              ],
              "enumTitles": [
                "Food enforcement reports (recalls)",
                "Drug enforcement reports (recalls)",
                "Device enforcement reports (recalls)",
                "Device recalls (detailed)",
                "Drug labels (SPL)",
                "NDC directory",
                "Device 510(k) clearances"
              ]
            },
            "default": [
              "food/enforcement",
              "drug/enforcement",
              "device/enforcement",
              "device/recall"
            ]
          },
          "dateFrom": {
            "title": "Date from (YYYY-MM-DD)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Inclusive lower bound on the dataset's main date (report_date for enforcement, event_date_posted for device recalls, effective_time for labels, marketing_start_date for NDC, decision_date for 510(k), receipt date for adverse events). In monitor mode this overrides the saved watermark."
          },
          "dateTo": {
            "title": "Date to (YYYY-MM-DD)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Inclusive upper bound on the main date."
          },
          "lookbackDays": {
            "title": "Default lookback (days)",
            "minimum": 1,
            "maximum": 36500,
            "type": "integer",
            "description": "Used when no dateFrom is set: search mode without any filters, and the first monitor run.",
            "default": 30
          },
          "keywords": {
            "title": "Keywords (search / monitor)",
            "type": "array",
            "description": "Phrases matched in product description, reason for recall, code info, and brand/generic names. Multiple keywords are OR'ed.",
            "items": {
              "type": "string"
            }
          },
          "firms": {
            "title": "Recalling firm / applicant / labeler",
            "type": "array",
            "description": "Company names (word match, possessive-tolerant). OR'ed.",
            "items": {
              "type": "string"
            }
          },
          "classifications": {
            "title": "Recall classification",
            "type": "array",
            "description": "Class I (most serious), Class II, Class III. Enforcement datasets only.",
            "items": {
              "type": "string",
              "enum": [
                "Class I",
                "Class II",
                "Class III"
              ]
            }
          },
          "statuses": {
            "title": "Recall status",
            "type": "array",
            "description": "e.g. Ongoing, Completed, Terminated (enforcement) or Open, Classified / Terminated (device recalls).",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Firm state (US)",
            "type": "array",
            "description": "Two-letter state codes of the recalling firm, e.g. CA, NY.",
            "items": {
              "type": "string"
            }
          },
          "rawSearch": {
            "title": "Advanced: raw openFDA search clause",
            "type": "string",
            "description": "Optional Lucene clause AND'ed to the query, e.g. `distribution_pattern:nationwide`. See https://open.fda.gov/apis/query-syntax/"
          },
          "maxResults": {
            "title": "Max result rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Global cap on record rows pushed (watchlist summaries are extra, one per product). Default 200; the form is prefilled with 50 to keep a first test run small.",
            "default": 200
          },
          "maxResultsPerQuery": {
            "title": "Max records per dataset query",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap per dataset (search/monitor) or per product per dataset (watchlist).",
            "default": 100
          },
          "sortOrder": {
            "title": "Sort",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Sort by the dataset's main date.",
            "default": "newest"
          },
          "dedupe": {
            "title": "Deduplicate",
            "type": "boolean",
            "description": "One row per recall/record even if several products or keywords match it (matches are merged into matched_items).",
            "default": true
          },
          "includeRaw": {
            "title": "Include raw openFDA record",
            "type": "boolean",
            "description": "Adds the untouched openFDA JSON under `raw` next to the flattened fields.",
            "default": true
          },
          "trimRawLists": {
            "title": "Trim long openfda ID lists in raw",
            "type": "boolean",
            "description": "Device records can carry hundreds of harmonized IDs (openfda.k_number, fei_number, registration_number). When on, lists longer than 20 are cut to 20 and the original lengths recorded in openfda._truncated_list_lengths. Turn off for a byte-exact raw copy.",
            "default": true
          },
          "emitWatchlistSummary": {
            "title": "Watchlist: one summary row per product",
            "type": "boolean",
            "description": "Adds a status row per product (MATCHES_FOUND / NO_MATCH_FOUND) for audit trails.",
            "default": true
          },
          "includePersonContacts": {
            "title": "Include named individual contacts",
            "type": "boolean",
            "description": "Off by default: removes fields naming individual people (device recall `additional_info_contact`, 510(k) `contact`) from both flattened and raw output.",
            "default": false
          },
          "labelMaxChars": {
            "title": "Drug label section max chars",
            "minimum": 100,
            "maximum": 20000,
            "type": "integer",
            "description": "Truncate flattened label sections (warnings, indications…) to this length. Raw keeps full text.",
            "default": 1500
          },
          "monitorStateKey": {
            "title": "Monitor state key",
            "type": "string",
            "description": "Name for the saved monitor state (use different keys for different watch configurations).",
            "default": "default"
          },
          "monitorOverlapDays": {
            "title": "Monitor overlap (days)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Re-scan this many days before the last watermark to catch late-posted records; already-seen IDs are skipped.",
            "default": 14
          },
          "resetMonitorState": {
            "title": "Reset monitor state",
            "type": "boolean",
            "description": "Forget previously seen records for this state key.",
            "default": false
          },
          "aeEndpoint": {
            "title": "Adverse events: dataset",
            "enum": [
              "drug/event",
              "device/event",
              "food/event"
            ],
            "type": "string",
            "description": "Aggregated counts only.",
            "default": "drug/event"
          },
          "aeProducts": {
            "title": "Adverse events: product names",
            "type": "array",
            "description": "Drug brand/generic names, device brand/generic names, or food brand names.",
            "items": {
              "type": "string"
            }
          },
          "aeCountBy": {
            "title": "Adverse events: count by",
            "enum": [
              "reaction",
              "seriousness",
              "outcome",
              "month",
              "event_type",
              "product_problem"
            ],
            "type": "string",
            "description": "drug/event: reaction, seriousness, outcome, month. device/event: event_type, product_problem, month. food/event: reaction, outcome, month.",
            "default": "reaction"
          },
          "aeTopN": {
            "title": "Adverse events: top N terms",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many most frequent terms to return per product (ignored for month, which returns all months).",
            "default": 25
          },
          "apiKey": {
            "title": "openFDA API key (optional)",
            "type": "string",
            "description": "Optional, free from https://open.fda.gov/apis/authentication/. Without a key openFDA allows 240 requests/min and 1,000 requests/day per IP (cloud IPs can be shared); with a key 120,000/day."
          },
          "maxApiRequests": {
            "title": "Max openFDA API requests",
            "minimum": 1,
            "maximum": 120000,
            "type": "integer",
            "description": "Safety budget per run. Defaults to 900 without a key, 20,000 with a key."
          },
          "requestsPerSecond": {
            "title": "Requests per second",
            "minimum": 0.2,
            "maximum": 4,
            "type": "number",
            "description": "Throttle (hard-capped at 4/s = openFDA's 240/min).",
            "default": 3.5
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Records per API request (openFDA max 1000). Large-record datasets are auto-capped (device recall 200, device enforcement 250, 510(k) 300, drug label 100) to keep memory low.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}