Home > Back-end >  In wikipedia API second array empty
In wikipedia API second array empty

Time:09-28

While retrieving JSON data the second array in the Wikipedia API is always empty why is it so?

https://en.wikipedia.org/w/api.php?format=json&action=opensearch&origin=*&search=javascript

Tried changing the search term but still, the second array is empty. Please help with any alternate link or any parameters that I might be missing.

CodePudding user response:

According to the API documentation the empty array should return the first line of the article. For some reason, the API returns an empty string. If you compare the response from the Sandbox API with the given response in the Example section on the documentation page you'll see that the error occurs in the API and not on your end.

Update After some more reading, below the Example section there is a link to a bug report which explains why the descriptions are disabled: https://phabricator.wikimedia.org/T241437

  • Related