Get Article by Slug

Fetch a single article from your project using its slug. This endpoint is primarily used for displaying an individual blog post page based on its unique slug.

Endpoint

GET https://beatrice.app/api/articles/[slug]?token=XXX

Replace [slug] with the actual slug of the article you want to retrieve.


Example

GET https://beatrice.app/api/articles/how-to-improve-seo?token=btc_1234567890abcdef

This example retrieves the article with slug how-to-improve-seo belonging to your project.


Response

Returns an object containing the article data.

Example Response

{
  "article": {
    "_id": "article_id",
    "title": "How to Improve SEO",
    "slug": "how-to-improve-seo",
    "meta_description": "Short meta description.",
    "content": "<p>Full HTML content here...</p>",
    "tags": ["seo", "marketing"],
    "image": "https://...",
    "publishedAt": "2025-06-28T12:34:56.789Z",
    "createdAt": "2025-06-27T12:34:56.789Z",
    "updatedAt": "2025-06-28T12:34:56.789Z"
  },
  "ok": true
}

Parameters

Parameter Type Required Description
slug params ✅ The slug of the article you want to fetch.
token query ✅ Your project token.

Errors

Status Meaning
400 Token required
401 Invalid token
404 Article not found
500 Server error

Notes

  • This endpoint returns the full HTML content of the article.
  • If the slug does not exist or the article is deleted, a 404 Article not found error is returned.
  • For optimal styling of the HTML content, consider using Tailwind Typography which provides beautiful default styles for prose content.