{
  "openapi": "3.0.1",
  "info": {
    "title": "Food Hygiene Ratings Scraper",
    "description": "Scrape UK food hygiene ratings for restaurants, cafés, takeaways, pubs, hotels and shops. Filter by name, postcode, council, business type and rating. Get address, postcode, coordinates, rating and date, inspection scores and the council's contact details. Open data, no login or proxy.",
    "version": "1.0",
    "x-build-id": "pHFQw3hGDSt0VSROS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/anyxsolutions~food-hygiene-ratings-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-anyxsolutions-food-hygiene-ratings-scraper",
        "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/anyxsolutions~food-hygiene-ratings-scraper/runs": {
      "post": {
        "operationId": "runs-sync-anyxsolutions-food-hygiene-ratings-scraper",
        "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/anyxsolutions~food-hygiene-ratings-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-anyxsolutions-food-hygiene-ratings-scraper",
        "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": {
          "startUrls": {
            "title": "Food hygiene rating URLs",
            "type": "array",
            "description": "Public ratings.food.gov.uk pages: a search (https://ratings.food.gov.uk/business-search?business-name-search=pizza&address-search=london), a local authority search (https://ratings.food.gov.uk/authority-search-landing/528) or a business page (https://ratings.food.gov.uk/business/1158712/pizza-pilgrims).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "businessName": {
            "title": "Business name",
            "type": "string",
            "description": "Find businesses whose name contains these words, for example Costa or pizza."
          },
          "address": {
            "title": "Address or postcode",
            "type": "string",
            "description": "Find businesses at an address, town or postcode, for example Manchester, SE1 or SE1 2ER."
          },
          "localAuthorities": {
            "title": "Local authorities",
            "type": "array",
            "description": "Only return businesses inspected by these councils, one per line, for example Southwark, Manchester or City of Edinburgh. Each council runs as its own search.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "enum": [
              "England",
              "Northern Ireland",
              "Scotland",
              "Wales"
            ],
            "type": "string",
            "description": "Only return businesses in this UK country. Ignored when local authorities are set."
          },
          "businessType": {
            "title": "Business type",
            "enum": [
              "restaurant-cafe-canteen",
              "takeaway-sandwich-shop",
              "pub-bar-nightclub",
              "hotel-bed-breakfast-guest-house",
              "mobile-caterer",
              "other-catering-premises",
              "retailers-supermarkets-hypermarkets",
              "retailers-other",
              "school-college-university",
              "hospitals-childcare-caring-premises",
              "manufacturers-packers",
              "distributors-transporters",
              "importers-exporters",
              "farmers-growers"
            ],
            "type": "string",
            "description": "Only return businesses of this type, such as restaurants and cafés, takeaways, pubs or hotels."
          },
          "rating": {
            "title": "Rating",
            "enum": [
              "5",
              "4",
              "3",
              "2",
              "1",
              "0",
              "Pass",
              "ImprovementRequired",
              "AwaitingPublication",
              "AwaitingInspection",
              "Exempt"
            ],
            "type": "string",
            "description": "Only return businesses with this rating: 0 to 5 in England, Wales and Northern Ireland, Pass or Improvement Required in Scotland, or a status such as Awaiting Inspection or Exempt."
          },
          "ratingComparison": {
            "title": "Rating comparison",
            "enum": [
              "equal",
              "atLeast",
              "atMost"
            ],
            "type": "string",
            "description": "How a 0 to 5 rating is matched: exactly, that rating or better, or that rating or worse. Statuses are always matched exactly.",
            "default": "equal"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "ratingHighest",
              "ratingLowest",
              "nameAsc",
              "nameDesc"
            ],
            "type": "string",
            "description": "Order of results for the filter search: best match, rating (highest or lowest first) or business name (A to Z or Z to A).",
            "default": "relevance"
          },
          "maxItems": {
            "title": "Maximum businesses per source",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of businesses to return per URL or local authority. Leave empty for every matching business."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Food hygiene ratings are open data and need no proxy.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}