How to get all Wikipedia article titles with MediaWiki API?

荒凉一梦 提交于 2019-12-11 13:44:07

问题


I know you can get all titles from Wikipedia's Database dump and that you can query for specific titles, but how can you get them all through the MediaWiki API?


回答1:


For that you would use the Allpages API:

https://en.wikipedia.org/w/api.php?action=query&format=json&list=allpages&aplimit=max

You will not get all at once but up to 500 at a time and then a continuation marker which you can use for next batch of titles. Continue this until the JSON does not have query-continue in the beginning of the answer.



来源:https://stackoverflow.com/questions/29258782/how-to-get-all-wikipedia-article-titles-with-mediawiki-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!