{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Food Hygiene Ratings (FSA) — Scraper & API",
    "description": "Search the official UK Food Hygiene Rating Scheme by business name, postcode, council, business type, rating, rating date or distance. Tidy rows with rating, address, geo, inspection scores and council contact. No API key. Pay per result.",
    "version": "1.0",
    "x-build-id": "vXyKlQMR1Rdjp8G7Z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/powerfully_goliath~uk-food-hygiene/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-powerfully_goliath-uk-food-hygiene",
        "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/powerfully_goliath~uk-food-hygiene/runs": {
      "post": {
        "operationId": "runs-sync-powerfully_goliath-uk-food-hygiene",
        "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/powerfully_goliath~uk-food-hygiene/run-sync": {
      "post": {
        "operationId": "run-sync-powerfully_goliath-uk-food-hygiene",
        "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": {
          "businessName": {
            "title": "Business name",
            "type": "string",
            "description": "Whole or part of the trading name, e.g. 'Greggs' or 'Pizza'."
          },
          "address": {
            "title": "Address, town or postcode",
            "type": "string",
            "description": "Free-text address search: a full postcode (LS1 4DT), a postcode district (LS1), a street or a town."
          },
          "localAuthorities": {
            "title": "Local authorities (councils)",
            "type": "array",
            "description": "Council names as the FSA lists them, e.g. 'Leeds', 'Westminster', 'Cardiff', 'Belfast City', 'Aberdeen City' — or their numeric FSA LocalAuthorityId. Each council is searched in turn.",
            "items": {
              "type": "string"
            }
          },
          "businessTypes": {
            "title": "Business types",
            "type": "array",
            "description": "Only these kinds of premises. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "Distributors/Transporters",
                "Farmers/growers",
                "Hospitals/Childcare/Caring Premises",
                "Hotel/bed & breakfast/guest house",
                "Importers/Exporters",
                "Manufacturers/packers",
                "Mobile caterer",
                "Other catering premises",
                "Pub/bar/nightclub",
                "Restaurant/Cafe/Canteen",
                "Retailers - other",
                "Retailers - supermarkets/hypermarkets",
                "School/college/university",
                "Takeaway/sandwich shop"
              ],
              "enumTitles": [
                "Distributors/Transporters",
                "Farmers/growers",
                "Hospitals/Childcare/Caring Premises",
                "Hotel/bed & breakfast/guest house",
                "Importers/Exporters",
                "Manufacturers/packers",
                "Mobile caterer",
                "Other catering premises",
                "Pub/bar/nightclub",
                "Restaurant/Cafe/Canteen",
                "Retailers - other",
                "Retailers - supermarkets/hypermarkets",
                "School/college/university",
                "Takeaway/sandwich shop"
              ]
            }
          },
          "rating": {
            "title": "Hygiene rating",
            "enum": [
              "any",
              "5",
              "4",
              "3",
              "2",
              "1",
              "0",
              "Pass",
              "ImprovementRequired",
              "AwaitingInspection",
              "AwaitingPublication",
              "Exempt"
            ],
            "type": "string",
            "description": "England, Wales and Northern Ireland use 0-5 (FHRS). Scotland uses Pass / Improvement Required (FHIS).",
            "default": "any"
          },
          "ratingOperator": {
            "title": "Rating match",
            "enum": [
              "equal",
              "atLeast",
              "atMost"
            ],
            "type": "string",
            "description": "For a 0-5 rating: exactly, or that rating and better/worse. 'At most 2' finds the poorly rated premises.",
            "default": "equal"
          },
          "schemeType": {
            "title": "Scheme",
            "enum": [
              "any",
              "FHRS",
              "FHIS"
            ],
            "type": "string",
            "description": "Which national scheme to search. Leave on 'Both' unless you only want one.",
            "default": "any"
          },
          "ratedSince": {
            "title": "Rated on or after",
            "type": "string",
            "description": "Only premises whose rating date is on/after this date — e.g. 2026-01-01, or '30 days' for recent inspections. Premises with no rating date are left out when this is set."
          },
          "ratedBefore": {
            "title": "Rated on or before",
            "type": "string",
            "description": "Only premises whose rating date is on/before this date."
          },
          "latitude": {
            "title": "Latitude",
            "minimum": 49,
            "maximum": 61.5,
            "type": "number",
            "description": "Centre of a radius search, e.g. 53.7951."
          },
          "longitude": {
            "title": "Longitude",
            "minimum": -8.7,
            "maximum": 2,
            "type": "number",
            "description": "Centre of a radius search, e.g. -1.5476."
          },
          "radiusMiles": {
            "title": "Radius",
            "minimum": 0.01,
            "maximum": 50,
            "type": "number",
            "description": "Search radius around the latitude/longitude. Default 1 mile."
          },
          "fhrsIds": {
            "title": "FHRS IDs",
            "type": "array",
            "description": "Look up specific establishments by their FHRSID (the number in a ratings.food.gov.uk/business/... link).",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "ratingHighFirst",
              "ratingLowFirst",
              "nameAZ",
              "nameZA",
              "distance"
            ],
            "type": "string",
            "description": "Order of results as returned by the FSA.",
            "default": "relevance"
          },
          "includeScores": {
            "title": "Include inspection scores",
            "type": "boolean",
            "description": "Add the hygiene, structural and confidence-in-management points (lower is better; 0 is best).",
            "default": true
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Stop after this many establishments. You are charged only for results delivered.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}