# CodePen Embed API

**Canonical:** https://apis.io/apis/codepen/embed/  
**Provider:** CodePen — https://apis.io/providers/codepen/  
**Base URL:** https://public.codepenassets.com/embed/index.js  
**Documentation:** https://blog.codepen.io/documentation/embedded-pens/

CodePen Embed API is one of 4 APIs that [CodePen](https://apis.io/providers/codepen/) publishes on the [APIs.io](https://apis.io/) network. Tagged areas include Embeds, JavaScript, and Front-End Development. The published artifact set on APIs.io includes API documentation.

Client-side JavaScript API for rendering and lazy-loading embedded Pens on external web pages. Uses the global window.__CPEmbed() function with data-* attributes on a .codepen div to control height, theme, default tab, animations, and zoom level. A __CodePenIFrameAddedToPage callback is available for post-embed hooks.

## Machine-readable artifacts (1)

- **Documentation** — https://blog.codepen.io/documentation/embedded-pens/

## Other CodePen APIs (3)

- [CodePen oEmbed API](https://apis.io/apis/codepen/oembed/)
- [CodePen POST to Prefill API](https://apis.io/apis/codepen/post-to-prefill/)
- [CodePen Prefill Embeds API](https://apis.io/apis/codepen/prefill-embeds/)

## Tags

Embeds, JavaScript, Front-End Development

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/codepen/embed/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/codepen/.
