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

Get your Ghost API Key and Ghost version number

Connect to your ghost blog and create a new Integration to get your Content API Key.

Create an Integration to get your Content API Key

You will need the URL of your Ghost Blog and the Content API Key

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/content-api

(Optional) Create .env variable


Use in your TypeScript file

import { TSGhostContentAPI } from "@ts-ghost/content-api";
const api = new TSGhostContentAPI(
  process.env.GHOST_URL || "",
  process.env.GHOST_CONTENT_API_KEY || "",
export async function getBlogPosts() {
  const response = await api.posts
      limit: 10,
      title: true,
      slug: true,
      id: 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;
  // }[]
  return response.data;