ListenBrainz lookup for exact recording

Hi all,
I’m new to LB, but I love the project. Unfortunately, I’m quite new too API too. :slight_smile:

I’m just experimenting a bit using cURL to find the MBIDs of recordings and releases. This is the command I run expecting to find this release:
curl -s -G "https://api.listenbrainz.org/1/metadata/lookup/" --data-urlencode "recording_name=Alive" --data-urlencode "artist_name=Pearl Jam" --data-urlencode "release_name=Rearviewmirror"

Instead, the output is linked to Ten:

{"artist_credit_name":"Pearl Jam","artist_mbids":["83b9cbe7-9857-49e2-ab8e-b57b01038103"],"recording_mbid":"c8ecea4a-b955-416d-866b-c218a73fa588","recording_name":"Alive","release_mbid":"8d0bc6d4-8700-44e8-90c8-b86c23e7ff14","release_name":"Ten"}

I’d like to improve my query to see if I can get it right. I couldn’t find a list of all the “properties” I can pass to the /lookup/ url. Do you know where can I find it?

Thanks in advance!

P.S.
The goal is to improve the Bash macOS scrobbler I’m working on.

1 Like

Hi!

This endpoint doesn’t have any more options, I’m afraid.

What is happening is that the current mapping (which maps metadata to canonical MusicBrainz recordings) doesn’t really take into account the release the recording came from. Instead all recordings are mapped to their canonical release, which is never a best-of or compilation. Most of the time it maps to the normal albums we’d expect it to map to.

The good news is that I am about to start working on creating a mapping that supports releases, which in theory, should map to the correct release you’re hoping for.

1 Like

To add to Rob, you can try using the Musicbrainz API instead. This one stays accurate

1 Like

Thank you both for the answers!
I think that the “cleanest” way (and simplest for the maintainers) is to use a single API which works better for the lookups. At the moment, I think that the MusicBrainz one is more complete.

So, I’ll adjust my scrobbler to use MB API and then jq to parse the response.
For now, I’ll check track number as factor: usually a recording has different track number in the several releases. So, based on the “score” of the recording and the track number, I should be able to identify the recording/release pretty easily.

EDIT: Done! With a way too complicated jq command I think I was able to get the right combination… I tested it, and it seems to work. :slight_smile: