Overview
The Ghost CMS API offers a structured way to interact with content and administrative functions of a Ghost installation. Designed for developers and independent publishers, Ghost operates as either a self-hosted open-source platform or a managed service through Ghost Pro. Its API provides programmatic access to posts, pages, authors, tags, and members, making it suitable for scenarios where a custom frontend is preferred over Ghost's default theme engine. This headless approach allows content created and managed within Ghost to be delivered to any application, such as mobile apps, static site generators, or custom web frontends, providing flexibility in presentation and user experience.
Ghost's API is divided into two main categories: the Content API and the Admin API. The Content API is read-only and publicly accessible, designed for fetching published content to display on a website or application. It supports filtering, ordering, and pagination, allowing developers to query specific types of content, such as posts by a particular author or posts tagged with a certain category. The Admin API, conversely, requires authentication and provides full CRUD (Create, Read, Update, Delete) operations across all content types, members, and site settings. This API is used for automating content publication, managing member subscriptions, integrating with third-party services, and performing administrative tasks programmatically.
The platform is particularly well-suited for independent publishers, bloggers, and organizations that prioritize content delivery and membership management. Its focus on speed and a clean writing experience, coupled with robust API access, enables developers to build highly customized publishing platforms. For instance, a developer might use the Content API to feed blog posts into a Next.js application, while using the Admin API to automatically publish articles drafted in an external editor. Ghost's emphasis on subscriptions and member management also makes it a strong candidate for creating paywalled content or exclusive member-only sections, with the API facilitating custom user registration flows and subscription management integrations. The Ghost API reference documentation details the available endpoints and data models for both Content and Admin APIs.
While Ghost offers a default theme engine, its headless capabilities are a primary draw for developers seeking more control over the user interface and overall architecture. This aligns with broader industry trends towards decoupled architectures, where content management is separated from content presentation. For example, a common pattern involves using Ghost as the content backend and a static site generator like Gatsby or Astro for the frontend, leveraging the Content API to fetch data during build time. The Admin API can then be used for tasks like importing a large set of legacy blog posts or programmatically updating metadata across multiple articles.
Security considerations are central to API design, and Ghost implements token-based authentication for its Admin API to ensure that only authorized applications can perform write operations. Developers are advised to handle API keys securely, typically by storing them as environment variables and restricting their exposure. The platform also adheres to compliance standards like GDPR for data privacy, which is important for applications handling user data, particularly in membership scenarios. This commitment to both developer flexibility and operational security makes Ghost a comprehensive solution for modern content delivery needs.
Key features
- Content API: A public, read-only API for fetching posts, pages, authors, and tags. Supports filtering, sorting, and pagination to retrieve specific content sets for display on custom frontends.
- Admin API: A secure, authenticated API for full CRUD operations on content, members, and site settings. Enables programmatic content creation, updates, deletions, and management of user subscriptions.
- Membership Management: API endpoints for managing site members, including creation, retrieval, updates, and subscription status changes, facilitating custom user authentication and paywall integrations.
- Webhooks: Configurable webhooks that trigger external actions upon specific events within Ghost, such as a new post being published or a member signing up. Webhooks enable real-time integrations with other services.
- Image Uploads and Management: API support for uploading and managing images and other media assets, allowing for integration with custom media libraries or external image optimization services.
- Data Import/Export: Capabilities within the Admin API to import and export content, which is useful for migration tasks or syncing content across multiple Ghost instances.
- Custom Integrations: The RESTful nature of the API allows for integration with virtually any programming language or framework, enabling developers to build highly bespoke applications around Ghost content.
Pricing
Ghost offers both a free, self-hostable open-source version and managed hosting plans through Ghost Pro. Pricing for Ghost Pro is tiered based on the number of members and ranges from basic publishing to advanced features for larger audiences.
| Plan Name | Price (billed annually, as of 2026-05-09) | Key Features / Member Limits |
|---|---|---|
| Self-Hosted Open Source | Free | Full control, unlimited members, requires self-management, community support. |
| Creator | $9/month | Up to 500 members, custom domain, basic analytics, email newsletters, managed hosting. |
| Growth | $25/month | Up to 1,000 members, advanced analytics, custom themes, integrations, priority support. |
| Pro | $50/month | Up to 10,000 members, advanced audience tools, content experiments, dedicated support. |
| Business | Custom pricing | For enterprises, over 100,000 members, custom setup, dedicated account management. |
For detailed and up-to-date pricing information, including higher-tier plans and specific feature breakdowns, refer to the Ghost pricing page.
Common integrations
- Static Site Generators (e.g., Next.js, Gatsby, Astro): Use the Content API to fetch Ghost content at build time or on demand, enabling fast, SEO-friendly websites.
- Email Marketing Services (e.g., Mailchimp, ConvertKit): Integrate the Admin API to sync Ghost members with email lists or trigger campaigns based on member actions.
- Payment Gateways (e.g., Stripe): Integrate with the Admin API to manage member subscriptions and process payments for premium content or memberships. The Stripe API documentation provides further details on payment processing.
- Analytics Platforms (e.g., Google Analytics, Plausible): Embed tracking codes or use webhooks to send content and member data for detailed performance monitoring.
- Search Services (e.g., Algolia, MeiliSearch): Index Ghost content using the Content API to provide custom search functionality within a frontend application.
- CRM Systems: Sync member data from Ghost to a CRM using the Admin API to centralize customer information and manage relationships.
- Automation Tools (e.g., Zapier, Make.com): Connect Ghost webhooks with hundreds of other applications to automate workflows, such as posting new articles to social media or archiving content.
Alternatives
- Strapi: An open-source headless CMS that is highly customizable and self-hostable, offering a broader range of content types beyond publishing-specific needs.
- Contentful: A cloud-native headless CMS known for its strong enterprise features, robust content modeling, and extensive marketplace of integrations.
- Sanity: A headless CMS specializing in structured content and real-time collaboration, offering a highly flexible content schema and a powerful query language (GROQ).
Getting started
To get started with the Ghost Content API, you'll need a Ghost instance and an API key. This example demonstrates fetching the latest posts using the official Node.js client library. First, ensure you have a Content API key and the API URL from your Ghost admin panel (Settings > Integrations > Custom Integrations).
Install the Ghost Content API client:
npm install @tryghost/content-api
Then, create a JavaScript file (e.g., fetch-posts.js) and add the following code:
const GhostContentAPI = require('@tryghost/content-api');
// Initialize the Ghost Content API client
const api = new GhostContentAPI({
url: 'YOUR_GHOST_URL',
key: 'YOUR_CONTENT_API_KEY',
version: 'v5.0' // Use the appropriate API version for your Ghost instance
});
async function fetchLatestPosts() {
try {
const posts = await api.posts
.browse({
limit: 5,
order: 'published_at DESC',
fields: 'title,slug,published_at'
})
.catch(err => {
console.error(err);
throw new Error('Failed to browse posts.');
});
console.log('Successfully fetched posts:');
posts.forEach(post => {
console.log(`- ${post.title} (Slug: ${post.slug}, Published: ${new Date(post.published_at).toLocaleDateString()})`);
});
} catch (error) {
console.error('Error fetching posts:', error.message);
}
}
fetchLatestPosts();
Replace 'YOUR_GHOST_URL' with the URL of your Ghost site (e.g., 'https://yourdomain.com') and 'YOUR_CONTENT_API_KEY' with your actual Content API key. Make sure to specify the correct version for your Ghost installation, typically 'v5.0' or 'v4.0' as found in your Ghost admin panel under Integrations.
Run the script using Node.js:
node fetch-posts.js
This script will connect to your Ghost instance, fetch the five most recently published posts, and log their titles, slugs, and publication dates to the console. This basic setup can be extended to build full-featured frontends, integrate content into other applications, or perform more complex queries as outlined in the Ghost Content API post browsing documentation.