Public API
Direct REST API usage for fetching published AutoBlogWriter blog content.
Public API
This page documents direct REST access to the AutoBlogWriter public content API.
If you are using Next.js, the SDK is usually the fastest path to production. For direct API calls or custom platforms, use the endpoints below.
Base URL
https://api.autoblogwriter.appAuthentication
Use your workspace API key (ba_pk_...) with one of the supported auth headers:
Authorization: Bearer <YOUR_API_KEY>or
x-api-key: <YOUR_API_KEY>Workspace Slug Requirement
Public content endpoints are workspace-scoped and require a workspaceSlug in the URL path:
/v1/public/:workspaceSlug/...Find your workspace slug in the AutoBlogWriter dashboard workspace settings.
Endpoint: List Published Posts
GET /v1/public/:workspaceSlug/blogs
Returns published blog posts with pagination metadata.
Query Parameters
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
limit | number | No | 20 | Page size |
page | number | No | 1 | 1-based page number |
category | string | No | — | Filter by category |
cURL Example
curl --request GET \
--url "https://api.autoblogwriter.app/v1/public/my-blog/blogs?limit=10&page=1&category=SEO" \
--header "Authorization: Bearer ba_pk_your_api_key"Example Success Response
{
"success": true,
"data": {
"items": [
{
"id": "post_1",
"title": "How to Scale Content Ops",
"slug": "scale-content-ops",
"excerpt": "A practical system for higher output.",
"content": "# ...",
"status": "PUBLISHED",
"categories": ["SEO", "Automation"],
"updatedAt": "2026-01-01T00:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 42,
"totalPages": 5,
"hasMore": true
}
}
}Endpoint: Get Post By Slug
GET /v1/public/:workspaceSlug/blogs/:slug
Returns a single published post by URL slug.
cURL Example
curl --request GET \
--url "https://api.autoblogwriter.app/v1/public/my-blog/blogs/scale-content-ops" \
--header "x-api-key: ba_pk_your_api_key"Example Success Response
{
"success": true,
"data": {
"post": {
"id": "post_1",
"title": "How to Scale Content Ops",
"slug": "scale-content-ops",
"content": "# ...",
"status": "PUBLISHED",
"categories": ["SEO"],
"relatedPosts": [
{
"id": "post_2",
"title": "Editorial Calendars That Ship",
"slug": "editorial-calendars-ship",
"updatedAt": "2026-01-02T00:00:00.000Z"
}
],
"updatedAt": "2026-01-01T00:00:00.000Z"
}
}
}Response Envelope and Errors
Successful JSON responses are wrapped as:
{
"success": true,
"data": {}
}When the API returns a non-2xx status, use the HTTP status code plus error body fields for handling.
Common practical cases:
401 Unauthorized: invalid API key or header format.404 Not Found: slug does not exist for the workspace.429 Too Many Requests: retry with backoff.5xx: temporary server failure.
Pagination Guidance (SDK Parity)
The official SDK exposes nextCursor for pagination, but the API uses page numbers.
- Start with
page=1. - If
pagination.hasMoreistrue, requestpage + 1. - Stop when
hasMoreisfalse.
SDK vs Direct API
Use the SDK if you want typed helpers, Next.js cache tags, metadata utilities, and built-in error classes.
Use direct API calls when integrating from non-Next.js stacks or custom data pipelines.
See Client Reference for the SDK path.