DEV Community

Cover image for How to fetch your dev.to posts
Luthfi Afriansyah
Luthfi Afriansyah

Posted on

How to fetch your dev.to posts

Do you want to get the datas of your dev.to posts? Here's a quick tutorial :

Fetch the api using Javascript built in function fetch.

fetch('https://dev.to/api/articles?username=luthpai')
  .then(res => res.json())
  .then(data => console.log(data))
Enter fullscreen mode Exit fullscreen mode

You can apply the codes above by changing the username and change the then(data => ...) depend on what Javascript framework you're using.

Top comments (0)