Article API
Programmatically fetch your content using the Metrics & Co. API for integration with custom CMS platforms or backend systems.
Use the article API to synchronize content into your own CMS, database or application. It is pull-based: your backend must fetch, save and publish the articles. Merely generating an API key does not publish anything.
#Connect and authenticate
Open Settings → Publishing → API → Connect. Generate a key and store it as a server-side secret named AI_GROWTH_API_KEY. Copy the exact API base address from the authenticated setup instructions into AI_GROWTH_API_BASE; if it is not shown, request it from Metrics support. These names are your application’s configuration variables, not a claim that the login website is an API endpoint.
Keep both configuration values on the server. Never use a NEXT_PUBLIC_ or VITE_ prefix for a secret, paste it into public code, or log authentication headers. Every request uses X-API-Key and Content-Type: application/json.
#List article summaries
Request GET /v1/articles?limit=50&offset=0 relative to the configured base. Articles arrive newest first. The maximum page size is 50. Summaries do not contain the full HTML or Markdown body.
curl --fail-with-body "$AI_GROWTH_API_BASE/v1/articles?limit=50&offset=0" \
-H "X-API-Key: $AI_GROWTH_API_KEY" \
-H "Content-Type: application/json"#Fetch the full article
Use an article ID from the list response with GET /v1/articles/{id}. Retrieve the full record before creating a post. Do not treat the list excerpt as the article body.
curl --fail-with-body "$AI_GROWTH_API_BASE/v1/articles/ARTICLE_ID" \
-H "X-API-Key: $AI_GROWTH_API_KEY" \
-H "Content-Type: application/json"Replace ARTICLE_ID with a real ID from your own list response. Run these commands only on a trusted development machine or server with environment variables configured.
#Paginate reliably
Start with limit=50 and offset=0, then request offsets 50, 100 and so on. Stop only when a successful response contains fewer than 50 items. A failed request is not the end of the list.
For each summary, retrieve the full record. Validate the response shape before saving; report errors rather than storing an empty article. For 429 or transient 5xx responses, respect Retry-After where supplied and retry with bounded exponential backoff.
#Map fields to your CMS
| API field | Destination |
|---|---|
title | Post title |
slug | Canonical post slug and idempotency key |
content_html | Full body for an HTML CMS |
content_markdown | Full body for a Markdown CMS |
meta_description | SEO description |
hero_image_url | Cover or featured image |
jsonLd, faqJsonLd | Validated page structured data |
languageCode | Language or locale |
publishedAt | Publication date, when provided |
published_url | Detected public article URL |
Upsert by slug while keeping languages separate, for example with a unique (languageCode, slug) key. Preserve intentional CMS edits with an explicit update policy instead of blindly overwriting editorial work. Keep API source identifiers separately so retries do not create duplicates.
published_url can be empty until the live page is detected. It is not a reason to discard a generated article, and it is not the same as your own CMS approval state.
#Store locally and schedule the sync
The API is rate-limited. Save imported articles in your own storage and render pages from there. Do not call the API on every visitor request.
Run a scheduled job, CI task or framework revalidation workflow to discover new articles. Update or invalidate the blog index and sitemap after a successful publish. Use a lock to prevent overlapping syncs and retain the previous published version if an import fails.
#Render safely and make pages discoverable
Sanitize HTML before rendering. Validate structured data and emit it separately as JSON-LD, rather than executing arbitrary scripts from article HTML. Keep one canonical URL per language/page, server-render the article body, return a real 404 for unknown slugs and include only published URLs in your sitemap.
For images, verify that the destination can access the source URL and copy required assets into durable storage if your publishing model depends on them. Match title, body, language and publication status between the CMS and the public site.
#Rotate keys
A website key may be shared across API-based publishing connections. Rotating it can affect Duda, Framer, Lovable and other consumers. Update every configured consumer and verify a successful sync before retiring old configuration. Never send keys in support screenshots or public URLs.
#Troubleshooting
- 401: Check the exact
X-API-Keyheader and the key for the correct website.
- 404: List articles again and use a real accessible ID.
- 429: Reduce request frequency, cache locally and back off.
- Only summaries appear: Fetch each article detail endpoint.
- New posts never appear: Confirm the scheduled sync runs and the CMS publication step succeeds.
- Missing styles: Your CMS theme controls fonts, tables, spacing and mobile responsiveness; see Article quality.
For push-based delivery, use Webhooks.