Blog Posts API

Read-only access to published blog posts from the blog app.

Endpoint

GET
https://blog.eggisatria.dev/api/v1/posts

Query parameters

NameTypeDefaultDescription
limit1..10020Maximum number of posts to return.
qstringSubstring search across title, excerpt, and content (case-insensitive).
tagstringFilter by tag slug (exact match).

Example request

Terminal
curl https://blog.eggisatria.dev/api/v1/posts?tag=nextjs&limit=5 \
  -H "x-api-key: exstr_live_..."

Example response

JSON
{
  "success": true,
  "data": {
    "count": 1,
    "posts": [
      {
        "id": "ckxxx...",
        "slug": "building-with-nextjs-15",
        "title": "Building with Next.js 15",
        "excerpt": "A quick tour of the new features…",
        "coverImage": "/blog/nextjs-15.png",
        "publishedAt": "2024-12-01T08:00:00.000Z",
        "readingTime": 6,
        "author": "Eggi Satria",
        "tags": [{ "name": "Next.js", "slug": "nextjs" }],
        "views": 1284,
        "createdAt": "2024-11-28T10:00:00.000Z",
        "updatedAt": "2024-12-01T08:00:00.000Z"
      }
    ]
  },
  "error": null
}

Notes

  • Only published = true posts are returned.
  • Results are sorted by publishedAt DESC.
  • The post body (MDX) is omitted from list responses. To fetch a single post's full content, use /api/posts/[slug] (no auth required for public posts).