| Type | Supported Formats | Supported Types | |
|---|---|---|---|
| Library Template | png jpg jpeg webp pdf | base64 url binary |
Automate this template using integrations
You can generate Tweet Screenshot renders using Rest API and Orshot SDKs
await fetch("https://api.orshot.com/v1/generate/images", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <ORSHOT_API_KEY>",
},
body: JSON.stringify({
"templateId": "tweet-image",
"response": {
"format": "png",
"type": "base64"
"scale": 1
},
"modifications": {
"tweetUrl": "https://x.com/super_/status/1708798783079793072",
"tweetId": "1708798783079793072",
"tweetFontSize": "2",
"tweetBackgroundColor": "#fff",
"tweetTextColor": "#111",
"showRepliedToTweet": "false",
"hideHeader": "false",
"hideMetrics": "false",
"googleFont": "Inter",
"hideVerifiedIcon": "false",
"hideQuoteTweet": "false",
"hideDateTime": "false",
"hideMedia": "false",
"hideShadow": "false",
"backgroundColor": "#f1f1f1",
"backgroundImageUrl": "",
"padding": "100",
"width": "1000"
}
}),
});You can customize the template using following modifications
| Key | Description | Type |
|---|---|---|
| tweetUrl | Link to tweet, cannot be used together with tweetId | url |
| tweetId | Tweet's ID, cannot be used with tweetUrl | string |
| tweetFontSize | Font size for tweet text in CSS REM value | number |
| tweetBackgroundColor | Tweet Background color | string |
| tweetTextColor | Tweet Text color | string |
| showRepliedToTweet | Whether to show the replied to tweet, if tweet is a reply(uses 2 extra renders) | boolean |
| hideHeader | Whether to hide or show the header section, includes profile photo, name and username | boolean |
| hideMetrics | Whether to hide the tweet metrics | boolean |
| googleFont | Specify name of a Google Font to use in tweet text | string |
| hideVerifiedIcon | Whether to hide or show verified icon | boolean |
| hideQuoteTweet | Control if you want to show the quoted tweet | boolean |
| hideDateTime | Hide date and time of tweet | boolean |
| hideMedia | Hide tweet images | boolean |
| hideShadow | Hide shadow behind tweet box | boolean |
| backgroundColor | Hex or CSS color of background | string |
| backgroundImageUrl | Link to background image | string |
| padding | Padding(in pixels value) around the tweet box | number |
| width | Max width of output image | number |