These are the basic steps to follow to interact with the Ghost Content API in your TypeScript project.

Get your Ghost Admin API Key and Ghost version number

Admin API keys can be obtained by creating a new Custom Integration under the Integrations screen in Ghost Admin. Keys for individual users can be found on their respective settings page.

My advice would be to connect to your Ghost Admin panel and go to https://{your-ghost-blog-domain}/ghost/#/settings/integrations and create a new integration, choose an appropriate Name and Descriptions.


For all operations You will need:

  • the Admin API Key
  • and the API URL to instantiate the client.

If you plan on creating webhooks you will also need to provide the integration_id, this is the auto-generated ID of the integration you just created. To visualize that id, on your integration page, look at the url:

  • https://{your-ghost-blog-domain}/ghost/#/settings/integrations/63887c187f2cf32001fec9a8

The last part 63887c187f2cf32001fec9a8 is the integration_id.

To know which Ghost Version you are using go in the Settings and click on top right button "About Ghost":

Ghost Version

Here the version is "v5.47.0"


pnpm add @ts-ghost/admin-api

(Optional) Create .env variable


Use in your TypeScript file

import { TSGhostAdminAPI } from "@ts-ghost/admin-api";
const api = new TSGhostAdminAPI(
  process.env.GHOST_URL || "",
  process.env.GHOST_ADMIN_API_KEY || "",
export async function getBlogPosts() {
  const response = await api.posts
      limit: 10,
      title: true,
      slug: true,
      id: true,
      html: true,
      plaintext: true,
      html: true,
      plaintext: true,
  if (!response.success) {
    throw new Error(response.errors.join(", "));
  // Response data is typed correctly with only the requested fields
  // {
  //   title: string;
  //   slug: string;
  //   id: string;
  //   html: string;
  //   plaintext: string;
  // }[]
  return response.data;