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:

  1. Setup your API key
  2. Set X-API-KEY in the request header
  3. 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:

https://api.twittershots.com

Authentication

To authenticate you need to add an X-API-KEY header with your API key.

X-API-KEY: YOUR_API_KEY
Replace YOUR_API_KEY with your actual API key from Account Settings.

Remember your API key is a secret. Do not share it with others or expose it in any client-side code.

Screenshot

Endpoint
GEThttps://api.twittershots.com/api/v1/screenshot/:statusId
Headers
  • Accept: image/svg+xml, image/png, text/html
Path Parameters
  • 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

StatusDescription
200Successful request.
400Check that the parameters were correct.
401The API key used was missing.
403The API key used was invalid.
404The resource was not found.
429The rate limit was exceeded.
5xxIndicates an error with TwitterShots servers.