How can I embed Postgres data charts and visualizations on my website?
Embed Postgres data charts and visualizations directly on your website with Indiequery's iframe embed code. Your charts update automatically when the underlying data changes - no manual exports or updates needed.
Get the Embed Code
After you create a visualization from your query results, click the Export button in the query editor. Toggle on Create public URL to enable sharing. You'll see two fields:
Public URL - A standalone page that displays your chart or table. Good for sharing via email or Slack.
Embed Code - An iframe snippet you can paste into any website. This is what you use to embed PostgreSQL charts on your own pages.
Click the copy button next to the embed code field. The copied snippet looks like this:
<iframe src="https://app.indiequery.com/embed/TOKEN" width="100%" height="500" style="border: 1px solid #e5e7eb; border-radius: 8px;"></iframe>
Paste this code into your website's HTML wherever you want the chart to appear.
Customize the Embed Size and Theme
The default embed height is 500px. Adjust the height value based on your content:
- Charts: 400-600px works well for most line, bar, and area charts
- Tables: 600-800px gives enough room for scrolling through rows
Set
width="100%"to make the embed responsive and fill its container. The visualization automatically scales to fit whatever dimensions you specify.
You can also control the color theme by adding a theme parameter to the embed URL. Add ?theme=light, ?theme=dark, or ?theme=auto to the src URL. The default is auto-detect based on the viewer's system preference.
Embed Live Data That Auto-Updates
When you embed Postgres charts on your website, visitors see live data from your database. The visualization automatically refreshes to show current query results whenever someone loads the page.
If you update your query or modify the visualization settings (change colors, adjust chart type, update formatting), those changes appear immediately in all embedded instances. You don't need to update the embed code or regenerate anything.
Where to Use Embedded Postgres Visualizations
Marketing pages - Show customer count, revenue growth, or product usage stats with live data from your database.
Client portals - Give clients access to their metrics without database credentials or dashboard logins.
Internal wikis - Embed charts in Notion, Confluence, or team documentation so your docs always display current data.
Public status pages - Display uptime, response times, or system health metrics that update automatically.
The embed works on any platform that supports iframes, including WordPress, Webflow, Framer, custom HTML sites, and most website builders.