DEV Community

Senthil Pitchappan V
Senthil Pitchappan V

Posted on

3 1

Dev.to API's which can be used to view posts on your web page / portfolio

Steps:

  1. Create a API key from your dev.to account, here
  2. Save your API key, in postman or .env file of your project.

Used this API in my portfolio, which works great. Do check it out.

API:

Your Published Article
curl --location --request GET 'https://dev.to/api/articles/me/published' \
--header 'api-key: API_KEY'
Enter fullscreen mode Exit fullscreen mode
Your Unpublished Article
curl --location --request GET 'https://dev.to/api/articles/me/unpublished' \
--header 'api-key: API_KEY'
Enter fullscreen mode Exit fullscreen mode
Update an Article
curl --location --request PUT 'https://dev.to/api/articles/{id}' \
-d '{
      "article": {
              "title": "Hello, World!",
              "published": true,
              "body_markdown": "Hello DEV, this is my first 
                   post",
              "tags": [
                  "discuss",
                  "help"
              ],
              "series": "Hello series"
              }
    }' \
--header 'api-key: API_KEY'
Enter fullscreen mode Exit fullscreen mode
Create a new post
curl --location --request POST 
'https://dev.to/api/articles' \
-d '{
           "article": {
              "title": "Hello, World!",
              "published": true,
              "body_markdown": "Hello DEV, this is my first 
                    post",
              "tags": [
                  "discuss",
                  "help"
               ],
               "series": "Hello series"
              }
    }' \
--header 'api-key: API_KEY'
Enter fullscreen mode Exit fullscreen mode
List of followers
curl --location --request GET 'https://dev.to/api/followers/users' \
--header 'api-key: API_KEY'
Enter fullscreen mode Exit fullscreen mode
List of tags you follow
curl --location --request GET 'https://dev.to/api/follows/tags' \
--header 'api-key: API_KEY'
Enter fullscreen mode Exit fullscreen mode
Get your Profile Photo
curl --location --request GET 'https://dev.to/api/profile_images/{user_name}' \
--header 'api-key: API_KEY'
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (1)

Collapse
 
ayabouchiha profile image
Aya Bouchiha

Thank you

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

Best practices for optimal infrastructure performance with Magento

Running a Magento store? Struggling with performance bottlenecks? Join us and get actionable insights and real-world strategies to keep your store fast and reliable.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️