Using Ghost Admin API

Manage Ghost blog content via the Admin API with JWT authentication.

1|1|Updated Sep 17, 2025
One-click install
npx skills add https://github.com/houfu/blog-alt-counsel --skill using-ghost-admin-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Using Ghost Admin API
Source: https://github.com/houfu/blog-alt-counsel/tree/main/.claude/skills/using-ghost-admin-api
Command: npx skills add https://github.com/houfu/blog-alt-counsel --skill using-ghost-admin-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @tryghost/admin-api, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive programmatic access to the Ghost Admin API, automating the creation, editing, and analysis of blog posts, drafts, and other content. It eliminates the need for manual interaction with the Ghost dashboard for complex content management tasks, saving significant time and reducing errors.

Core Features & Use Cases

  • Content Management: Programmatically create, update, and delete posts and pages, including setting status (draft, published, scheduled).
  • Lexical Content Builder: Construct Ghost's rich Lexical JSON format for advanced content structures, ensuring full editor compatibility.
  • Automated Metadata Generation: Automatically generate missing titles, custom excerpts, and relevant tags for posts, ensuring consistency and SEO readiness.
  • Use Case: Automatically publish a series of pre-written articles as drafts, complete with SEO-friendly excerpts and relevant tags, without ever logging into the Ghost admin panel. This is ideal for bulk uploads or integrating with external content pipelines.

Quick Start

Ensure GHOST_SITE_URL and GHOST_ADMIN_API_KEY are set in your environment.

This example uses the bundled Node.js script for Lexical content generation.

const { LexicalBuilder, text } = require('./.claude/skills/using-ghost-admin-api/scripts/ghost-lexical-single.js'); const GhostAdminAPI = require('@tryghost/admin-api');

const api = new GhostAdminAPI({ url: process.env.GHOST_SITE_URL, key: process.env.GHOST_ADMIN_API_KEY, version: 'v6.0' });

const content = new LexicalBuilder() .h1('My Automated Post Title') .paragraph('This post was created by AI using the Ghost Admin API skill.') .build();

api.posts.add({ title: "AI-Generated Draft Post", lexical: JSON.stringify(content), status: "draft", custom_excerpt: "A concise summary generated by AI.", tags: [{ name: "Automation" }, { name: "AI" }] }) .then(response => console.log('Post created:', response.url)) .catch(error => console.error('Error:', error));

Frequently Asked Questions about Using Ghost Admin API

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Ghost blog post creation and publishing without using the dashboard?

Use the Ghost Admin API with JWT authentication to programmatically create, draft, and publish posts. The API accepts Lexical JSON content format and handles metadata like titles, excerpts, tags, and SEO settings, eliminating manual dashboard interaction for bulk workflows.

What is Lexical JSON and why does Ghost use it for content?

Lexical JSON is Ghost's rich-text format for storing structured content with formatting, links, and embeds. It ensures full compatibility with Ghost's editor and enables programmatic content construction with consistent formatting across API-created and dashboard-edited posts.

Can I sync blog content between Ghost and external repositories or pipelines?

Yes. The Ghost Admin API supports creating drafts, pages, and posts with custom metadata and tags, making it suitable for integrating external content pipelines, bulk uploads, and syncing with local repositories without manual dashboard steps.

Do I need special setup or authentication to access the Ghost Admin API?

Yes. You need JWT-based authentication using a Ghost Admin API key and site URL set as environment variables. The @tryghost/admin-api package handles authentication and provides REST endpoints for posts, pages, members, tags, newsletters, and other resources.

How can I automatically generate SEO metadata like titles and excerpts for bulk posts?

The Ghost Admin API accepts custom_excerpt, title, and tags fields for each post. You can populate these programmatically before creation, ensuring consistency and SEO readiness across multiple posts in automated workflows.

What Ghost versions and API endpoints does the Admin API support?

The Ghost Admin API works with Ghost v6.0 and provides REST endpoints for posts, pages, members, tags, newsletters, and other resources. Check your Ghost instance version compatibility before implementing to ensure endpoint availability.