Embed Widget
Add the Political Temperature Index to your website with two lines of HTML. The widget auto-updates every 15 minutes and requires no API key.
Quick Start
Paste this snippet anywhere in your HTML. The script discovers .pti-widget elements and replaces them with sandboxed iframes.
<script src="https://politicaltemperature.com/widget.js"></script>
<div class="pti-widget"></div>Live Preview
Widget Sizes
Control the widget size with the data-size attribute. Defaults to standard if omitted.
Standard
322 × 202pxShows temperature, label, daily change, 7-day trend sparkline, and attribution. Best for sidebars and dashboards.
<div class="pti-widget" data-size="standard"></div>Compact
242 × 78pxMinimal badge showing temperature and label. Fits in nav bars, footers, and tight spaces.
<div class="pti-widget" data-size="compact"></div>iframe Fallback
If you prefer not to include an external script, embed the widget directly with an iframe.
<iframe
src="https://politicaltemperature.com/embed/standard"
width="322" height="202" scrolling="no"
style="border:none;border-radius:12px;color-scheme:dark;overflow:hidden"
loading="lazy"
title="Political Temperature Index"
></iframe><iframe
src="https://politicaltemperature.com/embed/compact"
width="242" height="78" scrolling="no"
style="border:none;border-radius:12px;color-scheme:dark;overflow:hidden"
loading="lazy"
title="Political Temperature Index"
></iframe>Attribution
The widget includes a link back to politicaltemperature.com. Please keep this attribution visible. Data refreshes every 15 minutes via the public API — no key or registration required. The widget is lightweight (<2KB loader) and loads lazily to minimize impact on page performance.