ContioReach Logo
ContioReach
API Reference

Posts API

Get posts from the content management system

URL

https://contioreach.com/api/public/post

Method

GET

Query Parameters

ParameterTypeDescription
offsetOptionalnumberThe offset for pagination (default: 0)
limitOptionalnumberThe limit for pagination (default: 10)
categoryOptionalstringCategory slug(s) to filter by. Multiple categories can be specified as comma-separated values
tagsOptionalstringTag slug(s) to filter by. Multiple tags can be specified as comma-separated values
authorOptionalstringAuthor slug to filter by
slugOptionalstringPost slug to fetch a specific post
minimalOptionalbooleanSet 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();
}