Get recent articles globally

GET /articles

Get most recent articles globally. Use query parameters to filter results. Auth is optional

Query parameters

  • tag string

    Filter by tag

  • author string

    Filter by author (username)

  • Filter by favorites of a user (username)

  • limit integer

    Limit number of articles returned

    Default value is 20.

  • offset integer

    Offset/skip number of articles

    Default value is 0.

Responses

GET /articles
curl \
 --request GET '/api/articles'
Response examples (200)
{
  "articles": [
    {
      "body": "It takes a Jacobian",
      "slug": "how-to-train-your-dragon",
      "tags": [
        "dragons",
        "training"
      ],
      "title": "How to train your dragon",
      "author": {
        "bio": "I work at State Farm.",
        "image": "https://i.stack.imgur.com/xHWG8.jpg",
        "username": "jake",
        "following": false
      },
      "createdAt": "2021-02-18T03:22:56.637Z",
      "favorited": false,
      "updatedAt": "2021-02-18T03:48:35.824Z",
      "description": "Ever wonder how?",
      "favoritesCount": 0
    },
    {
      "body": "It is a dragon",
      "slug": "how-to-train-your-dragon-2",
      "tags": [
        "dragons",
        "training"
      ],
      "title": "How to train your dragon 2",
      "author": {
        "bio": "I work at State Farm.",
        "image": "https://i.stack.imgur.com/xHWG8.jpg",
        "username": "jake",
        "following": false
      },
      "createdAt": "2021-02-18T03:22:56.637Z",
      "favorited": false,
      "updatedAt": "2021-02-18T03:48:35.824Z",
      "description": "So toothless",
      "favoritesCount": 0
    }
  ],
  "articlesCount": 2
}
Response examples (422)
{
  "errors": {
    "body": [
      "string"
    ]
  }
}