{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA & CPSC Product Recalls API: Food, Drug & Device",
    "description": "FDA and CPSC product recalls as clean JSON: food, drug and device enforcement plus consumer products. Hazard, class, firm, lots, UPCs. Daily monitor.",
    "version": "1.0",
    "x-build-id": "j0MHkNp4C6wP0hI1c"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/optimistprime~us-product-recalls-fda-cpsc/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-optimistprime-us-product-recalls-fda-cpsc",
        "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/optimistprime~us-product-recalls-fda-cpsc/runs": {
      "post": {
        "operationId": "runs-sync-optimistprime-us-product-recalls-fda-cpsc",
        "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/optimistprime~us-product-recalls-fda-cpsc/run-sync": {
      "post": {
        "operationId": "run-sync-optimistprime-us-product-recalls-fda-cpsc",
        "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": {
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Which official recall sources to search. fda-food, fda-drug and fda-device are FDA enforcement reports (weekly). cpsc is the U.S. Consumer Product Safety Commission (consumer products).",
            "items": {
              "type": "string",
              "enum": [
                "fda-food",
                "fda-drug",
                "fda-device",
                "cpsc"
              ],
              "enumTitles": [
                "FDA food",
                "FDA drugs",
                "FDA medical devices",
                "CPSC consumer products"
              ]
            },
            "default": [
              "fda-food",
              "fda-drug",
              "fda-device",
              "cpsc"
            ]
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Leave blank for 30 days (10 on a monitor's first run)."
          },
          "fromDate": {
            "title": "From date",
            "type": "string",
            "description": "Optional start date (YYYY-MM-DD). Overrides Days back."
          },
          "toDate": {
            "title": "To date",
            "type": "string",
            "description": "Optional end date (YYYY-MM-DD). Defaults to today."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Optional. Keep recalls whose product description, title, reason/hazard or firm name contains any of these words (case-insensitive), e.g. listeria, peanut, stroller, lithium battery, a brand name.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywordFields": {
            "title": "Match keywords in",
            "type": "array",
            "description": "Optional. Where keywords must appear. Empty = all fields (product names, title, description, reason/hazard, firm names). For example choose only Product name to avoid matches in hazard text. FDA has no title, and its product name is the product description.",
            "items": {
              "type": "string",
              "enum": [
                "productName",
                "title",
                "description",
                "reason",
                "firm"
              ],
              "enumTitles": [
                "Product name",
                "Title (CPSC)",
                "Product description",
                "Reason / hazard",
                "Firm names"
              ]
            },
            "default": []
          },
          "fdaClassifications": {
            "title": "FDA classes",
            "type": "array",
            "description": "FDA only. Class I = reasonable probability of serious harm or death; Class II = temporary or reversible harm; Class III = unlikely to cause harm. Empty = all. CPSC recalls have no class and are kept unless you choose FDA sources only.",
            "items": {
              "type": "string",
              "enum": [
                "Class I",
                "Class II",
                "Class III"
              ]
            },
            "default": []
          },
          "fdaStatus": {
            "title": "FDA recall status",
            "type": "array",
            "description": "FDA only. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "Ongoing",
                "Completed",
                "Terminated"
              ]
            },
            "default": []
          },
          "firmStates": {
            "title": "Recalling firm US states",
            "type": "array",
            "description": "FDA only. Two-letter state codes of the recalling firm (e.g. CA, MN). Empty = all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "monitorMode": {
            "title": "Monitor mode (only new recalls)",
            "type": "boolean",
            "description": "Return only recalls this monitor hasn't returned before. Schedule daily for alerts. Recalls already seen are skipped and not charged.",
            "default": false
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Name of the monitor state (letters, digits, dashes). Use different IDs for different watchlists.",
            "default": "default"
          },
          "firstRunDaysBack": {
            "title": "First monitor run: days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Monitor mode only. The first run of a new Monitor ID (nothing saved yet) looks back this many days, so it doesn't pull a long backlog. Ignored when you set Days back or From date.",
            "default": 10
          },
          "maxItems": {
            "title": "Max recalls",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many rows (0 = no limit). Prefilled 8 so a first try costs under $0.02.",
            "default": 50
          },
          "timeBudgetSeconds": {
            "title": "Time budget (seconds)",
            "minimum": 0,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop fetching after this many seconds and return what was found so far (truncated: true). 0 = no limit. Keeps AI-agent calls fast.",
            "default": 45
          },
          "descriptionMaxChars": {
            "title": "Max description length",
            "minimum": 0,
            "type": "integer",
            "description": "Truncate long product descriptions to this many characters (0 = full).",
            "default": 1000
          },
          "includeImages": {
            "title": "Include image URLs (CPSC)",
            "type": "boolean",
            "description": "Add CPSC product image URLs and captions. Images are not downloaded.",
            "default": false
          },
          "openFdaApiKey": {
            "title": "openFDA API key (optional)",
            "type": "string",
            "description": "Optional free key from open.fda.gov for high-volume use. Without it, openFDA allows 1,000 requests/day per IP. A typical run uses 1–3 FDA requests."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}