I'm in the middle of learning about how to use APIs with LC but having problems calling the Wikipedia API. As per their documentation https://www.mediawiki.org/wiki/API:Tutorial I've put together the following code (similar has worked for other APIs) but draws a blank with wikipedia.
Is it that the JSON output is not in format that LC is expecting as it looks slightly different to other APIs have been successfully calling?
Grateful for any advice.
Many thanks,
Glenn
Code: Select all
on mouseup
put "https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=LiveCode&format=json" into tURL
put url tURL into tData
put JSONtoArray(tData) into tArray
repeat with x = 1 to the number of elements in tArray
put tArray["title"] into tSearch
put tSearch into field"Field"
end repeat
end mouseup