Skip to main content
GET
/
blogs
List Blogs
curl --request GET \
  --url https://api.stru.ai/blogs
{
  "500": {},
  "blogs": [
    {
      "id": "<string>",
      "title": "<string>",
      "content": "<string>",
      "author": {},
      "description": {},
      "tags": [
        {}
      ],
      "thumbnail": {},
      "slug": "<string>",
      "published": true,
      "created_at": "<string>",
      "updated_at": "<string>"
    }
  ],
  "total": 123,
  "page": 123,
  "limit": 123,
  "pages": 123
}

Overview

Retrieve a paginated list of blog posts with support for filtering by tags, authors, and publication status. Perfect for building blog indexes and category pages.

Query Parameters

page
integer
default:"1"
Page number (must be ≥ 1)
?page=2
limit
integer
default:"20"
Items per page (1-100)
?limit=10
published_only
boolean
default:"true"
Show only published blogs (set to false to include drafts)
?published_only=false
tag
string
Filter by tag (case-sensitive)
?tag=python
author
string
Filter by author name (case-sensitive)
?author=John%20Doe

Response

Returns a paginated list of blog posts.
blogs
array
Array of blog post objects
total
number
Total number of blogs matching filters
page
number
Current page number
limit
number
Items per page
pages
number
Total number of pages

Example Requests

# Get first page (default 20 items)
curl https://api.stru.ai/blogs

Example Response

{
  "blogs": [
    {
      "id": "ec94c8ac-44a2-4093-acce-548905684ddf",
      "title": "ETABS Python API Tutorial",
      "content": "# Full markdown content...",
      "author": "John Doe",
      "description": "Learn how to automate ETABS...",
      "tags": ["python", "etabs", "automation"],
      "thumbnail": "https://example.com/thumb.jpg",
      "slug": "etabs-python-api-tutorial",
      "published": true,
      "created_at": "2025-10-11T01:48:25.067567",
      "updated_at": "2025-10-11T01:48:25.067567"
    },
    {
      "id": "f1a2b3c4-d5e6-7890-abcd-ef9876543210",
      "title": "SAP2000 Automation Guide",
      "content": "# Getting Started...",
      "author": "Jane Smith",
      "description": "Automate your SAP2000 workflows",
      "tags": ["sap2000", "automation"],
      "thumbnail": "https://example.com/sap-thumb.jpg",
      "slug": "sap2000-automation-guide",
      "published": true,
      "created_at": "2025-10-10T15:30:00.000000",
      "updated_at": "2025-10-10T15:30:00.000000"
    }
  ],
  "total": 42,
  "page": 1,
  "limit": 20,
  "pages": 3
}
Status Code: 200 OK

Error Responses

500
Internal Server Error
Server error occurred
{
  "detail": "Failed to fetch blogs: [error message]"
}

Pagination Guide

1

Calculate Total Pages

Use the pages field to determine how many pages are available.
"pages": 3  // Total of 3 pages
2

Navigate Pages

Increment the page parameter to navigate through results.
# Page 1
curl "https://api.stru.ai/blogs?page=1"

# Page 2
curl "https://api.stru.ai/blogs?page=2"
3

Adjust Page Size

Modify limit to control items per page (max 100).
curl "https://api.stru.ai/blogs?limit=50"

Best Practices

Use pagination - Don’t try to fetch all blogs at once. Use reasonable page sizes (10-50 items).
Cache results - Blog lists don’t change frequently. Cache for 5-10 minutes to reduce API calls.
Filter server-side - Use tag and author filters instead of fetching all blogs and filtering client-side.
Combine tag filtering with pagination to build efficient category pages for your blog.