Skip to main content
GET
/
posts
List posts
curl --request GET \
  --url https://psn-api.paystub.dev/posts
{
  "success": true,
  "data": [
    {
      "id": 123,
      "site_id": 123,
      "post_category_id": 123,
      "user_id": 123,
      "type": "<string>",
      "country": "<string>",
      "title": "<string>",
      "slug": "<string>",
      "excerpt": "<string>",
      "content": "<string>",
      "meta": {},
      "faq": {},
      "fact_check": {},
      "minutes_to_read": 123,
      "view_count": 123,
      "is_draft": true,
      "media": [
        {
          "id": 123,
          "name": "<string>",
          "file_name": "<string>",
          "mime_type": "<string>",
          "size": 123,
          "url": "<string>",
          "created_at": "2023-11-07T05:31:56Z"
        }
      ],
      "published_at": "2023-11-07T05:31:56Z",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ],
  "links": {
    "first": "https://api.paystub.dev/posts?page=1",
    "last": "https://api.paystub.dev/posts?page=1",
    "prev": "<string>",
    "next": "<string>"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": "<string>",
        "label": "<string>",
        "active": true
      }
    ],
    "path": "https://api.paystub.dev/posts",
    "per_page": 15,
    "to": 1,
    "total": 1
  }
}

Query Parameters

filter[type]
string

Filter by post type

filter[country]
string

Filter by country

filter[title]
string

Filter by title

filter[post_category_id]
integer

Filter by category ID

filter[is_draft]
boolean

Filter by draft status

include
enum<string>

Include related resources

Available options:
postCategory,
user,
site
sort
enum<string>

Sort by field

Available options:
title,
-title,
created_at,
-created_at,
published_at,
-published_at,
view_count,
-view_count

Response

200 - application/json

List of posts

success
boolean
Example:

true

data
object[]
meta
object