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___…


This content originally appeared on DEV Community and was authored by Manu

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


This content originally appeared on DEV Community and was authored by Manu


Print Share Comment Cite Upload Translate Updates
APA

Manu | Sciencx (2022-01-14T16:22:09+00:00) Hey! Did you know Dev.to has an API??. Retrieved from https://www.scien.cx/2022/01/14/hey-did-you-know-dev-to-has-an-api/

MLA
" » Hey! Did you know Dev.to has an API??." Manu | Sciencx - Friday January 14, 2022, https://www.scien.cx/2022/01/14/hey-did-you-know-dev-to-has-an-api/
HARVARD
Manu | Sciencx Friday January 14, 2022 » Hey! Did you know Dev.to has an API??., viewed ,<https://www.scien.cx/2022/01/14/hey-did-you-know-dev-to-has-an-api/>
VANCOUVER
Manu | Sciencx - » Hey! Did you know Dev.to has an API??. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/14/hey-did-you-know-dev-to-has-an-api/
CHICAGO
" » Hey! Did you know Dev.to has an API??." Manu | Sciencx - Accessed . https://www.scien.cx/2022/01/14/hey-did-you-know-dev-to-has-an-api/
IEEE
" » Hey! Did you know Dev.to has an API??." Manu | Sciencx [Online]. Available: https://www.scien.cx/2022/01/14/hey-did-you-know-dev-to-has-an-api/. [Accessed: ]
rf:citation
» Hey! Did you know Dev.to has an API?? | Manu | Sciencx | https://www.scien.cx/2022/01/14/hey-did-you-know-dev-to-has-an-api/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.