Skip to main content
The Kash web app serves two iframe widgets that need no API calls at all: Both take a UUID in the path. They read no query parameters. Any site may frame them, because they send Content-Security-Policy: frame-ancestors *. They are not indexed by search engines.

Market iframe

The card refreshes its prices live. Visitors choose an outcome and an amount, and the widget opens X with a prediction tweet already written, which the Kash trading bot reads to place the trade. If a new tab can’t be opened, the widget asks your page to open the link (see Events), and if that fails too, it copies the link to the clipboard. That clipboard fallback is why allow="clipboard-write" is recommended. Get market IDs from GET /api/markets.

Thread iframe

The thread widget shows:
  • the thread’s title, description, time remaining and total predictions
  • an amount selector and a Yes/No toggle
  • a heatmap grid of the thread’s markets, highest volume first, loaded with status=all so ended markets still appear with their status
Visitors add Yes or No predictions on binary markets in the grid, then post them all in one tweet. Selecting a market tile, or predicting on a market with more than two outcomes, opens that market on app.kash.bot in a new tab. Get thread IDs from GET /api/threads. If a thread has no markets, the widget shows an empty state. If you sandbox the frame, the widget needs at least allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox, so it can run, call the API, and open X and market pages in new tabs. Don’t grant allow-top-navigation. The widget never needs to navigate your page. To shrink the frame on small screens, use a media query:
If your site sets a Content Security Policy, allow the frame with frame-src https://app.kash.bot.

Events

The widgets post messages to the parent window, addressed to your page’s origin. Every message has the shape { type, data, origin: "https://app.kash.bot", timestamp }:

Troubleshooting

  • “Not found” inside the frame. The ID isn’t a UUID or doesn’t exist.
  • A thread shows no markets. Check GET /api/threads/{id}/markets?status=all.
  • Nothing happens when a visitor predicts. A sandbox without allow-popups blocks the X tab. Handle kash-open-twitter, or loosen the sandbox.

Next steps

Quickstart

Embed your first market

HTML examples

Copy-paste pages