Embed a country
Put a small version of any country page in an article or a newsletter. It shows the income curve, the median income and the four income levels, with a picker to switch countries. It’s free and needs no key. Your readers aren’t tracked: we only count page views, without cookies.
The snippet
<iframe src="https://theperspectivemachine.com/embed/portugal/" title="Income in Portugal — The Perspective Machine" width="100%" height="440" style="border:0;max-width:680px;border-radius:14px" loading="lazy"></iframe>
<script>addEventListener("message",function(e){if(e.origin==="https://theperspectivemachine.com"&&e.data&&e.data.type==="pm-embed"){var f=document.querySelector('iframe[src*="/embed/'+e.data.slug+'/"]');if(f)f.style.height=e.data.height+"px"}})</script>The second line is optional. It lets the frame resize to fit; without it, the widget still works at a fixed height of 440px.
Or just paste the URL
In WordPress and Ghost, paste a country page's address, like https://theperspectivemachine.com/in/portugal/, on its own line and it turns into the widget. This works through oEmbed; the endpoint is https://theperspectivemachine.com/oembed?url=….
What the widget will never do
- Ask your readers for an income. The “Place your own income” button opens the full site in the top window, and the math stays on their device there too.
- Set a cookie, read one, or identify anyone. We count how many times the widget is viewed, and that’s all.
- Say anything the country page doesn't. Both are built by the same code from the same World Bank data.
The credit line is built into the widget's footer. Please keep it, so your readers can find the source.