An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
January 14, 2022 04:22 pm GMT
Original Link: https://dev.to/manuthecoder/hey-did-you-know-devto-has-an-api-3api
Hey! Did you know Dev.to has an API??
Have you ever wanted to embed a "Recent Posts" in your website? DEV.to has an API for this.
Check out this example: https://manuthecoder.ml
Just make a simple HTTP request to this URL:
https://dev.to/api/articles?username=____YOUR_USERNAME_HERE____&per_page=5
Example JS usage:
fetch("https://dev.to/api/articles?username=manuthecoder&per_page=10") .then(res => res.json()) .then(res => { res.forEach(article => { var item = document.createElement("div") item.innerHTML = `<b>${article.title}</b><p></p>${article.description}</p>`; item.classList.add("card") document.body.appendChild(item) })})
- screw IE. nobody uses it lol
Original Link: https://dev.to/manuthecoder/hey-did-you-know-devto-has-an-api-3api
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To