POST /api/v1/oembed/resolve returns normalized metadata and available embed
markup for X, Facebook, Instagram, Threads, TikTok, and Reddit.
Authentication
Use an issued Pirehub API key with theoembed:read scope. If you need a key or
additional permissions, contact Pirehub support.
Keep the key on your server in an environment variable such as PIREHUB_API_KEY.
Send the key in x-pirehub-api-key or Authorization: Bearer. OAuth clients may
also request oembed:read; see Authentication.
Request
The body accepts onlyurl: a nonempty HTTP(S) URL of at most 2048 characters.
Whitespace is trimmed. URLs with embedded credentials, non-default ports, private
network destinations, or unsupported provider hosts are rejected. URLs normalize
to HTTPS, and fragments and provider tracking parameters are removed.
USERNAME and POST_ID with a public post. These templates are
illustrative; they do not reference real posts.
Supported provider short links include Facebook share links and
fb.watch,
TikTok vm.tiktok.com / vt.tiktok.com, and redd.it. Redirect destinations
must remain within the provider’s allowed hosts. Profile and arbitrary website
URLs are not supported. Public content can still be unavailable to the provider API.
Response
This illustrative X response shows a post without a thumbnail:
X currently returns metadata without HTML or scripts. Other providers return
their available markup with script tags removed and the required script URLs
listed separately in
embed.scripts. Raw provider metadata is not exposed.
Render an embed
Checkcapabilities.html and embed.html before rendering. Provider markup is
untrusted: use a sandboxed iframe isolated from your application’s origin,
and load approved provider scripts inside that frame when
capabilities.requiresHydration is true. Do not insert this HTML directly into
your application with innerHTML or v-html.
When HTML is unavailable, display the returned title, author, thumbnail, or link.
To generate a PNG, use the screenshot API with a key that
also has screenshot:capture.
Cache and limits
Successful results may be cached for one hour. Unavailable, private, or unsupported post results may be cached for 60 seconds; provider rate-limit errors for 10 seconds. The response does not include a cache-hit flag. This endpoint does not acceptrefreshCache or other screenshot options.
Requests, including cache hits, use the API key’s per-minute and monthly limits.
Inspect X-ApiKey-RateLimit-*, X-ApiKey-Monthly-*, and Retry-After when present.
Provider requests use an 8-second timeout within a 12-second resolution abort
signal; URL/DNS validation has separate bounds. These are not a guaranteed total
HTTP response time.
Errors
Errors usesuccess: false, error.code, error.message, and data.requestId.
See Errors and retries and the
endpoint reference for the full contract.