# Search API can not find this recording

**URL:** <https://community.metabrainz.org/t/search-api-can-not-find-this-recording/479535>\
**Category:** Development\
**Tags:** webservice, api\
**Created:** [May 31, 2020, 6:34pm UTC](https://community.metabrainz.org/t/search-api-can-not-find-this-recording/479535 "2020-05-31T18:34:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicholasbird](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/n/9de0a6/32.png) [@nicholasbird](https://community.metabrainz.org/u/nicholasbird)\
**Post date:** [May 31, 2020, 6:34pm UTC](https://community.metabrainz.org/t/search-api-can-not-find-this-recording/479535/1 "2020-05-31T18:34:44Z")

</div>

I am trying to find this recording using the api  
[https://musicbrainz.org/recording/4de1d1b5-1546-4ff7-ba8f-d8b70c947a13](https://musicbrainz.org/recording/4de1d1b5-1546-4ff7-ba8f-d8b70c947a13)  
using track title and one of the artists on the track “#1 dads”

i am using an artist and title on a track to confirm the artist’s mbzid, and using a specific track to reduce errors.

i am using  
[https://musicbrainz.org/ws/2/recording?query=recording:'Two%20Weeks'&artistname:'%231%20Dads'&fmt=json](https://musicbrainz.org/ws/2/recording?query=recording:%27Two%20Weeks%27&artistname:%27%231%20Dads%27&fmt=json)

i am using artist name as the documentation says this is how to search for a named artist on a track with multiple artists (i believe)

it doesnt work, could anyone advise as to how you find this recording using title and artist where the number of artists on the track may be more than 1.  
thanks

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [May 31, 2020, 7:53pm UTC](https://community.metabrainz.org/t/search-api-can-not-find-this-recording/479535/2 "2020-05-31T19:53:46Z")

</div>

I changed it a little bit and it is found now: [`query=recording%3A%22Two%20Weeks%22%20AND%20artistname%3A%22%231%20Dads%22`](https://musicbrainz.org/ws/2/recording?query=recording%3A%22Two%20Weeks%22%20AND%20artistname%3A%22%231%20Dads%22&fmt=json) (`recording:"Two Weeks" AND artistname:"#1 Dads"`) but I usually use just `artist` not `artistname`, I never tried to understand the difference.

---

<div class="post-metadata">

**Author:** ![nicholasbird](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/n/9de0a6/32.png) [@nicholasbird](https://community.metabrainz.org/u/nicholasbird)\
**Post date:** [May 31, 2020, 8:10pm UTC](https://community.metabrainz.org/t/search-api-can-not-find-this-recording/479535/3 "2020-05-31T20:10:05Z")

</div>

thank you so much..can you advise is the lesson simply to enclose all terms in double quotes as a general rule..is that a known thing?

artist vs artistname  
according to documentation  
|artist|artist name is name(s) as it appears on the recording|  
|artistname|an artist on the recording, each artist added as a separate field|

so i assume the reason why  
[https://musicbrainz.org/ws/2/recording?query=recording:“Two%20Weeks”%20AND%20artist:“%231%20Dads”&fmt=json](https://musicbrainz.org/ws/2/recording?query=recording:%22Two%20Weeks%22%20AND%20artist:%22%231%20Dads%22&fmt=json)  
works..when it shouldnt (because the artist is" #1 Dads feat. Tom Snowdon") is simply due to the normal reason of the searches being promiscuous when an exact match isnt found?

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [May 31, 2020, 8:13pm UTC](https://community.metabrainz.org/t/search-api-can-not-find-this-recording/479535/4 "2020-05-31T20:13:41Z")

</div>

I use double quotes for everything, it’s just my habit, this search also works with single quotes.  
The issue here was that you used `&` (and even not encodeURIComponent) instead of `AND` inside `?query=`, between `recording:` and `artistname:`.
