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. - The account's own notifications, exactly
https://x.com/notifications(no tab, query, fragment or trailing slash), from its own signed-in X. The picture is one "followed you" notification, never the page: the newest with at leastx_notifications.min_othersothers. Every name in it is blurred (an emoji in a name too), so is any other text that isn't X's own words, and every avatar unlessx_notifications.blur_avatarsisfalse(CSS in that tab only: nothing posted, typed or clicked); right before and after the picture the browser checks that only X's own words ("and 12 others followed you") stay readable, elsenames_not_blurred.notificationsays how many others X counted. Noclip.selector. Opening the page clears the account's unread badge on X, as any visit does. - 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. - Story sources: any page on the company blogs and changelogs
openai.com,deepmind.google,developers.googleblog.com,github.blog,vercel.com,blog.cloudflare.com,supabase.com,stripe.com,huggingface.co,cursor.com,blog.replit.com,railway.com,neon.com,developer.apple.com,blogs.nvidia.com,aws.amazon.com; any page on the outletswww.theverge.com,arstechnica.com,www.wired.com,www.theregister.com,9to5mac.com,www.bloomberg.com,www.theinformation.com,www.404media.co,www.platformer.news; and onlygithub.com/<owner>/<repo>/releases,/releases/latestor/releases/tag/<tag>;replit.com/blogand/blog/<post>;www.npmjs.com/package/<name>(or@<scope>/<name>, optionally/v/<version>); any page onpypistats.org;apps.apple.com/<country>/app/<name>/id<digits>;www.producthunt.com/posts/<slug>,/products/<slug>or/products/<slug>/launches/<slug>(no query or fragment on those). The picture is the article's headline area (kicker, title, dek, byline, lead picture or chart; a blog, changelog or data page with no lead picture goes on into its first lines), orclip.selector; a page with no headline is pictured from its top (cropsays which). Fixed and sticky layers (cookie and consent banners, newsletter pop-ups, sticky headers, paywall overlays) are hidden with CSS; a bot check, a paywall or a consent wall over the headline answerspage_blocked.
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. On a story source page it replaces the headline's area.
≤ 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
x_notificationsobjecthttps://x.com/notificationsonly: on another address it answers400.›Show fieldsHide fields
min_othersintegerThe fewest others the "followed you" notification must count.
Default0≥ 0 · ≤ 1000blur_avatarsbooleanfalseleaves the avatars sharp. The names are always blurred.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.cropstringok: trueon a story source page:article(the headline's area),element(clip.selector) orpage(no headline: from the top).One ofarticleelementpagecaptured_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.x_no_follow_notification: The notifications page showed no "followed you" notification with at leastx_notifications.min_othersothers: try again later.names_not_blurred: A word other than X's own stayed readable in the notification, before or right after the picture: no picture.detailsays what, as counts, never the words.x_notification_not_loaded: X drew the notification again, or dropped it, before the picture: try again.page_blocked: A story source page behind a bot check that didn't pass by itself, a paywall or a consent wall over its headline, or a blurred headline:blocked_bysays which. Nothing is clicked or accepted.page_error: A story source page answered an HTTP error.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_hiddenx_no_follow_notificationnames_not_blurredx_notification_not_loadedpage_blockedpage_errorno_picturecapture_faileddetailstringok: false: the same, in words.blocked_bystringcode: page_blocked: what stood in front of the page.One ofbot_checkpaywallconsentnotificationobjectok: trueonhttps://x.com/notifications: the "followed you" notification pictured.›Show fieldsHide fields
kindanyrequiredAlwaysfollowedothersintegerrequiredThe number X writes in "and N others", or how many more people it names ("Alice and Bob followed you" is 1).
≥ 0names_blurredanyrequiredAlwaystrueavatars_blurredbooleanrequired
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?