If you're a developer who writes articles on daily.dev, you may want to display these articles on your personal blog or portfolio website. One way to do this is by using the dev.to API, which allows you to access articles from daily.dev and other websites.
Step 1: Get Your daily.dev Username
First, you'll need to find your daily.dev username. This is the handle that appears in the URL of your articles, such as "https://dev.to/{username}/your-article-slug".
Step 2: Fetch Your Articles
To fetch your articles from daily.dev, make a GET request to the following endpoint:
https://dev.to/api/articles?username={USERNAME}
Replace {USERNAME} with your actual daily.dev username. This endpoint will return a JSON array of your articles, along with their titles, URLs, and other metadata.
Step 3: Display Your Articles in Your Blog App
Once you have your articles, you can display them in your blog app however you like. For example, you could loop through the array of articles and render a list of links to each article. Or, you could display the full text of each article on a separate page.
To display the full text of an article, you can make a GET request to the URL of the article, which is included in the JSON object returned by the API. This will return the HTML content of the article, which you can then parse and display in your app.
Conclusion
Using the dev.to API, it's easy to fetch and display your articles from daily.dev in your personal blog or portfolio website. With just a few lines of code, you can keep your app up to date with your latest content from daily.dev.
Top comments (1)
How do I get over the limit on the articles I get? I am getting stopped at 30 but I have more articles than that