When a task reaches its final state, we POST its result to your endpoint. One delivery per task: nothing when it is accepted, nothing per page.

Register your endpoint

You register it yourself, once, with webhook-configuration:
signing_secret is shown once and can never be read again. Store it before you close the connection.
  • A request can send its result to another endpoint: put that endpoint’s id in the request’s data.webhook_endpoint_id.
  • Registering a URL you already have answers 409, because a second copy would double every delivery.
  • Changing or switching off an endpoint, or seeing past deliveries, is done by our team. Contact us.

What a delivery looks like

The body is JSON. event is always EVENT.DATA_RESULT. queue names the shape: Every body carries status (success or failed), task_status (the outcome code), reason, details, task_id, external_request_id and publisher_key, plus the result links for its type. A failure has the same shape as a success, with empty links. See Google Maps reviews for a REVIEW_DATA example, and the webhook for a run with authors for GRAPH_DATA. Match a delivery to your request on task_id or external_request_id. Every delivery has these headers:

Verify the signature

v1 is HMAC-SHA256(signing_secret, "{t}." + raw_body), as hex.
  1. Read the raw request body. Do not parse and re-serialise it: the key order or spacing would change and the signature would not match.
  2. Recompute the HMAC and compare it in constant time.
  3. Reject the delivery if t is more than 5 minutes old. This stops a captured request from being replayed later.
  4. During a secret rotation the header can carry two v1= values. Accept the delivery if any of them matches.
A minimal receiver, in Python with Flask:

Retries and duplicates

  • Answer 2xx quickly. Anything else, or no answer within your timeout_seconds, counts as a failure and we retry. Do the work after you answer, not before.
  • Remove duplicates with X-DP-Event-Id. Every attempt at the same result carries the same id, so a retry after a timeout you actually processed is easy to spot. If our team re-runs a task, that is a new result with a new id.
  • Retries are limited. After the last attempt the delivery stays failed. If your endpoint was down for a long time, collect the missed results with retrieve-data.
  • A failed delivery never fails the scrape. Your records are stored either way, and retrieve-data returns them.