Skip to content

Link Tokens

Streaming links in the API are represented as link tokens — encrypted, opaque strings that resolve to provider-specific URLs when accessed through our redirect service.

Raw streaming URLs (e.g., netflix.com/title/12345) are never exposed in the API or snapshots. Instead, each link is encrypted into a token like 3xK9mP.... This design:

  • Protects providers — URLs can’t be scraped or hotlinked
  • Enables affiliate tracking — the redirect service injects attribution parameters
  • Generates deep links — the redirect returns device-specific URLs (web, Fire TV, Android TV, tvOS, Roku, webOS)
  • Supports key rotation — tokens can be re-encrypted without changing the data format
  1. Fetch streaming links for a title via the API:

    Terminal window
    curl -H "Authorization: Bearer YOUR_KEY" \
    "https://api.popcorntime.app/v1/media/jR9Lk5mP/links?country=US"

    Response:

    [
    {
    "provider_id": "netflix",
    "link_token": "3xK9mPv2bQ7nRtYs...",
    "price_types": ["flatrate"],
    "formats": ["HD", "UHD"]
    }
    ]
  2. Redirect the user through the redirect service:

    https://popcorntime.app/go/{link_token}

    The service decrypts the token, generates the platform-appropriate deep link, injects affiliate parameters, and returns a 302 redirect to the provider.

  3. The user lands on the provider’s page (Netflix, Disney+, etc.) with the correct title pre-selected.

https://popcorntime.app/go/{link_token}
ParameterDescription
platformTarget platform for the deep link

Available platforms:

PlatformValueDescription
Web browserwebStandard HTTPS URL
iOSiosUniversal link / app URI scheme
AndroidandroidAndroid intent / app link
Android TVandroid_tvAndroid TV deep link
Fire TVfire_tvAmazon Fire TV deep link
RokurokuRoku channel deep link
webOS (LG)webosLG Smart TV deep link

Example:

https://popcorntime.app/go/3xK9mPv2bQ7nRtYs?platform=fire_tv

Each link in the API response includes a platforms array listing the supported platforms for that specific provider link:

{
"provider_id": "netflix",
"link_token": "3xK9mPv2bQ7nRtYs...",
"platforms": ["web", "ios", "android", "android_tv", "fire_tv"],
"price_types": ["flatrate"],
"formats": ["HD", "UHD"]
}

Only pass a platform value that appears in the link’s platforms array. If you omit it, the redirect service defaults to web.

Tokens are AES-256-SIV encrypted and bs58 encoded:

bs58([ key_version: u8 ] ++ aes_siv_encrypt(key, url_bytes))

The 1-byte version prefix supports key rotation. Old tokens remain valid as long as the previous key is retained server-side.

<a href="https://popcorntime.app/go/3xK9mPv2bQ7nRtYs">
Watch on Netflix
</a>
function watchOn(linkToken) {
window.open(`https://popcorntime.app/go/${linkToken}`, '_blank');
}

Pass the platform parameter to get the correct deep link for the device:

const platform = detectPlatform(); // "fire_tv", "android_tv", "webos", etc.
const url = `https://popcorntime.app/go/${token}?platform=${platform}`;
// The redirect service returns a platform-specific URI scheme

The links.parquet file contains a link_token column. These tokens work the same way — pass them through the redirect service:

-- DuckDB: get all Netflix links for a title
SELECT link_token, provider_id, price_types
FROM 'US_links.parquet'
WHERE media_id = 12345 AND provider_id = 'netflix';

Then redirect: https://popcorntime.app/go/{link_token}