Get Artists with specific country and genre

Hello,

I am trying to retrieve artists based on a country like using Search API method:

http://musicbrainz.org/ws/2/artist/?query=country:us&limit=100&offset=0

It seems to be working.
When I try to add ‘pop’ tag to the query (in addition to the country) to receive ‘pop’ genre, it returns unexpected results which makes the query unusable:

http://musicbrainz.org/ws/2/artist/?query=tag:pop+AND+country:us&limit=100&offset=0

An assistant would be appreciated.

From quickly looking over the result I don’t see anything unexpected, the results all seem to have “pop” in one of their tags.

If you mean that you want to have only results where a tag is exactly “pop” (and not e.g. “pop rock”) I don’t think this is possible with Lucene queries. You probably could filter out unwanted tags with something like tag:pop AND NOT tag:rock AND country:us

4 Likes

Hi, is it possible to get that list not using code, but using the search UI?

Sure, there is a search at Search - MusicBrainz

Enabled “Indexed search with advanced query syntax”

2 Likes

Thanks @outsidecontext for your feedback.
I used the query

area:Italy AND tag="progressive rock"

with the following result : it is quite far from what I expected :slightly_smiling_face:

Now I have 2 questions:

  • using “area= Italy” the result is only with the exact match of this string or the geographic reprentation, so also the cities in the country?
  • wich is the field in the autor template used to match the tag?

The correct syntax is area:Italy AND tag:"progressive rock" (note the colon), and with that the result looks good to me.

The documentation says

(part of) the name of the artist’s main associated area

See Indexed Search Syntax - MusicBrainz . So ('d say that will find artist’s with the area set to Italy, but not those which have set the area to Rome. But I don’t know whether maybe hierarchical search is implemented here.

The folksonomy tags and genres, which you can see on the sidebar on the right of the artist’s page

1 Like

I tried with the country and a town , and the second results are not included in the first ones: so, there is no hierarchical search for the area.

Let me say that a hierarchy should be used also for the tags, in order to adress all the genres with the same root.

Any hint abaout how to manage such hierarchies

the hierarchy of areas does exist

you linked Siena (city), which is part of Siena (province), which is part of Toscana (region), which is part of Italy (country)

i’m not sure what it would take to get a search to include all parts of an area (instead of things just tagged as in the area itself) aside from using a bunch of ORs

How can I use such hierarchy in a query?

1 Like

Hi all,
may I revamp this threat? I’m also looking to get all artists with an area, beginarea or endarea in a certain country. It must be possible, because Belgium - Artists - MusicBrainz seems to find artists that have Belgium somewhere in the area, beginarea or endarea field. The page also loads really fast, so there must be some cache or index? I’d greatly appreciate it if somebody could help me out finding the right API call?
Thanks,
T.

Just https://musicbrainz.org/ws/2/artist?area=5b8a5ee5-0bb3-34cf-9a75-c27c44e341fc should do the trick I think.

2 Likes

I think you are right! The count for BE is 43552 and the webpage shows 436 pages. So with 100 artists per page, that seems right!
Thanks a lot,
T.