TwitterShots icon

TwitterShots

Get Tweet screenshots from TwitterShots API

Overview

This node integrates with the TwitterShots API to generate screenshots of tweets based on their tweet ID. It is useful for workflows that require visual representations of tweets, such as social media monitoring, reporting, or content archiving. For example, you can automatically capture and save a screenshot of a specific tweet in SVG, PNG, or HTML format, optionally customizing its appearance with themes and logos.

Properties

Name Meaning
Tweet ID The unique identifier of the tweet to capture a screenshot of.
Format The output format of the screenshot. Options: SVG (default), PNG, or HTML.
Theme The visual theme of the screenshot. Options: Light (default) or Dark.
Logo The logo displayed on the screenshot. Options: X (Twitter default, default), Bluebird, None.
Additional Fields Extra options to customize the screenshot display:
- Show Full Text: Whether to show the full text of the tweet (boolean, default true).
- Show Timestamp: Whether to show the tweet's timestamp (boolean, default true).
- Show Views: Whether to show the views count (boolean, default true).
- Show Stats: Whether to show other tweet statistics (boolean, default true).

Output

The node outputs data in two possible forms depending on the selected format:

  • For SVG, PNG, or JPEG formats:

    • Outputs binary data containing the image file of the tweet screenshot.
    • The binary data is named tweet.<format> (e.g., tweet.svg).
    • The JSON part of the output is empty.
  • For HTML format:

    • Outputs JSON containing the raw HTML string of the tweet screenshot under the html field.
    • No binary data is included.

Each output item is paired with the corresponding input item index.

Dependencies

  • Requires an API key credential for authenticating requests to the TwitterShots API.
  • The node makes HTTP GET requests to https://api.twittershots.com/api/v1/screenshot/{tweetId}.
  • The node expects the user to configure the API authentication credential within n8n.

Troubleshooting

  • Common issues:

    • Invalid or missing Tweet ID will cause the API request to fail.
    • Incorrect or expired API credentials will result in authentication errors.
    • Unsupported format values may cause unexpected responses or errors.
    • Network connectivity issues can prevent successful API calls.
  • Error messages:

    • Errors from the TwitterShots API are caught and returned as error JSON objects if "Continue On Fail" is enabled.
    • Otherwise, the node throws an error indicating the failure reason, which could be related to invalid parameters or authentication problems.
  • Resolution tips:

    • Verify the Tweet ID is correct and publicly accessible.
    • Ensure the API key credential is valid and has proper permissions.
    • Use supported formats (svg, png, html) and themes (light, dark).
    • Check network connectivity and proxy settings if applicable.

Links and References

Discussion