Posts API
Create and manage blog posts programmatically with RESTful API
Overview
The Posts API allows you to create, publish, and manage blog posts programmatically using API key authentication. You can create posts with rich content, AI-generated content, and manage visibility settings.
Playground
You can try the API endpoints in the Posts API Playground.
Authentication
All endpoints require API key authentication. Use your API key in one of two ways:
-
Authorization Header (Recommended):
Authorization: Bearer YOUR_API_KEY -
Query Parameter:
?key=YOUR_API_KEY
Rate Limits
Rate limits are configured based on your subscription tier:
- Free Plan: 200 requests per hour
- Pro Plan: 2000 requests per hour
- Lifetime Plan: 2000 requests per hour
Endpoints
Create Post
POST /api/v1/postsCreate a new blog post with optional AI-powered content generation.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Post title (max 200 characters) |
content | string | Yes | Post content (markdown supported) |
summary | string | No | Short summary of the post |
coverImage | string | No | Cover image URL |
tags | string[] | No | Array of tags |
visible | boolean | No | Visibility (default: true) |
published | boolean | No | Publish status (default: true) |
useAI | boolean | No | Use AI to enhance content (default: false) |
aiModel | string | No | AI model for content generation |
slug | string | No | Custom URL slug |
Example Request
curl -X POST "https://like.do/api/v1/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Getting Started with LikeDo API",
"content": "In this post, we will explore how to use the LikeDo API...",
"summary": "Learn how to integrate LikeDo API into your application",
"tags": ["tutorial", "api", "documentation"],
"visible": true,
"published": true
}'Success Response (201 Created)
{
"success": true,
"data": {
"id": "post123",
"title": "Getting Started with LikeDo API",
"slug": "getting-started-with-likedo-api",
"content": "In this post, we will explore how to use the LikeDo API...",
"summary": "Learn how to integrate LikeDo API into your application",
"coverImage": null,
"tags": ["tutorial", "api", "documentation"],
"visible": true,
"published": true,
"views": 0,
"createdAt": "2026-01-04T12:00:00.000Z",
"updatedAt": "2026-01-04T12:00:00.000Z",
"postUrl": "https://like.do/blog/getting-started-with-likedo-api"
}
}List Posts
GET /api/v1/postsRetrieve a paginated list of your blog posts with filtering and sorting options.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number (minimum: 1) |
limit | number | 10 | Items per page (1-100) |
search | string | - | Search in title, content, summary |
sortBy | string | createdAt | Sort field: title, createdAt, views, updatedAt |
sortOrder | string | desc | Sort order: asc or desc |
tags | string | - | Filter by tag (comma-separated for multiple) |
published | boolean | - | Filter by published status |
visible | boolean | - | Filter by visibility |
Example Request
curl -X GET "https://like.do/api/v1/posts?page=1&limit=10&published=true" \
-H "Authorization: Bearer YOUR_API_KEY"Success Response (200 OK)
{
"success": true,
"data": {
"items": [
{
"id": "post123",
"title": "Getting Started with LikeDo API",
"slug": "getting-started-with-likedo-api",
"summary": "Learn how to integrate LikeDo API into your application",
"coverImage": null,
"tags": ["tutorial", "api", "documentation"],
"views": 42,
"published": true,
"visible": true,
"createdAt": "2026-01-04T12:00:00.000Z",
"updatedAt": "2026-01-04T12:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1,
"hasNext": false,
"hasPrevious": false
}
}
}Get Post by ID
GET /api/v1/posts/:idRetrieve detailed information about a specific post by its ID.
Example Request
curl -X GET "https://like.do/api/v1/posts/post123" \
-H "Authorization: Bearer YOUR_API_KEY"Success Response (200 OK)
{
"success": true,
"data": {
"id": "post123",
"title": "Getting Started with LikeDo API",
"slug": "getting-started-with-likedo-api",
"content": "In this post, we will explore how to use the LikeDo API...",
"summary": "Learn how to integrate LikeDo API into your application",
"coverImage": null,
"tags": ["tutorial", "api", "documentation"],
"visible": true,
"published": true,
"views": 42,
"createdAt": "2026-01-04T12:00:00.000Z",
"updatedAt": "2026-01-04T12:00:00.000Z",
"author": {
"id": "user123",
"name": "John Doe"
}
}
}Update Post
PUT /api/v1/posts/:idUpdate an existing blog post. Only the post owner can update the post.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | No | Updated post title |
content | string | No | Updated post content |
summary | string | No | Updated summary |
coverImage | string | No | Updated cover image URL |
tags | string[] | No | Updated tags |
visible | boolean | No | Updated visibility |
published | boolean | No | Updated publish status |
Example Request
curl -X PUT "https://like.do/api/v1/posts/post123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Getting Started with LikeDo API (Updated)",
"published": true
}'Success Response (200 OK)
{
"success": true,
"data": {
"id": "post123",
"title": "Getting Started with LikeDo API (Updated)",
"slug": "getting-started-with-likedo-api",
"content": "In this post, we will explore how to use the LikeDo API...",
"summary": "Learn how to integrate LikeDo API into your application",
"published": true,
"updatedAt": "2026-01-04T12:30:00.000Z"
}
}Delete Post
DELETE /api/v1/posts/:idDelete a blog post. Only the post owner can delete the post.
Example Request
curl -X DELETE "https://like.do/api/v1/posts/post123" \
-H "Authorization: Bearer YOUR_API_KEY"Success Response (200 OK)
{
"success": true,
"message": "Post deleted successfully"
}Error Responses
All error responses follow a consistent format:
{
"success": false,
"error": "Error message describing what went wrong"
}Common Error Codes
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid request data or missing required fields |
| 401 | Unauthorized - Missing or invalid API key |
| 403 | Forbidden - API key valid but you don't own this resource |
| 404 | Not Found - Post not found |
| 409 | Conflict - Post slug already exists |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Something went wrong on our end |
AI-Powered Content Generation
When creating a post with useAI: true, the API will use AI to enhance your content:
- Title Enhancement: Generate engaging titles
- Summary Generation: Auto-generate post summaries
- Content Enhancement: Improve readability and structure
- SEO Optimization: Add SEO-friendly metadata
Example with AI:
curl -X POST "https://like.do/api/v1/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "API Integration Guide",
"content": "Basic content about API integration...",
"useAI": true,
"aiModel": "gpt-4"
}'Best Practices
- Use Meaningful Slugs: Create custom slugs that are SEO-friendly and descriptive
- Optimize Images: Use optimized images for cover photos to improve page load speed
- Tag Consistently: Use consistent tagging for better content organization
- Draft First: Create posts as drafts (
published: false) before publishing - Batch Operations: Space out post creation requests to avoid rate limits
- Cache Responses: Cache post data when appropriate to reduce API calls
Code Examples
JavaScript (Node.js)
const fetch = require('node-fetch');
async function createPost(apiKey, postData) {
const response = await fetch('https://like.do/api/v1/posts', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify(postData),
});
const result = await response.json();
if (!response.ok) {
throw new Error(result.error || 'Failed to create post');
}
return result.data;
}
// Usage
const post = await createPost(process.env.API_KEY, {
title: 'My Blog Post',
content: 'Post content here...',
tags: ['tutorial', 'api'],
published: true,
});
console.log('Post created:', post.postUrl);Python
import requests
import os
def create_post(api_key, post_data):
response = requests.post(
'https://like.do/api/v1/posts',
headers={
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json',
},
json=post_data
)
result = response.json()
if not response.ok:
raise Exception(result.get('error', 'Failed to create post'))
return result['data']
# Usage
post = create_post(os.getenv('API_KEY'), {
'title': 'My Blog Post',
'content': 'Post content here...',
'tags': ['tutorial', 'api'],
'published': True,
})
print('Post created:', post['postUrl'])Support
Need help with the Posts API?
- Interactive Playground: Try it now
- API Overview: View all APIs
- Contact Support: Reach out to our team for technical assistance
LikeDo Docs