API Overview

Spreaker API is a REST web service located at:
http://api.spreaker.com

The web service currently supports different response formats, but we higly encourage the JSON format (other formats are deprecated). You can explicitly set the response format, adding the format query parameter to the request.

Example:
GET /whoami?format=json

Response

The response can be a success or an error. On success the API always returns a 2xx status code, while on error the API could return a 4xx code (client error) or 5xx code (server error). There is a global rule that is valid for all requests: if you get a 5xx status code you should retry the same request, while if you get a 4xx status code the same request will always fail.

Success response format

The success response always contains a response object, whose content can be of three different types:
  • record: a single entity that contains various information (eg. user, show, radio, ...)
  • collection: a list of records
  • pager: a special data type used for data pagination (more information at Pager)

Example (record):
{"response": {"time": {"epoch": 1295955160, "date":"2011-01-25 11:32:40" }}}

Error response format

All the errors thrown by the Spreaker API, are in the same format. The response object contains an error object with the following properties:
  • code: the response status code
  • messages: an array of strings

Example:
{response: {error: { messages: [ "The provided API uri is unknown" ], code: 404 }}}


Timestamp

Timestamps returned from Spreaker APIs are in UTC (unless otherwise stated) and always specified in ISO format (YYYY-MM-DD HH:MM:SS).