Blog API Documentation

RESTful API for accessing blog posts programmatically

Overview

The Blog API provides programmatic access to published blog posts. All endpoints return JSON responses.

Base URL

https://industweb-dgfwmufw.manus.space/api/trpc

Authentication

Public endpoints do not require authentication. Admin endpoints require valid session cookies.

Endpoints

GETList Blog Posts
Retrieve a list of published blog posts with optional filtering

Endpoint

GET https://industweb-dgfwmufw.manus.space/api/trpc/blog.list

Query Parameters

category
Filter by category
search
Search in title
limit
Number of posts to return
offset
Pagination offset

Example Request

<?php
$url = 'https://industweb-dgfwmufw.manus.space/api/trpc/blog.list?input=' . urlencode(json_encode([
    'limit' => 10,
    'offset' => 0
]));

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json'
]);

$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);

foreach ($data['result']['data'] as $post) {
    echo $post['title'] . "\n";
    echo $post['excerpt'] . "\n\n";
}
?>

Example Response

{
  "result": {
    "data": [
      {
        "id": 1,
        "title": "Understanding Flow Measurement Technology",
        "slug": "understanding-flow-measurement-technology",
        "excerpt": "A comprehensive guide to modern flow measurement...",
        "content": "...",
        "featuredImage": "/uploads/blog/image.jpg",
        "category": "Technical",
        "publishedAt": "2024-01-15T10:00:00.000Z",
        "viewCount": 245
      }
    ]
  }
}
GETGet Single Blog Post
Retrieve a single blog post by slug

Endpoint

GET https://industweb-dgfwmufw.manus.space/api/trpc/blog.getBySlug

Query Parameters

slug
Blog post slug (required)

Example Request

<?php
$slug = 'understanding-flow-measurement-technology';
$url = 'https://industweb-dgfwmufw.manus.space/api/trpc/blog.getBySlug?input=' . urlencode(json_encode([
    'slug' => $slug
]));

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$post = json_decode($response, true)['result']['data'];
curl_close($ch);

echo $post['title'];
?>
Rate Limits

Currently, there are no rate limits on public API endpoints. However, we recommend implementing reasonable caching on your end to minimize unnecessary requests.

Support

For API support or questions, please contact us: