Pint of Plain API

You can access (some) of the data in the Pint of Plain database through a rather crude API I've knocked up.

Like the rest of this project, this is more a way of me to experiment with these services so if you do end up using these don't be too surprised if they change in unexpected ways.

There are two interfaces - JSON and XML. Neither actually do much at the moment. Over the coming weeks I'll be expanding these to expose all of the functionality of the site.

XML API

There are three available functions through the API. You can get a list of bars, search the database and get information on a specific bar.

barlist: http://pintofplain.com/api/rest/xml/pid/barlist/

Optional Paramters

  • start int default 0
  • limit int default 10
  • order string (name|latest)

This function will return a list of the bars in the database. By default it returns the 10 most recently added bars.

Start determines where in the list of bars the start point is.

Limit determines the number of bars returned. A maxium of 50 will be return for any one request.

Order can be 'name' or 'latest'. 'name' returns a list ordered alapbetically by bar name. 'latest' orders the list by most recently added.

For each bar, the following is returned: bar_id, bar name, street, city, postcode, county, latitude, longitude

Example

To return a list of 20 bars starting at the 10th and ordered by name you would use the following: http://pintofplain.com/api/rest/xml/pid/barlist/start/10/limit/20/order/name/

search: http://pintofplain.com/api/rest/xml/pid/search/

Optional Paramters

  • name string
  • street string
  • city string
  • postcode string

This function allows you to seach for a bar using any of the optional paramters. Each of the paramters takes a string as the input.

Example

Find the bars on Dorset Street: http://pintofplain.com/api/rest/xml/pid/search/street/dorset/

bar: http://pintofplain.com/api/rest/xml/pid/bar/bar_id/{bar_id}

Paramters

  • bar_id int

This function will return the details of a single bar. One paramter is required, the bar_id. This id can be found using the barlist or search functions.

For each bar, the following is returned: bar_id, bar name, street, city, postcode, county, review, review date, reviewer id, rating, toilet rating, latitude, longitude

Example

To get the details of Mulligan's you would use the following url: http://pintofplain.com/api/rest/xml/pid/bar/bar_id/78

JSON API

You can expose the available functions through the url http://pintofplain.com/api/rest/json/