Posts

List posts

get/posts

Request

  • Base URL
    https://gorest.co.in/public/v3
  • URL
    https://gorest.co.in/public/v3/posts
  • Auth
    • none
    • or HTTP bearer

Query parameters

page[size]integer

Items on one page.

page[after]string

The cursor of the next page, from meta.next_cursor or the Link header. Treat it as opaque; it works only with the same query.

page[number]integer

Offset paging, 1 based, at most 10,000. Cannot be sent with page[after]. Pages can shift while you write.

page[count]boolean

true adds meta.total to a cursor page (it costs a count).

searchstring

Case-insensitive text search over the resource's text fields.

statusstring
user_idstring uuid

filter[user_id]= (one user), filter[status]=draft,published (any of). An id you cannot see gives an empty list.

sort'created_at' | '-created_at' | 'title' | '-title'

One field; a leading - sorts descending. Default -created_at.

postsstring

fields[posts]=id,title returns only those fields; included items are added whole.

includestring

Adds related items to each item, one level deep: user, comments. Comma separated.

Headers

If-None-Matchstring

An ETag from an earlier answer; an unchanged item answers 304 with no body.

Response

One page of posts.

Example response

{
  "data": [
    {
      "comments": [
        {
          "post": {
            "title": "Cursor paging in five minutes",
            "user": {
              "email": "aarav.sharma@example.com",
              "name": "Aarav Sharma"
            }
          },
          "user": {
            "email": "aarav.sharma@example.com",
            "name": "Aarav Sharma"
          }
        }
      ],
      "title": "Cursor paging in five minutes",
      "user": {
        "email": "aarav.sharma@example.com",
        "name": "Aarav Sharma"
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.