Content API
Fetch your published BuzzRank articles from your own site and render them your way.
Overview
The Content API is pull-based. BuzzRank does not push anything to your site: your site calls BuzzRank and reads the articles that are published. When an article is published in BuzzRank (manually or on its schedule), it appears in the API. When you update a published article, the change shows up the next time your site fetches it.
Use Case: Sites built with code or AI builders that have no CMS to publish into: Next.js, Framer, Lovable, Bolt, v0, Replit, Base44, Astro, Nuxt and similar.
Setup
Configure the Content API in BuzzRank Site Settings > Integrations > Content API.
1. Article URL pattern (optional, recommended)
Tell BuzzRank where articles live on your site. The pattern must contain {slug}. It is used for links, sitemaps and link exchange, and to fill the url field of each article.
https://example.com/blog/{slug}2. API key
Generate an API key. It starts with brc_ and is shown only once, so copy it right away and store it as a secret environment variable, for example BUZZRANK_API_KEY. Generating a new key or revoking the key stops the old one from working immediately.
3. Fetch articles on your site
Call the endpoints below from your server or at build time. See the examples further down.
Authentication
Every request must include your API key in one of these headers:
API Key header
X-API-Key: <key>
Bearer token
Authorization: Bearer <key>
The key belongs to one site and only returns that site's published articles. The base URL is https://buzzrank.io/api/v1. The exact endpoint is also shown in Site Settings next to your key.
Endpoints
Both endpoints are read-only and return JSON. Only articles with the status published are returned.
Returns published articles, newest first, without the article body. Fetch a single article to get content_html.
Query parameters:
| Parameter | Description |
|---|---|
| limit | Articles per page, 1 to 50. Default 20. Values outside the range are clamped. |
| cursor | The next_cursor value from the previous page. Omit it for the first page. |
| language | Only return articles in this language (e.g. en). |
Response:
{
"data": [
{
"id": "k17f3x9q2m8n4p6r5t1v0w7y3z",
"slug": "how-to-optimize-website-seo",
"title": "How to Optimize Your Website for SEO",
"excerpt": "Learn the best practices for SEO optimization...",
"meta_title": "SEO Optimization Guide",
"meta_description": "Complete guide to optimizing your website...",
"language": "en",
"keyword": "website seo optimization",
"category": "SEO",
"hero_image_url": "https://images.buzzrank.io/abc123.jpg",
"hero_image_alt": "Laptop showing a search results page",
"url": "https://example.com/blog/how-to-optimize-website-seo",
"published_at": "2026-01-11T12:00:00.000Z",
"updated_at": "2026-01-11T12:00:00.000Z"
}
],
"next_cursor": "eyJpZCI6Ims..."
}next_cursor is null on the last page. The language filter is applied to each page after it is read, so a page can hold fewer articles than limit (even none) while next_cursor is still set. Keep requesting pages until next_cursor is null.
Returns one published article by its ID or slug, with the full HTML body and JSON-LD. Returns 404 not_found if the article does not exist, is not published, or belongs to another site.
Response:
{
"data": {
"id": "k17f3x9q2m8n4p6r5t1v0w7y3z",
"slug": "how-to-optimize-website-seo",
"title": "How to Optimize Your Website for SEO",
"excerpt": "Learn the best practices for SEO optimization...",
"meta_title": "SEO Optimization Guide",
"meta_description": "Complete guide to optimizing your website...",
"language": "en",
"keyword": "website seo optimization",
"category": "SEO",
"hero_image_url": "https://images.buzzrank.io/abc123.jpg",
"hero_image_alt": "Laptop showing a search results page",
"url": "https://example.com/blog/how-to-optimize-website-seo",
"published_at": "2026-01-11T12:00:00.000Z",
"updated_at": "2026-01-11T12:00:00.000Z",
"content_html": "<h2>Introduction</h2><p>SEO is important...</p>",
"json_ld": {
"@context": "https://schema.org",
"@type": "Article",
"headline": "How to Optimize Your Website for SEO"
},
"lsi_keywords": ["seo checklist", "on-page seo"]
}
}Article Fields
Both endpoints return these fields for every article:
| Field | Type | Description |
|---|---|---|
| id | string | Article ID. Can be used instead of the slug in GET /api/v1/articles/{id}. |
| slug | string | URL slug of the article. |
| title | string | Article title. |
| excerpt | string | null | Short summary of the article. |
| meta_title | string | SEO title. Falls back to title. |
| meta_description | string | null | SEO description. Falls back to excerpt. |
| language | string | Language of the article, as set in BuzzRank (e.g. en). |
| keyword | string | Main keyword the article targets. |
| category | string | null | Suggested category. |
| hero_image_url | string | null | Featured image URL. |
| hero_image_alt | string | Alt text of the featured image. Falls back to title. |
| url | string | null | Public URL of the article: the URL recorded when it was published, otherwise your article URL pattern with {slug} filled in. null when neither is set. |
| published_at | string | null | Publish time (ISO 8601). |
| updated_at | string | ISO 8601 timestamp. Currently the publish time, or the creation time if there is none. |
The single-article endpoint adds:
| Field | Type | Description |
|---|---|---|
| content_html | string | Article body as HTML, ready to render. YouTube placeholders are converted to embedded iframes and internal data attributes are removed. JSON-LD is not included here. |
| json_ld | object | array | null | Parsed JSON-LD structured data, or null. |
| lsi_keywords | string[] | Related keywords used in the article. Empty array if none. |
Error Handling
Errors use the same shape on both endpoints:
{
"error": {
"code": "invalid_api_key",
"message": "The API key is not valid or was revoked."
}
}| Status | Code | Meaning |
|---|---|---|
| 401 | missing_api_key | No key in X-API-Key or Authorization: Bearer |
| 401 | invalid_api_key | The key is wrong, was replaced or was revoked |
| 400 | invalid_cursor | The cursor is invalid. Start again without it |
| 400 | invalid_id | Empty article ID or slug |
| 404 | not_found | No published article with this ID or slug |
| 500 | server_error | Something went wrong on our side. Try again |
Caching and Security
Keep the key secret. CORS is open for GET requests, so the API can technically be called from a browser, but then anyone can read your key from the page. Call the API from your server, a server function or at build time instead.
Successful responses carry Cache-Control: private, max-age=60; errors carry Cache-Control: no-store. Do not call the API on every page view. Sync articles into your own store, or cache the responses, for example with revalidate in Next.js. New and updated articles then appear once the cache refreshes.
Testing with curl
# List the newest 10 articles
curl "https://buzzrank.io/api/v1/articles?limit=10" \
-H "X-API-Key: $BUZZRANK_API_KEY"
# Next page, English articles only
curl "https://buzzrank.io/api/v1/articles?limit=10&language=en&cursor=NEXT_CURSOR" \
-H "X-API-Key: $BUZZRANK_API_KEY"
# One article by slug (or ID), with a Bearer token
curl "https://buzzrank.io/api/v1/articles/how-to-optimize-website-seo" \
-H "Authorization: Bearer $BUZZRANK_API_KEY"Example: Next.js (App Router)
A small client for the API. It runs only on the server, so BUZZRANK_API_KEY never reaches the browser, and it caches each response for 5 minutes.
// lib/buzzrank.ts
const API = "https://buzzrank.io/api/v1";
export type ArticleSummary = {
id: string;
slug: string;
title: string;
excerpt: string | null;
meta_title: string;
meta_description: string | null;
language: string;
keyword: string;
category: string | null;
hero_image_url: string | null;
hero_image_alt: string;
url: string | null;
published_at: string | null;
updated_at: string;
};
export type Article = ArticleSummary & {
content_html: string;
json_ld: unknown;
lsi_keywords: string[];
};
function buzzrank(path: string) {
return fetch(`${API}${path}`, {
headers: { "X-API-Key": process.env.BUZZRANK_API_KEY! },
next: { revalidate: 300 }, // refresh at most every 5 minutes
});
}
// All published articles, following next_cursor to the last page.
export async function getAllArticles(): Promise<ArticleSummary[]> {
const articles: ArticleSummary[] = [];
let cursor: string | null = null;
do {
const query = new URLSearchParams({ limit: "50" });
if (cursor) query.set("cursor", cursor);
const res = await buzzrank(`/articles?${query}`);
if (!res.ok) throw new Error(`BuzzRank API error ${res.status}`);
const page: { data: ArticleSummary[]; next_cursor: string | null } = await res.json();
articles.push(...page.data);
cursor = page.next_cursor;
} while (cursor);
return articles;
}
export async function getArticle(slug: string): Promise<Article | null> {
const res = await buzzrank(`/articles/${encodeURIComponent(slug)}`);
if (res.status === 404) return null;
if (!res.ok) throw new Error(`BuzzRank API error ${res.status}`);
const body: { data: Article } = await res.json();
return body.data;
}The blog index:
// app/blog/page.tsx
import Link from "next/link";
import { getAllArticles } from "@/lib/buzzrank";
export const revalidate = 300;
export default async function BlogPage() {
const articles = await getAllArticles();
return (
<ul>
{articles.map((article) => (
<li key={article.id}>
<Link href={`/blog/${article.slug}`}>{article.title}</Link>
{article.excerpt && <p>{article.excerpt}</p>}
</li>
))}
</ul>
);
}The article page. generateStaticParams prerenders every article at build time; articles published later are rendered on first request and then cached.
// app/blog/[slug]/page.tsx
import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { getAllArticles, getArticle } from "@/lib/buzzrank";
export const revalidate = 300;
type Props = { params: Promise<{ slug: string }> };
export async function generateStaticParams() {
const articles = await getAllArticles();
return articles.map((article) => ({ slug: article.slug }));
}
export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const article = await getArticle(slug);
if (!article) return {};
return {
title: article.meta_title,
description: article.meta_description ?? undefined,
alternates: article.url ? { canonical: article.url } : undefined,
openGraph: article.hero_image_url
? { images: [{ url: article.hero_image_url, alt: article.hero_image_alt }] }
: undefined,
};
}
export default async function ArticlePage({ params }: Props) {
const { slug } = await params;
const article = await getArticle(slug);
if (!article) notFound();
return (
<article>
{article.json_ld ? (
<script
type="application/ld+json"
// Escape "<" so the JSON cannot close the script tag
dangerouslySetInnerHTML={{
__html: JSON.stringify(article.json_ld).replace(/</g, "\\u003c"),
}}
/>
) : null}
<h1>{article.title}</h1>
{article.hero_image_url && (
<img src={article.hero_image_url} alt={article.hero_image_alt} />
)}
<div dangerouslySetInnerHTML={{ __html: article.content_html }} />
</article>
);
}Example: Lovable, Bolt, v0 and other builders
Put these helpers in a server function (an edge function, API route or server action), never in client code. Store the key as a secret named BUZZRANK_API_KEY. In Supabase Edge Functions, read it with Deno.env.get("BUZZRANK_API_KEY") instead of process.env.
const BASE = "https://buzzrank.io/api/v1";
const headers = { Authorization: `Bearer ${process.env.BUZZRANK_API_KEY}` };
// One page of articles: { data: [...], next_cursor }
export async function listArticles(cursor) {
const url = new URL(`${BASE}/articles`);
url.searchParams.set("limit", "20");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, { headers });
const body = await res.json();
if (!res.ok) throw new Error(body.error.message);
return body;
}
// One article with content_html, json_ld and lsi_keywords, or null if not found
export async function getArticle(slug) {
const res = await fetch(`${BASE}/articles/${encodeURIComponent(slug)}`, { headers });
if (res.status === 404) return null;
const body = await res.json();
if (!res.ok) throw new Error(body.error.message);
return body.data;
}Render content_html as HTML and add json_ld to the page inside a <script type="application/ld+json"> tag. Cache the results instead of fetching on every visit.
Content API vs REST API and Webhook
| Content API | REST API / Webhook | |
|---|---|---|
| Direction | Your site calls BuzzRank | BuzzRank calls your server |
| Your server | Nothing to expose, only outgoing requests | Must expose endpoints |
| Authentication | Your BuzzRank API key | Your token or HMAC signature |
| Best for | Code and AI-built sites without a CMS | Headless CMS, custom integrations |
Need Help?
If you need assistance with the Content API, contact us at support@buzzrank.io