JSFiddle - React, Tailwind, and code Playground

HTML

<pre></pre>

JavaScript

var url = 'https:\/\/en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=pageimages|extracts&pilimit=max&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch='
  
    var searchTerm = 'food';
    url = url + searchTerm + "&callback=?";
    $.getJSON(url, function(data){
      $('pre').html(JSON.stringify(data,null,4))
    })