Ghost.io API
A strongly-typed, async Rust client for the Ghost CMS API.
⚠️ v0.1.0 — Content API is stable. Admin API is planned for v0.2.0.
Overview
ghost-io-api is an ergonomic Rust interface to the Ghost Content API. It is designed to be:
- Async-first — built on
tokioandreqwest - Strongly typed — every request and response is a Rust struct with serde derives
- Fluent — a builder API for query parameters keeps call sites readable
- Correct — integration-tested against
demo.ghost.io
Installation
[]
= "0.1"
= { = "1", = ["rt-multi-thread", "macros"] }
Quick Start
use ContentApiKey;
use ;
use Result;
async
Features
Content API (v0.1.0)
| Endpoint | Browse | Read by ID | Read by Slug |
|---|---|---|---|
| Posts | ✅ | ✅ | ✅ |
| Pages | ✅ | ✅ | ✅ |
| Tags | ✅ | ✅ | ✅ |
| Authors | ✅ | ✅ | ✅ |
| Tiers | ✅ | — | — |
| Settings | ✅ | — | — |
Admin API
| Feature | Status |
|---|---|
| JWT authentication | 🔜 v0.2.0 |
| Posts CRUD | 🔜 v0.2.0 |
| Members | 🔜 v0.6.0 |
Usage
Authentication
Content API keys are 26-character hexadecimal strings found under Ghost Admin → Integrations → Content API.
use ContentApiKey;
let key = new?;
Creating a client
use GhostContentClient;
let client = new?;
Trailing slashes on the URL are stripped automatically. The client sets Accept-Version: v5.0 on every request.
Browsing posts
use BrowsePostsParams;
let response = client.browse_posts.await?;
Fluent query builder
Use BrowseParams for a chainable builder interface:
use BrowseParams;
use BrowsePostsParams;
let browse = new
.limit
.page
.filter
.order
.include;
let params = BrowsePostsParams ;
let response = client.browse_posts.await?;
Reading a single resource
// By ID
let post = client.read_post_by_id.await?;
// By slug, with relations
let post = client.read_post_by_slug.await?;
// Pages, tags, authors follow the same pattern
let page = client.read_page_by_slug.await?;
let tag = client.read_tag_by_slug.await?;
let author = client.read_author_by_slug.await?;
Pagination
let pagination = &response.meta.pagination;
println!;
println!;
if pagination.has_next
Site settings
let settings = client.get_settings.await?;
println!;
println!;
Error handling
use GhostError;
match client.read_post_by_id.await
Examples
list_posts
Pages through all published posts and prints title, slug, and publication date.
# Uses demo.ghost.io by default
# Point at your own site
GHOST_URL=https://your-site.ghost.io \
GHOST_CONTENT_KEY=your-content-api-key \
Running Tests
# Unit + doc tests (no network required)
# Integration tests (hits demo.ghost.io)
License
MIT © 2026 Arunkumar Mourougappane