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.

GET/api/v1/articlesList published articles

Returns published articles, newest first, without the article body. Fetch a single article to get content_html.

Query parameters:

ParameterDescription
limitArticles per page, 1 to 50. Default 20. Values outside the range are clamped.
cursorThe next_cursor value from the previous page. Omit it for the first page.
languageOnly 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.

GET/api/v1/articles/{id or slug}Get one article

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:

FieldTypeDescription
idstringArticle ID. Can be used instead of the slug in GET /api/v1/articles/{id}.
slugstringURL slug of the article.
titlestringArticle title.
excerptstring | nullShort summary of the article.
meta_titlestringSEO title. Falls back to title.
meta_descriptionstring | nullSEO description. Falls back to excerpt.
languagestringLanguage of the article, as set in BuzzRank (e.g. en).
keywordstringMain keyword the article targets.
categorystring | nullSuggested category.
hero_image_urlstring | nullFeatured image URL.
hero_image_altstringAlt text of the featured image. Falls back to title.
urlstring | nullPublic 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_atstring | nullPublish time (ISO 8601).
updated_atstringISO 8601 timestamp. Currently the publish time, or the creation time if there is none.

The single-article endpoint adds:

FieldTypeDescription
content_htmlstringArticle 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_ldobject | array | nullParsed JSON-LD structured data, or null.
lsi_keywordsstring[]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."
  }
}
StatusCodeMeaning
401missing_api_keyNo key in X-API-Key or Authorization: Bearer
401invalid_api_keyThe key is wrong, was replaced or was revoked
400invalid_cursorThe cursor is invalid. Start again without it
400invalid_idEmpty article ID or slug
404not_foundNo published article with this ID or slug
500server_errorSomething 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 APIREST API / Webhook
DirectionYour site calls BuzzRankBuzzRank calls your server
Your serverNothing to expose, only outgoing requestsMust expose endpoints
AuthenticationYour BuzzRank API keyYour token or HMAC signature
Best forCode and AI-built sites without a CMSHeadless CMS, custom integrations

See also the REST API and Webhook docs.

Need Help?

If you need assistance with the Content API, contact us at support@buzzrank.io