I’m playing with wikipedia API.
I would like to get all country names from http://en.wikipedia.org/wiki/List_of_sovereign_states.
I tried with http://en.wikipedia.org/w/api.php?format=jsonfm&action=query&prop=revisions&titles=List_of_sovereign_states&rvprop=content, but all useful data is inside one string.
Is there any chance to filter that out and get just country names?
You could try parsing the string, but there is no guarantee it won’t change in the future.
You would be better off by looking at Category:Countries by continent and retrieving the names of members of its subcategories. But you would still have to filter out some noise, like “List of sovereign states and dependent territories in Europe”.
As another option, you might want to get that list from another source, like the World Bank API: http://api.worldbank.org/countries?format=json