-
Notifications
You must be signed in to change notification settings - Fork 2
docs: add GET /api/research/track/playlists endpoint #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6913,6 +6913,158 @@ | |||||
| } | ||||||
| } | ||||||
| }, | ||||||
| "/api/research/track/playlists": { | ||||||
| "get": { | ||||||
| "description": "Get playlists featuring a specific track — editorial, algorithmic, and indie. Returns playlist name, cover image, follower count, and curator.", | ||||||
| "parameters": [ | ||||||
| { | ||||||
| "name": "id", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Chartmetric track ID. Provide this or `q`.", | ||||||
| "schema": { | ||||||
| "type": "string" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "q", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Track name to search for. Provide this or `id`.", | ||||||
| "schema": { | ||||||
| "type": "string" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "artist", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Artist name — improves track search accuracy when using `q`.", | ||||||
| "schema": { | ||||||
| "type": "string" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "platform", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Streaming platform.", | ||||||
| "schema": { | ||||||
| "type": "string", | ||||||
| "enum": ["spotify", "applemusic", "deezer", "amazon"], | ||||||
| "default": "spotify" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "status", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Playlist status.", | ||||||
| "schema": { | ||||||
| "type": "string", | ||||||
| "enum": ["current", "past"], | ||||||
| "default": "current" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "editorial", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Only editorial playlists.", | ||||||
| "schema": { | ||||||
| "type": "boolean" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "since", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Filter by start date (YYYY-MM-DD).", | ||||||
| "schema": { | ||||||
| "type": "string" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "until", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Filter by end date (YYYY-MM-DD).", | ||||||
| "schema": { | ||||||
| "type": "string" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "sort", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Sort results by this field (e.g. followers, added_at, position).", | ||||||
| "schema": { | ||||||
| "type": "string" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "limit", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Maximum number of results (max 100).", | ||||||
| "schema": { | ||||||
| "type": "integer", | ||||||
| "default": 10 | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "offset", | ||||||
| "in": "query", | ||||||
| "required": false, | ||||||
| "description": "Offset for pagination.", | ||||||
| "schema": { | ||||||
| "type": "integer", | ||||||
| "default": 0 | ||||||
| } | ||||||
| } | ||||||
| ], | ||||||
| "responses": { | ||||||
| "200": { | ||||||
| "description": "Playlists featuring the track", | ||||||
| "content": { | ||||||
| "application/json": { | ||||||
| "schema": { | ||||||
| "$ref": "#/components/schemas/ResearchTrackPlaylistsResponse" | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| }, | ||||||
| "400": { | ||||||
| "description": "Missing or invalid parameters", | ||||||
| "content": { | ||||||
| "application/json": { | ||||||
| "schema": { | ||||||
| "type": "object", | ||||||
| "properties": { | ||||||
| "status": { "type": "string", "example": "error" }, | ||||||
| "error": { "type": "string" } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| }, | ||||||
| "401": { | ||||||
| "description": "Authentication required", | ||||||
| "content": { | ||||||
| "application/json": { | ||||||
| "schema": { | ||||||
| "type": "object", | ||||||
| "properties": { | ||||||
| "status": { "type": "string", "example": "error" }, | ||||||
| "error": { "type": "string" } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| }, | ||||||
| "/api/research/tracks": { | ||||||
| "get": { | ||||||
| "description": "Get all tracks by an artist with popularity data.", | ||||||
|
|
@@ -15087,6 +15239,55 @@ | |||||
| } | ||||||
| } | ||||||
| }, | ||||||
| "ResearchTrackPlaylistsResponse": { | ||||||
| "type": "object", | ||||||
| "properties": { | ||||||
| "status": { | ||||||
| "type": "string", | ||||||
| "example": "success" | ||||||
| }, | ||||||
| "placements": { | ||||||
| "type": "array", | ||||||
| "items": { | ||||||
| "type": "object", | ||||||
| "properties": { | ||||||
| "playlist": { | ||||||
| "type": "object", | ||||||
| "properties": { | ||||||
| "name": { "type": "string", "description": "Playlist name" }, | ||||||
| "image_url": { "type": "string", "description": "Playlist cover image URL" }, | ||||||
| "playlist_id": { "type": "string", "description": "Spotify playlist ID" }, | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use platform-neutral wording for The schema says “Spotify playlist ID”, but this endpoint is documented for multiple platforms. Consider neutral wording (e.g., “Platform playlist ID”). Proposed patch- "playlist_id": { "type": "string", "description": "Spotify playlist ID" },
+ "playlist_id": { "type": "string", "description": "Platform playlist ID" },📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| "id": { "type": "integer", "description": "Chartmetric playlist ID" }, | ||||||
| "description": { "type": "string" }, | ||||||
| "followers": { "type": "integer", "description": "Playlist follower count" }, | ||||||
| "num_track": { "type": "integer", "description": "Number of tracks" }, | ||||||
| "editorial": { "type": "boolean", "description": "Whether playlist is editorial" }, | ||||||
| "owner_name": { "type": "string", "description": "Playlist curator name" }, | ||||||
| "position": { "type": "integer", "description": "Track position in playlist" }, | ||||||
| "peak_position": { "type": "integer", "description": "Track peak position" }, | ||||||
| "added_at": { "type": "string", "description": "When track was added" }, | ||||||
| "tags": { "type": "array", "items": { "type": "object" } } | ||||||
| }, | ||||||
| "additionalProperties": true | ||||||
| }, | ||||||
| "track": { | ||||||
| "type": "object", | ||||||
| "properties": { | ||||||
| "name": { "type": "string", "description": "Track name" }, | ||||||
| "cm_track": { "type": "integer", "description": "Chartmetric track ID" }, | ||||||
| "isrc": { "type": "string", "description": "Track ISRC" }, | ||||||
| "image_url": { "type": "string", "description": "Track image URL" }, | ||||||
| "artist_names": { "type": "array", "items": { "type": "string" } }, | ||||||
| "spotify_popularity": { "type": "integer" } | ||||||
| }, | ||||||
| "additionalProperties": true | ||||||
| } | ||||||
| }, | ||||||
| "additionalProperties": true | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| }, | ||||||
| "ResearchProfileResponse": { | ||||||
| "type": "object", | ||||||
| "description": "Full artist profile \u2014 bio, genres, social links, label, images, and basic stats.", | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,4 @@ | ||||||||||||||||||||
| --- | ||||||||||||||||||||
| title: 'Track Playlists' | ||||||||||||||||||||
| openapi: 'GET /api/research/track/playlists' | ||||||||||||||||||||
| --- | ||||||||||||||||||||
|
Comment on lines
+1
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add This API page is correctly frontmatter-only, but it’s missing a Proposed fix ---
title: 'Track Playlists'
+description: 'Get playlists associated with a track in Research.'
openapi: 'GET /api/research/track/playlists'
---As per coding guidelines, " 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align schema constraints with the parameter descriptions.
since/untilare documented asYYYY-MM-DDbut lackformat: date, andlimitsays max 100 without amaximumconstraint. This creates a doc/contract mismatch for generated clients and validators.Proposed patch
{ "name": "since", "in": "query", "required": false, "description": "Filter by start date (YYYY-MM-DD).", "schema": { - "type": "string" + "type": "string", + "format": "date" } }, { "name": "until", "in": "query", "required": false, "description": "Filter by end date (YYYY-MM-DD).", "schema": { - "type": "string" + "type": "string", + "format": "date" } }, @@ { "name": "limit", "in": "query", "required": false, "description": "Maximum number of results (max 100).", "schema": { "type": "integer", - "default": 10 + "default": 10, + "minimum": 1, + "maximum": 100 } },🤖 Prompt for AI Agents