Reputation: 35822
I would like to get multiple artists for a specified recording. Say I have the (main) artist name like Pat Metheny, and have the album title like "Bright Size Life". I would like to get the other (2) artists for my result (Jaco Pastorius, and Bob Moses). When I use interactively the web page displays those two artists, however when I am using the API, only one artist is in the response.
Here are the queries what I am trying:
http://musicbrainz.org/ws/2/work/?query=bright%20size%20life
or
http://musicbrainz.org/ws/2/recording?query=Bright%20size%20life
and here is the result with only one artist:
What I am missing? Thx in advance
Upvotes: 0
Views: 1498
Reputation: 1681
There are several things wrong with your current approach:
There are multiple levels at which an artist's role on a song or album can be noted: 1. If the relationship is applicable to all tracks on a release, apply it to every work or recording on the release. 2. If the relationship applies to only a few tracks, and you know which ones, apply it only to those works or recordings. 3. If you are unsure which tracks a relationship applies to, put it at release level. A basic effort to determine to which tracks the relationship is applicable is appreciated. 4. If the credit is release level, and does not apply on a track by track basis (e.g. graphic design for the album's cover), then apply the relationship to the release, not the tracks.
The recording you're showing in your second screenshot is this one which does not have any relationships, neither does the release it appears on (so there's no relationship information that could be included in the XML response).
The search web service is not a replacement for the normal one. This means that not all of the information available in the database is made available via the search web service, although it might be available through the regular one (although using the regular one might require searching first to get the MusicBrainz IDs of the things you want to retrieve information about).
So, to answer the question of how to retrieve the information about the recording of in your first screenshot (which is this one): The result you get from the standard web service (click on the "Details" tab on the website, it will include a link to the XML representation, which is https://musicbrainz.org/ws/2/recording/6cbda46a-4db9-4575-865d-5be479e30b84?inc=artist-credits+releases for "Bright Size Life") can be made to changed to include relationships to artists by including the artist-rels include argument (here's what it would look like for a recording that does have relationships)).
However, if you know the MusicBrainz ID of the release and want to get both the release and recording relationships in one request, then that's possible and documented:
By default, these 'inc=' arguments will only load relationship for the requested entity. When you are loading a release, you might want to load relationships for all its recordings and also works linked to the recordings. This is useful to get full release credits. There are additional arguments that can be used only on release requests and allow you to specify for which entities to load relationships:
- recording-level-rels
- work-level-rels
This means that you can add artist-rels
and recording-level-rels
to a release request (like https://musicbrainz.org/ws/2/release/b60d1bc5-a18c-38ca-a26b-6e040d5d7acb?inc=artist-credits%2Bdiscids%2Blabels%2Brecordings+recording-level-rels+artist-rels) for the Bright Size Life release and get artist relationship information for the release and all recordings appearing on it.
Upvotes: 1