Skip to main content
GET
/
v1
/
posts
List posts
curl --request GET \
  --url https://api.marblecms.com/v1/posts \
  --header 'Authorization: Bearer <token>'
{
  "posts": [
    {
      "id": "clx000post",
      "slug": "getting-started-with-nextjs",
      "title": "Getting Started with Next.js",
      "content": "<p>Hello world</p>",
      "featured": false,
      "coverImage": "https://cdn.example.com/cover.jpg",
      "description": "A beginner's guide to Next.js",
      "publishedAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-01-16T12:00:00Z",
      "attribution": "Photo by Unsplash",
      "authors": [
        {
          "id": "clx123abc",
          "name": "John Doe",
          "image": "https://cdn.example.com/avatar.jpg",
          "bio": "Technical writer and developer",
          "role": "Editor",
          "slug": "john-doe",
          "socials": [
            {
              "url": "https://twitter.com/johndoe",
              "platform": "twitter"
            }
          ]
        }
      ],
      "category": {
        "id": "clx456def",
        "name": "Technology",
        "slug": "technology",
        "description": "Tech news and tutorials"
      },
      "tags": [
        {
          "id": "clx789ghi",
          "name": "JavaScript",
          "slug": "javascript",
          "description": "JavaScript tutorials"
        }
      ]
    }
  ],
  "pagination": {
    "limit": 10,
    "currentPage": 1,
    "nextPage": 2,
    "previousPage": null,
    "totalPages": 5,
    "totalItems": 42
  }
}

Authorizations

Authorization
string
header
required

Your Marble API key

Query Parameters

limit
string
default:10

Number of posts per page, or 'all' for no pagination

Example:

"10"

page
string
default:1

Page number

Example:

"1"

order
enum<string>
default:desc

Sort order by publishedAt

Available options:
asc,
desc
Example:

"desc"

categories
string

Comma-separated category slugs to include

Example:

"tech,news"

excludeCategories
string

Comma-separated category slugs to exclude

Example:

"drafts"

tags
string

Comma-separated tag slugs to include

Example:

"javascript,react"

excludeTags
string

Comma-separated tag slugs to exclude

Example:

"outdated"

query
string

Search query for title and content

Example:

"nextjs"

format
enum<string>

Content format (html or markdown)

Available options:
html,
markdown
Example:

"html"

Response

Paginated list of posts

posts
object[]
required
pagination
object
required