API Reference

Complete REST API documentation for BlogStack.pro. Build custom integrations, automate content workflows, and extend your blog platform with our comprehensive API.

REST API

JSON over HTTPS

API Keys

Bearer token auth

Rate Limits

1000 req/hour

Secure

HTTPS only

Base URL

https://api.blogstack.pro/v1

All API requests should be made to this base URL with the appropriate endpoint path. The API uses version 1 and is stable for production use.

Authentication

Authenticate your API requests using Bearer tokens. Include your API key in the Authorization header.

Authorization Header
Authorization: Bearer YOUR_API_KEY

API Endpoints

Complete reference for all available endpoints with request/response examples.

GET/api/v1/blogsAuth Required

List all blogs for the authenticated user

Request Example

cURL
curl -X GET "https://api.blogstack.pro/v1/blogs" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response Example

JSON Response
{
  "data": [
    {
      "id": "blog-123",
      "name": "My Tech Blog", 
      "subdomain": "tech-blog",
      "status": "active",
      "created_at": "2025-01-01T00:00:00Z"
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "per_page": 20
  }
}
POST/api/v1/blogsAuth Required

Create a new blog

Request Example

cURL
curl -X POST "https://api.blogstack.pro/v1/blogs" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My New Blog",
    "subdomain": "my-new-blog",
    "description": "A blog about technology"
  }'

Response Example

JSON Response
{
  "data": {
    "id": "blog-456",
    "name": "My New Blog",
    "subdomain": "my-new-blog", 
    "description": "A blog about technology",
    "status": "active",
    "created_at": "2025-01-19T12:00:00Z"
  }
}
GET/api/v1/blogs/{blog_id}/postsAuth Required

List posts for a specific blog

Request Example

cURL
curl -X GET "https://api.blogstack.pro/v1/blogs/blog-123/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response Example

JSON Response
{
  "data": [
    {
      "id": "post-789",
      "title": "Getting Started with API",
      "slug": "getting-started-with-api",
      "status": "published",
      "published_at": "2025-01-19T10:00:00Z",
      "excerpt": "Learn how to use our API...",
      "author": {
        "id": "user-123",
        "name": "John Doe"
      }
    }
  ]
}
POST/api/v1/blogs/{blog_id}/postsAuth Required

Create a new post in a blog

Request Example

cURL
curl -X POST "https://api.blogstack.pro/v1/blogs/blog-123/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My New Post",
    "content": "<p>This is the post content...</p>",
    "status": "published",
    "categories": ["technology", "tutorials"],
    "tags": ["api", "development"]
  }'

Response Example

JSON Response
{
  "data": {
    "id": "post-101",
    "title": "My New Post",
    "slug": "my-new-post",
    "content": "<p>This is the post content...</p>",
    "status": "published",
    "published_at": "2025-01-19T12:30:00Z",
    "categories": ["technology", "tutorials"],
    "tags": ["api", "development"]
  }
}

Error Codes

Standard HTTP status codes and error responses to help you debug API issues.

400

Bad Request

The request was invalid or malformed

401

Unauthorized

Invalid or missing API key

403

Forbidden

You don't have permission to access this resource

404

Not Found

The requested resource was not found

429

Rate Limited

Too many requests, please slow down

500

Server Error

An internal server error occurred

Error Response Format

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "The request data is invalid",
    "details": [
      {
        "field": "title",
        "message": "Title is required"
      }
    ]
  }
}

Rate Limiting

Our API implements rate limiting to ensure fair usage and optimal performance for all users.

Standard Plan1,000 requests/hour
Professional Plan5,000 requests/hour
Enterprise Plan25,000 requests/hour

Rate Limit Headers

Every API response includes rate limit information in the headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1641024000

SDKs & Code Examples

Get started quickly with our official SDKs and code examples in popular languages.

JS

JavaScript

Available
PY

Python

Available
PHP

PHP

Available
GO

Go

Coming Soon

JavaScript SDK Example

// Install: npm install @blogstack/sdk

import { BlogStack } from '@blogstack/sdk'

const client = new BlogStack({
  apiKey: 'your-api-key'
})

// Create a new blog
const blog = await client.blogs.create({
  name: 'My Tech Blog',
  subdomain: 'my-tech-blog'
})

// Create a post
const post = await client.posts.create(blog.id, {
  title: 'Getting Started with BlogStack',
  content: '<p>This is my first post!</p>',
  status: 'published'
})

Ready to Start Building?

Get your API key and start building powerful integrations with BlogStack.pro today.

✓ 14-day free trial    ✓ No credit card required    ✓ Full API access