Skip to main content
Use the Blog Articles API when your site wants to pull finished YALG articles and render them in its own blog. Your application calls YALG from a trusted server environment with a Developer API key.
This is the pull-based integration. If you want YALG to push completed articles to your own endpoint, see Blog Delivery.

1. Create a Developer API key

  1. Sign in to YALG.
  2. Open Settings > Developer.
  3. Create a named API key for the site or environment that will read blog articles.
  4. Copy the full key immediately. It is shown once.
  5. Store it server-side, for example as YALG_BLOG_API_KEY.
API keys are shown once. Store them in a server-side secret manager or environment variable, and never expose them in client-side code.
Do not expose this key in browser JavaScript. Fetch YALG articles from your backend, server component, serverless function, or worker.

2. List blog articles

The request is scoped to the API key owner. You do not send a user id.
The response is an array of article summaries. It includes metadata needed to render cards and choose which articles are public, but it does not include the full Markdown body.

Public rendering filter

The list endpoint returns all blog article jobs for the key owner, including drafts, running jobs, failed jobs, and completed jobs. For a public blog, filter before rendering:
  • status should be FINISHED or PUBLISHED.
  • language should match the current site locale, such as en, fr, or es.
  • slug should be present.
  • articleTitle or topic should be present.

3. Get one article with Markdown

Use the article id from the list response:
The detail response contains the same metadata plus generation details and articleMarkdown.
articleMarkdown can be null while an article is still running, blocked, or failed. Treat it as the canonical article body once the article is FINISHED or PUBLISHED.

Download raw Markdown

If you only need the article body as a Markdown file, use:
This returns text/markdown; charset=utf-8 and a Content-Disposition attachment filename based on the article topic. The endpoint returns an error if Markdown is not available yet.

4. Example server-side fetch

Headers

Common errors

Difference from Blog Delivery

There are two API keys involved in blog integrations:
  • Developer API key: created in Settings > Developer, sent by your server to YALG as x-api-key, used for GET /v1/blog/articles.
  • Delivery API key: configured in YALG blog delivery settings, sent by YALG to your receiver endpoint as x-api-key when YALG pushes an article to your app.