API Reference

Get up and running with our API methods, keys and integration tools.

Get Started

The base URL for our API is

https://api.screpto.com/v1

All requests must be encoded as JSON with the Content-Type: application/json header.

Responses from Screpto API, including errors, are encoded as JSON as well.

Authentication

Requests to the API must provide an API key through the Authorization header which can be found in Account settingsAPI Key tab.

https://api.screpto.com/v1?token=<API_KEY>

Replace <API_KEY> with your account's API key

Errors

All API endpoints contain a status code, error type and a message within the error responses.

{
"statusCode": 400,
"error": "Bad Request",
"message": "Missing token query param"
}

Rate Limits

We limit the number of calls you can make over a certain period of time. Rate limits vary and are specified by the following header in all responses:

HeaderDescription
x-ratelimit-limitThe maximum number of requests that the consumer is permitted to make.
x-ratelimit-remainingThe number of requests remaining in the current rate limit window.
x-ratelimit-resetThe time at which the current rate limit window resets in UTC epoch seconds.

When the rate limit is exceeded, an error is returned with the status "429 Too Many Requests":

{
"error": {
"code": "too_many_requests",
"message": "Rate limit exceeded",
}
}

Results

Get task results

Endpoint:

GET https://api.screpto.com/v1/results/:TASK_ID

Retrieves results of a task.

Example Request:

curl "https://api.screpto.com/v1/results/:task_id?token=<API_KEY>"

Request parameters

NameTypeRequiredDescription
tokenStringYesYour account API key
resultIdIDNoA string ID of a run. When defined, this parameter allows you to retrieve results of a specific run instead of default.
downloadStringNoThe format in which you want to download the results which can either be json or csv.

Webhooks

Webhooks allow you to subscribe to certain events on your task by providing a destination URL.

We send a POST request to that URL with an event payload every time an event associated with the webhook happens.

Each task can register up to 2 webhooks.

Webhook events

The webhook URL receives a HTTP POST request with a JSON payload for each event. All the events has the following format:

{
"type": <event-type>,
"createdAt": <javascript-timestamp>,
"payload": <payload for the event>,
"taskId": <taskId>
}

Event Payloads

Here's a list of supported event types and their payload.

Successful run

Event type: run.success

Occurs whenever a task run is successfuly completed.

KeyTypeDescription
resultIdIDRun identifier
durationNumberExecution duration in seconds
totalPagesNumberTotal numbers of pages extracted
dataArrayExtraction results in JSON format

Failed run

Event type: run.failure

Occurs whenever a task run fails.

KeyTypeDescription
reasonStringReason of failure

Cost calculation

At its core, Screpto manages a large pool of servers with a strong platform on top and then lends this platform to users. If you run a task, you get allocated a part of our servers with the added services that we provide. This allocated server does some work for you and after everything is done, the server is returned to our pool.

This means credit consumption is directly correlated to the specifics of your request.

Execution cost

Credit consumption per successful Execution

DescriptionCredits consumed
1 second execution duration10
1 second execution duration with Javascript rendering enabled20

API request cost

Credit consumption per successful API request

DescriptionCredits consumed
1 API request20
1 webhook HTTP request20