Issue with AJAX request with Wikipedia API

Issue with AJAX request with Wikipedia API
0

#1

Hello,

So, there is something I just cannot understand with the Wikipedia API.

If I do the AJAX request with the following data parameters :

data: { action: 'query', list: 'search', srsearch: 'butterfly', format: 'json', srnamespace: 0, srlimit: 10, prop: 'info', inprop: 'url' }

I’d expect to see what’s included in the prop parameter. (such as the page id). But I don’t see the page id in the returned objects. :sweat:

Now, in order to see the page ids, it works if I use the generator parameter instead of the list parameter. Like this :

data: {format: 'json', action: 'query', generator: 'search', gsrnamespace: 0, gsrlimit: 10, gsrsearch: 'butterfly', gsrprop, prop: 'info', inprop: 'url'}

But then, if I add the gsrprop parameter (to get the snippet), I don’t have the snippet in the returned objects. :confused::dizzy_face:

What am I missing here ? Or are some of the parameters deprecated and the wiki page has not been updated ?


#2

I didn’t use the gsrprop parameter but here is an example of mine where I am getting the snippet: http://codepen.io/gwenf/pen/yNxeQo?editors=0010