Get Articles
Fetch all articles from your project that have been generated by Beatrice. This endpoint is primarily used for the /blog page that displays all articles in a paginated format, allowing users to browse through your content efficiently.
Endpoint
GET https://beatrice.app/api/articles?token=XXX
With optional parameters:
GET https://beatrice.app/api/articles?token=btc_1234567890abcdef&page=2&limit=20&search=marketing&published=published
This example retrieves the second page of published articles containing "marketing" in their title, with 20 articles per page.
Response
Returns an object containing an array of articles and pagination information.
Example Response
{
"data": [
{
"_id": "article_id",
"title": "Article Title",
"slug": "article-title",
"meta_description": "Short meta description.",
"tags": ["tag1", "tag2"],
"image": "https://...",
"authorSlug": "author-slug",
"deletedAt": null,
"publishedAt": "2025-06-28T12:34:56.789Z",
"createdAt": "2025-06-27T12:34:56.789Z",
"updatedAt": "2025-06-28T12:34:56.789Z"
}
],
"pagination": {
"total": 42,
"page": 1,
"limit": 10,
"pages": 5
}
}
Pagination Details
The pagination object provides essential information for implementing pagination in your application:
total
: The total number of articles matching your query (including all pages)page
: The current page number being returnedlimit
: The maximum number of articles per page that was requestedpages
: The total number of pages available based on the total count and limit
For example, if you have 42 total articles and request 10 per page, you'll get 5 pages total.
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | string | ✅ | Your project token. |
page | number | No | Page number for pagination (default: 1). |
limit | number | No | Number of articles per page (default: 1000). |
search | string | No | Search keyword to filter by title. |
tag | string | No | Filter by tag. |
published | string | No | Filter by status: published or draft . |
Errors
Status | Meaning |
---|---|
400 | Token required |
401 | Invalid token |
500 | Server error |