API Documentation

Quick Example


The following example shows how you can use cURL to screenshot an X post and save it as an image:

curl https://api.pikaso.me/screenshot/twitter \
     -d tweet_id=1033749606373445633 \
     -d layout=nova1 \
     -d theme=dark \
     -d size=auto \
     -G \
     -u $TOKEN:$TOKEN_SECRET \
     -o tweet.png

HTTP/1.1 200 OK
Content-Type: image/png
Content-Length: 111499
Content-Disposition: attachment; filename="api.pikaso.me-dog_feelings-20180826_161446-1033749606373445633.png"

<binary image data>

Authentication


To authenticate, you need to generate an API Key first.

Your API Key consists of a Token and a Token Secret. You should send them as username and password in the Basic Auth method with your request:

credentials = Base64(token + ":" + token_secret)
set_header("Authorization: Basic " + credentials)

Screenshot X Post


This method lets you screenshot an X post.


Endpoint


GET https://api.pikaso.me/screenshot/twitter


Params


tweet_id(Required)
The ID of the X post that you want to screenshot.

layout
The layout to use.
bubble1, bubble2, fab, iconic, nova1, nova2, quote, simple, square, standard, random

theme
The theme to use.
light, dark, lights_out, autumn, carnation, cerise, forest, growth, pattens_blue, moon_yellow, pistachio, pumpkin, sapphire, shamrock, spanish_yellow, random

size
The size of the generated image.
auto, ig_post, ig_story


Response


The response contains the generated screenshot image as binary. The format of the image is specified in the Content-Type header field.



Errors


HTTP 401
Missing/invalid credentials.

HTTP 422
Invalid argument. The error.code field in the response body contains the actual error:

invalid_access_token
Pikaso's access to your X account has been revoked.
missing_tweet_id
The required tweet_id param was not supplied.
tweet_not_found
The X post was not found.
unauthorized
You are not authorized to view this X post.
twitter_error
X is having problems right now.
invalid_layout
The specified layout argument was invalid.
invalid_theme
The specified theme argument was invalid.
invalid_size
The specified size argument was invalid.