Add More API End Points

I am Big Fan of Ghost API :100:


  • Random Posts (with limits)
  • Tags

Add Trusted Domain Registration Option on Ghost Admin Panel

Could you explain what you’re after in a little bit more detail?

I don’t know of any other API that offers random data - it’s normal to generate that client side.

Tags are also already offered via the API, so could you explain what you haven’t been able to do?

1 Like

On the topic of api endpoints, will we be seeing the ability to publish new, edit existing posts via api?

Display Random Posts via API

1 Like

I Build a Quotes website on Ghost
I provide a Public API to My Users (Currently I add CORS Via add_header Method)

Currently, I need this Below Options

  • Add trusted domain from Ghost Admin Panel
  • Display Random Posts via API URL (useful one While Build a CLI or Widgets)

Sorry @mskian I wasn’t asking you to give an example of how it might work. I am saying I do not know of any API of any software or service which offers random data.

We have plans to review API authentication including trusted domains and also writing to the API, but not for a few more months at least. However cc @gcordalis it is currently possible to do anything that Ghost Admin can do via the API, it’s just not “official” yet and therefore likely to change.

the Random Post endpoint for Display the Random Post Results via JSON

Thanks for clarifying - are there any docs about Ghost Admin or should I dig deep and have a look at how it runs?

Best thing to do is open Chrome DevTools whilst using the admin area to do the actions you want to automate, you’ll then be able to inspect the API requests in the Network tab.

There are also docs for user authentication that explain how to get the necessary tokens to make private API requests.

If you decide to use the private API just be aware that it’s private so that we can change it as needed. Hannah already mentioned above that we’ll be looking to overhaul the authentication in the not too distant future, we also want to look at changing how URLs are output so that they are more useful for external clients.

1 Like

Thanks Kevin and Hannah, this should be everything I need to get started.

I’m not too worried about the Private API changing, this is just a stopgap solution until I have the time to put a proper solution in place.

Hey @Kevin, I know this isn’t supported so understand if you can’t help with this - I’m running into the ‘UpdateCollisionError’ - I’m pretty confident the requests I’m making are correct but I can’t seem to get around it. Do you have any suggestions for how to get around this conflict?

That error occurs when the updated_at value of a post that is sent to the server does not match the updated_at value that is stored in the database for that post.

You can see the implementation here, the protection is in place to prevent an accidental overwrite of a post with an old version either due to keeping the admin open and using an old tab or when multiple people have edited a post.

Champion, thanks so much!

Tumblr does that. You could go to any Tumblr blog, and open up the /random endpoint, which will then cause a redirect to a certain post.


It’s a neat way of allowing people to stumble upon interesting content from the past.

i sugest avoid this approach in favor of etag and conditional request, because its rest complient , flexible and is a protocol already defined.

in this way the knowledge of rest is reuset else need to know a specificity of ghostjs api.