Skip to main content
GET
/
blogs
/
{blog_id}
Get Blog by ID
curl --request GET \
  --url https://api.stru.ai/blogs/{blog_id}
{
  "404": {},
  "500": {},
  "id": "<string>",
  "title": "<string>",
  "content": "<string>",
  "author": {},
  "description": {},
  "tags": [
    {}
  ],
  "thumbnail": {},
  "slug": "<string>",
  "published": true,
  "created_at": "<string>",
  "updated_at": "<string>"
}

Overview

Retrieve a specific blog post using its unique identifier (UUID). Use this when you have the blog’s ID stored in your database.
For user-facing URLs, consider using Get Blog by Slug instead for cleaner, SEO-friendly URLs.

Path Parameters

blog_id
string
required
Blog post UUID (v4 format)
ec94c8ac-44a2-4093-acce-548905684ddf

Response

Returns a single blog post object.
id
string
Unique blog post UUID
title
string
Blog post title
content
string
Full markdown content
author
string | null
Author name
description
string | null
Short description/excerpt
tags
array
Array of tag strings
thumbnail
string | null
Thumbnail image URL
slug
string
URL-friendly slug
published
boolean
Publication status
created_at
string
ISO 8601 creation timestamp
updated_at
string
ISO 8601 last update timestamp

Example Requests

curl https://api.stru.ai/blogs/ec94c8ac-44a2-4093-acce-548905684ddf

Example Response

{
  "id": "ec94c8ac-44a2-4093-acce-548905684ddf",
  "title": "ETABS Python API Tutorial",
  "content": "# Introduction\n\nThis comprehensive tutorial will teach you how to automate ETABS using Python...\n\n## Getting Started\n\nFirst, install the required packages:\n\n```bash\npip install comtypes\n```\n\n## Connecting to ETABS\n\n...",
  "author": "John Doe",
  "description": "Learn how to automate ETABS with Python",
  "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"
}
Status Code: 200 OK

Error Responses

404
Not Found
Blog post not found
{
  "detail": "Blog not found"
}
500
Internal Server Error
Server error occurred
{
  "detail": "Failed to fetch blog: [error message]"
}

Use Cases

When you store blog IDs in your database and need to retrieve the full content.
# User clicked on a blog from your database
user_saved_blog_id = get_from_database("user_bookmarks")
blog = get_blog_by_id(user_saved_blog_id)
When building admin panels or CMS interfaces that work with UUIDs.
# Admin editing a blog
blog = get_blog_by_id(selected_blog_id)
display_editor(blog)
When integrating with other services that reference blogs by UUID.
# External service sends you a blog_id
webhook_data = {"blog_id": "ec94c8ac-..."}
blog = get_blog_by_id(webhook_data["blog_id"])

Best Practices

Validate UUID format - Before making the request, validate that the ID is a valid UUID to avoid 404 errors.
Cache blog content - Blog posts don’t change frequently. Cache for 5-10 minutes to reduce API calls.
Handle 404 gracefully - Always check for 404 responses and show appropriate error messages to users.
For public-facing blog pages, use the Get Blog by Slug endpoint instead. It provides cleaner URLs and better SEO.
The blog_id must be a valid UUID v4. Invalid formats will return a 404 error.