{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Food Hygiene Ratings — New & Changed Alerts",
    "description": "UK food hygiene ratings: search the official Food Standards Agency register by council, business name or type, or watch an area and get alerts only for new establishments and rating changes. Pay per record, no start fee.",
    "version": "0.0",
    "x-build-id": "pqXamg2oglxaaFMnA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/magnova~uk-food-hygiene-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-magnova-uk-food-hygiene-monitor",
        "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/magnova~uk-food-hygiene-monitor/runs": {
      "post": {
        "operationId": "runs-sync-magnova-uk-food-hygiene-monitor",
        "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/magnova~uk-food-hygiene-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-magnova-uk-food-hygiene-monitor",
        "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": {
          "businessTypeId": {
            "title": "Business type ID",
            "minimum": 1,
            "type": "integer",
            "description": "The FSA business type ID: 1 = Restaurant/Cafe/Canteen, 7844 = Takeaway/sandwich shop, 7843 = Pub/bar/nightclub, 7842 = Hotel/bed & breakfast/guest house, 7840 = Retailers - supermarkets/hypermarkets, 4613 = Retailers - other, 7846 = Mobile caterer, 7841 = Other catering premises, 7845 = School/college/university, 5 = Hospitals/Childcare/Caring Premises, 7839 = Manufacturers/packers, 7838 = Farmers/growers, 7 = Distributors/Transporters, 14 = Importers/Exporters. Works alone (whole UK) or combined."
          },
          "localAuthorityId": {
            "title": "Local authority ID",
            "minimum": 1,
            "type": "integer",
            "description": "The FSA local authority (council) ID to search: 120 = Westminster, 93 = Camden, 374 = Birmingham, 180 = Manchester, 197 = Aberdeen City. One of the 363 authorities in the FSA register. Combine with name or businessTypeId to narrow further, or leave unset and filter by name or type alone."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum establishment records delivered per run (1-1000). Extra matching establishments beyond this are not delivered or charged. On a watch's first check this is also the baseline delivery size (the full matching set is still remembered); later checks deliver at most this many new/change alerts.",
            "default": 100
          },
          "maxTotalChargeUsd": {
            "title": "Max total charge (USD)",
            "type": "number",
            "description": "Optional hard cap on the total charge for this run, in USD, shared across establishment records and rating-change alerts. The run stops delivering charged records before the cap would be exceeded; ERROR and SUMMARY records are always free."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "watch"
            ],
            "type": "string",
            "description": "Search returns every matching establishment now. Watch stores the current matching set in the actor's storage: the first watch run returns it as a baseline, later runs return only establishments that are NEW or whose rating CHANGED since the previous check. Run watch mode on a schedule (or call the server URL) to track a council area, a chain name, or a business type.",
            "default": "search"
          },
          "name": {
            "title": "Business name contains",
            "type": "string",
            "description": "Only establishments whose business name contains this text (case-insensitive), e.g. a chain name like Greggs or Costa. Up to 100 characters. Works alone (searches the whole UK) or combined with a local authority or business type."
          },
          "rating": {
            "title": "Rating filter",
            "enum": [
              "0",
              "1",
              "2",
              "3",
              "4",
              "5",
              "Pass",
              "ImprovementRequired",
              "AwaitingInspection",
              "AwaitingPublication",
              "Exempt"
            ],
            "type": "string",
            "description": "Only establishments with this rating. 0-5 are the FHRS ratings for England, Wales and Northern Ireland; Pass / ImprovementRequired are Scotland's FHIS outcomes (a numeric filter matches nothing in Scotland, and vice versa). AwaitingInspection finds newly registered businesses that have not been inspected yet. Leave unset for all ratings."
          },
          "ratingOperator": {
            "title": "Rating comparison",
            "enum": [
              "Equal",
              "LessThanOrEqual",
              "GreaterThanOrEqual"
            ],
            "type": "string",
            "description": "How the rating filter compares: Equal (default), LessThanOrEqual (e.g. rating 2 = every establishment rated 2, 1 or 0 — the low-rated list), or GreaterThanOrEqual. Only applies when a rating is set, and comparisons only rank the numeric 0-5 FHRS ratings.",
            "default": "Equal"
          },
          "sinceDate": {
            "title": "Rated since (YYYY-MM-DD)",
            "type": "string",
            "description": "Caller-held cursor: only establishments whose rating date is on or after this date (YYYY-MM-DD) are delivered. Establishments with no rating date yet (awaiting inspection) are left out while a cursor is set. Applied on top of the other filters, in both modes."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}