Getting track lists from releases, via API with JSON

Hi - I’m writing a little iOS app which uses the API to search the database for artists, albums (releases, not necessarily release groups), songs (tracks), display some metadata, etc. - mostly for my own self-education (for now).

My app is working as intended so far, for artists and releases - I get back results (as JSON) that make sense.

My problem is that I can’t seem to get any data back on the track/song level.

From my reading of the docs, it appears that track/song level items can be found as part of an array called “track” (not “tracks”!), nested within a “Media” item, which is nested within a “Release” item.

The JSON I get back from my requests has these nested items as described above (all nested under another outer item). The Media item appears mostly correct, including things like “format” and “track-count”.

But the “track” (or “tracks”?) array is always missing!

What am I doing wrong here?

Here’s a sample URL (for the album “Trane’s Blues” by John Coltrane):

https://musicbrainz.org/ws/2/release/?fmt=json&query=reid:03751bea-4479-4f7f-a5e8-473568e95927

Is there something wrong with this URL that would prevent the tracks from showing up in the result?

Thanks, and apologies if this is really dumb…

-HS

1 Like

Currently, you only ask for release data.
If you want to get recording data too, you have to include them in your URL request string like this:
https://musicbrainz.org/ws/2/release/03751bea-4479-4f7f-a5e8-473568e95927?inc=recordings&fmt=json
there are more inc parameters available, please see
https://musicbrainz.org/doc/MusicBrainz_API#inc=

5 Likes

Thanks, that’s what I needed! I figured I must have been missing something simple in the docs…

1 Like