DEV Community

Usaid
Usaid

Posted on

Simple way to use dev.to article API to show your articles on your portfolio website.

Do you want to set your dev.to articles to appear on your portfolio website?
Let me show you how I used the article API to get my dev.to posts on my portfolio website in just two steps.

  1. Just add your username at the end of this API-link: "https://dev.to/api/articles?username=yourUserName"
  2. Use axios to get your posts and then render it on the frontend.

simple example:

const getDevToPosts = () => {
axios
.get("https://dev.to/api/articles?username=usaidpeerzada")
.then((res) => {
setBlogState(res.data);
});
};

Discussion (1)

Collapse
bazalduadw profile image
Bazaldua

Thanks!