Twitter Screenshot API
Quickstart
Is there is a way to generate Twitter screenshot with API?
Yes, this doc shows how to integrate the Screenshot API into your app or workflow.
curl --location 'https://api.twittershots.com/api/v1/screenshot/1617979122625712128?format=svg&theme=light'--header 'Accept: image/svg+xml,image/png,text/html'--header 'Cache-Control: no-cache'--header 'X-API-KEY: YOUR_X_API_KEY'
API Reference
Use screenshot API in 3 simple steps:
- Setup your API key
- Set X-API-KEY in the request header
- Send a GET request to the API endpoint
If you’re using AI, simply click the Copy page button in the top right.
Docs pages can be copied as Markdown, making it easy to feed into an LLM and let AI handle everything.
It's in Beta. If you have other needs, feel free to contact support.
Base URL
The TwitterShots API is built on REST principles. We enforce HTTPS in every request to improve data security, integrity, and privacy. The API does not support HTTP.
All requests contain the following base URL:
Authentication
To authenticate you need to add an X-API-KEY header with your API key.
Remember your API key is a secret. Do not share it with others or expose it in any client-side code.
Screenshot
- Accept: image/svg+xml, image/png, text/html
- statusId: string (required) - The tweet id
Params
- format (optional): Specifies the image format to return
- svg (default): Vector image format
- png: PNG image format
- html: HTML format
- theme (optional): Specifies the image style (light or dark mode)
- light (default): Light theme
- dark: Dark theme
- logo (optional): Specifies the logo type to display
- x (default): X (Twitter) logo
- bluebird: Bluebird logo
- none: No logo
- showFullText (optional): Show full tweet or collapsed with "Show more"
- true (default): Full tweet content
- false: Collapsed with "Show more"
- showTimestamp (optional): Show tweet timestamp
- true (default): Show timestamp
- false: Hide timestamp
- showViews (optional): Show tweet view count
- true (default): Show view count
- false: Hide view count
- showStats (optional): Show tweet statistics
- true (default): Show reply, retweet, and like counts
- false: Hide all statistics
Usage
- Free: 5 screenshots for trial
- Business: 6,000 screenshots per month
Response codes
TwitterShots uses standard HTTP codes to indicate the success or failure of your requests.
In general, 2xx HTTP codes correspond to success, 4xx codes are for user-related failures, and 5xx codes are for infrastructure issues.
If 5xx errors persist, please contact our support team at support@twittershots.com and we'll help you troubleshoot as soon as possible.
Status
Status | Description |
---|---|
200 | Successful request. |
400 | Check that the parameters were correct. |
401 | The API key used was missing. |
403 | The API key used was invalid. |
404 | The resource was not found. |
429 | The rate limit was exceeded. |
5xx | Indicates an error with TwitterShots servers. |