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.
- Just add your username at the end of this API-link: "https://dev.to/api/articles?username=yourUserName"
- 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)
Thanks!
Hi, thanks for this! The API returns the description truncated with "...". Is there a way to get the full body of the article?