{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Food Business Leads - New Openings & Hygiene Fails",
    "description": "Find UK food businesses at the moment they need you: the ones that just registered and are awaiting their first inspection, and the ones that just failed a hygiene inspection. Swept from all 363 local authority registers via the official Food Standards Agency API.",
    "version": "1.0",
    "x-build-id": "sWca6i0fdoSTGcMD7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wellbuilt_zythem~uk-food-business-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wellbuilt_zythem-uk-food-business-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/wellbuilt_zythem~uk-food-business-leads/runs": {
      "post": {
        "operationId": "runs-sync-wellbuilt_zythem-uk-food-business-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/wellbuilt_zythem~uk-food-business-leads/run-sync": {
      "post": {
        "operationId": "run-sync-wellbuilt_zythem-uk-food-business-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": {
          "onlyNewlyRegistered": {
            "title": "Only newly registered businesses (awaiting first inspection)",
            "type": "boolean",
            "description": "The highest-intent filter. A business awaiting its first hygiene inspection has just registered: it is opening, and it is buying everything at once.",
            "default": false
          },
          "onlyNeedingHelp": {
            "title": "Only businesses that failed (rating 0-2, or Improvement Required)",
            "type": "boolean",
            "description": "A business rated 0, 1 or 2 has an urgent, public, time-limited problem. Works for both the English 0-5 scale and the Scottish pass/fail scheme.",
            "default": false
          },
          "ratedWithinDays": {
            "title": "Rated within the last N days",
            "minimum": 0,
            "type": "integer",
            "description": "Only businesses inspected recently. Combine with the rating filter to get this month's failures rather than every failure ever. 0 means no date limit.",
            "default": 0
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Filter by FSA region. Leave empty for the whole UK.",
            "items": {
              "type": "string",
              "enum": [
                "London",
                "South East",
                "North West",
                "Scotland",
                "East Counties",
                "South West",
                "Yorkshire and Humberside",
                "West Midlands",
                "East Midlands",
                "Wales",
                "North East",
                "Northern Ireland"
              ],
              "enumTitles": [
                "London (81,519)",
                "South East (79,389)",
                "North West (65,626)",
                "Scotland (59,052)",
                "East Counties (54,027)",
                "South West (54,454)",
                "Yorkshire and Humberside (50,627)",
                "West Midlands (50,235)",
                "East Midlands (43,939)",
                "Wales (34,257)",
                "North East (23,019)",
                "Northern Ireland (16,948)"
              ]
            },
            "default": []
          },
          "localAuthorities": {
            "title": "Local authorities",
            "type": "array",
            "description": "Filter by council name, case-insensitive and partial. Typing \"cambridge\" matches Cambridge City, East Cambridgeshire and South Cambridgeshire.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "businessTypes": {
            "title": "Business types",
            "type": "array",
            "description": "Filter by the FSA's own business type. Leave empty for all of them.",
            "items": {
              "type": "string",
              "enum": [
                "Restaurant/Cafe/Canteen",
                "Takeaway/sandwich shop",
                "Pub/bar/nightclub",
                "Hotel/bed & breakfast/guest house",
                "Retailers - other",
                "Retailers - supermarkets/hypermarkets",
                "Mobile caterer",
                "Other catering premises",
                "Manufacturers/packers",
                "Distributors/Transporters",
                "Farmers/growers",
                "School/college/university",
                "Hospitals/Childcare/Caring Premises",
                "Importers/Exporters"
              ]
            },
            "default": []
          },
          "maxRatingScore": {
            "title": "Maximum rating score (0-5)",
            "minimum": -1,
            "maximum": 5,
            "type": "integer",
            "description": "Finer than the failure switch. 3 gives you everything below a good rating. Leave at -1 to ignore.",
            "default": -1
          },
          "onlyWithCoordinates": {
            "title": "Only businesses with coordinates",
            "type": "boolean",
            "description": "About 80% carry latitude and longitude. Turn this on if you are plotting them or assigning territories.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many records. Leave at 0 for no limit. The whole UK is over 613,000 establishments, so set this unless you mean it.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}