Skip to content

A REST API with data on all boy bands and their members since 1980.

Notifications You must be signed in to change notification settings

ericwm76/boybands2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I Want It All: Boy Bands and Their Members Since 1980

This API enables the user to retrieve and interact with data on all boy bands and their members since 1980.

The data used to seed this database came from The Pudding. You can find the original data with documentation about how the data was compiled and criteria for which bands made the cut here. Check them out! They're doing some really amazing things with data-based visual essays on cultural topics from politics to sports to entertainment.


Tech

This application was built using the following technologies:

  • Node.js
  • Express.js
  • Knex
  • PostgresQL

Project Management

This application was managed using Trello and Github Issues. Link to Trello board here.


API Endpoints

Base URL

This application is deployed live on Heroky. All URLs referenced in the documentation have the following base URL:

https://boybands.herokuapp.com/


GET all boy bands:

GET /api/v1/bands

Response

Status Response
200 Returns an array of all of the band objects

Response Parameters

Name Type Description
id number Unique band identifier.
name string Name of boy band.
highest_pos string The highest position on the Billboard Top 100 charts reached by any of this boy band's songs.
highest_pos_date string The date on which this boy band's biggest hit reached its highest position on the Billboard Top 100 charts. If the band had multiple hits reach the same position, the date given is the date of their earliest hit to reach that position.
highest_song string The name of the song that reached the highest position on the Billboard Top 100 charts. If the band had multiple hits reach the same position, the song given is the earliest song to reach that position.
highest_song_vid URL A URL linking to the music video for the band's highest song.
Example response
[
  {
    "band": "NSYNC",
    "highest_pos": 1,
    "highest_pos_date": "2000-07-29",
    "highest_song": "It's Gonna Be Me",
    "highest_song_vid": "https://www.youtube.com/watch?v=GQMlWwIXg3M"
  }
]

GET a specific boy band by ID:

GET /api/v1/bands/:id

Query Parameters

Name Type Description
id number Unique band identifier.

Response

Status Response
200 Returns a specific boy band object.

GET all boy band members:

GET /api/v1/members

Response

Status Response
200 Returns an array of all of the band member objects

Response Parameters

Name Type Description
id number Unique band member identifier.
name string Name of boy band member.
band_name string The name of the boy band of which they are/were a member.
dob string The member's date of birth.
hair_color string The boy band member's hair color.
hair_frosted string Did the boy band member have frosted tips? Returns yes, no, red or green.
hair_style string The boy band member's hair style.
eyes string The boy band member's eye color.
facial_hair string If the boy band member has facial hair, returns a description of the type (mustache, goatee, etc.)
accessories string If the boy band member wears accessories, returns a description of the type (earrings, necklace, baseball hat, etc.)
top_style string The style of top the boy band member typically wears on stage (t-shirt, suit jacket, etc.)
bottom_style string The style of pants the boy band member typically wears on stage (dress pants, jeans, etc.)
instruments string If the boy band member played an instrument, that instrument is returned here (bass, keyboard, etc.)
Example response
[
    {
        "id": 13,
        "name": "Justin Timberlake",
        "band_name": "NSYNC",
        "dob": "1/31/1981",
        "hair_color": "brown",
        "hair_frosted": "yes",
        "hair_style": "curly",
        "eyes": "blue",
        "facial_hair": "",
        "accessories": "earrings",
        "top_style": "other jacket, short-sleeve t-shirt",
        "bottom_style": "dress pants",
        "instrument": "",
        "height": null,
        "created_at": "2019-11-25T00:38:48.535Z",
        "updated_at": "2019-11-25T00:38:48.535Z"
    }
]

GET a specific boy band member by ID:

GET /api/v1/members/:id

Query Parameters

Name Type Description
id number Unique band member identifier.

Response

Status Response
200 Returns a specific boy band member object.

Add a band:

POST /api/v1/bands/

Parameters

Name Type Description Required
name string Name of boy band. YES
highest_pos string The highest position on the Billboard Top 100 charts reached by any of this boy band's songs. NO
highest_pos_date string The date on which this boy band's biggest hit reached its highest position on the Billboard Top 100 charts. If the band had multiple hits reach the same position, the date given is the date of their earliest hit to reach that position. NO
highest_song string The name of the song that reached the highest position on the Billboard Top 100 charts. If the band had multiple hits reach the same position, the song given is the earliest song to reach that position. NO
highest_song_vid URL A URL linking to the music video for the band's highest song. NO

Response

Status Response
201 Returns `Boy band with id of (band_id) successfully created!`
422 { error: `Expected format: { name: , highest_pos: , highest_pos_date: , highest_song: , highest_song_vid: , } At least name is required. Please provide the band's name.` }
Example response
`Boy band with id of 63 successfully created!`

or

{ error: `Expected format: {
      name: <String>,
      highest_pos: <String>,
      highest_pos_date: <String>,
      highest_song: <String>,
      highest_song_vid: <URL>,
    }
    At least name is required. Please provide the band's name.` }

Add a band member:

POST /api/v1/members/

Parameters

Name Type Description Required
name string Name of boy band member. YES
band_name string The name of the boy band of which they are/were a member. YES
dob string The member's date of birth. NO
hair_color string The boy band member's hair color. NO
hair_frosted string Did the boy band member have frosted tips? Returns yes, no, red or green. NO
hair_style string The boy band member's hair style. NO
eyes string The boy band member's eye color. NO
facial_hair string If the boy band member has facial hair, returns a description of the type (mustache, goatee, etc.) NO
accessories string If the boy band member wears accessories, returns a description of the type (earrings, necklace, baseball hat, etc.) NO
top_style string The style of top the boy band member typically wears on stage (t-shirt, suit jacket, etc.) NO
bottom_style string The style of pants the boy band member typically wears on stage (dress pants, jeans, etc.) NO
instruments string If the boy band member played an instrument, that instrument is returned here (bass, keyboard, etc.) NO

Response

Status Response
201 Returns `Boy band member with id of (member_id) successfully created!`
422 { error: `Expected format: { name: , band_name: , dob: , hair_color: , hair_frosted: , hair_style: , eyes: , facial_hair: , accessories: , top_style: , bottom_style: , instrument: } At least name and band_name are required. You're missing (name of parameter)`}
Example response
`Boy band with id of 63 successfully created!`

or

{ error: `Expected format: {
        name: <String>,
        band_name: <String>,
        dob: <String>,
        hair_color: <String>,
        hair_frosted: <String>,
        hair_style: <String>,
        eyes: <String>,
        facial_hair: <String>,
        accessories: <String>,
        top_style: <String>,
        bottom_style: <String>,
        instrument: <String>
      }
      At least name and band_name are required. You're missing band_name.`}

Delete a boy band member:

DELETE /api/v1/members/:id

Response

Status Response
200 `Boy band member (id_number) sucessfully deleted!`
404 `There is not a boy band member with an id of (id_number)`

About

A REST API with data on all boy bands and their members since 1980.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published