Capture a page
Early access. Tell us what you're building and we'll set you up. Contact us
api.lempile.com/accounts/{account_id}/captureA JPEG of one page, opened in the X account's own browser and proxy. Read-only: a new tab, cookie banners and X's overlays hidden with CSS (never clicked), the picture, the tab closed. Not a write: no Idempotency-Key, no receipt, not paced.
It opens only:
- A public X post, exactly
https://x.com/<handle>/status/<digits>(handle 1–15 letters, digits or_, noti; 1–25 digits; no query, fragment or trailing slash;x.comonly). The picture is the post's own article, read from the account's own signed-in X, taken only when X shows it under that handle, ending at its action bar. Noclip.selector; withx_post: { counts: false }the time and views row and the action bar are left out too. - A status page:
https://<host>,https://<host>/orhttps://<host>/incidents/<id>(8–40 letters or digits) onwww.vercel-status.com,www.githubstatus.com,status.supabase.com,www.cloudflarestatus.com,status.openai.com,status.claude.com,www.netlifystatus.com,status.render.com,status.flyio.net,status.clerk.com,resend-status.com. - The account's own X:
https://x.com/<its handle>andhttps://x.com/i/account_analytics. - News pages: any page on
blog.google,developers.google.com,blogs.bing.com,www.seroundtable.com,techcrunch.com;https://news.ycombinator.com/item?id=<digits>; and any page on a site Lempile added to your workspace's list.
Hosts match exactly. The browser checks the address again before opening it and after the page loads. When the page gave no picture the answer is still 200, with ok: false and the browser's code.
Scope: accounts.write.
Authentication
X-API-KEY header·A Lempile API key, made in the dashboard under Access tokens.Path parameters
account_idstringrequiredLempile id, X user id or handle.
Request body
urlstring · urirequiredOne of the addresses the capture opens, exactly.
widthintegerCSS pixels (under 768, X and most sites draw their phone layout).
Default520≥ 320 · ≤ 1280dprintegerDefault2≥ 1 · ≤ 3clipobject›Show fieldsHide fields
maxHeightintegerCSS pixels: the picture stops there.
max_heightworks too.Default1600≥ 100 · ≤ 4000selectorstringThe picture is that element. Not on an X post.
≤ 200 chars
x_postobjectX posts only: on another address it answers
400.›Show fieldsHide fields
countsbooleanfalseleaves out the post's time and views row and its action bar (no views, replies, reposts, likes or bookmarks); the picture ends 16 px under its last content.Defaulttrue
Responses
200The picture (ok: true), or why there is none (ok: false with code).
›
ok: true), or why there is none (ok: false with code).application/json
objectanyrequiredAlwaysPageCaptureokbooleanrequiredaccount_idstringrequiredurlstringrequiredfinal_urlstringok: true: the address the page ended on.titlestringwidthintegerPixels of the JPEG: CSS width times
dpr.heightintegerjpeg_base64stringok: true: the JPEG, base64, nodata:prefix.captured_atstring · date-timerequiredcodestringok: false: why there's no picture.x_post_author_mismatch: X shows the post under another handle than the address's, or no author it could read.x_post_protected: The post is from a protected account.x_post_deleted: X says the post doesn't exist: deleted, or never posted.x_post_age_restricted: X shows the post only behind an age or sensitive-content warning (never clicked through).x_post_unavailable: X shows its "This post is unavailable" notice.x_post_not_loaded: X ran but didn't show the post within 25 seconds.x_signed_out: X is signed out in the account's browser.x_app_not_loaded: X's app didn't load in the account's browser.left_allowed_hosts: The page went to another address after it loaded.url_not_allowed: The browser's own check refused the address.element_not_found: No element forclip.selectorwithin 10 seconds.browser_busy: The account's browser was on another job: try again in a minute.capture_blank: The picture came out blank (almost all of it one colour), or X drew the post's box empty: it isn't returned.counts_not_hidden: Asked withx_post: { counts: false }, but the views row and action bar couldn't be hidden: no picture, never one with counts.no_picture: The browser gave no picture.capture_failed: The capture stopped.One ofx_post_author_mismatchx_post_protectedx_post_deletedx_post_age_restrictedx_post_unavailablex_post_not_loadedx_signed_outx_app_not_loadedleft_allowed_hostsurl_not_allowedelement_not_foundbrowser_busycapture_blankcounts_not_hiddenno_picturecapture_faileddetailstringok: false: the same, in words.
400errors/invalid_parameters: an address it doesn't open (the detail lists them), a field out of range, or clip.selector on an X post. errors/missing_parameters: no url.
›
errors/invalid_parameters: an address it doesn't open (the detail lists them), a field out of range, or clip.selector on an X post. errors/missing_parameters: no url.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
401Missing or invalid API key ({error, message}), errors/disconnected_account, or errors/reauth_required when X is signed out in the account's browser.
›
{error, message}), errors/disconnected_account, or errors/reauth_required when X is signed out in the account's browser.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
402subscription_required: the workspace has no active trial or subscription.
›
subscription_required: the workspace has no active trial or subscription.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
403errors/insufficient_permissions: the key lacks accounts.write.
›
errors/insufficient_permissions: the key lacks accounts.write.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
404errors/resource_not_found: no such account in this workspace, or it isn't an X account.
›
errors/resource_not_found: no such account in this workspace, or it isn't an X account.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
422errors/proxy_auth_failed or errors/proxy_unreachable: the account's proxy is down.
›
errors/proxy_auth_failed or errors/proxy_unreachable: the account's proxy is down.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
423errors/x_account_locked: X shows the account its lock page (x.com/account/access). Nothing was done; someone has to pass X's check.
›
errors/x_account_locked: X shows the account its lock page (x.com/account/access). Nothing was done; someone has to pass X's check.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
503errors/service_unavailable (the account isn't ready, or the browser runner can't be reached), errors/no_client_session, or errors/maintenance with retry_at.
›
errors/service_unavailable (the account isn't ready, or the browser runner can't be reached), errors/no_client_session, or errors/maintenance with retry_at.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
504errors/timeout: no picture within 90 seconds. Nothing was clicked or typed.
›
errors/timeout: no picture within 90 seconds. Nothing was clicked or typed.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
Was this page helpful?