[GH-ISSUE #268] [WIP] Spotify artist URI to social pages, Wiki summary #192

Closed
opened 2026-02-28 14:31:15 +03:00 by kerem · 8 comments
Owner

Originally created by @jacksongoode on GitHub (Jan 20, 2022).
Original GitHub issue: https://github.com/jpochyla/psst/issues/268

Since seeing this feature on the roadmap, I thought I'd get the initial architecture in place to make sure this might be the best/most effective string of API calls to make.

Right now it takes two calls to reach social links, four to reach a Wiki summary:

  1. MusicBrainz url lookup:
  • Takes Spotify artist URL
  • Returns MusicBrains ID
  1. MusicBrainz artist social links:
  • Takes MusicBrainz ID
  • Returns social links (ie. Wikidata, YouTube, SoundCloud, Facebook, Discogs, official pages, etc.)
  1. Wikidata to Wikipedia page:
  • Takes Wikidata ID
  • Returns Wikipedia pages by language
  1. Fetch summary:
  • Takes Wikipedia page
  • Returns summary of artist page

I feel like it should be possible to reach the MusicBrainz social links with one call, but their API docs are a bit of a mess. The total call time with reqwests is around 3-4s.

Originally created by @jacksongoode on GitHub (Jan 20, 2022). Original GitHub issue: https://github.com/jpochyla/psst/issues/268 Since seeing this feature on the roadmap, I thought I'd get the initial architecture in place to make sure this might be the best/most effective string of API calls to make. Right now it takes two calls to reach social links, four to reach a Wiki summary: 1. MusicBrainz url lookup: - Takes Spotify artist URL - Returns MusicBrains ID 2. MusicBrainz artist social links: - Takes MusicBrainz ID - Returns social links (ie. Wikidata, YouTube, SoundCloud, Facebook, Discogs, official pages, etc.) 3. Wikidata to Wikipedia page: - Takes Wikidata ID - Returns Wikipedia pages by language 4. Fetch summary: - Takes Wikipedia page - Returns summary of artist page I feel like it _should_ be possible to reach the MusicBrainz social links with one call, but their API docs are a bit of a mess. The total call time with `reqwests` is around 3-4s.
kerem 2026-02-28 14:31:15 +03:00
Author
Owner

@kingosticks commented on GitHub (Jan 21, 2022):

How are you getting the musicbrainz ID from a Spotify URL? Is there some API to do that that I've missed?

<!-- gh-comment-id:1018791479 --> @kingosticks commented on GitHub (Jan 21, 2022): How are you getting the musicbrainz ID from a Spotify URL? Is there some API to do that that I've missed?
Author
Owner

@jacksongoode commented on GitHub (Jan 21, 2022):

How are you getting the musicbrainz ID from a Spotify URL? Is there some API to do that that I've missed?

The MusicBrainz ID is retrieved by looking up which artist has the Spotify URL in their metadata on MusicBrainz.

For example: https://beta.musicbrainz.org/ws/2/url/?query=url:https://open.spotify.com/artist/1WZarnZpWEv7dDtjAETt4X

<!-- gh-comment-id:1018804537 --> @jacksongoode commented on GitHub (Jan 21, 2022): > How are you getting the musicbrainz ID from a Spotify URL? Is there some API to do that that I've missed? The MusicBrainz ID is retrieved by looking up which artist has the Spotify URL in their metadata on MusicBrainz. For example: https://beta.musicbrainz.org/ws/2/url/?query=url:https://open.spotify.com/artist/1WZarnZpWEv7dDtjAETt4X
Author
Owner

@kingosticks commented on GitHub (Jan 21, 2022):

Excellent, thank you!

<!-- gh-comment-id:1018843194 --> @kingosticks commented on GitHub (Jan 21, 2022): Excellent, thank you!
Author
Owner

@jpochyla commented on GitHub (Jan 22, 2022):

That sounds great @jacksongoode!

<!-- gh-comment-id:1019277652 --> @jpochyla commented on GitHub (Jan 22, 2022): That sounds great @jacksongoode!
Author
Owner

@jacksongoode commented on GitHub (Feb 14, 2022):

A proof of concept using ureq can be checked out here. First time working with Rust so it might take me a while to integrate :)

<!-- gh-comment-id:1038789427 --> @jacksongoode commented on GitHub (Feb 14, 2022): A proof of concept using `ureq` can be checked out [here](https://github.com/jacksongoode/spotipedia/blob/master/src/main.rs). First time working with Rust so it might take me a while to integrate :)
Author
Owner

@AmyMagdalena commented on GitHub (Apr 13, 2022):

For example: https://beta.musicbrainz.org/ws/2/url/?query=url:https://open.spotify.com/artist/1WZarnZpWEv7dDtjAETt4X

Not sure if important but the URI without the subdomain of beta. produces the same XML data

https://musicbrainz.org/ws/2/url/?query=url:https://open.spotify.com/artist/1WZarnZpWEv7dDtjAETt4X

non-beta URI I feel is potentially more future stable

<!-- gh-comment-id:1098139525 --> @AmyMagdalena commented on GitHub (Apr 13, 2022): > For example: https://beta.musicbrainz.org/ws/2/url/?query=url:https://open.spotify.com/artist/1WZarnZpWEv7dDtjAETt4X Not sure if important but the URI without the subdomain of `beta.` produces the same XML data https://musicbrainz.org/ws/2/url/?query=url:https://open.spotify.com/artist/1WZarnZpWEv7dDtjAETt4X non-beta URI I feel is potentially more future stable
Author
Owner

@SO9010 commented on GitHub (Oct 2, 2024):

Heya, spotify does this and I am probably able to use the same API request format as I did with getting the lyrics for the songs as it's the same background api provider.

Screenshot_20241002-131956.png

<!-- gh-comment-id:2388510348 --> @SO9010 commented on GitHub (Oct 2, 2024): Heya, spotify does this and I am probably able to use the same API request format as I did with getting the lyrics for the songs as it's the same background api provider. ![Screenshot_20241002-131956.png](https://github.com/user-attachments/assets/5230a19b-03be-4ee6-bf7b-8093f6f7c811)
Author
Owner

@jacksongoode commented on GitHub (Oct 16, 2024):

Closed with #537

<!-- gh-comment-id:2417960371 --> @jacksongoode commented on GitHub (Oct 16, 2024): Closed with #537
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#192
No description provided.