How to Get All Posts in JSON Format with Ghost Public API

In this small and easy tutorial we are going to get all posts from a Ghost blog using Ghost Public API. We need to cover a few steps:

Enable Ghost Public API

Enable Ghost Public API from your Ghost Admin Dashboard (Dashboard -> Settings -> Labs)

Get client_id and client_secret

Get client_id and client_secret. Go to your website and View page source. You should see something like this:

<script type="text/javascript">
	clientId: "ghost-frontend",
	clientSecret: "xxxxxxxxxxxx"

Request URL

Go to:

Replace clientId and clientSecret with data that you found in the source. Also replace with your domain. The request must come from a URL that the Ghost blog recognises or the request will not be authorised.


More information about Ghost Public API you can find on Public API Beta or Ghost Docs.

I want more

Are you interested in a specific Ghost issue, feature or tutorial and we didn't cover it up in our blog? Drop us a message and we might write about it.