{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Food Business First-Seen Leads",
    "description": "Track FHRS food businesses first observed after your prior complete scan. Filter by council, region, business type and rating. No opening-date claims or private contacts.",
    "version": "1.0",
    "x-build-id": "Bwf6t2xpJ637ANZN9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/afkdigital~uk-food-business-first-seen-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-afkdigital-uk-food-business-first-seen-leads",
        "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/afkdigital~uk-food-business-first-seen-leads/runs": {
      "post": {
        "operationId": "runs-sync-afkdigital-uk-food-business-first-seen-leads",
        "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/afkdigital~uk-food-business-first-seen-leads/run-sync": {
      "post": {
        "operationId": "run-sync-afkdigital-uk-food-business-first-seen-leads",
        "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": {
          "localAuthorityId": {
            "title": "FSA Local Authority ID",
            "minimum": 1,
            "type": "integer",
            "description": "Preferred exact local authority identifier, e.g. 321 Isles of Scilly."
          },
          "localAuthority": {
            "title": "Local authority name",
            "maxLength": 100,
            "type": "string",
            "description": "Exact case-insensitive official local authority name. Alternative to numeric ID."
          },
          "region": {
            "title": "FSA region name",
            "maxLength": 100,
            "type": "string",
            "description": "Exact official region, e.g. London, South West, Scotland. May cover many authorities."
          },
          "businessTypeId": {
            "title": "FSA Business Type ID",
            "minimum": 1,
            "type": "integer",
            "description": "Optional API business-type filter."
          },
          "businessType": {
            "title": "Business type includes",
            "maxLength": 100,
            "type": "string",
            "description": "Optional case-insensitive substring of FSA BusinessType."
          },
          "keyword": {
            "title": "Business name keyword",
            "maxLength": 100,
            "type": "string",
            "description": "Optional case-insensitive keyword within the business name, NOT an email/phone search."
          },
          "dateFrom": {
            "title": "Inspection date from (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional RatingDate lower bound, NOT registration/opening date."
          },
          "dateTo": {
            "title": "Inspection date to (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional RatingDate upper bound, NOT registration/opening date."
          },
          "ratingMin": {
            "title": "Minimum numeric hygiene rating",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Optional inclusive 0–5 FHRS rating; pending, exempt and FHIS ratings are not numeric."
          },
          "ratingMax": {
            "title": "Maximum numeric hygiene rating",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Optional inclusive 0–5 FHRS rating."
          },
          "resultLimit": {
            "title": "Maximum new leads per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Other new leads are retained as pending in the snapshot; full scan is still required.",
            "default": 100
          },
          "monitorId": {
            "title": "Persistent monitor ID",
            "maxLength": 64,
            "type": "string",
            "description": "Unique ID (3–64 letters, digits, _ or -) to persist observations in an isolated named Apify KV store. Without this, use an Actor task or previousSnapshot."
          },
          "previousSnapshot": {
            "title": "Previous snapshot JSON",
            "type": "string",
            "description": "Optional entire SNAPSHOT JSON returned by previous successful run with exactly the same matching filters. Overrides saved monitor state."
          },
          "pageSize": {
            "title": "Requested page size",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Controls FHRS scanning: pageSize",
            "default": 100
          },
          "maxPages": {
            "title": "Maximum establishment pages",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Safely fail incomplete scans; do not charge or update state.",
            "default": 150
          },
          "maxAuthorities": {
            "title": "Maximum authorities",
            "minimum": 1,
            "maximum": 400,
            "type": "integer",
            "description": "Controls FHRS scanning: maxAuthorities",
            "default": 40
          },
          "requestDelayMs": {
            "title": "Minimum FSA request interval (ms)",
            "minimum": 1000,
            "maximum": 30000,
            "type": "integer",
            "description": "Single-threaded API requests. FSA does not publish a fixed throttle limit.",
            "default": 1250
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}