Nav Wyre Data UK Hygiene Rating API Documentation

Wyre Data - UK Restaurant API

An API to search for all restaurants, pubs, bars, hotels, cafes, coffee shops and nightclubs in the UK. Find establishment names, addresses, postcodes, food hygiene ratings, local authorities, latitudes, longitudes and plenty more!



How to test an API with Postman or cURL


To test an API endpoint you can use a free API test tool like Postman. Head over to their site to download their software:
https://www.postman.com/downloads/

Test tools like Postman save you having to build a front end to use the API. You can skip building the front end and just test the API directly, to see if it works and what data it will return. Once you have Postman you will then need to set it up.


Postman Setup

Refer to the screenshot below when you go through these 4 x steps:
1. Select 'GET' as you're making a GET request to retrieve information
2. Fill in the endpoint URL you would like to test (see below for all Wyre Data endpoints)
3. Next, select 'Headers' tab. Enter the 'key' for your RapidAPI key e.g. 'x-rapidapi-key'
4. Finally, enter the 'value' for your RapidAPI key (see section below on how to get your RapidAPI key)

postman


How to get your RapidAPI Key

1. Go to https://rapidapi.com/ and sign up for a free account
2. Search for 'Wyre Data' in the search bar, on the RapidAPI homepage, to find the API
3. Click the blue 'Subscribe to test' button to signup for Wyre Data API
4. Finally, you can find your RapidAPI key in the right hand pane 'Code Snippets' - see screenshot below:

rapidapi


Example of a successful Postman request

In this screenshot you can see the data that is returned from the endpoint. In this case the search was for the restaurant 'Baha', using the 'Find a Restaurant' endpoint. 24 x fields of data are returned. Here's the screenshot:

result2


Using CURL

From Postman you can generate the code to use CURL very easily. Just click 'code' on the right hand side and you will get a popup with the CURL code. Here's the screenshot:

curl



Optional Query Parameters

limitQuery - Applies to all endpoints, excluding Autocomplete Search and Autocomplete Details. An endpoint will return all data in the search unless you limit the query with an optional query parameter. For instance, the Local Authority search will return all establishments within its administrative area. A search against the Town endpoint will return all restaurants in that town/city. To limit the responses please use 'limitQuery' optional parameter, and give it a value. For example, a limitQuery=5 value would only return 5 x responses.

partialMatch - Applies only to Find a Restaurant endpoint. Exact matching is used when making an API request e.g. 'Mowgli' will only find the exact match 'Mowgli', not the partial match 'Mowgli Indian Takeaway'. If a town is misspelt it will not be found, even with partial matching. To include partial matches please use the optional query parameter 'partialMatch' and make sure it is equal to 'yes'. This activates partial matching on a search term.

town - Applies only to Autocomplete Search endpoint. Recommended to always use as a 'filter' parameter for the Autocomplete Search endpoint. Not using it will mean the Autocomplete Search will often retrieve only the first 5 x results where there can be far more than 5 x matching results. For example, if you use Autocomplete Search to look for 'Nandos' it will find over 100 Nandos restaurants, but only the first 5 x Nandos would get displayed in the suggestions list. So its advised to use the 'town' optional parameter to filter the results to a specific town/city, which will return all the Nandos for that place. This will produce much better results.


Important note about speed/response times - To get the quickest response time use the limitQuery optional parameter with a low number. Omitting limitQuery will add a big delay to the response time. Using the partialMatch optional parameter will also add a big delay to response times.




Endpoints

Get your API key from RapidAPI to use these endpoints.


Find a Restaurant

GET request - Enter the name of a restaurant to use this endpoint

A Wyre Data request is an HTTP URL of the following form:
https://wyre-data.p.rapidapi.com/restaurants/{restaurantName}?parameters

Base URL
https://wyre-data.p.rapidapi.com

Path
/restaurants/{restaurantName}:

Example Request - CURL
curl --location --request GET 'https://wyre-data.p.rapidapi.com/restaurants/baha' \ --header 'x-rapidapi-key: INSERT_RAPIDAPI_KEY_HERE'

Parameters
Name In Type Required Example
restaurantName path string true Mowgli
x-rapidapi-key header string true 999034d4a5msha6f68db3ab64e43p12abf2jsnabff656340a7
limitQuery query number false limitQuery=1
partialMatch query string false partialMatch=yes


Max Results
25

Example Response (JSON)
         {
        "_id": "5f0f6d598ce8aa3307824e33",
        "FHRSID": 759801,
        "BusinessName": "Mowgli Indian Bistro & Bar",
        "BusinessType": "Restaurant/Cafe/Canteen",
        "BusinessTypeID": 1,
        "AddressLine1": "43 Marina",
        "AddressLine2": "Bexhill",
        "AddressLine3": "East Sussex",
        "PostCode": "TN40 1BQ",
        "RatingValue": 1,
        "RatingKey": "fhrs_1_en-GB",
        "RatingDate": "2020-02-20",
        "LocalAuthorityCode": 106,
        "LocalAuthorityName": "Rother",
        "LocalAuthorityWebSite": "http://www.rother.gov.uk",
        "LocalAuthorityEmailAddress": "envhealth@rother.gov.uk",
        "Scores/Hygiene": 15,
        "Scores/Structural": 15,
        "Scores/ConfidenceInManagement": 20,
        "SchemeType": "FHRS",
        "NewRatingPending": false,
        "Geocode/Longitude": 0.475814,
        "Geocode/Latitude": 50.838135
    }
        
        



Find a Food Hygiene Rating for a restaurant

GET request - Enter the name of a restaurant to use this endpoint

A Wyre Data request is an HTTP URL of the following form:
https://wyre-data.p.rapidapi.com/restaurants/ratings/{restaurantName}?parameters

Base URL
https://wyre-data.p.rapidapi.com

Path
/restaurants/ratings/{restaurantName}:

Example Request - CURL
curl --location --request GET 'https://wyre-data.p.rapidapi.com/restaurants/ratings/baha' \ --header 'x-rapidapi-key: INSERT_RAPIDAPI_KEY_HERE'

Parameters
Name In Type Required Example
restaurantName path string true Green Tree
x-rapidapi-key header string true 999034d4a5msha6f68db3ab64e43p12abf2jsnabff656340a7
limitQuery query number false limitQuery=1


Max Results
25

Example Response (JSON)
          {
        "_id": "5f0f6d9d8ce8aa3307852c86",
        "BusinessName": "Green Tree",
        "BusinessType": "Pub/bar/nightclub",
        "AddressLine3": "Bedale",
        "PostCode": "DL8 1JW",
        "RatingValue": 5,
        "LocalAuthorityName": "Richmondshire"
    }
        
        


Find all Restaurants within a Town/City

GET request- Enter the name of a town/city to use this endpoint

A Wyre Data request is an HTTP URL of the following form:
https://wyre-data.p.rapidapi.com/restaurants/town/{town}?parameters

Base URL
https://wyre-data.p.rapidapi.com

Path
/restaurants/town/{town}:

Example Request - CURL
curl --location --request GET 'https://wyre-data.p.rapidapi.com/restaurants/town/hambleton' \ --header 'x-rapidapi-key: INSERT_RAPIDAPI_KEY_HERE'

Parameters
Name In Type Required Example
town path string true Hambleton
x-rapidapi-key header string true 999034d4a5msha6f68db3ab64e43p12abf2jsnabff656340a7
limitQuery query number false limitQuery=1


Max Results
No max - all results returned

Example Response (JSON)
        {
        "_id": "5f0f6d838ce8aa33078438b1",
        "BusinessName": "Conifers Nursing Home",
        "AddressLine2": "Hambleton",
        "AddressLine3": "Lancashire",
        "PostCode": "FY6 9EP",
        "RatingValue": 4
    }
        
        


Find all Restaurants within a Local Authority

GET request- Enter the name of a local authority to use this endpoint

A Wyre Data request is an HTTP URL of the following form:
https://wyre-data.p.rapidapi.com/restaurants/localauthority/{localAuthority}?parameters

Base URL
https://wyre-data.p.rapidapi.com

Path
/restaurants/localauthority/{localAuthority}:

Example Request - CURL
curl --location --request GET 'https://wyre-data.p.rapidapi.com/restaurants/localauthority/Wyre' \ --header 'x-rapidapi-key: INSERT_RAPIDAPI_KEY_HERE'

Parameters
Name In Type Required Example
localAuthority path string true Wyre
x-rapidapi-key header string true 999034d4a5msha6f68db3ab64e43p12abf2jsnabff656340a7
limitQuery query number false limitQuery=1


Max Results
No max - all results returned

Example Response (JSON)
         {
        "_id": "5f0f6d828ce8aa33078437bb",
        "BusinessName": "BELLS GUEST HOUSE AND TEA ROOMS",
        "BusinessType": "Restaurant/Cafe/Canteen",
        "AddressLine1": "Bell Farm",
        "AddressLine2": "Bradshaw Lane",
        "AddressLine3": "Pilling",
        "PostCode": "PR3 6SN",
        "RatingValue": 3,
        "LocalAuthorityName": "Wyre"
    }
        
        



Autocomplete Restaurants Search (with filter by Town)

GET request- Enter the name of a restaurant to use this endpoint

A Wyre Data request is an HTTP URL of the following form:
https://wyre-data.p.rapidapi.com/search?parameters

Base URL
https://wyre-data.p.rapidapi.com

Path
/search?parameters

Example Request - CURL
curl --location 'https://wyre-data.p.rapidapi.com/search?term=blue&town=preston' \ --header 'x-rapidapi-key: INSERT_RAPIDAPI_KEY_HERE'

Parameters
Name In Type Required Example
term query string true mowgli
x-rapidapi-key header string true 999034d4a5msha6f68db3ab64e43p12abf2jsnabff656340a7
town query string false preston


Max Results
5

Example Response (JSON)
         [
          {
              "_id": "6399f69471c0238ae6ebb8e0",
              "BusinessName": "Blue Bell Inn",
              "AddressLine2": "114 Church Street",
              "AddressLine3": "Preston"
          },
          {
              "_id": "6399f69471c0238ae6ebb8e3",
              "BusinessName": "Blue Sky",
              "AddressLine2": "4 Floyd Road",
              "AddressLine3": "Preston"
          },
          {
              "_id": "6399f69471c0238ae6ebb8e6",
              "BusinessName": "Bluebells Private Day Nursery",
              "AddressLine2": "Longsands Lane",
              "AddressLine3": "Preston"
          },
          {
              "_id": "6399f6ae71c0238ae6ed1b90",
              "BusinessName": "The Blue Pig Company",
              "AddressLine2": "Long Preston",
              "AddressLine3": "North Yorkshire",
              "AddressLine4": ""
          }
      ]
        
        



Autocomplete Details - Find by ID

GET request- Enter the restaurant _id retrieved from the Autocomplete endpoint to use this endpoint

A Wyre Data request is an HTTP URL of the following form:
https://wyre-data.p.rapidapi.com/get/{_id}

Base URL
https://wyre-data.p.rapidapi.com

Path
/get/{_id}

Example Request - CURL
curl --location 'https://wyre-data.p.rapidapi.com/get/6399f64671c0238ae6e76eed' \ --header 'x-rapidapi-key: INSERT_RAPIDAPI_KEY_HERE'

Parameters
None


Max Results
1

Example Response (JSON)
         {
          "_id": "6399f64671c0238ae6e76eed",
          "FHRSID": 369306,
          "BusinessName": "Bengal Blue",
          "BusinessType": "Restaurant/Cafe/Canteen",
          "BusinessTypeID": 1,
          "AddressLine1": "17-19 Walton Road",
          "AddressLine2": "Aylesbury",
          "AddressLine3": "Buckinghamshire",
          "PostCode": "HP21 7SR",
          "RatingValue": "3",
          "RatingKey": "fhrs_3_en-GB",
          "RatingDate": "2019-07-19",
          "LocalAuthorityCode": 21,
          "LocalAuthorityName": "Buckinghamshire",
          "LocalAuthorityWebSite": "http://www.buckinghamshire.gov.uk",
          "LocalAuthorityEmailAddress": "envhealth.av@buckinghamshire.gov.uk",
          "Scores_Hygiene": "10",
          "Scores_Structural": "10",
          "Scores_ConfidenceInManagement": "5",
          "SchemeType": "FHRS",
          "Geocode_Longitude": -0.805642,
          "Geocode_Latitude": 51.811465,
          "RatingDate_xsi:nil": "",
          "Scores": "",
          "Geocode": "",
          "AddressLine4": ""
      }
        
        


Disclaimer

Every effort is made to ensure that the information provided on this site is accurate and up to date, but no legal responsibility is accepted for any errors, omissions or misleading statements.

Data Sources

Wyre Data uses a variety of data sources. The Food Standards Agency is amongst these data providers.
Attribution statement
Contains public sector information licensed under the Open Government Licence v3.0.

The usage of FSA data is in line with the Open Government License:
https://www.nationalarchives.gov.uk/doc/open-government-licence/version/


Legal - Terms of Service

(a) No Scraping. Customer will not export, extract, or otherwise scrape Wyre Data content for use outside the Wyre Data API Services. For example, Customer will not: (i) pre-fetch, index, store, create their own datasets, reshare, or rehost Wyre Data content outside the services; (ii) bulk download Wyre Data data/API results; (iii) copy and save business names, addresses, latitudes & longitudes or food hygiene ratings; or (iv) use Wyre Data content with text-to-speech services.

(b) No Caching. Customer will not cache Wyre Data content except in the following circumstances: (i) Customer can temporarily cache latitude (lat) and longitude (lng) values from the Wyre Data API for up to 30 consecutive calendar days, after which Customer must delete the cached latitude and longitude values. (ii) Customer can temporarily cache address and food hygiene rating values from the Wyre Data API for up to 30 consecutive calendar days, after which Customer must delete the cached latitude and longitude values.

(c) No Circumventing Fees. Customer will not circumvent the applicable Fees. For example, Customer will not create multiple billing accounts or Projects to avoid incurring Fees, prevent Wyre Data from accurately calculating Customer’s Service usage levels or abuse any free Service quotas.