How to get all article pages under a Wikipedia Category and its sub-categories?

后端 未结 3 748
既然无缘
既然无缘 2020-12-09 09:03

I want to get all the articles names under a category and its sub-categories.

Options I\'m aware of:

  1. Using the Wikipedia API. Does it have such an opt
3条回答
  •  孤街浪徒
    2020-12-09 09:39

    You can do this through the following two API methods:

    For articles pages for this category

    YOUR_URL/api.php?action=query&format=json&list=categorymembers&cmtitle=Category:Music
    

    For get subcategories:

    YOUR_URL/api.php?action=query&format=json&list=categorymembers&cmtype=subcat&cmtitle=Category:Music
    

    You can get more info on Mediawiki API

提交回复
热议问题