ID: getAllAlbums
Get all albums
GET
/api/v1/artists/{artistId}/albums
Get a list of all albums from a legendary Argentine Rock artist.
Parameters
Path Parameters
artistId*
Typeinteger
RequiredExample
1format
int64Query Parameters
limit
The number of items to return
Typeinteger
Examples
102050format
int64default
10offset
The number of items to skip before starting to collect the result set
Typeinteger
Examples
123456format
int64default
0Responses
OK
application/json
JSON
{
"data": [
{
"id": 1,
"name": "La Máquina de Hacer Pájaros",
"year": 1976,
"image": "https://cdn.rock-legends.com/photos/la-maquina.jpg"
}
],
"meta": {
"limit": 10,
"offset": 0,
"total": 100,
"next": "/artists?limit=10&offset=10"
}
}
GET
/api/v1/artists/{artistId}/albums
Samples
Bruno
get {
url: https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1/albums?limit=10&offset=1
}
headers {
Content-Type: application/json
}Bruno
get {
url: https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1/albums?limit=10&offset=1
}
headers {
Content-Type: application/json
}cURL
curl -X GET \
'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1/albums?limit=10&offset=1' \
-H "Content-Type: application/json"JavaScript
fetch('https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1/albums?limit=10&offset=1', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));PHP
<?php
$url = 'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1/albums';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$query = http_build_query([
'limit' => '10',
'offset' => '1',
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>Python
import requests
url = 'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1/albums'
params = {
'limit': 10,
'offset': 1
}
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, params=params, headers=headers)
print(response.json())