Songs

The /songs endpoints of the Karaoke API provide functionalities to interact with songs, including creating new entries, retrieving song information, and searching for random songs.

Base URL: https://kareoke.lbarcl.repl.co

Endpoints

Create New Song Entry

POST https://kareoke.lbarcl.repl.co/songs

Create a new song entry by providing both YouTube (yid) and Spotify (sid) IDs.

Query Parameters

NameTypeDescription

yid*

String

YouTube ID.

sid*

String

Spotify ID

id (string): Karaoke track ID.

spotify (string): Spotify track ID.

youtube (string): YouTube video ID.

Get Random Song

GET https://kareoke.lbarcl.repl.co/songs/random

Retrieve a random song from the database.

id (string): Karaoke track ID.

spotify (string): Spotify track ID.

youtube (string): YouTube video ID.

GET

3. Search for Song

Search for a song based on a provided query string.

  • URL: /songs/search

  • Method: GET

  • Parameters:

    • query (string): Search query.

Request

// Example GET request using Axios
axios.get('https://kareoke.lbarcl.repl.co/songs/search?query=your_query_here')
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
  });

Response

  • id (string): Karaoke track ID.

  • spotify (string): Spotify track ID.

  • youtube (string): YouTube video ID.

4. Get Song Information by ID

Retrieve information about a song using its ID.

  • URL: /songs/:id

  • Method: GET

  • Parameters:

    • id (string): Karaoke track ID.

Request

// Example GET request using Axios
axios.get('https://kareoke.lbarcl.repl.co/songs/karaoke_track_id_here')
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
  });

Response

  • id (string): Karaoke track ID.

  • spotify (object):

    • id (string): Spotify track ID.

    • title (string): Title of the track.

    • image (string): URL of the track's album cover image.

    • artist (string): Artist of the track.

    • duration (number): Duration of the track in milliseconds.

  • youtube (object):

    • id (string): YouTube video ID.

    • title (string): Title of the video.

    • image (string): URL of the video's thumbnail image.

    • artist (string): Channel name of the video.

    • duration (number): Duration of the video in seconds.


Please note that this documentation is designed for GitBook compatibility based on the provided /songs endpoints. If there are any additional features or functionalities that need to be included, please let me know.

Last updated