Last active
August 29, 2015 14:01
-
-
Save fehguy/c100e957219336e5f3c0 to your computer and use it in GitHub Desktop.
Calling wordnik API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.authorizations.add("api_key", new ApiKeyAuthorization("api_key", "YOUR_KEY", "header")); | |
var args = {word: "cat"}; | |
wordnik = new SwaggerApi({ | |
url: "https://api.wordnik.com/v4/resources.json", | |
success: function() { | |
if(wordnik.ready === true) { | |
wordnik.word.getDefinitions(args, function(data){ | |
var definitions = data.obj; console.log(definitions[0].word); | |
for (var i = 0; i < definitions.length; i++) { | |
var definition = definitions[i]; | |
console.log(definition); | |
} | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment