Detailed Screenshot Capture Execution Log

Swagger documentation: https://api.screenshotapi.io/swagger#!/log/logrequestId

Endpoint for retrieving execution log detail for a specific screen capture request:

GET https://api.screenshotapi.io/log/{RequestId}

Add your API key to the HTTP header in the apikey field.

The detailed log is useful for seeing exactly where your screenshot capture request is at. If you have submitted the request and have not yet got back a response and want more visibility into why, this detailed log output will provide that. No API credits are used by calling this endpoint.

Do not poll for a large number of requests

This endpoint is NOT intended to be used as an alternative way to retrieve your screenshot requests as each request of the log service puts strain on our database. Always use the Retrieve endpoint to poll for completed screenshots, which can be called any number of times. This endpoint should be used only for informational purposes in relatively low volume.

Also note that you can only use the log service for requests submitted with your own API key, you can't use it to query information about requests submitted with our demo site or from any other customer account.

Detail Log Request

RequestId

The RequestId querystring parameter is the same as the key used to retrieve your screenshot, a value that uniquely identifies your screenshot capture request.

Detail Log Response

If the given RequestId is not found the API will produce a 404. If it is found, but does not belong to your account you will receive a 403. If it is found and it belongs to your account you will receive a response detailing the execution steps the request has undergone so far.

Example response:

{
    "behindSeconds": 0,
    "requestId": "3a117a4c6eb778f6635afa8444cd518a",
    "captureRequest": "{\"rawUrl\":\"http://www.msn.com\",\"canonicalUrl\":\"http://www.msn.com/\",\"domain\":\"www.msn.com\",\"viewport\":\"1280x1024\",\"fresh\":true,\"webdriver\":\"FF\",\"javascript\":true,\"fullpage\":false,\"deviceEmulation\":\"\",\"requestId\":\"3a117a4c6eb778f6635afa8444cd518a\",\"s3key\":\"captures/3a117a4c6eb778f6635afa8444cd518a.png\",\"waitSeconds\":0 }",
    "logEntries": [
        {
            "status": "SUBMITTED",
            "timestamp": 1505357736,
            "timestampUtc": "2017-09-14T02:55:36.000Z"
        },
        {
            "status": "STARTED_PROCESSING",
            "timestamp": 1505357737,
            "timestampUtc": "2017-09-14T02:55:37.000Z"
        },
        {
            "status": "SUCCESS_PROCESSING",
            "timestamp": 1505357756,
            "timestampUtc": "2017-09-14T02:55:56.000Z"
        }
    ]
}

The log entry list shows you each step in processing. If a request is SUBMITTED but has not yet STARTED_PROCESSING, that could be because all the workers are currently processing other requests (requests are handled in a FIFO manner). You may also see ERROR_PROCESSING indicatingn that the back-end screenshot worker attempted to capture the URL but encountered an error. Our system will automatically retry all errors up to a maximum of 3 attempts, if all 3 attempts fail the ending entry will be of status ERROR_FINAL, indicating no additional retries will be attempted. It is only after this phase that the Retrieve API will return the error response, while the back-end is retrying after a single error, the retrieve API continues to indicate a Processing response.

BehindSeconds

Number of seconds behind the returned data is from realtime. Normally this will be nearly zero however if our log stream consumer is falling behind this will indicate how many seconds behind. If it is running behind this may cause 404 issues simply because the data hasn't arrived yet.

RequestId

The same RequestId given in making this request.

CaptureRequest

The screenshot capture request that this detailed log entry corresponds to. Note that the format of this capture request is the internal representation and may differ from the json format which you submitted.

LogEntries

Each phase of execution will have its own row in this list. If the request is still processing there may be additional records if queried again. Failed requests are automatically re-processed a number of times.

Query Log of Screenshot Capture Requests

Swagger documentation: https://api.screenshotapi.io/swagger#!/log/log

Endpoint for retrieving a list of your screenshot capture requests and their statuses:

GET https://api.screenshotapi.io/log&status={status}&limit={limit}&offset={offset}

Add your API key to the HTTP header in the apikey field.

Use this endpoint to query lists of your screenshot capture requests. You can bring back lists of all requests, or just requests in certain states such as pending, successful, or error states. Note that only a maximum of 3 days of data is kept in our log database. Older records are purged.

Log Request

Status

The status of each screenshot capture you would like returned. Specify PROCESSING to return requests in all states prior to successful completion or final error (after max retries). Specify COMPLETE to return all requests which have completed successfully or reached final error. Specify ERROR to retrieve all errored requests. Specify ALL to retrieve all requests.

Limit

Because the results of a query may return a large number, depending on your usage, the return set must be paginated.
The limit parameter controls the maximum number of items that may be returned for a single request. This parameter can be thought of as the page size.

Offset

The offset parameter controls the starting point within the collection of resource results. For example, if you have a collection of 15 items to be retrieved from a resource and you specify limit=5, you can retrieve the entire set of results in 3 successive requests by varying the offset value: offset=0, offset=5, and offset=10. Note that the first item in the collection is retrieved by setting a zero offset.

Log Response

Example response (abbreviated).

{
    "behindSeconds": 0,
    "results": [
        {
            "timestamp": 1505394730,
            "timestampUtc": "2017-09-14T13:12:10.000Z",
            "requestId": "b7c511e444ffadf8f62b8462269c65fb",
            "captureRequest": "{\"rawUrl\":\"http://www.msn.com\",\"canonicalUrl\":\"http://www.msn.com/\",\"domain\":\"www.msn.com\",\"viewport\":\"1280x1024\",\"fresh\":true,\"webdriver\":\"FF\",\"javascript\":true,\"fullpage\":false,\"deviceEmulation\":\"\",\"requestId\":\"b7c511e444ffadf8f62b8462269c65fb\",\"s3key\":\"captures/b7c511e444ffadf8f62b8462269c65fb.png\",\"waitSeconds\":0}",
            "status": "SUCCESS"
        },
        {
            "timestamp": 1505394617,
            "timestampUtc": "2017-09-14T13:10:17.000Z",
            "requestId": "07084343eb9fb0b5d3ec8b1109e99830",
            "apiCreditsUsed": 2,
            "captureRequest": "{\"rawUrl\":\"http://www.msn.com\",\"canonicalUrl\":\"http://www.msn.com/\",\"domain\":\"www.msn.com\",\"viewport\":\"1280x1024\",\"fresh\":true,\"webdriver\":\"FF\",\"javascript\":true,\"fullpage\":false,\"deviceEmulation\":\"\",\"requestId\":\"07084343eb9fb0b5d3ec8b1109e99830\",\"s3key\":\"captures/07084343eb9fb0b5d3ec8b1109e99830.png\",\"waitSeconds\":0}",
            "status": "SUCCESS"
        }
    ],
    "totalResults": 135,
    "next": "http://api.screenshotapi.io/log/status=COMPLETE&limit=100&offset=1"
}

BehindSeconds

Number of seconds behind the returned data is from realtime. Normally this will be nearly zero however if our log stream consumer is falling behind this will indicate how many seconds behind. If it is running behind this may cause the results to indicate no or less records than may exist due to the data stream being behind.

Results

The list of results, screenshot capture requests, that match your filter.

TotalResults

This indicates the total number of individual Result entries in the entire data set, which you may have to make multiple calls using limit and offset ot retrieve the entire set.

Next / Prev

If there are additional results, or prior results, these URLs will return the next or previous set of results.