Skip to main content
GET
/
v1
/
posts
curl -H "Authorization: Bearer YOUR_API_KEY" "https://api.marblecms.com/v1/posts"
{
  "posts": [
    {
      "id": "clt92n38p000108l48zkj41an",
      "slug": "introducing-marblecms",
      "title": "Introducing Marble",
      "content": "<h1>Hello World!</h1><p>This is the content of the post.</p>",
      "featured": true,
      "description": "The modern headless CMS for modern web applications.",
      "coverImage": "https://cdn.marblecms.com/images/cover.jpg",
      "publishedAt": "2024-03-05T00:00:00.000Z",
      "updatedAt": "2024-03-10T12:00:00.000Z",
      "authors": [
        {
          "id": "clt92f96m000008l4gken6v2t",
          "name": "John Doe",
          "slug": "john-doe",
          "image": "https://cdn.marblecms.com/avatars/john.jpg",
          "bio": "John is a software developer and writer.",
          "role": "Software Developer",
          "socials": [
            { "url": "https://twitter.com/johndoe", "platform": "x" }
          ]
        }
      ],
      "category": {
        "id": "clt92hrnp000208l43kbo28d0",
        "name": "Announcements",
        "slug": "announcements",
        "description": "Latest news and updates."
      },
      "tags": [
        {
          "id": "clt92k3c1000408l47h5f0b5y",
          "name": "Tutorials",
          "slug": "tutorials",
          "description": null
        }
      ],
      "attribution": null
    }
  ],
  "pagination": {
    "limit": 10,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": 2,
    "totalPages": 13,
    "totalItems": 125
  }
}
curl -H "Authorization: Bearer YOUR_API_KEY" "https://api.marblecms.com/v1/posts"
{
  "posts": [
    {
      "id": "clt92n38p000108l48zkj41an",
      "slug": "introducing-marblecms",
      "title": "Introducing Marble",
      "content": "<h1>Hello World!</h1><p>This is the content of the post.</p>",
      "featured": true,
      "description": "The modern headless CMS for modern web applications.",
      "coverImage": "https://cdn.marblecms.com/images/cover.jpg",
      "publishedAt": "2024-03-05T00:00:00.000Z",
      "updatedAt": "2024-03-10T12:00:00.000Z",
      "authors": [
        {
          "id": "clt92f96m000008l4gken6v2t",
          "name": "John Doe",
          "slug": "john-doe",
          "image": "https://cdn.marblecms.com/avatars/john.jpg",
          "bio": "John is a software developer and writer.",
          "role": "Software Developer",
          "socials": [
            { "url": "https://twitter.com/johndoe", "platform": "x" }
          ]
        }
      ],
      "category": {
        "id": "clt92hrnp000208l43kbo28d0",
        "name": "Announcements",
        "slug": "announcements",
        "description": "Latest news and updates."
      },
      "tags": [
        {
          "id": "clt92k3c1000408l47h5f0b5y",
          "name": "Tutorials",
          "slug": "tutorials",
          "description": null
        }
      ],
      "attribution": null
    }
  ],
  "pagination": {
    "limit": 10,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": 2,
    "totalPages": 13,
    "totalItems": 125
  }
}

Authorizations

Authorization
string
required
Your Marble API key. Include it in the header as: Bearer YOUR_API_KEY

Query Parameters

Use query parameters to paginate, sort, and filter results.

Pagination

limit
integer | "all"
default:"10"
Maximum number of items per page. - Use a number between 1 and 200 - Use "all" to return all posts in a single response (use with caution for large datasets)
page
integer
default:"1"
Page number to return. Pages start at 1.

Sorting

order
string
default:"desc"
Sort order by publishedAt date. Accepted values: asc, desc

Filtering

categories
string
Comma-separated list of category slugs to include. ?categories=tutorials,announcements
excludeCategories
string
Comma-separated list of category slugs to exclude. ?excludeCategories=drafts,internal
tags
string
Comma-separated list of tag slugs. Returns posts matching any of the specified tags. ?tags=product,engineering
excludeTags
string
Comma-separated list of tag slugs to exclude. ?excludeTags=archived,deprecated
query
string
Full-text search across title and content fields. ?query=getting started

Content Format

format
string
Format of the content field in the response. - Default: HTML content as stored - markdown: Content converted to Markdown

Examples

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.marblecms.com/v1/posts?categories=tutorials"
curl -H \
"https://api.marblecms.com/v1/posts?categories=tutorials&tags=beginner&limit=5"
curl -H \
"https://api.marblecms.com/v1/posts?limit=all&format=markdown" ```
</Accordion>

<Accordion title="Search posts">
```bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.marblecms.com/v1/posts?query=getting%20started"
Responses include a pagination object with navigation helpers. For advanced usage and error handling, see the Pagination guide.