A more task-oriented view about how to get stuff done with the API.
The following steps are needed in general to work with the API:
- Select the API version you want to work with. At the moment there is only one choice: v1
- Authorization: add your consumer key as a query paramter or use OAuth as described in the Authentication Overview.
- Set up the user interface language you want results to be in, the easiest way is to set the
- Specify which format you want your response. The easiest way is to set the
- Select the resource and any query parameters you need.
- Build the request. The request consists of the full URL to the API itself, plus the name of any parameters and their values.
- Invoke the request. Depending on the request, you invoke it with the appropriate HTTP method: GET, PUT, DELETE, or POST.
- Get the response and parse it for the data you need. If you are retrieving information, parse the response for the data you need. Some of the data may be contained directly within the response, marked by appropriate elements, and some data may appear as links to other resources.
- Use the response data to do further operations. You can use the links (which are URLs) within a response in other requests. That is, you can pass these links to other API resources to retrieve or update the data they reference.
Some of the tasks you might need are these:
- Finding places by their name
- Finding places that are near a certain position
- Looking up details of a specific place, including its reviews
The following shows some basic tasks and the API resources you need to perform them. Note that you need to prefix all of these resources with the full host (
http://api.qype.com) and the version of the API your using (
/v1/) like this:
to find all places matching a term. For example 'sushi' in 'Hamburg'.
You'll get a list of 10 places with links to more details. You can also paginate the results to get more results.
will give you all places near a point, ordered by distance.
In this case you need to come up with the latitude/longitude yourself (for example: your application data, geo sensitive libraries like CoreLocation on the iPhone or Mozilla Geode.
gives you the address, category, url and phonenumber of a place. You shouldn't need to come up with the place_id by yourself but by following links from other resource responses.
gives you a paginated list of reviews in one language for this place.
checks authorized user into a place.