Api Reference
Articles
The Articles API lets you retrieve published articles from your connected blog. All endpoints in this section require an Authorization: Bearer <access_token> header and the articles:read scope.
Only published articles are returned by the Articles API. Draft or unpublished articles are not accessible through the API.
Content Format
Article content is always returned in Markdown format. The content field contains the full article body as a Markdown string, including headings, paragraphs, lists, code blocks, bold/italic text, links, and embedded images.
To display articles on your site, you need to render the Markdown to HTML. Common libraries:
- JavaScript/React —
react-markdown+remark-gfmfor GitHub Flavored Markdown - Python —
markdownormistune - Go —
goldmark - PHP —
league/commonmark
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
function ArticlePage({ article }) {
return (
<article>
<h1>{article.title}</h1>
<ReactMarkdown remarkPlugins={[remarkGfm]}>
{article.content}
</ReactMarkdown>
</article>
);
}Inline images referenced in the Markdown content use URLs from LxBlog's image hosting. These URLs are also listed in the inlineImageUrls array for convenience — useful if you want to download and self-host the images.
Article Language
Articles are written in the language configured on the blog. The blog's language is an ISO 639-1 code (e.g. en, pt, es, fr, de). You can check the blog's language via the Status endpoint (blog.language). All articles from a blog are in the same language.
List Articles
/api/v1/articlesReturns a paginated list of all published articles for the connected blog, ordered by publication date (newest first).
Query Parameters
| Name | Type | Description |
|---|---|---|
page | number | Page number for pagination.(default: 1) |
limit | number | Number of articles per page (max 100).(default: 20) |
Response
{
"articles": [
{
"id": "cm5abc123def456ghi789",
"slug": "getting-started-with-nextjs",
"title": "Getting Started with Next.js",
"description": "A comprehensive guide to building modern web applications with Next.js.",
"content": "# Getting Started with Next.js\n\nNext.js is a React framework...",
"coverImageUrl": "https://images.example.com/nextjs-cover.jpg",
"inlineImageUrls": [
"https://images.example.com/diagram-1.png",
"https://images.example.com/screenshot-2.png"
],
"tags": ["nextjs", "react", "web-development"],
"seoKeywords": ["next.js tutorial", "react framework", "server-side rendering"],
"seoScore": 8,
"schemaOrgJson": {
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "Getting Started with Next.js",
"description": "A comprehensive guide..."
},
"publishedAt": "2026-02-15T10:30:00.000Z",
"updatedAt": "2026-02-18T14:22:00.000Z",
"viewCount": 142,
"contentHash": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 42,
"totalPages": 3
}
}Article Object Fields
| Name | Type | Description |
|---|---|---|
id | string | Unique CUID identifier for the article. |
slug | string | URL-friendly slug derived from the article title. |
title | string | The article title. |
description | string | null | Short summary or meta description of the article. |
content | string | Full article body in Markdown format. See Content Format section above. |
coverImageUrl | string | null | URL of the cover/hero image, if generated. |
inlineImageUrls | string[] | URLs of images embedded within the article Markdown content. |
tags | string[] | List of tags associated with the article. |
seoKeywords | string[] | SEO keywords assigned to the article during AI generation. |
seoScore | number | null | SEO quality score (0-10) from the AI review process. Null if SEO scoring is disabled. |
schemaOrgJson | object | null | Schema.org JSON-LD structured data for the article. Can be embedded in your page as a <script type="application/ld+json"> tag for SEO. |
publishedAt | string | ISO 8601 timestamp of when the article was published. |
updatedAt | string | ISO 8601 timestamp of the last modification. |
viewCount | number | Number of page views on the LxBlog hosted blog. Starts at 0. |
contentHash | string | SHA-256 hash of the article content (title + description + content + tags). Used for change detection during sync. |
Pagination Object
| Name | Type | Description |
|---|---|---|
page | number | Current page number. |
limit | number | Number of articles per page. |
total | number | Total number of published articles. |
totalPages | number | Total number of pages. |
Get Single Article
/api/v1/articles/{idOrSlug}Retrieves a single published article by its CUID identifier or URL slug.
Path Parameters
| Name | Type | Description |
|---|---|---|
idOrSlug* | string | The article CUID (e.g. cm5abc123def456ghi789) or slug (e.g. getting-started-with-nextjs). |
Example Requests
curl https://lxblog.app/api/v1/articles/cm5abc123def456ghi789 \
-H "Authorization: Bearer lxb_at_your_access_token"curl https://lxblog.app/api/v1/articles/getting-started-with-nextjs \
-H "Authorization: Bearer lxb_at_your_access_token"Response
Returns a single article object wrapped in an article key, with the same fields as the list endpoint.
{
"article": {
"id": "cm5abc123def456ghi789",
"slug": "getting-started-with-nextjs",
"title": "Getting Started with Next.js",
"description": "A comprehensive guide to building modern web applications with Next.js.",
"content": "# Getting Started with Next.js\n\nNext.js is a React framework...",
"coverImageUrl": "https://images.example.com/nextjs-cover.jpg",
"inlineImageUrls": [
"https://images.example.com/diagram-1.png",
"https://images.example.com/screenshot-2.png"
],
"tags": ["nextjs", "react", "web-development"],
"seoKeywords": ["next.js tutorial", "react framework", "server-side rendering"],
"seoScore": 8,
"schemaOrgJson": {
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "Getting Started with Next.js"
},
"publishedAt": "2026-02-15T10:30:00.000Z",
"updatedAt": "2026-02-18T14:22:00.000Z",
"viewCount": 142,
"contentHash": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2"
}
}Using Schema.org Data
If the article includes schemaOrgJson, you can embed it in your page for better SEO. Search engines use this structured data to create rich results.
function ArticleHead({ article }) {
return (
<head>
{article.schemaOrgJson && (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(article.schemaOrgJson),
}}
/>
)}
</head>
);
}Error Responses
The Articles API returns standard HTTP error codes when a request fails.
{
"error": "invalid_token",
"error_description": "Access token is missing, expired, or invalid."
}{
"error": "insufficient_scope",
"error_description": "Required scope: articles:read"
}{
"error": "not_found",
"error_description": "Article not found"
}