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);
});
};

Top comments (2)

Collapse
 
bazalduadw profile image
Bazaldua

Thanks!

Collapse
 
chinonsoike profile image
Chinonso Ikewelugo

Hi, thanks for this! The API returns the description truncated with "...". Is there a way to get the full body of the article?