Embed a circuit on your website
You can show any Circuit Canvas circuit on your own website, for example in a tutorial. The embed shows the circuit's schematic and its breadboard wiring diagram, with a switch between the two. An Edit this circuit button lets your reader open their own copy of the circuit in the editor, in a new tab. Nothing in the embed takes the reader away from your page.
Get the embed code
- Open your circuit in the editor.
- In Share Project, choose Anyone with the link.
- Choose Share Project > Embed on a website…, pick what to show, and copy the code.
The code is an iframe:
<iframe src="https://circuitcanvas.com/p/PROJECT_ID/embed" width="600" height="400"
style="max-width: 100%; border: 0;" title="My circuit" loading="lazy"></iframe>
PROJECT_ID is the id in the circuit's address, https://circuitcanvas.com/p/PROJECT_ID.
Options
| Address | Shows |
|---|---|
/p/PROJECT_ID/embed |
Both pictures, with a Breadboard / Schematic switch |
/p/PROJECT_ID/embed?view=schematic |
The schematic only |
/p/PROJECT_ID/embed?view=layout |
The breadboard wiring diagram only |
You can give the iframe any size from 280 pixels wide. 600 by 400 suits most pages, and max-width: 100% keeps it inside a narrow column.
Good to know
- The embed shows the circuit as it is saved now. When you change the circuit, the embed follows.
- If you make the circuit private or delete it, the embed says "This circuit is not available".
- The embed is a plain page with two pictures. It sets no cookies and loads no analytics.
- A circuit from the circuit library can be embedded too. Its project id is in the address that Open in the editor on its page leads to.
oEmbed
Circuit Canvas is an oEmbed provider, so a site that supports oEmbed can turn a pasted circuit link into an embed.
- Endpoint:
https://circuitcanvas.com/oembed - URL schemes:
https://circuitcanvas.com/circuits/*andhttps://circuitcanvas.com/p/* - Formats: JSON (the default) and XML (
format=xml) - Discovery: every circuit page carries
<link rel="alternate" type="application/json+oembed">and itstext/xml+oembedtwin.
| Parameter | Meaning |
|---|---|
url |
The circuit's address. Required. Add ?view=schematic or ?view=layout to the address for one picture only. |
format |
json or xml |
maxwidth, maxheight |
The largest size the embed may have, in pixels |
Example:
https://circuitcanvas.com/oembed?url=https%3A%2F%2Fcircuitcanvas.com%2Fcircuits%2F555-timer-blink-led-f93hrg
The answer is of type rich. Its html is the iframe above, 600 by 400 unless a smaller maxwidth or maxheight was asked for, and thumbnail_url is a picture of the circuit. A circuit that is private or does not exist answers 404.
Questions
Contact us if something does not work on your site.