Skip to main content

/bands

Base URL: https://hippohonk-api-642586320677.herokuapp.com/

GET

Summary: Get all bands in the database.

Returns a list of bands ordered by average rating (descending).

Optional filters:

  • genre_id: only return bands in the specified genre

Code samples

# All bands
curl /bands

# Filter by genre_id
curl "/bands?genre_id=2"

Responses

Response 200

OK

Response fields

Returns an array

Field (*)TypeDescriptionExample
band_idintegerUnique ID for the band.
namestringName of the band."Faux Real"
descriptiontextSummary of the band that can't be captured through genre alone."French Art Pop duo producing jams with an eye for performance. We are all living in the United Snakes of America, and the brothers Arndt are the snake charmers.\n"
average_ratingnumberAverage rating for the band.4
locationstringLocation the band calls home."Los Angeles, CA"
urlstringURL for the band's website or social media site."https://isthisfauxreal.com/"
genre_idintegerUnique ID for a genre.2
genre_namestringName for a band's primary genre."Art Pop"
imagestringPath to the web-hosted image. This image should be pre-processed to the correct size and hosted in a secure location."Currently not implemented"

(*) Required field

Example response(s)

List of bands

[
{
"band_id": 1386,
"name": "Phantogram",
"description": "Dark ambient indie electro-pop who have been at the forefront of this genre for a decade.",
"average_rating": 4.89,
"location": "Saratoga Springs, NY",
"url": "http://phantogrammusic.virb.com/music",
"genre_id": 45,
"genre_name": "Synth Pop",
"image": "v1425489534/raqs1rix20wrl4smrg4i.png"
},
{
"band_id": 1608,
"name": "Kishi Bashi",
"description": "A classically trained violinist, Kishi Bashi (the pseudonym of Kaoru Ishibashi) makes highly catchy indie pop tracks using repeated loops of instrumentation and vocals. Unique and mesmerizing live.",
"average_rating": 5,
"location": "Athensa GA",
"url": "http://www.kishibashi.com/music",
"genre_id": 44,
"genre_name": "Indie Pop",
"image": "v1425262448/yzo3mysaolekvammwh00.png"
}
]

Response 400

Invalid query parameter

Response fields

Field (*)TypeDescriptionExample
message *string

(*) Required field

Example response(s)

genre_id is not a number

{
"error": "Invalid query parameter",
"message": "genre_id must be a number"
}

Response 500

Server error

Response fields

Field (*)TypeDescriptionExample
message *string

(*) Required field

POST

Summary: Create a new band

Creates a new band in the hippohonk database.

Required params: name, genre_id

Note: Genres are managed as a standardized list to support filtering by genre. Refer to the Genres API documentation to get a list of genres.

Code samples

curl -X POST /bands \
-H "Content-Type: application/json" \
-d '{
"name": "Jungle",
"genre_id": 2,
"average_rating": 5
}'

Request body fields

Field (*)TypeDescriptionExample
name *stringName of the band.
descriptiontextSummary of the band that can't be captured through genre alone."French Art Pop duo producing jams with an eye for performance. We are all living in the United Snakes of America, and the brothers Arndt are the snake charmers.\n"
average_ratingnumberAverage rating for the band.4
locationstringLocation the band calls home."Los Angeles, CA"
genre_id *integerUnique ID for a genre.2

(*) Required field

Example request(s)

Request with minimum required parameters

{
"name": "Jungle",
"genre_id": 2
}

Request with additional parameters

{
"name": "The Last Dinner Party",
"genre_id": 5,
"average_rating": 5
}

Responses

Response 201

Band creation successful.

Response fields

Field (*)TypeDescriptionExample
idintegerUnique ID for the band.
namestringName of the band."Faux Real"
descriptiontextSummary of the band that can't be captured through genre alone."French Art Pop duo producing jams with an eye for performance. We are all living in the United Snakes of America, and the brothers Arndt are the snake charmers.\n"
average_ratingnumberAverage rating for the band.4
locationstringLocation the band calls home."Los Angeles, CA"
genre_idintegerUnique ID for a genre.2
urlstringURL for the band's website or social media site."https://isthisfauxreal.com/"

(*) Required field

Response 500

Server error

Response fields

Field (*)TypeDescriptionExample
message *string

(*) Required field