Skip to content

Commit

Permalink
Added type definitions for the recently played tracks API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajit Khatri authored and Rajit Khatri committed Nov 5, 2024
1 parent 6d84dd5 commit fba5297
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions src/types/spotify-web-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,111 @@ export type GetRecommendationsResponse = {
is_local: boolean
}[]
};

export class GetRecentlyPlayedTracks {
data = new RecentlyPlayedTracks();
}

export class RecentlyPlayedTracks {
limit = "50";
after = "";
}

export type GetRecentlyPlayedTracksResponse = {
href: string,
limit: number,
next: string,
cursors: {
after: string,
before: string
},
total: number,
items:
{
track:
{
album: {
album_type: string,
total_tracks: number,
available_markets: string[],
external_urls: {
spotify: string
},
href: string,
id: string,
images:
{
url: string,
height: number,
width: number,
}[],
name: string,
release_date: string,
release_date_precision: string,
restrictions: {
reason: string,
},
type: string,
uri: string,
artists:
{
external_urls: {
spotify: string
},
href: string,
id: string,
name: string,
type: string,
uri: string
}[]
},
artists:
{
external_urls: {
spotify: string
},
href: string,
id: string,
name: string,
type: string,
uri: string
}[],
available_markets:
string[],
disc_number: number,
duration_ms: number,
explicit: boolean,
external_ids: {
isrc: string,
ean: string,
upc: string
},
external_urls: {
spotify: string
},
href: string,
id: string,
is_playable: boolean,
linked_from: {},
restrictions: {
reason: string
},
name: string,
popularity: number,
preview_url: string,
track_number: number,
type: string,
uri: string,
is_local: boolean
},
played_at: string,
context: {
type: string,
href: string,
external_urls: {
spotify: string
},
uri: string
}
}[]
}

0 comments on commit fba5297

Please sign in to comment.