Simple API OverviewThe official.fm Simple API provides a RESTful way to access resources such as tracks, users, and playlists. All requests are simple GET requests that return JSON, JSONP or XML responses. Authentication is done via a token passed as an HTTP parameter to every request. The Simple API is read-only. Use the Advanced API if you want to upload tracks, vote, edit metadata, etc. URL structureUsing the API is making GET requests to URLs that look like this:
And getting responses that look like this:
JSON[
{
title: "dancin on your grave prod. Scoop Deville",
artist_string: "Get Busy Committee ft. Brevi",
id: 151426,
plays_count: 916
}
]
XML<tracks>
<track>
<title>dancin on your grave prod. Scoop Deville</title>
<artist_string>Get Busy Committee ft. Brevi</artist_string>
<id>151426</id>
<plays_count>916</plays_count>
</track>
</tracks>
When paginate option is available, just add /paginate at the end of URL:
And getting responses that look like this:
JSON{
total:100,
page:1,
per_page:20,
current:20,
tracks:
[
{
title: "dancin on your grave prod. Scoop Deville",
artist_string: "Get Busy Committee ft. Brevi",
id: 151426,
plays_count: 916
}
]
}
XML<tracks total="100" page="1" per_page=20"" current="20">
<track>
<title>dancin on your grave prod. Scoop Deville</title>
<artist_string>Get Busy Committee ft. Brevi</artist_string>
<id>151426</id>
<plays_count>916</plays_count>
</track>
</tracks>
Each application has its own application key. If you don't have one yet, register now! See endpoints for a comprehensive list of valid request URLs, and their possible responses ParametersSometimes an API url accepts additional parameters, such as genre, or api_embed_codes.
Parameters in a GET request are added like that:
The following parameters are accepted by all requests:
API ConsoleThe best way to experiment try a few requests in our awesome API console powered by apigee. |