Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Latest commit

 

History

History
242 lines (144 loc) · 5.73 KB

song.mdx

File metadata and controls

242 lines (144 loc) · 5.73 KB
sidebar_position
3

Song

import ApiCodeBlock from '../../src/components/ApiCodeBlock'; import Highlight from '../../src/components/Highlight'; import ApiTryIt from '../../src/components/ApiTryIt';

export const endpoints = [ { method: 'GET', uri: '/v1/song/:id' }, { method: 'GET', uri: '/v1/song' }, { method: 'GET', uri: '/v1/random/song/:count' }, ];

This is an object representing an Anime show's opening or ending song. The API allows you to retrieve individual Song as well as a list of them using various filters.

The Song object

Attributes


id

Unique identifier for a Song.


anime_id

Anime external unique identifier.


title

The song's original title.


artist

The song's artist name.


album

The song's album name.


year

The song's release year.


season

The song's release season.

"WINTER": 0,
"SPRING": 1,
"SUMMER": 2,
"FALL": 3,
"UNKNOWN": 4

duration

The song's duration in milliseconds.


preview_url

The song's Spotify preview url, which provides ~30 seconds of the song.


open_spotify_url

The song's Spotify Web Player url to listen to it.


local_spotify_url

The song's Spotify App url to listen to it. This url will open your local Spotify application automatically.


type

The song's type.

"OPENING": 0,
"ENDING": 1,
"NONE": 2

Example

{
  "anime_id": 1,
  "title": "The Real Folk Blues",
  "artist": "Mai Yamane",
  "album": "COWBOY BEBOP Vitaminless",
  "year": 1998,
  "season": 1,
  "duration": 377066,
  "preview_url": "https://p.scdn.co/mp3-preview/a2226076e4b89e16d8827189fd32da4535d369b4?cid=b074c52808fb4394a28785f381872ea2",
  "open_spotify_url": "https://open.spotify.com/track/5Cmf3LmbLd9g79rS55X7qK",
  "local_spotify_url": "spotify:track:5Cmf3LmbLd9g79rS55X7qK",
  "type": 1,
  "id": 1
}

Retrieve a specific Song

Retrieves an Anime show's Song, based on its unique identifier.

Parameters

No parameters.

Returns

Returns a Song object if a valid identifier was provided.

Try it

export const retrieveSongParams = [ { name: ':id', type: 'number', placeholder: ':id', value: '11' } ];

Get a list of Song

Returns a list of Song objects. The Songs are returned sorted by year descending, after by season descending.

Parameters


anime_id

A filter on the list based on the anime_id field value.


title

A case-insensitive pattern filter on the list based on the title field value.


artist

A case-insensitive pattern filter on the list based on the artist field value.


year

A filter on the list based on the year field value.


season

A filter on the list based on the season field value.


type

A filter on the list based on the type field value.


Returns

Returns an array of Anime objects with a size based on the filter provided.

Try it

export const getListSongParams = [ { name: 'anime_id', type: 'number', placeholder: 'anime_id', value: '10' }, { name: 'title', type: 'text', placeholder: 'title', value: '' }, { name: 'artist', type: 'text', placeholder: 'artist', value: 'FLOW' }, { name: 'year', type: 'text', placeholder: 'year', value: '' }, { name: 'season', type: 'text', placeholder: 'season', value: '' }, { name: 'type', type: 'text', placeholder: 'type', value: '' }, ];

Retrieve random Songs

Retrieves a random Anime show's Song list.

Parameters

No parameters.

Returns

Returns a random Song list.

Try it

export const retrieveRandomSongParams = [ { name: ':count', type: 'number', placeholder: ':count', value: '5' } ];