I like to use the wikipedia entry API.
Ok, my JSON request looks like this:
var request = 'https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&titles=berlin';
$.getJSON(request, function(data) {
console.log(data)
})
What I get is something like this:
{"batchcomplete":"","query":{"pages":{"411322":{"pageid": 411322,"ns":0,"title":"Berlin","extract":"entry-text."}}}}
But how to extract the information with JSON extraction.
I tried to do:
var x=data.query.pages
But that didn't work for me, to extract Title and extract-text.