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. 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.


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"
    }
        
        


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.