Skip to content
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

[WIP] Spotify artist URI to social pages, Wiki summary #268

Closed
jacksongoode opened this issue Jan 20, 2022 · 8 comments
Closed

[WIP] Spotify artist URI to social pages, Wiki summary #268

jacksongoode opened this issue Jan 20, 2022 · 8 comments
Labels
enhancement New feature or request

Comments

@jacksongoode
Copy link
Collaborator

jacksongoode commented Jan 20, 2022

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.

@kingosticks
Copy link

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

@jacksongoode
Copy link
Collaborator Author

jacksongoode commented 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

@kingosticks
Copy link

Excellent, thank you!

@jpochyla
Copy link
Owner

That sounds great @jacksongoode!

@jpochyla jpochyla added the enhancement New feature or request label Jan 25, 2022
@jacksongoode
Copy link
Collaborator Author

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 :)

@AmyMagdalena
Copy link

AmyMagdalena commented 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

@SO9010
Copy link
Contributor

SO9010 commented 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

@jacksongoode
Copy link
Collaborator Author

Closed with #537

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants