# Write here. Show it anywhere.

> Add .json to any address of your site and read posts, pages, tags and authors with a content key. Write in PixelGlass, show it in your own code.

Every address of a PixelGlass site answers JSON. Add .json, send a content key, and **read the post as a visitor reads it**: its HTML, its tags, its authors and its cover, every address absolute.

## By hand, in the admin

1. As an admin, open **Settings › API**. Under **Your site**, name a key and press **New key**.
2. Add .json to an address of your site: a page of the home, a post, a tag or an author.
3. Send the key as a key parameter on the address, or as a Bearer token in the Authorization header.
4. Read the answer in your own code. Every answer allows any origin, so the key can sit in a page's code.
5. Press **Remove** beside a key on the same screen to close it.

## With your agent

> Write a post on our spring opening hours, tag it News, and publish it.

> Schedule “The Friday menu” for 9am tomorrow.

> Give my newest post a meta title and description for search.

The tools it calls: `create_post`, `publish_post`, `update_post_settings`, `list_posts`.

No tool makes a content key or reads the site's JSON. Your agent writes, schedules and publishes the posts, and your own code reads them.

## Examples

- **A restaurant's app.** A restaurant writes its news in PixelGlass. **Its booking app reads the News tag as JSON** and shows the newest three posts on its home screen.
- **A product's changelog.** A software team publishes release notes on its PixelGlass site and shows them inside the product, read from the tag's JSON.
- **A private site, read by code.** A company keeps its PixelGlass site private. Its intranet still reads every post with the content key.

## Questions

### Can I use PixelGlass as a headless CMS?

Yes. Add .json to any address of a PixelGlass site and send a content key. You read the home page, posts, pages, tags and authors as a visitor reads them.

### Is a content key safe in browser code?

Yes. A content key opens only what a visitor reads, so it may sit in a page's code. It never opens the admin.

### What does a post's JSON hold?

Its title, address, excerpt, who can read it, cover, reading time, meta data, tags and authors. One post adds its HTML, with every address in it absolute, and its translations.

### Does the JSON show drafts?

No. Drafts, scheduled posts and posts sent by email alone are not found. A post the reader may not read comes with its teaser and no HTML.

### Can code read a private PixelGlass site?

Yes. A private site closes its pages to visitors, and the content key still opens its JSON.

### Does the site's JSON work on the free trial?

The site's JSON opens once the site is on a plan. On the trial, New key waits.

## See also

- [Sync members from your app](https://pixelglass.co/guides/sync-members-from-your-app): Keep your app's users and your PixelGlass members in step over the admin's JSON: find by address, add, change, label, and change many at once.
- [Make a staff key](https://pixelglass.co/guides/make-a-staff-key): A staff key acts as you, inside your role, on the admin's JSON and the MCP server. Make one, copy it once, remove it to close it.
- [Write and publish a post](https://pixelglass.co/guides/write-and-publish-a-post): Write a post in the PixelGlass editor, check it in your theme, and publish it to your site, your newsletter or both. By hand or with your agent.
- [Developer API](https://pixelglass.co/features/developers): Read your site as JSON, sync members from your app, sign readers in with your own accounts, and run it all from an agent. Webhooks are coming soon.
- [SEO and AI search](https://pixelglass.co/features/seo): Every PixelGlass site is ready for Google and AI answer engines: llms.txt, a Markdown twin of every post, sitemaps, feeds, structured data and hreflang.
- [Every guide](https://pixelglass.co/guides)
- [Pricing](https://pixelglass.co/pricing): every feature on every plan, 14 days free
- [Create your site](https://pixelglass.co/signup)
