Help with Wikipedia project API

Help with Wikipedia project API
0

#1

I’m not sure if I’m looping through the json data correctly. Could someone tell me what I’m doing incorrectly? https://codepen.io/lalov1/pen/EyXyOz


#2

You’re iterating the wrong thing. Try this code out and see how it’s different:

success: function(data){
          //console.log(data.query.search["0"].snippet);
          console.log(data.query.search)
        }

#3

Awesome! That worked, but I don’t see how I would get the specific page. How does that work?

Thank you!


#4

Do you mean the link to the Wikipedia article? They are all https://en.wikipedia.org/wiki/ + articleTitle so you can generate them easily.


#5

Yes, I’ll give it a try!