API Reference

EasyBlog is a light-weight headless blog CMS that allows you to add a blog site to your web application within minutes. The API requires authentication using an API key passed in the x-api-key header.

Rate Limiting

The API has a rate limit of 100 requests per minute per API key. Exceeding this limit will result in a rate limit error response.

The Blog Model

The blog model contains blog post content, categories, and tags, and metadata.

Properties

  • Name
    title
    Type
    string
    Description

    The title of the blog post.

  • Name
    project_id
    Type
    string
    Description

    The ID of the project this blog belongs to.

  • Name
    word_count
    Type
    number
    Description

    The total word count of the blog post.

  • Name
    author
    Type
    string
    Description

    The display name of the blog post author.

  • Name
    author_id
    Type
    string
    Description

    The unique identifier of the blog post author.

  • Name
    slug
    Type
    string
    Description

    The URL-friendly version of the blog post title.

  • Name
    tags
    Type
    array
    Description

    An array of strings representing the blog post tags.

  • Name
    excerpt
    Type
    string
    Description

    A short summary or preview of the blog post content.

  • Name
    category
    Type
    string
    Description

    The category the blog post belongs to.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the blog post was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the blog post was last updated.


GET/v1/blogs

List all blog posts

Retrieve a paginated list of all published blog posts for a project.

Optional query parameters

  • Name
    index
    Type
    number
    Description

    Number of items to skip. Defaults to 0.

  • Name
    limit
    Type
    number
    Description

    Maximum number of items to return. Defaults to 10.

  • Name
    category
    Type
    string
    Description

    Filter posts by category.

  • Name
    tags
    Type
    array
    Description

    Filter posts by one or more tags.

Request

GET
/v1/blogs
curl -G https://api.easyblog.io/v1/blogs \
  -H "x-api-key: {your-api-key}" \
  -d limit=10 \
  -d category="technology" \
  -d tags[]=javascript

Response

{
  "blogs": [
    {
      "title": "Getting Started with EasyBlog",
      "word_count": 1500,
      "category": "technology",
      "author": "John Doe",
      "author_id": "auth0|123",
      "slug": "getting-started-with-easyblog",
      "tags": ["javascript", "tutorial"],
      "excerpt": "Learn how to integrate EasyBlog into your application...",
      "created_at": "2024-03-20T12:00:00Z",
      "updated_at": "2024-03-20T12:00:00Z",
      "project_id": "proj_123"
    }
  ],
  "total": 45
}

GET/v1/blogs/:slug

Retrieve a blog post

Retrieve a single blog post by its slug. This endpoint also returns the full HTML content of the blog post.

URL parameters

  • Name
    slug
    Type
    string
    Description

    The slug of the blog post to retrieve.

Request

GET
/v1/blogs/getting-started-with-easyblog
curl https://api.easyblog.io/v1/blogs/getting-started-with-easyblog \
  -H "x-api-key: {your-api-key}"

Response

{
  "blog": {
    "title": "Getting Started with EasyBlog",
    "word_count": 1500,
    "category": "technology",
    "author": "John Doe",
    "author_id": "auth0|123",
    "slug": "getting-started-with-easyblog",
    "tags": ["javascript", "tutorial"],
    "excerpt": "Learn how to integrate EasyBlog into your application...",
    "created_at": "2024-03-20T12:00:00Z",
    "updated_at": "2024-03-20T12:00:00Z",
    "project_id": "proj_123",
    "html_content": "<article>...</article>"
  }
}

Was this page helpful?