# Content API on self hosted blog

**URL:** <https://forum.ghost.org/t/content-api-on-self-hosted-blog/8159>\
**Category:** Developer help\
**Created:** [July 7, 2019, 8:46pm UTC](https://forum.ghost.org/t/content-api-on-self-hosted-blog/8159 "2019-07-07T20:46:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pankaj](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/pankaj/32/4492_2.png) [@pankaj](https://forum.ghost.org/u/pankaj)\
**Post date:** [July 7, 2019, 8:46pm UTC](https://forum.ghost.org/t/content-api-on-self-hosted-blog/8159/1 "2019-07-07T20:46:32Z")

</div>

Hello,

My blog is [https://time2hack.com](https://time2hack.com) which is running with 2.25.4 on Ubuntu

I wanted to know about how to use Content API from self-hosted blog?

---

<div class="post-metadata">

**Author:** ![lmuzquiz](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lmuzquiz/32/598_2.png) [@lmuzquiz](https://forum.ghost.org/u/lmuzquiz)\
**Post date:** [July 7, 2019, 11:48pm UTC](https://forum.ghost.org/t/content-api-on-self-hosted-blog/8159/2 "2019-07-07T23:48:24Z")

</div>

Have you tried the content api client library?

> **[Content API JavaScript Client](https://ghost.org/docs/content-api/javascript/)**
>
> JavaScript Client Library for fetching data from the Ghost Content API. Read more on Ghost Docs 👉

---

<div class="post-metadata">

**Author:** ![pankaj](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/pankaj/32/4492_2.png) [@pankaj](https://forum.ghost.org/u/pankaj)\
**Post date:** [July 8, 2019, 7:39am UTC](https://forum.ghost.org/t/content-api-on-self-hosted-blog/8159/3 "2019-07-08T07:39:28Z")

</div>

Yeah but I would need following section:

```auto
const api = new GhostContentAPI({
  url: 'https://demo.ghost.io',
  key: '22444f78447824223cefc48062',
  version: 'v2'
});

```

and not sure if the stand alone installation of Ghost provides `key` for content API

---

<div class="post-metadata">

**Author:** ![pankaj](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/pankaj/32/4492_2.png) [@pankaj](https://forum.ghost.org/u/pankaj)\
**Post date:** [July 8, 2019, 7:48am UTC](https://forum.ghost.org/t/content-api-on-self-hosted-blog/8159/4 "2019-07-08T07:48:22Z")

</div>

I think I got it.

You need to create a custom integration to get the API keys

This is a bit weird UX to obtain Keys

---

<div class="post-metadata">

**Author:** ![naz](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/naz/32/30666_2.png) [@naz](https://forum.ghost.org/u/naz)\
**Post date:** [July 8, 2019, 8:16am UTC](https://forum.ghost.org/t/content-api-on-self-hosted-blog/8159/5 "2019-07-08T08:16:07Z")

</div>

> This is a bit weird UX to obtain Keys

Hi @pankaj 👋 Really interested to hear your feedback on this point :) What do you find weird about it? How do you think the UX could be improved?

---

<div class="post-metadata">

**Author:** ![pankaj](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/pankaj/32/4492_2.png) [@pankaj](https://forum.ghost.org/u/pankaj)\
**Post date:** [July 8, 2019, 1:05pm UTC](https://forum.ghost.org/t/content-api-on-self-hosted-blog/8159/6 "2019-07-08T13:05:26Z")

</div>

Hey @naz, Thanks for taking interest in this issue.

I almost gave up on ghost for headless CMS use because I thought I can not create content API keys in regular manner as Content API is API usage and not necessarily an integration (if we go in technicality, then yes)

Like we have Public API checkbox in Labs section; there should be a way or separate section to generate custom pairs of Content Keys with a name. And then possibility to list and delete those keys.

And the keys generated for `webhook`s can be listed but only deleted when `webhook` is deleted.

In my opinion, API keys management should be listed and done separately.

Benefits can be that for users who do not want to use API will not approach that section of blog, and intended use is explicit.

While doing it through integration, I might create a key which can be used with `webhook` but still active even if there is no `webhook` or actual integration in place.
