- How does the OpenlyLocal API work?
Openly Local is a uses a REST-based API. Specifically, each item (or 'Resource') has its own unique URL and the information is returned in different formats depending on the format requested via the URL. Data can be be returned as XML, JSON or, experimentally, RDFa.
So, for example, to see the HTML information on Aberdeen City Council go to http://news.openlylocal.com/councils/37-Aberdeen-City-Council
To see the XML, go to the same URL with '.xml' added to the end of the URL, i.e. http://news.openlylocal.com/councils/37-Aberdeen-City-Council.xml
To see the JSON version, go to the same URL with '.json' added to the end of the URL, i.e. http://news.openlylocal.com/councils/37-Aberdeen-City-Council.json
Note that you can omit the title of the resource from the end of the URL and leave just the ID. The title is there just for readability and SEO. So http://news.openlylocal.com/councils/37.xml and http://news.openlylocal.com/councils/37.json will work just as well.
The RDFa is embedded in the HTML so the URL is obviously the same. There is also a vocabulary page for the RDFa. Please contact us if you are likely to use the RDFa extensively and we can liaise on the information we are exposing in this way
Finally, there are links at the bottom of pretty much every page to the XML or JSON representation of the information.
- Will the structure of the API change?
- It's possible as we understand better how best to get the information out there, and respond to requests from people and sites using the data. If the data provided by the site is critical, please contact us, and we'll try to make sure we notify you prior to any changes.
- Where's the documentation?
- You're reading it. Seriously, at the moment we've been concentrating on extracting the data and making it available in a simple to use way. We've deliberately tried to use sensible naming conventions and structure to make it easy for anyone with any programming experience understand
- What's the licence?
- Some of the information is Crown Copyright, and you'll need a Click-Use Licence for that. Other information is nominally copyright the Local Authority concerned -- we feel that no council in their right mind could reasonably object to wider distribution of its democratic data; whether you wish to take the same attitude is, however, up to you. Still other is copyright OpenlyLocal, and while we're still looking at the exact licence we should use, we strong believe in open data and the one we choose will at the minimum allow full non-commercial use with attribution.
- I need some data you're not exposing
- Email us at and we'll see what we can do
More info on specific api calls
This is the starting point and returns a list of local authorities that we have opened up data for (see also /councils/all.xml below)
It includes each authority's basic information, including address, telephone, website etc, as well as the OpenlyLocal id, which is used in calls to get detailed information about each council. It also includes the several other identifiers for the authority, including ONS SNAC code, WhatDoTheyKnow.com name and Wikipedia url.
This returns the same information as councils.xml but returns information for all of the UK's councils, and thus can act as a lookup table (see also Full list of councils now online and accessible via API) for cross-referencing different identifiers for the local authorities (e.g. SNAC id and wikipedia page)
This returns information for the given council, including a list of its members, active committees, wards and forthcoming meetings. Note, usually only the id, title, url and OpenlyLocal url of these items are returned, and a further API call will need to be made to the appropriate URL for the detailed information for the item. It also returns recent activity for the council, i.e. new and updated records
Returns all forthcoming meetings for the committee.
By default returns all meetings for the committee, including those in the past (returns most recent first).
- 30/11/09 Added RDF representations for councils, wards, members, police_forces. Added #parent_council to show parent county council for district councils, and #child_councils to show child district councils for county council. Added #twitter_account to council attributes, also #police_force.
- 08/10/09 Recent activity (new and updated members, committees, meetings) is now returned when info for a particular council is requested
- 29/09/09 Ward info returned with member is now full info for the ward (e.g. title, id, ONS Snac ID, Local Authority URL), not just the ID