Tweets
Tweet embed API for X post HTML and oEmbed
Get the HTML that embeds one public tweet on a website, with the tweet link and author. Pick a light or dark theme, hide media or the thread. 1 credit a call.
- 200
- 400
- 401
- 402
- 404
- 424
- 429
- 502
- 503
GET
Tweet embed API for X post HTML and oEmbed
Embed tweet returns the HTML that shows one public tweet on a website.
The endpoint is
Use
An option has a value the endpoint does not take. Fix the option and send the request again.
The provided tweet ID is empty or not a valid format.
Missing or invalid API key. Check the
X has no embed for the tweet. The author may have deleted it, or the account is private.
The read service returned an error. Retry after a short delay.
X returned no embed, or Xquik is busy. Retry after a short delay. The request costs nothing.
You exceeded your tier rate limit. Wait for the
The normalized v1 response contract can return 424 when the read service is unavailable.
GET /api/v1/x/tweets/{id}/embed.
GET /x/tweets/{id}/embed when a page, CMS, or newsletter tool shows a tweet.
The HTML is the markup X gives websites for that tweet.
Each call costs 1 credit. A refused request costs nothing.
Place the embed on a page
Insertembed.html where the tweet belongs.
The markup holds the tweet text and a script tag that loads X’s widget.
The widget then draws the full tweet card in the reader’s browser.
Send omitScript=true when a page shows several tweets.
Load X’s widget script once on that page instead.
Store embed.html with the tweet ID and the options you sent.
A stored embed saves a second call for the same tweet and look.
Path parameters
Query parameters
string
Color theme of the embed:
light or dark. X uses light when you omit it. Any letter case works.boolean
Set
true to leave photos, videos, and link cards out.boolean
Set
true to leave the tweet this one replies to out.boolean
Set
true to leave the widget script tag out. Use it on pages that load the script once themselves.Headers
string
Full account key. Sessions and OAuth also work.
string
Bearer xq_your_guest_key_here authenticates paid_reads guest keys. Direct MPP uses the Payment ... credential. Get it from the WWW-Authenticate: Payment challenge.Response
200 OK
object
The embed of the tweet.
Embed object fields.
string
ID of the embedded tweet.
string
Link to the tweet with its author’s username.
string
Display name of the tweet’s author.
string
Link to the author’s profile.
string
Markup to place on a page. It loads X’s widget script unless
omitScript is true.number
Width of the embed in pixels.
number
Height in pixels. Present only when X fixes it.
400 Invalid input
400 Invalid tweet ID
401 Unauthenticated
x-api-key header value.
402 Payment required
Account keys get account options. Guest keys get guest top-up only. Anonymous calls receive a direct MPPWWW-Authenticate: Payment challenge plus a guest wallet creation action.
No checkout starts automatically. Confirm any payment action.
404 Tweet not found
502 X API unavailable
503 Service busy
429 Rate limit exceeded
Retry-After header before retrying.
424 Dependency failed
Tweet embed API questions
How do I embed a tweet on a website with an API?
CallGET /x/tweets/{id}/embed with the tweet ID or URL.
Insert embed.html into your page where the tweet belongs.
How do I get a dark theme tweet embed?
Sendtheme=dark. The returned markup then asks X’s widget for the dark card.
How do I embed many tweets on one page?
SendomitScript=true for each tweet.
Load X’s widget script once on the page.
How much does a tweet embed cost?
Each call costs 1 credit. A refused or failed request costs nothing.Does this replace X’s official API?
No. This page documents Xquik, an independent third-party service. It does not document X’s official API.Next steps. Get tweet reads the tweet’s fields as JSON, or Download media saves its photos and videos.