Content API

Table of contents

Ghost's RESTful Content API delivers published content to the world and can be accessed in a read-only manner by any client to render in a website, app or other embedded media.

Access control is managed via an API key, and even the most complex filters are made simple with our SDK. The Content API is designed to be fully cachable, meaning you can fetch data as often as you like without limitation.


API Clients

JavaScript Client Library

We've developed an API client for JavaScript, that will allow you to quickly and easily interact with the Content API. The client is an advanced wrapper on top of our REST API - everything that can be done with the Content API can be done using the client, with no need to deal with the details of authentication or the request & response format.

Handlebars

You can upgrade your Ghost theme to use the v3 Content API by specifying the ghost-api version in the engines field of your package.json. See the handlebars reference for an example.


Authentication

Url

https://{admin_domain}

Your admin domain can be different to your main domain. Using the correct domain and protocol are critical to getting consistent behaviour, particularly when dealing with CORS in the browser. All Ghost(Pro) blogs have a *.ghost.io domain as their admin domain and require https.

Path & Version

/ghost/api/{version}/content/

Each API is prefixed with the same path, followed by a specific version. Version strings are required and always start with v. The api versioning guide explains the current available versions and stability index.

Key

?key={key}

Content API keys are provided via a query parameter in the url. These keys are safe for use in browsers and other insecure environments, as they only ever provide access to public data. Sites in private mode should consider where they share any keys they create.

The Content API URL and key can be obtained by creating a new Custom Integration under the Integrations screen in Ghost Admin.

Get a Ghost Content API key

Working Example

cURL

# Real endpoint - copy and paste to see!
curl "https://demo.ghost.io/ghost/api/v3/content/posts/?key=22444f78447824223cefc48062"

Endpoints

The Content API provides access to Posts, Pages, Tags, Authors and Settings. All endpoints return JSON.

DId you get you answer?

Our product is for you. You will get all the topics in our documentation. If you don't get anything in our documentation, feel free to contact with us. We are here 24/7 to help you Contact

All copyright reserved by Electronthemes. Published with Ghost