Add live prediction markets to any website with a single script tag. Real-time prices, 24h sparkline, zero dependencies.
One line of HTML. Paste the snippet below into your page and replace the market address with the one you want to embed.
<script src="https://www.flipcoin.fun/embed.js"
data-market="0x..."
data-size="card"
data-theme="dark">
</script>How it works
data-market from the tagiframe pointing to /api/embed/{address}The iframe is sandboxed with allow-scripts allow-same-origin allow-popups. No access to your page's DOM or cookies. The “Trade on FlipCoin” link opens in a new tab.
Choose a size that fits your layout. Click to preview each variant live.
Default. Shows question, YES/NO prices, sparkline, and volume. Best for blog posts and dashboards.
Compact
400×60Single-line ticker — perfect for sidebars, footers, or inline mentions.
Card
420×280Default. Shows question, YES/NO prices, sparkline, and volume. Best for blog posts and dashboards.
Full
600×420Large widget with sparkline chart, volume, deadline, and CTA button. Great for dedicated embed sections.
Your snippet
<script src="https://www.flipcoin.fun/embed.js"
data-market="0x89419ea26297e6de50f288cf2891424f89893e94">
</script>Default values are omitted. data-size defaults to card, data-theme defaults to dark.
| Attribute | Required | Default | Description |
|---|---|---|---|
data-market | Required | — | Market contract address (0x..., 42 chars) |
data-size | Optional | card | compact | card | full |
data-theme | Optional | dark | dark | light |
Finding a market address
Open any market on flipcoin.fun and copy the 0x... address from the URL. For example: flipcoin.fun/market/0x89419ea...
Direct iframe
If you prefer to create the iframe yourself instead of using embed.js, use the URL directly:
<iframe
src="https://www.flipcoin.fun/api/embed/0x...?size=card&theme=dark"
width="420" height="280"
style="border:none;border-radius:14px;max-width:100%"
loading="lazy"
sandbox="allow-scripts allow-same-origin allow-popups"
title="FlipCoin Market">
</iframe>Multiple widgets
Add multiple script tags for different markets. Each one creates its own iframe:
<script src="https://www.flipcoin.fun/embed.js" data-market="0xaaa..."></script>
<script src="https://www.flipcoin.fun/embed.js" data-market="0xbbb..."></script>Security
textContent (safe DOM API), never innerHTMLCaching
Widget HTML is cached for 30 seconds at the CDN level with a 120-second stale-while-revalidate window. Live prices refresh via client-side polling every 60 seconds.
Responsive
All sizes have max-width: 100% set automatically, so they shrink on smaller screens. The widget is best viewed at its native dimensions or wider.