In this article, we’ll explain the difference between sync and async requests, highlight the benefits of the async flow, and describe key parameters with examples.
default
Synchronous requests - Send a request and get a real-time response immediatelyresponse_ID
, and is a direct request (i.e. you will be billed for this request).response_ID
and is free of charge (i.e. you will not be billed for this request). If you call for a response_ID
which is still being processed you will receive a 102 status code.Enable "Asynchronous requests"
[Optional] Setting up a webhook (POST or GET)
Sending an async request
x-response-id
header with the ID of your request. This is the RESPONSE_ID
for this request which you will use when collecting your results in the next step.RESPONSE_ID
in your script by initializing it along with your request like this:Webhook notification
status
, response_id
, request_url
and hook_data
(optional - if you’ve used the webhook_data
parameter in your request).100.27.150.189
18.214.10.85
Collecting your results
RESPONSE_ID
received in step 3, send the following:POST /{unblocker|serp}/req
Parameter | Type | Description |
---|---|---|
url (*) | String | Defines the url of the request |
method | String | Defines the HTTP method of the request |
headers | Object | Defines headers to be used in the request |
body | String or Object | Defines body to be sent with request. If an object is specified, it is serialized to JSON, and Content-Type header is set to application/json. |
country | String | Defines country to be used for request (2-letters code) |
webhook_url | String | Defines the URL to which the job status notification will be sent. If you don’t want to setup a default webhook (above) or prefer the URL to be different per request, use this. |
webhook_method | String | Defines the HTTP method to use with the webhook_url (GET or POST) |
webhook_data | Any | Defines the data that will be sent with job status notification |
Parameter | Type | Description |
---|---|---|
query (*) | Object | |
brd_json | 1 or “html” | Defines the response format |
GET /{unblocker|serp}/get_result
response_id
comes from the x-response-id
header of the request creation response
Parameter | Description |
---|---|
response_id (*) | Defines the job id. Received in the response headers of your initial async request. |
multi
parameter instead of query
.
These parallel requests use the same peer IP and session and can be used for collecting additional data, comparison tests, etc. – e.g., making a pair of requests with different parameters/values. They use the same IP and session.
Conditions: