← All posts

How to Embed Adult Videos on Any Website With a REST API

October 2, 2026

Most adult sites still do embeds the hard way: copy an iframe from a host, paste it into a post, and hope the link survives next month. An API turns that into a repeatable step your code does for you. This guide shows the whole loop with AdultEmbed, from an empty page to a working player.

1. Get a key

Sign up on the homepage with your email and site. The key appears on the next screen — there is no approval queue. Every request sends it in a header:

X-API-Key: your-64-character-key

Keep it server-side. Anything you put in front-end JavaScript can be copied by anyone who opens your page source.

2. Find a scene

The browse endpoint is the workhorse. It filters by category, tag, performer and studio slugs (comma-separated), does full-text search, sorts, and paginates:

curl -H "X-API-Key: $KEY" \
  "https://adultembed.com/api/database/browse/?tags=massage&sort=views&page_size=20"

Each result carries the title, slug, thumbnail, duration, tags, performers and studio — enough to build a card on a listing page without a second request.

3. Ask for a player

When a visitor opens a scene, request an embed for that video ID:

curl -X POST -H "X-API-Key: $KEY" \
  "https://adultembed.com/api/videos/123456/get-embed/"

The response contains player_url and a ready-made embed_code iframe. The URL is signed and bound to the domain that requested it, so it cannot simply be lifted onto another site, and it expires after a couple of hours — request a fresh one per page view rather than storing it.

4. Render it

In PHP the whole flow is a few lines:

$ch = curl_init("https://adultembed.com/api/videos/$id/get-embed/");
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["X-API-Key: " . getenv('AE_KEY')]]);
$embed = json_decode(curl_exec($ch), true);
echo $embed['embed_code'];

The video streams from a CDN, not from your server, so your hosting bill does not change whether ten or ten thousand people press play.

What to cache, and what not to

  • Cache browse results and scene metadata for minutes or hours — they change slowly.
  • Do not cache player URLs; they are short-lived on purpose.
  • Use the changelog endpoint to learn about new and removed scenes instead of re-reading the whole catalogue.

That is the entire integration. Everything else — category pages, performer pages, search — is the same browse call with different filters.

Build on a free, open adult video API — your key is ready in seconds.

Get a free API key →