API Reference
Posts API
Get posts from the content management system
URL
https://contioreach.com/api/public/postMethod
GETQuery Parameters
| Parameter | Type | Description |
|---|---|---|
offsetOptional | number | The offset for pagination (default: 0) |
limitOptional | number | The limit for pagination (default: 10) |
categoryOptional | string | Category slug(s) to filter by. Multiple categories can be specified as comma-separated values |
tagsOptional | string | Tag slug(s) to filter by. Multiple tags can be specified as comma-separated values |
authorOptional | string | Author slug to filter by |
slugOptional | string | Post slug to fetch a specific post |
minimalOptional | boolean | Set to 'true' to exclude content from response (for listing pages) |
Authentication
API requests require authentication using an API key in one of two ways:
x-api-key header
Include your API key in the x-api-key header
headers: {
'x-api-key': 'YOUR_API_KEY'
}authorization header
Include your API key in the authorization header with format: Bearer YOUR_API_KEY
headers: {
'authorization': 'Bearer YOUR_API_KEY'
}Response
200Success
// For multiple posts (listing)
{
data: [
{
title: string,
html_content?: string, // Excluded if minimal=true
slug: string,
description: string,
coverImage: string,
categories?: [
{
name: string,
slug: string
}
],
tags?: [
{
name: string,
slug: string
}
],
excerpt: string,
published_at: string,
authors?: [
{
slug: string,
name: string,
image: string,
bio: string,
website: string,
twitter: string
}
]
}
],
total: number,
offset: number,
limit: number,
hasMore: boolean
}
// For single post (with slug parameter)
{
data: {
// Same structure as array item above
}
}401Unauthorized
{
error: string // Authentication error message
}404Not Found
{
error: "Post not found"
}500Server Error
{
error: "Failed to fetch posts"
}Usage Examples
Fetch all posts with pagination
async function fetchPosts() {
const response = await fetch('https://contioreach.com/api/public/post?offset=0&limit=10', {
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
return await response.json();
}Fetch posts for a specific category
async function fetchPostsByCategory(category) {
const response = await fetch('https://contioreach.com/api/public/post?category=' + category, {
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
return await response.json();
}Fetch a single post by slug
async function fetchPostBySlug(slug) {
const response = await fetch('https://contioreach.com/api/public/post?slug=' + slug, {
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
return await response.json();
}Fetch posts with multiple filters and minimal data
async function fetchFilteredPosts() {
const response = await fetch('https://contioreach.com/api/public/post?category=news&tags=technology,ai&minimal=true', {
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
return await response.json();
}