Public Api gone in ghost version 2.11.0

Yesterday I upgrate my ghost-cli to ghost 2.11.0. After upgrating I can’t find public api in SETTINGS > Labs.
For that various things are not working like {{#get }}...{{/get}} tag.

1 Like

Hey @kingrayhan o/

The 2.11.0 release included a change to remove the Public API from the labs settings, if it had never been on before.

Were you using this previously?

The Public API has been deprecated in favor of our Content API.

If you are to update the package.json in the theme you’re using, so that your API version is 2 like here, in Casper you should have that functionality back.

I do wonder though, if you were using it before, how/why it has been removed, would you mind providing some more information about how your settings were previously configured?

2 Likes

Thanks, @egg, I didn’t know that I can enable ghost-api from package.json engines key.
Now it working fine.

Is package.json the only thing that needs updated after upgrading to 2.11.0 or later? Because I did it and get still doesn’t work fully (filter="page:true" returns nothing while include="authors,tags" only fetches tags’ info, not the authors’). I can still see the Public API option, with a deprecation warning, but I’m not sure if it should be left on or off (it won’t help either way for now).

L.E. Solved both my issues by using the new {{#get "pages"}}{{# foreach pages}}... instead of {{#get "posts" filter="page:true"}}{{# foreach posts}}... and by changing the author handlebars to more specific ones, such as {{primary_author.name}} instead of {{author}}.

1 Like

This problem also occurred after I deployed with docker(v2.22.1). I want to use ghostHunter, but I get an error “ghost is not defined”. I can’t find the relevant configuration in “Configuration - Adapt your publication to suit your needs”, do you have any idea to solve this problem under docker?

@dyzm_k did you ever find the solution? My search is also not working