v1

latestOpenAPI 3.0.12026-07-1715846.6 KB
Posts

List posts

Retrieves a list of posts with optional filtering and pagination. Returns lightweight post objects optimized for list views (excludes full content, only returns content_length for read time calculation).

get/api/v1/posts

Query parameters

limitinteger

Number of posts to return

offsetinteger

Number of posts to skip (for pagination)

status'draft' | 'published' | 'archived' | 'deleted'

Filter by post status

category_idinteger

Filter by category ID

sub_category_idinteger

Filter by subcategory ID

searchstring

Search in title, content, and summary

sort_by'created_at' | 'updated_at' | 'view_count' | 'title'

Field to sort by

sort_order'ASC' | 'DESC'

Sort order

Response

Posts retrieved successfully

statusboolean
messagestring

Example response

{
  "status": true,
  "message": "Posts retrieved successfully",
  "data": [
    {
      "id": 1,
      "slug": "getting-started-with-go",
      "title": "Getting Started with Go",
      "summary": "Learn the basics of Go programming",
      "meta_description": "A comprehensive guide to getting started with Go",
      "keywords": "go,programming,tutorial",
      "category_id": 1,
      "sub_category_id": 2,
      "created_by": 1,
      "view_count": 100,
      "content_length": 1250
    }
  ],
  "meta": {
    "total": 100,
    "limit": 10
  }
}