import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.blogPosts.list({});
console.log(result);
}
run();{
"object": "list",
"data": [
{
"id": "<string>",
"object": "<string>",
"title": "<string>",
"slug": "<string>",
"content": "<string>",
"status": "draft",
"excerpt": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"scheduled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"url": "<string>",
"category": "<string>"
}
],
"has_more": true,
"url": "<string>"
}Returns a list of blog posts, optionally filtered by status
import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.blogPosts.list({});
console.log(result);
}
run();{
"object": "list",
"data": [
{
"id": "<string>",
"object": "<string>",
"title": "<string>",
"slug": "<string>",
"content": "<string>",
"status": "draft",
"excerpt": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"scheduled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"url": "<string>",
"category": "<string>"
}
],
"has_more": true,
"url": "<string>"
}API key in the format: Bearer {api_token}
Filter by status: draft, published, scheduled, archived
draft, published, scheduled, archived Filter by category slug
Search by title
Cursor for pagination — the ID of the last item in the previous page
Items per page
1 <= x <= 100Was this page helpful?