Mediawiki search by infobox property

237 views Asked by At

I want search the media wiki api using the search term on specific category (eg: song).

Search term, I am trying to use combination of song name and artist

Search term = "song name" + "artist"

https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=xmlfm&titles=Why%20This%20Kolaveri%20Di%20&rvsection=0

Above api giving the infobox information like below

{{Infobox song
| Name = ''Why This Kolaveri Di''
| Cover = 
| Caption- = Screenshot of the song
| Artist = [[Dhanush]]
| Album = [[3 (2012 Indian film)|3]]
| URL =
| A-side =
| B-side =
| country = India
| Released = 16 November 2011
| Format = [[Music download|Digital download]]
| track_no = 1
| Recorded = [[2011 in music|2011]] at [[Panchathan Record Inn and AM Studios|AM Studios]], [[Chennai]]
| Genre =
| Length = 4:09
| Label = [[Sony Music Entertainment|Sony Music]]
| Producer = [[Anirudh Ravichander]]
| Writer = [[Dhanush]]
| Composer = [[Anirudh Ravichander]]
| Language = [[Tanglish]]
| Chart position =
| prev =
| prev_no = 2
| Misc =
{{External music video|{{YouTube|YR12Z8f1Dh8|"Why This Kolaveri Di"}}|Type=song}}
}}

I am trying to extract information from that.

So my question how can I query to search relevant page and get the Infobox data in single query. Is it possible in single query or do I need to use multiple query!

1

There are 1 answers

0
Tgr On

You need to use the search query as a generator (basically merge the parameters from the two queries and prepend all the parameter names from the search query with a g).