Blog API documentation
Display Klusio articles on your own website.
The authenticated API lets your server retrieve published articles as JSON. Your website then controls the layout of the title, image and content. Give your developer the company ID, a securely shared API key and this guide.
Last updated: 22 October 2026
How the connection works
Klusio stores the published content, and your server requests the articles it needs. The API validates the key and returns JSON. Your website renders the result in its own design. You do not need to be an API specialist to commission the connection.
Share credentials through a secure password manager with the developer who needs them. Never put the key in a public email, document or source repository.
- 1. Klusio
- Stores published articles.
- 2. Your server
- Requests the required data.
- 3. The API
- Authenticates and returns JSON.
- 4. Your website
- Displays the article to the visitor.
Quick start
Sign in and create a key under Settings → API in the Dutch account. Copy it immediately: the complete key is shown only once. Send it from your server, then request one article and check the layout. The base endpoint is GET https://klusio.nl/api/v1/blogs.
Replace the two placeholders below with your own company ID and key in a private terminal environment. A successful request returns HTTP 200 and success: true. These examples are documentation, not live requests.
curl --request GET \
--url "https://klusio.nl/api/v1/blogs?company_id=YOUR_COMPANY_ID&limit=1" \
--header "X-API-Key: YOUR_API_KEY"Keep the API key on your server
Use the X-API-Key header, or the supported Authorization: Bearer header. The key is a credential for the connection. Browser JavaScript exposes it to visitors; use a server-side application, serverless function or secure CMS storage. API v1 deliberately rejects keys in the query string, such as ?api_key=....
- Separate keys
- Give each website or integration a recognisable, separate key.
- Temporary interruption
- Disable a key when the connection is not needed.
- Suspected exposure
- Revoke and replace the exposed key.
- Temporary external access
- Set an expiry date.
X-API-Key: YOUR_API_KEY
# Alternative
Authorization: Bearer YOUR_API_KEYChoose the information to retrieve
Choose one primary request mode: a list, one article, a topic, a pillar URL or related articles. Do not combine slug, topic_id, pillar_url and related_to; ambiguous combinations return HTTP 400. The examples below are query strings to append to the base endpoint.
| Purpose | Example query | Result |
|---|---|---|
| Latest articles | ?company_id=YOUR_COMPANY_ID&limit=10 | A list, total and offset. |
| One complete article | ?company_id=YOUR_COMPANY_ID&slug=example-article | Content, SEO information and tracking data. |
| A topic | ?company_id=YOUR_COMPANY_ID&topic_id=5 | Articles and pillar information for that topic. |
| Topic associated with a pillar | ?company_id=YOUR_COMPANY_ID&pillar_url=https%3A%2F%2Fexample.com%2Fservice | The topic associated with that complete URL. |
| Related articles | ?company_id=YOUR_COMPANY_ID&related_to=example-article&limit=3 | Up to three relevant articles. |
List parameters and visibility
Company visibility settings still apply. Lists include only published, visible articles that meet the applicable blog settings. A direct slug request can retrieve a visible published article even when list filters exclude it. It does not grant access to an unpublished draft.
| Parameter | Required | Meaning |
|---|---|---|
| company_id | Yes | The Klusio company ID. |
| limit | No | Number of articles: default 20, maximum 100. |
| offset | No | Number to skip for pagination. |
| search | No | Search title, meta description and article content; maximum 200 characters. |
| sort | No | recent, oldest, popular or reading-time. |
| author_id | No | Only articles by this Klusio author. |
A list response
The list intentionally omits the full article body. Retrieve the individual article by slug when you need its content. All names, counts, ratings and URLs in this response are fictional examples; they are not customer evidence.
{
"success": true,
"total": 75,
"limit": 1,
"offset": 0,
"posts": [
{
"id": 2042,
"slug": "example-article",
"title": "Example title",
"meta_description": "A short description of the page.",
"featured_image": "https://example.com/image.webp",
"featured_image_alt": "Description of the image",
"author": "Author name",
"published_at": "2026-08-12 09:00:00",
"reading_time": 6,
"views_count": 123,
"is_indexed": true,
"content_type": "how_to_guide"
}
],
"reviews": {
"google_rating": 4.8,
"total_reviews": 47,
"rating_distribution": {
"5": 42,
"4": 3,
"3": 1,
"2": 0,
"1": 1
},
"business_name": "Example business",
"latest_reviews": []
},
"filters_applied": {
"search": null,
"sort": "recent",
"visibility": {
"min_views": 0,
"require_indexed": false,
"hide_after_days": null
}
}
}A complete article response
The post object contains content, meta_description, featured_image, cta_text, cta_link, topic fields and any available FAQ, HowTo and claim data. Additional fields provide the related display and tracking information.
- author_details and reviewer_details
- Information for visible expertise sections.
- schema_markup and seo_head
- HTML intended for the appropriate SEO output locations.
- pillar_post
- The associated main article or page, where available.
- tracking_script and tracking_token
- The supplied page-view measurement route.
- reviews
- The latest synchronised Google review summary.
A complete server-side PHP example
This retrieves five recent articles. Configure KLUSIO_API_KEY and KLUSIO_COMPANY_ID as server environment variables. The example checks transport and response status, keeps credentials out of the browser and escapes link titles.
post.content, seo_head, schema_markup and tracking_script can contain HTML. Only render them from a successful authenticated Klusio response at the correct location in your own template. Keep your CMS’s security and sanitisation controls; do not turn arbitrary upstream text into executable markup.
<?php
// Configure both values securely on your server, never in browser JavaScript.
$apiKey = getenv('KLUSIO_API_KEY');
$companyId = filter_var(getenv('KLUSIO_COMPANY_ID'), FILTER_VALIDATE_INT);
if (!$apiKey || !$companyId || $companyId < 1) {
throw new RuntimeException('Configure the Klusio API key and company ID.');
}
$url = 'https://klusio.nl/api/v1/blogs?' . http_build_query([
'company_id' => $companyId, 'limit' => 5, 'sort' => 'recent',
]);
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 15,
CURLOPT_HTTPHEADER => [
'Accept: application/json',
'X-API-Key: ' . $apiKey,
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curlError = curl_error($ch);
curl_close($ch);
if ($body === false || $curlError !== '') {
throw new RuntimeException('The Klusio API could not be reached.');
}
$data = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
if ($status !== 200 || empty($data['success'])) {
// Record the code and request ID in a private server log for investigation.
// Do not expose raw upstream errors or credentials to website visitors.
throw new RuntimeException('Klusio API request failed: ' . $status);
}
foreach ($data['posts'] as $post) {
echo '<a href="/blog/' . rawurlencode($post['slug']) . '">';
echo htmlspecialchars($post['title'], ENT_QUOTES, 'UTF-8');
echo '</a>';
}Measure article views
A successful slug request includes tracking_script with a short-lived token scoped to the article and company. If you implement tracking yourself, send POST https://klusio.nl/api/v1/track with post_id, company_id and the returned tracking_token. Optional fields are visitor_id, time_spent, scroll_depth, referrer and converted.
Keep applicable consent requirements in your integration. A page view is not a customer or a completed sale. The tracking token is not a replacement for your server-side API key on article requests.
// Render the verified article in its content container.
echo $data['post']['content'];
// Render the verified tracking markup, preferably before </body>.
echo $data['tracking_script'];Report recognisable AI traffic
Send AI-assistant referrals and recognised AI-crawler requests from your own server to POST /api/v1/ai-traffic, with the API key in X-API-Key. This endpoint has no Klusio WordPress plugin implementation. Ordinary Googlebot, Bingbot and search-engine referrals do not become AI traffic merely because they are automated or search-related.
The event storage does not retain an IP address, full user-agent string or URL query string. A crawler event means the request carried a recognised crawler identity; that can be spoofed and does not prove a citation. An explicit browser referral is the separate signal for a measured visit from an AI assistant.
{
"event_type": "crawler",
"event_key": "unique-idempotency-key-for-this-request",
"landing_url": "https://example.com/service",
"user_agent": "OAI-SearchBot/1.0"
}Display Google reviews carefully
The response can include the latest synchronised average rating, total review count, star distribution, business name and up to ten visible recent reviews. Synchronisation is periodic, normally daily; this is not a real-time Google request for each visitor.
If reviews are not connected or have not yet been retrieved, the object may be empty or contain zero values. Hide the review block cleanly instead of presenting an empty value as a genuine zero-star business rating.
Handle errors using the stable code
An error response contains success: false, a readable error, a stable error_code and a request_id. Keep the request ID for support. Do not rely on the exact wording or language of error to branch your code. The example message below is translated for this guide; production wording can differ.
| Status | Meaning | Next action |
|---|---|---|
| 400 | Invalid request. | Check the company ID, URL and parameter combination. |
| 401 | Missing or invalid key or tracking token. | Check the header or retrieve a fresh tracking token. |
| 403 | Disabled, expired, insufficiently permitted or wrong-company key. | Review the key in API management. |
| 404 | Article or topic not found. | Check the identifier. Inspect redirect_to when an article has moved. |
| 405 | Incorrect HTTP method. | Use GET for articles and POST for tracking. |
| 429 | Hourly limit reached. | Respect Retry-After and use caching. |
| 500 | Internal error. | Keep request_id and contact support. |
{
"success": false,
"error": "A valid API key is required. Use the X-API-Key header.",
"error_code": "invalid_api_key",
"request_id": "a1b2c3d4e5f60708"
}Rate limits and caching
The documented default for a new key is 100 requests per hour. The account allows a per-key limit from 1 to 1,000. After valid authentication, response headers report the applicable limit, remaining allowance and reset time. Treat the example values below as placeholders.
- Article lists
- Cache for roughly five to fifteen minutes where appropriate.
- Complete articles
- Cache for no more than an hour if changes need to reach your website within that time. Invalidate sooner when your publishing workflow requires it.
- Review summaries
- Do not fetch solely for reviews more often than their normal daily refresh.
- Rate-limit errors
- Follow Retry-After rather than retrying immediately.
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 96
X-RateLimit-Reset: 1786525200Migrate an existing integration in stages
The legacy /api/blog.php endpoint remains for existing integrations. Use /api/v1/blogs for new work: authentication is mandatory, query-string keys are rejected and validation and error codes are explicit.
Change the endpoint and add the X-API-Key header in a test environment first. Verify the list, an individual article, redirects and tracking. Only retire the old integration after the replacement works.
Contact support without sharing a secret
Send your company_id, endpoint, HTTP status, request_id and the time of the problem to support@klusio.nl. Never include the complete API key. Private server logs can help investigate the failure without exposing technical details to visitors.
Let’s look at your website.
Tell us what you want to improve. We’ll show you how Klusio could help, in English.