UK food hygiene ratings data API

Who knows, perhaps a software developer will use the UK food hygiene ratings API and a number of others to overlay restaurant ratings, bus stops and local weather on an interactive map... offering a perfect service for non-drivers looking to go al fresco at a hygienic restaurant on a sunny day?

This is the type of innovation the Food Standards Agency actively encourages, and to help, the FSA has set up this Food hygiene rating data forum to raise awareness of the API, get people talking about possible applications, and learn whether the API can be made more usable. The forum is also a good place for sharing updates.

About the data

The geocoded food hygiene rating data, which is free to use, provides the food hygiene rating or inspection result given to a business and reflects the standards of food hygiene found on the date of inspection or visit by the local authority. Businesses include restaurants, pubs, cafés, takeaways, hotels and other places consumers eat, as well as supermarkets and other food shops.

You can search for ratings online and read more about ratings at www.food.gov.uk/ratings.

The data is held on behalf of local authorities participating in either the Food Standards Agency's:

  • national Food Hygiene Rating Scheme (FHRS) in England, Northern Ireland and Wales, or
  • Food Hygiene Information Scheme (FHIS) in Scotland

API and images

You cna read more about the API and the 'ready to go' set of hygiene rating images at different resolutions at www.food.gov.uk/hygiene-rating-open-data

Ideas factory

So, can you think of any applications for the data, or perhaps able to share any good apps already using the API?

Comments

Hiya,Great dataset/API - I

Hiya,

Great dataset/API - I have put together a prototype application using your dataset (see http://www.ebusinessconsultant.co.uk/food-hygiene-rating/)  I am still trying to figure out how to use the data for something more productive.

I haven't imported all the data into the application but I will write something to auto fetch the XML files when I get a chance.

Once again, thanks for the dataset.

 Flag as offensive 

Usable data?

Hi michaelg, good to see another application out there using our food hygiene rating data! How did you get on with your plan to auto fetch the XML files? If you have any feedback on how we can make the XML files and API more usable, please let us know :) You and others might be interested to know that we are currently carrying out work to make the API more consumable. For example, including better documentation and calls to the sever. The upgraded API should be available sometime over the next few weeks. To keep up to date on developments on this, you might like to subscribe to our ‘UK food hygiene ratings data and API’ mailing list? You can do that via this link: https://public.govdelivery.com/accounts/UKFSA/subscriber/new?topic_id=UKFSA_41 Thanks for your interest in our data.

 Flag as offensive 

Hi D,

Hi D,

I wrote a small script to get the content of the authorities file (http://ratings.food.gov.uk/authorities/xml). For each <LocalAuthority /> in the file, fetch the XML file using the URL in <FileName />, parse the content and store in a MySQL table.  I run the script as a monthly cron job - so the process is automated - unmanned!

Like many of these services - its works until the provider decides to change their service ;)  It was a fun project to do.  Thank you for providing the data.

Michael G

 Flag as offensive 

Help us with developing our ratings widget

Hi Michale, I am in the process of look into adding this on a website. But my current website developer is not good with this API?

Can you or anyone here help?

Thanks

T

 Flag as offensive 

Hi MacT,

Hi MacT,

Happy to help. Send me an email (via http://www.creotec.com) with your requirements (and your website URL).

MG

 Flag as offensive 

Nice initial use of the data Michael

michaelg, just checked out your application and it's a nice representation of how to visualise the data and integrate it with other applications.

I done a quick check on a London McDonald's to see it had a 5/5 rating with a lot of good secondary data and a map overlay. Data could integrate well to a restaurant review site or something similar!

 Flag as offensive 

Wordpress integration

Hi

I am trying to create a simple FHR search facility for my wordpress page. Not sure how I would do this with an api as this is my first attempt. I wondered if you had some pointers to start me off on my quest.

Thanks in advance

 Flag as offensive 

A question.

Food hygiene is an ever interesting theme.

But this forum is somewhat sleepy. Is here people who actively use the FHR data on their sites? Is it easy to get help if something happens?

 Flag as offensive 

Great article

Thank you for this article.

I was able to inegrate food hygiene rating to my directory of UK takeaways. I fetch the xml file supplied with curl and its prety straight forward. Link would be as simple as http://ratings.food.gov.uk/search/en-gb/{$resName}/{$resPostcode}/xml in case anyone else was looking to this. I fetched curl output as $feedXml and reading the rating with a loop on $feedXml->EstablishmentCollection->EstablishmentDetail on $rating = $item->RatingValue.

I believe this is a great use for the rating

directory can be seen at takeawaydirectory.co.uk.

Thanks again

 Flag as offensive