List albums by an artist
curl --request GET \
--url http://localhost:6063/artists/{id}/albumsimport requests
url = "http://localhost:6063/artists/{id}/albums"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:6063/artists/{id}/albums', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "6063",
CURLOPT_URL => "http://localhost:6063/artists/{id}/albums",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:6063/artists/{id}/albums"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:6063/artists/{id}/albums")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6063/artists/{id}/albums")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"id": "cmodxew8w0053pdmdmro8vx0w",
"title": "2014 Forest Hills Drive",
"artist": "J. Cole",
"year": 2014,
"year_string": "2014-12-09",
"album_art": "216ccc791352fbbffc11268b984db19a.jpg",
"md5": "7efed3c16a2ea54a2c090e40f03107d4",
"artist_id": "cmodw19po0005pdmd6k9mwauv",
"label": null,
"copyright_message": "℗ 2014 Cole World/Interscope Records"
},
{
"id": "cmodw1a5l003dpdmd39obvgay",
"title": "Might Delete Later",
"artist": "J. Cole",
"year": 2024,
"year_string": "2024-04-05",
"album_art": "85b108fff8d0cabd396a2e79885f2752.jpg",
"md5": "ddbdd86c1fc7e7f1b5b901d83c83aaf2",
"artist_id": "cmodw19po0005pdmd6k9mwauv",
"label": null,
"copyright_message": "℗ 2024 Cole World, Inc., under exclusive license to Interscope Records"
}
]Artists
List albums by an artist
GET
/
artists
/
{id}
/
albums
List albums by an artist
curl --request GET \
--url http://localhost:6063/artists/{id}/albumsimport requests
url = "http://localhost:6063/artists/{id}/albums"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://localhost:6063/artists/{id}/albums', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "6063",
CURLOPT_URL => "http://localhost:6063/artists/{id}/albums",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:6063/artists/{id}/albums"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:6063/artists/{id}/albums")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:6063/artists/{id}/albums")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"id": "cmodxew8w0053pdmdmro8vx0w",
"title": "2014 Forest Hills Drive",
"artist": "J. Cole",
"year": 2014,
"year_string": "2014-12-09",
"album_art": "216ccc791352fbbffc11268b984db19a.jpg",
"md5": "7efed3c16a2ea54a2c090e40f03107d4",
"artist_id": "cmodw19po0005pdmd6k9mwauv",
"label": null,
"copyright_message": "℗ 2014 Cole World/Interscope Records"
},
{
"id": "cmodw1a5l003dpdmd39obvgay",
"title": "Might Delete Later",
"artist": "J. Cole",
"year": 2024,
"year_string": "2024-04-05",
"album_art": "85b108fff8d0cabd396a2e79885f2752.jpg",
"md5": "ddbdd86c1fc7e7f1b5b901d83c83aaf2",
"artist_id": "cmodw19po0005pdmd6k9mwauv",
"label": null,
"copyright_message": "℗ 2024 Cole World, Inc., under exclusive license to Interscope Records"
}
]⌘I