Wikipedia API: how to search for a term in a specific category

后端 未结 2 1215
有刺的猬
有刺的猬 2020-12-29 13:12

I\'m having hard time to figure out a basic task: how to find a term restricted in a specific category..

i feel Wiki API documentation is kinda confusing...

相关标签:
2条回答
  • 2020-12-29 13:27

    I feel your pain bro, try something like:

    http://en.wikipedia.org/w/api.php?action=query&list=search&format=jsonfm&srsearch=matrix+incategory:English-language_films

    Change the above format from jsonfm to json for real json output.

    0 讨论(0)
  • 2020-12-29 13:33

    You can't tell the API to only return articles from a category that match a certain criteria, unfortunately. You can, however, tell the API to return articles in a specific category, such as "1990s science fiction films", and then use another programming language such as PHP or JavaScript to then return the articles that match your specified criteria.

    0 讨论(0)
提交回复
热议问题