DEV API (beta) (0.7.0)

Download OpenAPI specification:Download

Access DEV articles, users and other resources via API.

All endpoints that don't require authentication are CORS enabled.

Dates and date times, unless otherwise specified, must be in the RFC 3339 format.

Authentication

api_key

API Key authentication.

Authentication for some endpoints, like write operations on the Articles API require a DEV API key.

Getting an API key

To obtain one, please follow these steps:

  • visit https://dev.to/settings/account

  • in the "DEV API Keys" section create a new key by adding a description and clicking on "Generate API Key"

    obtain a DEV API Key

  • You'll see the newly generated key in the same view generated DEV API Key

Security Scheme Type API Key
Header parameter name: api-key

oauth2

OAuth2 authentication.

OAuth2 authentication is still in private alpha.

Security Scheme Type OAuth2
authorizationCode OAuth Flow
Authorization URL: https://dev.to/oauth/authorize
Token URL: https://dev.to/oauth/token
Refresh URL: https://dev.to/oauth/token
Scopes:
    clientCredentials OAuth Flow
    Token URL: https://dev.to/oauth/token
    Refresh URL: https://dev.to/oauth/token
    Scopes:

      articles

      Articles are all the posts users create on DEV

      Published articles

      get/articles

      Production server

      https://dev.to/api/articles

      This endpoint allows the client to retrieve a list of articles.

      "Articles" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code.

      By default it will return featured, published articles ordered by descending popularity.

      It supports pagination, each page will contain 30 articles by default.

      query Parameters
      page
      integer <int32> >= 1
      Default: 1

      Pagination page.

      per_page
      integer <int32> [ 1 .. 1000 ]
      Default: 30

      Page size (the number of items to return per page).

      tag
      string
      Example: tag=discuss

      Using this parameter will retrieve articles that contain the requested tag.

      Articles will be ordered by descending popularity.

      This parameter can be used in conjuction with top.

      username
      string
      Example: username=ben

      Using this parameter will retrieve articles belonging to a User or Organization ordered by descending publication date.

      If state=all the number of items returned will be 1000 instead of the default 30.

      This parameter can be used in conjuction with state.

      state
      string
      Enum: "fresh" "rising" "all"
      Example: state=fresh

      Using this parameter will allow the client to check which articles are fresh or rising.

      If state=fresh the server will return fresh articles. If state=rising the server will return rising articles.

      This param can be used in conjuction with username, only if set to all.

      top
      integer <int32> >= 1
      Example: top=2

      Using this parameter will allow the client to return the most popular articles in the last N days.

      top indicates the number of days since publication of the articles returned.

      This param can be used in conjuction with tag.

      collection_id
      integer <int32>
      Example: collection_id=99

      Adding this will allow the client to return the list of articles belonging to the requested collection, ordered by ascending publication date.

      Responses

      200

      A list of articles

      Request samples

      Copy
      curl https://dev.to/api/articles
      

      Response samples

      Content type
      application/json
      Copy
      Expand all Collapse all
      []

      Create a new article

      post/articles

      Production server

      https://dev.to/api/articles

      This endpoint allows the client to create a new article.

      "Articles" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code.

      Rate limiting

      There is a limit of 10 requests per 30 seconds.

      Additional resources

      Authorizations:
      Request Body schema: application/json

      Article to create

      article
      object

      Responses

      201

      A newly created article

      400

      BadRequest

      401

      Unauthorized

      403

      Forbidden

      422

      Unprocessable Entity

      429

      Too Many Requests

      Request samples

      Content type
      application/json
      Example
      Copy
      Expand all Collapse all
      {
      • "article":
        {
        • "title": "Hello, World!",
        • "published": true,
        • "body_markdown": "Hello DEV, this is my first post",
        • "tags":
          [
          • "discuss",
          • "help"
          ],
        • "series": "Hello series",
        }
      }

      Response samples

      Content type
      application/json
      Copy
      Expand all Collapse all
      {}

      A published article

      get/articles/{id}

      Production server

      https://dev.to/api/articles/{id}

      This endpoint allows the client to retrieve a single published article given its id.

      path Parameters
      id
      required
      integer <int32> >= 1
      Example: 150589

      Id of the article

      Responses

      200

      An article

      404

      Resource not found

      Request samples

      Copy
      curl https://dev.to/api/articles/150589
      

      Response samples

      Content type
      application/json
      Copy
      Expand all Collapse all
      {}

      Update an article

      put/articles/{id}

      Production server

      https://dev.to/api/articles/{id}

      This endpoint allows the client to update an existing article.

      "Articles" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code.

      Rate limiting

      There is a limit of 150 requests per 30 seconds.

      Additional resources

      Authorizations:
      path Parameters
      id
      required
      integer <int32> >= 1
      Example: 150589

      Id of the article

      Request Body schema: application/json

      Article params for the update.

      Note: if the article contains a front matter in its body, its front matter properties will still take precedence over any JSON equivalent params, which means that the full body_markdown with the modified front matter params needs to be provided for an update to be successful

      article
      object

      Responses

      200