{
  "openapi": "3.0.1",
  "info": {
    "title": "Food Supplier & Regulatory Intelligence",
    "description": "US food supplier/product screening Actor: one-shot scan of a roster against FDA openFDA food enforcement and USDA FSIS recalls plus Safe & Suitable Ingredients. Emits evidence-linked supplier_exposure and ingredient_reference records. Not a general web scraper; not medical or legal advice.",
    "version": "0.0",
    "x-build-id": "N9qout7oo3wctbWh9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vamsi-krishna~food-supplier-regulatory-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vamsi-krishna-food-supplier-regulatory-intelligence",
        "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/vamsi-krishna~food-supplier-regulatory-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-vamsi-krishna-food-supplier-regulatory-intelligence",
        "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/vamsi-krishna~food-supplier-regulatory-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-vamsi-krishna-food-supplier-regulatory-intelligence",
        "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": {
          "region": {
            "title": "Region",
            "enum": [
              "US"
            ],
            "type": "string",
            "description": "Regulatory region to screen against. MVP supports US only (FDA openFDA food enforcement + USDA FSIS).",
            "default": "US"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "scan",
              "monitor"
            ],
            "type": "string",
            "description": "Run mode. Use scan for a one-shot roster screen against the lookback window. Use monitor for change-detection against a persisted named-KV baseline (requires a non-empty, non-default stateNamespace).",
            "default": "scan"
          },
          "lookbackDays": {
            "title": "Lookback days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "How many days of historical FDA/FSIS recall and enforcement records to include when scanning (ingredient table is not date-windowed the same way).",
            "default": 365
          },
          "sources": {
            "title": "Sources",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Official US data sources to query. FDA_FOOD_ENFORCEMENT and USDA_FSIS_RECALLS produce supplier_exposure records; USDA_FSIS_INGREDIENTS produces ingredient_reference records only.",
            "items": {
              "type": "string",
              "enum": [
                "FDA_FOOD_ENFORCEMENT",
                "USDA_FSIS_RECALLS",
                "USDA_FSIS_INGREDIENTS"
              ],
              "enumTitles": [
                "FDA Food Enforcement (openFDA)",
                "USDA FSIS Recalls",
                "USDA FSIS Safe & Suitable Ingredients"
              ]
            },
            "default": [
              "FDA_FOOD_ENFORCEMENT",
              "USDA_FSIS_RECALLS",
              "USDA_FSIS_INGREDIENTS"
            ]
          },
          "suppliers": {
            "title": "Suppliers",
            "type": "array",
            "description": "Supplier/manufacturer roster to match against recalling firms and related official fields. Provide legal/trade names, aliases, and optional FDA establishment identifiers — required for useful supplier_exposure hits.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "title": "Supplier ID",
                  "type": "string",
                  "description": "Optional stable identifier for this supplier in your catalog.",
                  "editor": "textfield"
                },
                "name": {
                  "title": "Name",
                  "type": "string",
                  "description": "Legal or trade name of the supplier or manufacturer.",
                  "editor": "textfield"
                },
                "aliases": {
                  "title": "Aliases",
                  "type": "array",
                  "description": "Alternate names, DBAs, or abbreviations used for matching.",
                  "editor": "stringList",
                  "items": {
                    "type": "string"
                  }
                },
                "country": {
                  "title": "Country",
                  "type": "string",
                  "description": "ISO country code or country name associated with the supplier (context only in MVP).",
                  "editor": "textfield"
                },
                "fdaEstablishmentId": {
                  "title": "FDA establishment ID",
                  "type": "string",
                  "description": "Optional FDA establishment identifier when known. Matching is only applied when the selected source exposes the field.",
                  "editor": "textfield"
                }
              }
            }
          },
          "products": {
            "title": "Products",
            "type": "array",
            "description": "Product roster to screen for product-level matches and ingredient_reference lookups. Include brand, manufacturer linkage, ingredient names, and optional GTIN/UPC/lot identifiers.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "title": "Product ID",
                  "type": "string",
                  "description": "Optional stable identifier for this product in your catalog.",
                  "editor": "textfield"
                },
                "name": {
                  "title": "Name",
                  "type": "string",
                  "description": "Product name as it appears in your catalog.",
                  "editor": "textfield"
                },
                "brand": {
                  "title": "Brand",
                  "type": "string",
                  "description": "Brand or label name associated with the product.",
                  "editor": "textfield"
                },
                "manufacturer": {
                  "title": "Manufacturer",
                  "type": "string",
                  "description": "Manufacturer or recalling-firm style name used for matching.",
                  "editor": "textfield"
                },
                "supplierId": {
                  "title": "Supplier ID",
                  "type": "string",
                  "description": "Optional link to a supplier.id in the suppliers roster.",
                  "editor": "textfield"
                },
                "ingredients": {
                  "title": "Ingredients",
                  "type": "array",
                  "description": "Ingredient names to compare against FSIS Safe & Suitable Ingredients and product descriptions.",
                  "editor": "stringList",
                  "items": {
                    "type": "string"
                  }
                },
                "gtin": {
                  "title": "GTIN",
                  "type": "string",
                  "description": "Optional Global Trade Item Number. Used only when a source exposes compatible identifiers.",
                  "editor": "textfield"
                },
                "upc": {
                  "title": "UPC",
                  "type": "string",
                  "description": "Optional Universal Product Code. Used only when a source exposes compatible identifiers.",
                  "editor": "textfield"
                },
                "lotNumber": {
                  "title": "Lot number",
                  "type": "string",
                  "description": "Optional lot or batch code. Used only when a source exposes lot-level detail.",
                  "editor": "textfield"
                }
              }
            }
          },
          "matchThreshold": {
            "title": "Match threshold",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Minimum fuzzy-match score (0–100) required to keep a candidate match. Exact and alias matches are always retained. Match confidence is independent of regulatory severity.",
            "default": 85
          },
          "maxRecords": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of supplier_exposure and ingredient_reference records to push to the dataset (0 = unlimited). Truncation is reported in SCAN_SUMMARY.",
            "default": 1000
          },
          "openFdaApiKey": {
            "title": "openFDA API key",
            "type": "string",
            "description": "Optional openFDA API key for higher rate limits on FDA_FOOD_ENFORCEMENT. Leave empty to use anonymous quotas. Stored encrypted when provided."
          },
          "emitBaselineMatches": {
            "title": "Emit baseline matches",
            "type": "boolean",
            "description": "Monitor first-run behavior when no baseline exists yet. If false (default), write a silent baseline and push zero dataset items. If true, push all current matches marked as baseline on the first monitor run. Ignored for mode=scan.",
            "default": false
          },
          "stateNamespace": {
            "title": "State namespace",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{1,63}$",
            "type": "string",
            "description": "Named key-value isolation namespace for monitor baselines (opens store fsri-state-{namespace}). Required for mode=monitor: must not be empty or the literal default (use a unique tenant/watchlist id). Scan may use default. Pattern: starts with a letter or digit, then 1–63 letters, digits, dots, underscores, or hyphens (^[A-Za-z0-9][A-Za-z0-9._-]{1,63}$)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}