Skip to content

Obter todos os álbuns

GET
/api/v1/artists/{artistId}/albums

Obtenha uma lista de todos os álbuns de um artista lendário do Rock Argentino.

Parámetros

Path Parameters

artistId*
Tipointeger
Requerido
Ejemplo1
formatint64

Query Parameters

limit

A quantidade de itens a retornar

Tipointeger
formatint64
default10
offset

A quantidade de itens a ignorar antes de começar a coletar o conjunto de resultados

Tipointeger
formatint64
default0

Respuestas

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"
}
}

Ejemplos

cURL
curl -X GET \
'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1/albums' \
 -H "Content-Type: application/json"
JavaScript
fetch('https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/artists/1/albums', {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',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
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'

headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)
print(response.json())
Powered by VitePress OpenAPI