v1

latestOpenAPI 3.1.02026-07-13305453.8 KB
Posts

List posts

Get a paginated list of published posts with optional filtering

get/v1/posts

Query parameters

limitinteger

Number of posts per page (1-100)

Example:10

Number of posts per page (1-100)

pageinteger

Page number

Example:1

Page number

order'asc' | 'desc'

Sort order by publishedAt

Example:desc

Sort order by publishedAt

categoriesstring[]

Category slugs to include

Category slugs to include

[
  "tech",
  "news"
]
excludeCategoriesstring[]

Category slugs to exclude

Category slugs to exclude

[
  "changelog"
]
tagsstring[]

Tag slugs to include

Tag slugs to include

[
  "javascript",
  "react"
]
excludeTagsstring[]

Tag slugs to exclude

Tag slugs to exclude

[
  "outdated"
]
querystring

Search query for title and content

Example:nextjs

Search query for title and content

format'html' | 'markdown'

Content format (html or markdown)

Example:html

Content format (html or markdown)

featured'true' | 'false'

Filter by featured status

Example:true

Filter by featured status

status'published' | 'draft' | 'all'

Filter by post status. Use 'published' for live posts, 'draft' for unpublished posts, or 'all' for both.

Example:published

Filter by post status. Use 'published' for live posts, 'draft' for unpublished posts, or 'all' for both.

Response

Paginated list of posts

Example response

{
  "posts": [
    {
      "id": "cryitfjp5678mn09qrstuvwx",
      "slug": "getting-started-with-nextjs",
      "title": "Getting Started with Next.js",
      "status": "published",
      "coverImage": "https://media.marblecms.com/cover.jpg",
      "description": "A beginner's guide to Next.js",
      "publishedAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-01-16T12:00:00Z",
      "authors": [
        {
          "id": "cryitfjp1234jl04vdnycek8",
          "name": "John Doe",
          "image": "https://media.marblecms.com/avatar.jpg",
          "bio": "Technical writer and developer",
          "role": "Editor",
          "slug": "john-doe",
          "socials": [
            {
              "url": "https://twitter.com/johndoe",
              "platform": "twitter"
            }
          ]
        }
      ],
      "category": {
        "id": "cryitfjp1234jl04vdnycek8",
        "name": "Technology",
        "slug": "technology",
        "description": "Tech news and tutorials"
      },
      "tags": [
        {
          "id": "cryitfjp1234jl04vdnycek8",
          "name": "JavaScript",
          "slug": "javascript",
          "description": "JavaScript tutorials"
        }
      ],
      "fields": {
        "release_date": "2024-01-15",
        "priority_score": 5,
        "hashtags": [
          "#javascript",
          "#nextjs"
        ]
      },
      "content": "<p>Hello world</p>"
    }
  ],
  "pagination": {
    "limit": 10,
    "currentPage": 1,
    "nextPage": 2,
    "totalPages": 5,
    "totalItems": 42
  }
}
All 30 operations