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
| Name | Type | Default | Description |
|---|---|---|---|
limit | 1..100 | 20 | Maximum number of posts to return. |
q | string | — | Substring search across title, excerpt, and content (case-insensitive). |
tag | string | — | Filter 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 = trueposts 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).