Blog Display API
AI agents & LLMs: read this documentation as Markdown at nextblog.ai/docs/endpoints.md or browse the per-section Markdown index.
Legacy alias
These endpoints keep working unchanged, but new integrations should use the Full REST API:
GET /api/v1/projects/{projectId}/posts and GET /api/v1/projects/{projectId}/posts/{postId}.These endpoints are for displaying published content on your own site: they return only posts that are published in NextBlog. The same project API key is used for authentication.
To create posts, change status, or edit drafts via HTTP, use the optional Post Management API (
/api/manage/...).Looking for detailed REST API integration guide? See our REST API Integration page for step-by-step setup instructions and examples.
Base URL
https://nextblog.ai/api/blogEndpoints
Get All Blog Posts
Endpoint:
GET /api/blog/{projectId}Description: Retrieves all published blog posts for a specific project.
Headers:
Authorization: Bearer your_api_key_hereExample Request:
curl -H "Authorization: Bearer your_api_key_here" \
https://nextblog.ai/api/blog/project_123Response:
{
"project": {
"id": "project_123",
"name": "My Blog"
},
"blogs": [
{
"id": "blog_456",
"title": "How to Optimize Your Website",
"slug": "how-to-optimize-website",
"description": "Learn the best practices for website optimization...",
"cover_image_url": "https://example.com/image.jpg",
"cover_image_alt": "How to Optimize Your Website",
"published": true,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
]
}Get Single Blog Post
Endpoint:
GET /api/blog/{projectId}/{slug}Description: Retrieves a specific blog post with full content using the post's slug.
Headers:
Authorization: Bearer your_api_key_hereExample Request:
curl -H "Authorization: Bearer your_api_key_here" \
https://nextblog.ai/api/blog/project_123/how-to-optimize-websiteResponse:
{
"project": {
"id": "project_123",
"name": "My Blog"
},
"blog": {
"id": "blog_456",
"title": "How to Optimize Your Website",
"slug": "how-to-optimize-website",
"description": "Learn the best practices for website optimization...",
"markdown": "# How to Optimize Your Website\n\nThis is the full blog post content in markdown format...",
"cover_image_url": "https://example.com/image.jpg",
"published": true,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
}Error Responses
The API returns standard HTTP status codes and error messages:
- 400 Bad Request: Missing required parameters
- 401 Unauthorized: Invalid or missing API key
- 404 Not Found: Project or blog post not found
- 500 Internal Server Error: Server error
Rate Limits
Requests are limited to 120 per minute and 1,000 per hour per credential, shared with the Full REST API and MCP. Exceeding a limit returns 429 with
Retry-After and X-RateLimit-* headers. See Full REST API for the stricter generation and billing limits.