DEV Community 👩‍💻👨‍💻

Cover image for How to make an API call using Deno
Alexandru-Dan Pop
Alexandru-Dan Pop

Posted on • Updated on

How to make an API call using Deno

Without trying to start any more hype for Deno today, I'm just going to show an example of doing a HTTP call with this shiny new tool.

Show me the code

import { soxa } from ''

const welcomeText = "Welcome to Deno.. a random joke is being prepared for you...";
console.log(`\n ${welcomeText} \n`);

async function fetchData() {
    const result = await soxa.get('');
    console.log(`${} \n`);
  } catch (err) {


Enter fullscreen mode Exit fullscreen mode


In the JS ecosystem we have been spoiled with tools where we can try our code straightaway, and you can do this with Deno today using a sandbox:

So just copy-paste the code above in the sandbox, click run, and enjoy.

We live some troubled times, so hopefully a Chuck Norris joke will put a smile on your face.

Img of sandbox running Deno

More interesting reads:

Top comments (4)

caroso1222 profile image
Carlos Roso

Great post, succinct and straight to the point, thanks!

alexandrudanpop profile image
Alexandru-Dan Pop


jwp profile image
John Peters

Did they name the http client "soxa" ?

alexandrudanpop profile image
Alexandru-Dan Pop • Edited on

Rings a bell? 🙂
It's a community package, so not really "the" way to do it.

Anyone can add third party modules and they appear here if you add them to their DB (it's pretty straight forward):

Let's Get Hacking

Join the DEV x Linode Hackathon 2022 and use your ingenuity and creativity to build using Linode.

Join the Hackathon <-