Create a command to find word meanings in dictionary

Hey @Clauwasaki!

You need to use $(eval), $(urlfetch), and $(query), if you don’t know what these do, please read the documentation.
You also need to use the documentation of the API you gave us, you’ll notice the API output is in JSON, the example given allows us to figure out how to exploit it with Javascript, but we could have gotten the same information by just trying the API in the browser.

With all that said, here’s the command to get the first result of any single word search:

$(eval $(urlfetch json https://api.dictionaryapi.dev/api/v2/entries/en/$(query))[0].meanings[0].definitions[0].definition)
1 Like