neyn
neyn

Reputation: 1

Get all wikipedia category list with each language using api?

I want get all wikipedia categorys name with api. i search it and find some way like dumb data or sql data but i want make it this with wikipedia api. Also i found it some great link for wikipedia tools like wmflabs.org but this tools not have my need.

i want use wikipedia api and result json data and get english wikipedia category name list. All categories content is here-> https://en.wikipedia.org/wiki/Portal:Contents/Categories

i need same style category name lis data all other languages.

i find it some query but not enough like(find subcategorys in weapons category)-> https://en.wikipedia.org/w/api.php ?action=query&list=categorymembers&cmtitle=Category:Weapons

Is any solution have for this situation?

Upvotes: 0

Views: 646

Answers (1)

Petr
Petr

Reputation: 6269

All the categories belong to the Category namespace, that has id=14, so you can use allpages API and filter by namespace using the apnamespace parameter. Here's an example query.

Upvotes: 0

Related Questions