Get blog post by slug
Retrieve a single published blog post by its URL slug, including full content and any linked products (for shoppable posts). content is an Editor.js document (time, version, blocks), or null for a post with no body; the block types and rendering rules are described on the PostContent schema. Read-only; accepts both publishable (tybrite_pk_*) and secret (tybrite_sk_*) API keys. Returns 404 if no published post matches the slug.
curl --request GET \
--url https://api.tybritelabs.com/v1/posts/{slug} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tybritelabs.com/v1/posts/{slug}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tybritelabs.com/v1/posts/{slug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tybritelabs.com/v1/posts/{slug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tybritelabs.com/v1/posts/{slug}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tybritelabs.com/v1/posts/{slug}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/posts/{slug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "154000f5-0dce-4c1e-aacc-873ccb8aab00",
"title": "The Best Tech Gifts for 2026",
"slug": "best-tech-gifts-2026",
"excerpt": "Our editors pick the standout gadgets worth gifting this year — from noise-cancelling headphones to smart wearables.",
"content": {
"time": 1781780452880,
"version": "2.30.8",
"blocks": [
{
"id": "Hk3j9sLq2a",
"type": "header",
"data": {
"text": "Headphones",
"level": 2
}
},
{
"id": "Pw8x1mTe5c",
"type": "paragraph",
"data": {
"text": "The <b>Sony WH-1000XM4</b> remains the benchmark for noise cancelling."
}
},
{
"id": "Lr2n7vQd4b",
"type": "list",
"data": {
"style": "unordered",
"items": [
{
"content": "30-hour battery",
"items": [],
"meta": {}
},
{
"content": "Folds flat",
"items": [],
"meta": {}
}
]
}
},
{
"id": "Dm5k0zXy9e",
"type": "delimiter",
"data": {}
},
{
"id": "Pe4t6uBn1f",
"type": "productEmbed",
"data": {
"productId": "7d425c0a-50e7-4e39-af79-6f7945f9dfa8",
"productName": "Sony WH-1000XM4",
"productImage": "https://cdn.example.com/products/sony-wh1000xm4.jpg",
"productPrice": 349.99,
"displayType": "card"
}
}
]
},
"featured_image": "https://images.unsplash.com/photo-1513708927688-890fe41dfddc?w=1200&q=80",
"video": null,
"category_name": "Buying Guides",
"status": "published",
"published_at": "2026-06-18T11:00:52.880415+00:00",
"view_count": 128,
"product_count": 2,
"seo_title": "Best Tech Gifts for 2026 | Galactic Test Store",
"seo_description": "Editor-picked gadgets worth gifting in 2026.",
"products": [
{
"embed_id": "278c7e72-58b5-44c8-bf73-d8608daea80a",
"block_id": null,
"display_type": "card",
"position": 1,
"product_id": "7d425c0a-50e7-4e39-af79-6f7945f9dfa8",
"variant_id": "69bd79e5-8cd1-41e2-ab8f-6c0397022928",
"name": "Sony WH-1000XM4",
"variant_name": "Default",
"sku": "SNY-WH1000-7d42",
"price": 349.99,
"sale_price": null,
"images": [
"https://cdn.example.com/products/sony-wh1000xm4.jpg"
],
"stock": 79,
"category": "Audio & Headphones",
"subcategory": "Active Noise Cancelling"
},
{
"embed_id": "9f3a1c04-2b77-4a1e-93d5-6c2f0b8e4a11",
"block_id": null,
"display_type": "card",
"position": 2,
"product_id": "0186665f-f0a1-4c79-976a-919b5b1c2daa",
"variant_id": "feae17dd-c3ce-4e6e-864b-c0b6e7625fb2",
"name": "Samsung Galaxy Watch 6",
"variant_name": "Default",
"sku": "SAM-GW6-0186",
"price": 320,
"sale_price": null,
"images": [
"https://cdn.example.com/products/galaxy-watch-6.jpg"
],
"stock": 24,
"category": "Wearables",
"subcategory": "Smart Watches"
}
]
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"details": "The 'email' field is required"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid Authorization header"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests for this API key. Please slow down and try again shortly.",
"remaining": 0,
"reset": 1706198400
}
}{
"error": {
"code": "server_error",
"message": "An unexpected error occurred"
}
}Authorizations
API Key Authentication
Use your API key in the Authorization header:
Authorization: Bearer tybrite_sk_live_YOUR_KEY
Key Types:
Secret Keys (Server-Side Only):
- Format:
tybrite_sk_live_*(production) ortybrite_sk_test_*(sandbox) - Full read/write access to all endpoints
- ⚠️ NEVER expose in client-side code or public repositories
- Required for: every write a shopper does not make for themselves, authentication, payment verification, AI recommendations
Publishable Keys (Client-Safe):
- Format:
tybrite_pk_live_*(production) ortybrite_pk_test_*(sandbox) - Catalogue reads, plus the actions a shopper takes for themselves
- ✅ Safe for client-side JavaScript, mobile apps, and public code
- Allowed for: browsing products, search, CMS content, pricing queries, cart and wishlist, reviews, storefront events, and the Agent API's quotes, cart drafts and checkout intents
Endpoint-Specific Requirements:
- Authentication endpoints (
/v1/auth/*): Secret key required - Payment verification (
POST /v1/payments/verify): Secret key required - AI Recommendations (
POST /v1/recommendations): Secret key required - Semantic Search (
POST /v1/search): Both key types allowed (read-only operation) - Shopper actions (cart, wishlist, reviews, storefront events, Agent API quotes, cart drafts and checkout intents): Both key types allowed
- All other write operations: Secret key required
- All read operations: Both key types allowed
Using a publishable key for restricted operations returns 403 Forbidden.
Headers
Header form of visitor_id. Takes precedence over the query parameter when both are sent.
Header form of session_id. Takes precedence over the query parameter when both are sent.
Path Parameters
Query Parameters
Comma-separated list of fields to include in the response.
Allowed Fields:
id,title,slug,excerpt,content,featured_image,videocategory_id,category_name,category_slug,category_iconauthor_name,author_avatar,status,published_atview_count,product_count,seo_title,seo_descriptioncreated_at,updated_at,products,lookbooks
Identifies the shopper viewing the post, so the view is attributed to them in your content analytics. Send the same value you use for other storefront analytics calls. When omitted, the view is attributed to a coarse fallback derived from the request, so repeat views by one shopper may not group together.
The x-visitor-id header carries the same value and takes precedence.
Groups this view into a browsing session. When omitted, a session is derived from the visitor identity.
The x-session-id header carries the same value and takes precedence.
Response
Success
The article body, or null for a post with no body. See PostContent.
Show child attributes
Show child attributes
Optional URL of a short video for this banner (MP4, H.264 with AAC audio). Null when none is set. featured_image stays the poster and the fallback, so a storefront that shows only images keeps working unchanged.
published, draft, archived Search keywords the author chose for the post, for a page's meta tags. Returned by getPost.
When the post was first created.
When the post was last edited, in any way and by anyone — the merchant in their admin, or an
automated change such as a regenerated cover image. Use it to show a "last updated" date on
an article; it is always set, and on a post that has never been revised it matches
created_at.
Products embedded in the post body, in the order the author placed them. Match an entry to a productEmbed block in content on product_id (the block's productId). block_id is the id of the content block an embed is anchored to and is null for embeds placed in the post editor. display_type is how the author chose to show it. Each entry arrives with the product already resolved, and an embed whose product is no longer available is omitted, so a post can return fewer products than were authored.
Show child attributes
Show child attributes
Lookbooks embedded in the post, each with the lookbook it points to already resolved.
Show child attributes
Show child attributes
curl --request GET \
--url https://api.tybritelabs.com/v1/posts/{slug} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tybritelabs.com/v1/posts/{slug}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tybritelabs.com/v1/posts/{slug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tybritelabs.com/v1/posts/{slug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tybritelabs.com/v1/posts/{slug}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tybritelabs.com/v1/posts/{slug}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/posts/{slug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "154000f5-0dce-4c1e-aacc-873ccb8aab00",
"title": "The Best Tech Gifts for 2026",
"slug": "best-tech-gifts-2026",
"excerpt": "Our editors pick the standout gadgets worth gifting this year — from noise-cancelling headphones to smart wearables.",
"content": {
"time": 1781780452880,
"version": "2.30.8",
"blocks": [
{
"id": "Hk3j9sLq2a",
"type": "header",
"data": {
"text": "Headphones",
"level": 2
}
},
{
"id": "Pw8x1mTe5c",
"type": "paragraph",
"data": {
"text": "The <b>Sony WH-1000XM4</b> remains the benchmark for noise cancelling."
}
},
{
"id": "Lr2n7vQd4b",
"type": "list",
"data": {
"style": "unordered",
"items": [
{
"content": "30-hour battery",
"items": [],
"meta": {}
},
{
"content": "Folds flat",
"items": [],
"meta": {}
}
]
}
},
{
"id": "Dm5k0zXy9e",
"type": "delimiter",
"data": {}
},
{
"id": "Pe4t6uBn1f",
"type": "productEmbed",
"data": {
"productId": "7d425c0a-50e7-4e39-af79-6f7945f9dfa8",
"productName": "Sony WH-1000XM4",
"productImage": "https://cdn.example.com/products/sony-wh1000xm4.jpg",
"productPrice": 349.99,
"displayType": "card"
}
}
]
},
"featured_image": "https://images.unsplash.com/photo-1513708927688-890fe41dfddc?w=1200&q=80",
"video": null,
"category_name": "Buying Guides",
"status": "published",
"published_at": "2026-06-18T11:00:52.880415+00:00",
"view_count": 128,
"product_count": 2,
"seo_title": "Best Tech Gifts for 2026 | Galactic Test Store",
"seo_description": "Editor-picked gadgets worth gifting in 2026.",
"products": [
{
"embed_id": "278c7e72-58b5-44c8-bf73-d8608daea80a",
"block_id": null,
"display_type": "card",
"position": 1,
"product_id": "7d425c0a-50e7-4e39-af79-6f7945f9dfa8",
"variant_id": "69bd79e5-8cd1-41e2-ab8f-6c0397022928",
"name": "Sony WH-1000XM4",
"variant_name": "Default",
"sku": "SNY-WH1000-7d42",
"price": 349.99,
"sale_price": null,
"images": [
"https://cdn.example.com/products/sony-wh1000xm4.jpg"
],
"stock": 79,
"category": "Audio & Headphones",
"subcategory": "Active Noise Cancelling"
},
{
"embed_id": "9f3a1c04-2b77-4a1e-93d5-6c2f0b8e4a11",
"block_id": null,
"display_type": "card",
"position": 2,
"product_id": "0186665f-f0a1-4c79-976a-919b5b1c2daa",
"variant_id": "feae17dd-c3ce-4e6e-864b-c0b6e7625fb2",
"name": "Samsung Galaxy Watch 6",
"variant_name": "Default",
"sku": "SAM-GW6-0186",
"price": 320,
"sale_price": null,
"images": [
"https://cdn.example.com/products/galaxy-watch-6.jpg"
],
"stock": 24,
"category": "Wearables",
"subcategory": "Smart Watches"
}
]
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"details": "The 'email' field is required"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid Authorization header"
}
}{
"error": {
"code": "not_found",
"message": "Resource not found"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests for this API key. Please slow down and try again shortly.",
"remaining": 0,
"reset": 1706198400
}
}{
"error": {
"code": "server_error",
"message": "An unexpected error occurred"
}
}
