Developer Docs

Snapup provides API so you can integrate your system with us and automate the process.

Quick start

Login into Snapup and navigate to Profile, you will get App Key and App Secret. Don't share these key and secret with anyone. Cause if anyone get these key and secret, they can send request to the system on behalf of you. If it seems the key and secret are compromised, hit Regenerate button to get a newly generated key and secret.

Host: https://snapup.xyz

Authorization

Add your key and secret either in Header or in URL Query params

X-App-Key: { your_app_key }
X-App-Secret: { your_app_secret }
                

Take Screenshot

POST /v1/snaps

Body
{
    "url": "https://www.google.com/search?q=codersgarage",
    "device_type": "1",
    "is_full_page": true,
    "width": 1024,
    "height": 720,
    "delay_time": 15,
    "network_id": "1",
    "block_ads": false,
    "is_retina": false,
    "email_for_notification": "sakib@codersgarage.com",
    "url_for_callback": "https://snapup.xyz/callback",
    "headers": {
        "Content-Type": "application/json",
        "Accept": "*/*"
    },
    "cookies": [
        {
            "name": "Test",
            "value": "Test 2",
            "url": " localhost",
            "domain": "localhost",
            "path": "/",
            "secure": false,
            "http_only": true,
            "expires": 1587693606
        }
    ]
}
                

Note: Screenshot taking is a complex process,so in case of safety increase http read and write timeout. Set is_retina to true for high resolution image.

Note: Only url field is required. Other fields are optional, use as per your need. expires under Cookie in is epoch seconds. Device type 1 is PC and 2 is Mobile.

Note: url_for_callback must be a valid URL and accessible publicly. You will get a multipart POST request, pdf file with key screenshot_as_pdf and image file with key screenshot_as_image.

Note: email_for_notification must be a valid email address. You will get an image and a PDF file.

Result 201
{
    "data": {
        "id": "f8dc674a-68df-49d8-aeb2-f841878dd410",
        "width": 1280,
        "height": 960,
        "is_for_mobile": false,
        "is_full_page": false,
        "status": "done",
        "delay_time": 0,
        "failure_reason": "",
        "url": "https://www.google.com/search?q=codersgarage",
        "stored_path": "https://snapup.xyz/v1/fs/d9bc0977-beb9-4ba3-93bf-37813f894d49/2afe31d6-5cc3-47b9-a65d-5fec695b9810.png",
        "network_id": "2",
        "created_at": "2020-04-24T02:19:34.646371Z",
        "updated_at": "2020-04-24T02:19:40.155535Z"
    }
}
                

Get Screenshot

GET /v1/snaps/{snap_id}

Result 200
{
    "data": {
        "id": "7b0e5bb7-1cd5-4281-accf-4cd34970f31b",
        "width": 1280,
        "height": 960,
        "is_for_mobile": false,
        "is_full_page": true,
        "status": "done",
        "delay_time": 15,
        "failure_reason": "",
        "url": "https://www.google.com/search?q=codersgarage",
        "stored_path": "https://snapup.xyz/v1/fs/d1e81f5f-0b07-4ea9-85fd-c5acce8522e7/5719b4e0-2a28-4133-be6e-c26d8abeb875.png",
        "network_id": "4",
        "created_at": "2020-04-23T02:08:24.320596Z",
        "updated_at": "2020-04-23T02:09:01.970849Z"
    }
}
                

List Screenshots

GET /v1/snaps

Query Params

page - Number of current page (default: 1)
limit - Number of items in the page (default: 10)
                

Result 200
{
    "data": {
        "current_page": 1,
        "next_page": 2,
        "per_page_item": 5,
        "prev_page": 0,
        "total_pages": 31,
        "screenshots": [
            {
                "id": "7b0e5bb7-1cd5-4281-accf-4cd34970f31b",
                "width": 1280,
                "height": 960,
                "is_for_mobile": false,
                "is_full_page": true,
                "status": "done",
                "delay_time": 15,
                "failure_reason": "",
                "url": "https://www.google.com/search?q=codersgarage",
                "stored_path": "https://a4546c71.ngrok.io/v1/fs/d1e81f5f-0b07-4ea9-85fd-c5acce8522e7/5719b4e0-2a28-4133-be6e-c26d8abeb875.png",
                "network_id": "4",
                "created_at": "2020-04-23T02:08:24.320596Z",
                "updated_at": "2020-04-23T02:09:01.970849Z"
            },
            {
                "id": "85f7394b-1cf1-4165-8306-37c635f7e7a3",
                "width": 1280,
                "height": 960,
                "is_for_mobile": false,
                "is_full_page": true,
                "status": "done",
                "delay_time": 15,
                "failure_reason": "",
                "url": "https://www.google.com/search?q=codersgarage",
                "stored_path": "https://a4546c71.ngrok.io/v1/fs/d1e81f5f-0b07-4ea9-85fd-c5acce8522e7/0d04ffe3-38f0-4ab0-8e0a-3c0f94ec1d8f.png",
                "network_id": "4",
                "created_at": "2020-04-23T02:08:21.580511Z",
                "updated_at": "2020-04-23T02:09:00.553987Z"
            },
            {
                "id": "31e23ed8-d2ae-483c-9d8a-ad6ef5245177",
                "width": 1280,
                "height": 960,
                "is_for_mobile": false,
                "is_full_page": true,
                "status": "done",
                "delay_time": 15,
                "failure_reason": "",
                "url": "https://www.google.com/search?q=codersgarage",
                "stored_path": "https://a4546c71.ngrok.io/v1/fs/d1e81f5f-0b07-4ea9-85fd-c5acce8522e7/ebf96f62-a42a-43cb-ac93-99b05fe79bfc.png",
                "network_id": "4",
                "created_at": "2020-04-23T02:08:18.880521Z",
                "updated_at": "2020-04-23T02:08:57.459217Z"
            },
            {
                "id": "eadd436a-fd79-4b63-9807-3cbb94671751",
                "width": 1280,
                "height": 960,
                "is_for_mobile": false,
                "is_full_page": true,
                "status": "done",
                "delay_time": 15,
                "failure_reason": "",
                "url": "https://www.google.com/search?q=codersgarage",
                "stored_path": "https://a4546c71.ngrok.io/v1/fs/d1e81f5f-0b07-4ea9-85fd-c5acce8522e7/a31e1fac-a0a8-4fbb-a4e5-925c0b03facf.png",
                "network_id": "4",
                "created_at": "2020-04-23T02:08:16.012762Z",
                "updated_at": "2020-04-23T02:08:55.42857Z"
            },
            {
                "id": "b1cdb86a-1131-4fcf-9762-133a83745ec6",
                "width": 1280,
                "height": 960,
                "is_for_mobile": false,
                "is_full_page": true,
                "status": "done",
                "delay_time": 15,
                "failure_reason": "",
                "url": "https://www.google.com/search?q=codersgarage",
                "stored_path": "https://a4546c71.ngrok.io/v1/fs/d1e81f5f-0b07-4ea9-85fd-c5acce8522e7/19b7959d-5539-4b66-8553-d2d6ce6b4ced.png",
                "network_id": "4",
                "created_at": "2020-04-23T02:08:13.336645Z",
                "updated_at": "2020-04-23T02:08:53.255896Z"
            }
        ]
    }
}
                

Get Screenshot By Format

GET /v1/snaps/{snap_id}/format

Query Params

type - document format type (default: png, Others: pdf|png|jpeg)
                

Result 200
Document file stream in expected format
                

Other Information



Available Standard Networks

1 - Amsterdam
2 - Singapore
3 - New York
                

Screenshot Status
Queued - When screenshot is queued
Rendering - When screenshot is being rendered
Done - When screenshot is ready to use
Failed - When failed to process the screenshot