DEV Community

Sh Raj
Sh Raj

Posted on • Edited on

Dev.to APIs πŸš€

GET Endpoints:

  1. Articles:

    • GET /api/articles: Retrieve a list of articles.
    • GET /api/articles/:id: Retrieve a specific article by its ID.
    • GET /api/articles/:slug: Retrieve a specific article by its URL slug.
    • https://dev.to/api/articles?per_page=12&page=${page}
    • https://dev.to/api/articles/latest?per_page=12&page=4 https://dev.to/stories/feed/latest?page=1
  2. Comments:

    • GET /api/comments: Retrieve a list of comments.
    • GET /api/comments/:id: Retrieve a specific comment by its ID.
  3. Users:

    • GET /api/articles/?username={username}: Retrieve a list of users.
    • GET /api/users/:username: Retrieve a specific user by their username.
  4. Tags:

    • GET /api/tags: Retrieve a list of tags.
    • GET /api/tags/:tag_name: Retrieve articles associated with a specific tag.
  5. Search

    • https://dev.to/api/articles/search?q=sh20raj
    • https://dev.to/search/feed_content?per_page=15&page=0&sort_by=published_at&sort_direction=desc&approved=&class_name=Article
    • https://dev.to/search/feed_content?per_page=60&page=0&class_name=Article&search_fields=dev.to+apis

POST Endpoints:

  1. Articles:

    • POST /api/articles: Create a new article.
  2. Comments:

    • POST /api/comments: Create a new comment.
  3. Users:

    • POST /api/users: Create a new user.
  4. Authentication:

    • POST /api/auth/token: Obtain an authentication token.
  5. Followers:

    • POST /api/follows: Follow a user.
  6. Reactions:

    • POST /api/articles/:id/reactions: React to an article.
    • POST /api/comments/:id/reactions: React to a comment.

Other Methods:

  1. PUT Endpoints:
  • PUT /api/articles/:id: Update an existing article.
  • PUT /api/comments/:id: Update an existing comment.
  • PUT /api/users/:username: Update an existing user.
  1. DELETE Endpoints:
  • DELETE /api/articles/:id: Delete an article.
  • DELETE /api/comments/:id: Delete a comment.
  • DELETE /api/users/:username: Delete a user.
  • DELETE /api/auth/token: Revoke an authentication token.
  • DELETE /api/follows/:id: Unfollow a user.

These sections categorize the endpoints based on their HTTP methods, making it easier to understand which endpoints are used for retrieving data (GET), creating new resources (POST), updating existing resources (PUT), and deleting resources (DELETE).

Top comments (0)