LxBlog
/Docs

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/Reactreact-markdown + remark-gfm for GitHub Flavored Markdown
  • Pythonmarkdown or mistune
  • Gogoldmark
  • PHPleague/commonmark
render-article.tsx
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

GET/api/v1/articles

Returns a paginated list of all published articles for the connected blog, ordered by publication date (newest first).

Query Parameters

NameTypeDescription
pagenumberPage number for pagination.(default: 1)
limitnumberNumber of articles per page (max 100).(default: 20)

Response

200 OK
{
  "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

NameTypeDescription
idstringUnique CUID identifier for the article.
slugstringURL-friendly slug derived from the article title.
titlestringThe article title.
descriptionstring | nullShort summary or meta description of the article.
contentstringFull article body in Markdown format. See Content Format section above.
coverImageUrlstring | nullURL of the cover/hero image, if generated.
inlineImageUrlsstring[]URLs of images embedded within the article Markdown content.
tagsstring[]List of tags associated with the article.
seoKeywordsstring[]SEO keywords assigned to the article during AI generation.
seoScorenumber | nullSEO quality score (0-10) from the AI review process. Null if SEO scoring is disabled.
schemaOrgJsonobject | nullSchema.org JSON-LD structured data for the article. Can be embedded in your page as a <script type="application/ld+json"> tag for SEO.
publishedAtstringISO 8601 timestamp of when the article was published.
updatedAtstringISO 8601 timestamp of the last modification.
viewCountnumberNumber of page views on the LxBlog hosted blog. Starts at 0.
contentHashstringSHA-256 hash of the article content (title + description + content + tags). Used for change detection during sync.

Pagination Object

NameTypeDescription
pagenumberCurrent page number.
limitnumberNumber of articles per page.
totalnumberTotal number of published articles.
totalPagesnumberTotal number of pages.

Get Single Article

GET/api/v1/articles/{idOrSlug}

Retrieves a single published article by its CUID identifier or URL slug.

Path Parameters

NameTypeDescription
idOrSlug*stringThe article CUID (e.g. cm5abc123def456ghi789) or slug (e.g. getting-started-with-nextjs).

Example Requests

Fetch by ID
curl https://lxblog.app/api/v1/articles/cm5abc123def456ghi789 \
  -H "Authorization: Bearer lxb_at_your_access_token"
Fetch by slug
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.

200 OK
{
  "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.

schema-org.tsx
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.

401 Unauthorized
{
  "error": "invalid_token",
  "error_description": "Access token is missing, expired, or invalid."
}
403 Forbidden
{
  "error": "insufficient_scope",
  "error_description": "Required scope: articles:read"
}
404 Not Found
{
  "error": "not_found",
  "error_description": "Article not found"
}