> Documentation index: https://roxyapi.com/llms.txt. Building an integration? Read https://roxyapi.com/AGENTS.md first.

# Astrology widget setup guide

> Put a live natal chart, daily horoscope, tarot reading, or Life Path calculator on the site you already have. One snippet, one publishable key, no code, no server.

A widget is a RoxyAPI UI component running on its own. It asks your visitor for what a reading needs (a birth date, a sign, a card), or opens straight on its content when it needs nothing, fetches the reading, and renders the result inside your page. The same widgets work on Squarespace, Wix, Shopify, WordPress, Notion, Linktree, Stan Store, and any page that accepts an HTML block or a link.

**Tip: Start in the widget builder**
Pick a widget, preview it on your theme and in your language, add your key, and copy the code for your site builder. Every widget previews before you sign up: [open the widget builder](/widgets#builder).

For a shop, paid reading or booking flow, start with [widget monetization models](/docs/monetization). It explains what the widget supplies and what your business must add.

## Get your publishable key

Widgets run in your visitor's browser, so they use a publishable key, which is safe to leave in public page source. It starts with `pk_`.

1. Open your [account API keys](/account?tab=keys) (Account, then API Keys).
2. Click **New key**, choose **Publishable** and **Live**.

   ![The Create API key dialog with Publishable (pk_) marked, Live selected and mysite.com and www.mysite.com in the allowed origins](/img/docs/widgets-new-key.webp)

3. Add your site domain to the key's origin allowlist, for example `mysite.com`. The list is optional, and a key with no origins works on any site, but list them before going live so a copied key returns an error on any other site. Add the `www.` form too if your site answers on both, and every host you will paste the widget on, one per line: a builder preview or staging host such as `yoursite.simplero.com` or `your-site.squarespace.com` is its own host, and the widget stays blank there until it is listed.
4. Copy the key. You will paste it into the widget builder next.

**Warning: Never paste a secret key into a page**
A secret key (`sk_`) belongs on a server, never in page source. A widget refuses one and shows an error instead of a reading. If you only have a secret key, create a publishable one; both live in the same account.

No account yet? [Pick a plan](/pricing). Every plan includes every widget, and a reading a visitor generates counts as one API request against your monthly quota, the same as any other call.

## Build your widget

1. Open the [widget builder](/widgets#builder) and pick a widget. Search by name, or open a category.

   ![The widget builder picker with the Natal chart widget marked in the Astrology group, beside its natal chart wheel preview](/img/docs/widgets-pick.webp)

2. Under **Look**, pick a theme and light or dark. Add your **Brand colour** and **Accent colour** as six digit hex (`#914955`) and pick a **Font** to match your site. The preview shows each choice.

   ![The Look settings in the widget builder with the Kiln theme marked among the Default, Rosewater, Eucalyptus, Moonlit and Celeste presets](/img/docs/widgets-look.webp)

3. Under **Content**, leave the language on **Match the page** unless you want the widget fixed to one language. See [Languages](#languages) below. Untick the written reading to show the chart alone. Tick Credit RoxyAPI only if you want a small link back to us under the reading; it is off by default.
4. Under **Your website**, paste your publishable key. Signed in with one already, it is filled in for you.
5. Pick your site builder, follow its three steps, and press **Copy code**. Until a key is in, the button reads **Add your key first** and takes you to the key field.

   ![Your website settings with pk_live_YOUR_KEY in the widget key field and the Copy code button marked on the Squarespace tab](/img/docs/widgets-copy.webp)

Your key stays in your browser. The builder sends nothing to RoxyAPI; it only writes the code on the page.

## Three ways to embed

Same key, same widget. Pick the one your platform accepts.


### Hosted embed URL

Paste this as a link into any block that accepts one: a Notion embed, a Linktree link, a Stan Store block, or an iframe in a Squarespace Code Block (its Embed Block takes oEmbed sources only, so the link renders nothing there). RoxyAPI hosts the page, you host nothing. The `pk=` part must be your own key.

```
https://roxyapi.com/embed/natal-chart?pk=pk_live_YOUR_KEY
```

### Iframe

Paste into any HTML block. Works where a raw script tag is not allowed.

```html
<iframe src="https://roxyapi.com/embed/natal-chart?pk=pk_live_YOUR_KEY" title="Natal chart widget" style="border:0;width:100%;height:600px" loading="lazy"></iframe>
```

### Script tag

Load the widgets script once, then drop one `div` per widget. The `data-roxy-widget` slug picks the widget, and it asks the visitor for what it needs and fetches the reading for them.

```html
<script src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/widgets.js" defer></script>
<div data-roxy-widget="natal-chart" data-publishable-key="pk_live_YOUR_KEY"></div>
```

Want the full component bundle and per-tag control instead? Load `roxy-ui.js` and place the component tag:

```html
<script src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/roxy-ui.js" defer></script>
<roxy-natal-chart publishable-key="pk_live_YOUR_KEY"></roxy-natal-chart>
```


Each component tag fetches its own reading; a setting such as `period="weekly"` or `mode="calendar"` picks another one. The widget builder always shows the exact code per widget, so copy from there rather than editing by hand.

## Brand colour, accent and font

Every widget takes your two brand colours and a font pair, with no CSS. Colours are six digit hex such as `#914955`; a value that does not validate is ignored.

| Setting | One-tag form | Component tag | Sets |
|---|---|---|---|
| Brand colour | `data-brand-color` | `brand-color` | The primary colour |
| Accent colour | `data-brand-accent` | `brand-accent` | The accent colour, with its text shade and focus ring |
| Font | `data-font` | `font` | `fraunces-jost`, `jost`, `geist` or `system` |

```html
<div data-roxy-widget="natal-chart" data-publishable-key="pk_live_YOUR_KEY" data-brand-color="#3e2a2c" data-brand-accent="#914955" data-font="fraunces-jost"></div>
```

## Sell branded reports

The `report` widget turns a branded report into a form on your page. Your visitor types the birth details the report needs and receives the finished document under your name, logo, colours and font: a PDF to download, or the report shown on the page. Pick the report and its branding under **Report** in the [report builder](/widgets#report), and preview a sample PDF of each one on [white label astrology reports](/reports).

```html
<script src="https://cdn.jsdelivr.net/npm/@roxyapi/ui@latest/dist/cdn/widgets.js" defer></script>
<div data-roxy-widget="report" data-publishable-key="pk_live_YOUR_KEY" data-report="natal" data-format="pdf" data-brand-name="Luna Rivera Astrology" data-brand-footer="Book a reading at lunarivera.com" data-brand-color="#3e2a2c" data-brand-accent="#914955"></div>
```

| One-tag form | Component tag | What it does |
|---|---|---|
| `data-report` | `report` | Which report: `natal`, `synastry`, `kundli`, `matchmaking`, `tarot`, `numerology`, `human-design`, `yearly-forecast` or `bazi` |
| `data-format` | `format` | `pdf` (default) offers a download; `html` shows the report on the page |
| `data-brand-name` | `brand-name` | Your business name on the cover and every page |
| `data-brand-logo` | `brand-logo` | An HTTPS URL of your logo, printed on the cover |
| `data-brand-footer` | `brand-footer` | A line at the foot of every page, such as a disclaimer or a booking note |

The brand colour, accent and font above brand the report as well as the form. The widget does not take payment: paste it on the page your checkout unlocks, so only buyers reach it. The no-code walkthrough is [how to sell astrology readings](/docs/tutorials/sell-astrology-reports); the API behind it is the [white-label PDF reports guide](/docs/guides/white-label-pdf-reports).

## Pick your platform

Step-by-step walkthroughs with screenshots of each editor: [Squarespace](/docs/integrations/squarespace), [Wix](/docs/integrations/wix), [Shopify](/docs/integrations/shopify), [WordPress](/docs/integrations/wordpress), and [Webasyst](/docs/integrations/webasyst). Notion, Linktree, and Stan Store take the hosted embed URL as a link or an embed block, no walkthrough needed.

## Languages

A widget follows the language of the page it sits on: on a Spanish site the readings arrive in Spanish with no setting at all. For the form labels and buttons in that language too, add the one language file line from the [UI components page](/docs/ui#load-the-labels-for-your-language) beside the widget script. A hosted embed loads it for the language you pick in the widget builder. To fix the language regardless of the page, pick one there before you copy and the snippet carries it.

## Fix a widget that shows an error


### The widget asks for your publishable key, says the key is invalid, or you see a 401
The snippet still carries the sample key `pk_live_YOUR_KEY`, or the key was pasted with a typo. A widget that asks for your publishable key on a site where your other widgets are working is this, not the allowlist: that one link or snippet was copied before the key was added. Open the [widget builder](/widgets#builder), add your real key under **Your website**, and copy the code again. A hosted embed URL must end in your own key, not the sample; an embed opened with the sample key, or with anything that is not a publishable key, shows a setup notice in place of the widget.

### The widget says it is not authorized for this site, or you see a 403
The page host is not on the key's origin allowlist. Open the key in your [account](/account?tab=keys) and add the exact host the page is served from, including the `www.` form if you use both.

### The widget refuses the key
You pasted a secret key. Create a publishable key and use that instead.

### Nothing renders at all
Your platform stripped the script tag. Use the iframe or the hosted embed URL, which work in any HTML block, and give the iframe a height.

A blank or gray iframe on a host that is not on the key allowlist is the browser refusing to show the frame, and nothing inside it can explain that. Check the allowlist first: the exact host the page is served from must be listed, including a staging or preview host.

### The reading is in English on a non-English site
Set the language in the widget builder before copying, or set `lang` on the widget. See [Languages](#languages) above.


Still stuck? [Contact us](/contact) with the page URL and the widget name.

## Frequently asked questions

### Do I need to know how to code?
No. Copy one snippet from the widget builder and paste it where the reading should appear. The widget asks for what it needs and fetches the reading itself.

### Is it safe to put the key in my page?
Yes. A publishable key is made for the browser. Lock it to your own domain in the allowlist, and a copied key returns an error instead of a reading on any other site.

### Can every request stay on my own domain?
Yes. On any PHP site, one file does it: [Self-Hosted Widgets for PHP](https://github.com/RoxyAPI/self-hosted-widgets-php) serves the widget files and relays every reading from your server, with step-by-step screenshots. On another stack, a developer can route the widget through your own server the same way: [Serve everything from your own domain](/docs/ui#serve-everything-from-your-own-domain).

### Do I need to register or authorize my website with RoxyAPI?
No registration, and a key with no allowed origins works on any site. To lock it down, which we recommend before going live, open your [account API keys](/account?tab=keys), edit the publishable key, and add every host the widget will run on to its allowed origins: your main domain, the `www.` form if your site answers on both, and any builder preview or staging host. Once a key lists origins, a widget on an unlisted host shows an error or stays blank until the host is added.

### Can visitors browse dream symbols or crystals and open one?
Yes. The dream search widget opens on the whole dream dictionary with an A to Z bar and a search box, the crystal grid opens on every crystal with chakra, zodiac, element, colour and planet filters, and the tarot deck opens on all 78 cards. A tap opens that entry under the list, in the language of the page, and Show more loads the next page. The dream card and crystal card widgets ask the visitor to type a name and pick it from the suggestions, so no one ever needs an ID.

### Does a widget reading count against my quota?
Each reading a visitor generates is one API request, the same as any other call. Every plan includes every widget.

### Can I style the widget to match my site?
Yes. Set your brand colour, accent and font in the widget builder, or with `data-brand-color`, `data-brand-accent` and `data-font` on the snippet. Dark mode follows your site, and five named presets (Rosewater, Eucalyptus, Kiln, Moonlit, Celeste) restyle every widget with one stylesheet link. All covered under [theming on the UI components page](/docs/ui#theming).

### Can I sell branded astrology reports with a widget?
Yes. The report widget asks your client for their birth details and hands back a PDF with your name, logo, colours and font on every page, or shows the report on the page. Build it in the [report builder](/widgets#report) and paste it on the page your checkout unlocks.

### Is there a RoxyAPI credit line on the widget?
Not unless you add one. Every widget renders under your brand alone. To name your source, add `&attribution=on` to a hosted embed URL or iframe, `data-attribution="on"` to the one-tag snippet, or `attribution` to the component tag, and a small "Spiritual data by RoxyAPI" link appears under the reading, in the same language as the reading.
