srd.pl
srd.pl

Reputation: 571

Wikipedia API - is there a general 'music' category?

I have a problem with Wikipedia API. I am using openSearch to get results with links to wikipedia pages. However open search doesn't seem to support +incategory. What is more, I would like to search for music artist (bands, solo singer and all other type of musicians). However I can't find any category named 'music'. The categories are too specific (i.e. 1980s music groups, solo singers etc.). However when you look at disambiguation page of wikipedia for example for offspring you can see this 'in music':

http://en.wikipedia.org/wiki/Offspring_%28disambiguation%29

So to sum up:

A) how can I use categories with action=opensearch? I need this action because I need the wikipedia url and I don't know how to retrieve this in another way.

B) how to set up a general category like 'music'?

Upvotes: 3

Views: 2106

Answers (1)

Anomie
Anomie

Reputation: 94834

A) It appears that Wikipedia's OpenSearch implementation does a prefix search on page titles only. There is no way to specify categories to look in. You should look into action=query&list=search instead. Note that you can easily create a Wikipedia url from the page title by simply percent-encoding it and appending it to http://en.wikipedia.org/wiki/.

B) As you've noted, Wikipedia's categorization system generally eschews broad categories such as "Music" in favor of more specific hierarchies. At this time, there is no way to search in subcategories of a category. You could "set up" such a category by convincing the Wikipedia community to change the way they do things (go here), but you're unlikely to meet with any success.

The "In music" you might see on a disambiguation page has nothing to do with categories you might be able to query or search on, it's just a section in the page used to organize the list no different from the section header "Sister sites" in Wikipedia's article about Stack Overflow.

Upvotes: 3

Related Questions