API Reference
Public REST API for subscriptions' websites. All endpoints require X-API-Key header.
Servers
https://api.example.comProductionhttp://localhost:3000Local
Authentication
Send your API key in the
X-API-Key header.X-API-Key: YOUR_API_KEYEndpoints
GET
/public/blog/categoriesGet categories and subcategories
Parameters
- parentId — query, integer
200Response example
application/json
[
{
"id": 1,
"typeName": "News",
"children": [
{
"id": 2,
"typeName": "World"
}
]
},
{
"id": 3,
"typeName": "Tech",
"children": [
{
"id": 4,
"typeName": "AI"
}
]
}
]GET
/public/blog/posts/{postId}/relatedGet related posts
Parameters
- postId * — path, integer
- language * — query, string
200Response example
application/json
[
{
"id": 601,
"language": "EN",
"title": "Scaling Node.js",
"slug": "scaling-nodejs",
"post": {
"id": 101,
"viewsCount": 2500
}
},
{
"id": 602,
"language": "EN",
"title": "Load balancing 101",
"slug": "load-balancing-101",
"post": {
"id": 102,
"viewsCount": 1900
}
}
]GET
/public/blog/posts/by-category-lite/{categoryId}Get posts by category (lite, flat, minimal fields)
Parameters
- categoryId * — path, integer
- language * — query, string
200Response example
application/json
{
"posts": [
{
"id": 2,
"language": "EN",
"title": "Test Title",
"slug": "test-title",
"post": {
"id": 4,
"category": {
"id": 1424,
"typeName": "Blog"
}
}
}
]
}GET
/public/blog/posts/by-category/{categoryId}Get posts by category (hierarchical)
Parameters
- categoryId * — path, integer
- language * — query, string
200Response example
application/json
{
"categoryId": 123,
"categoryName": "Main Category",
"posts": [
{
"id": 501,
"language": "EN",
"title": "Post A",
"slug": "post-a"
}
],
"subcategories": [
{
"categoryId": 124,
"categoryName": "Subcategory A",
"posts": [
{
"id": 502,
"language": "EN",
"title": "Post B",
"slug": "post-b"
}
],
"subcategories": [
{
"categoryId": 125,
"categoryName": "Nested Subcategory",
"posts": [],
"subcategories": []
}
]
}
]
}GET
/public/blog/posts/by-slug/{slug}Get single post by slug
Parameters
- slug * — path, string
- language * — query, string
200Response example
application/json
{
"id": 845,
"language": "EN",
"title": "My Post",
"slug": "my-post",
"post": {
"id": 321,
"viewsCount": 450
}
}GET
/public/blog/posts/popularGet popular posts
Parameters
- categoryId — query, integer
- limit — query, integer
- language * — query, string
200Response example
application/json
[
{
"id": 701,
"language": "EN",
"title": "Top 10 performance tips",
"slug": "top-10-performance-tips",
"post": {
"id": 103,
"viewsCount": 12000
}
}
]GET
/public/blog/posts/searchSearch posts
Parameters
- q * — query, string
- categoryId — query, integer
- language * — query, string
- page — query, integer
- limit — query, integer