webhookUrl when you start a crawl (POST /crawl) or an asynchronous map (POST /map/async). Geekflare then sends an HTTPS POST to that URL when the job changes state.
The response that creates the job contains a webhookSecret. It is shown once. Store it: you need it to check that a request really comes from Geekflare.
Requirements for your endpoint
- The URL must use
httpsand must not contain a username or password. - It must point to a public address. Private, loopback and link-local addresses (for example
10.x.x.x,127.0.0.1,169.254.169.254) and names that only resolve inside a network (localhost,*.internal,*.local) are rejected when you create the job, and again every time a delivery is attempted, after DNS resolution. - Redirects are not followed. Answer on the URL you registered.
- Answer with a
2xxstatus within 10 seconds. Anything else counts as a failed attempt. The response body is ignored.
Request
The body is always:
Events
Crawl
Choose events with
webhookEvents when you create the crawl. If you leave it out you get the defaults.
crawl.started, crawl.on_hold, crawl.resumed, crawl.completed, crawl.failed and crawl.cancelled carry the state of the job:
expiresAtis when the pages and the ZIP of the crawl are deleted. It isnulluntil the crawl has finished.crawl.on_holdhasholdReason(creditsorbilling),holdExpiresAt(when the crawl fails if credits have not been added) andreason.- During planned maintenance a running crawl can be paused without a webhook:
GET /crawl/{id}then showsstatus: "on_hold"withholdReason: "maintenance"and noholdExpiresAt, and the crawl continues by itself afterwards. crawl.failedafter an unresolved hold hasreason: "hold_expired".
crawl.page:
contentUrl is a temporary signed link. It works until linkExpiresAt and never later than expiresAt. When it has expired, call GET /crawl/{id}: every response contains fresh links.
Map
Verify the signature
Every request is signed with yourwebhookSecret. Check the signature before you trust the body.
X-Geekflare-Signature looks like t=1767225600,v1=<hex>:
tis the Unix time in seconds when the request was signed.v1is the hexadecimal HMAC-SHA256 of the string"<t>.<raw request body>", using thewebhookSecret(the whole value, including thewhsec_prefix) as the key.
Retries
A delivery is retried until your endpoint answers2xx, up to 5 attempts in total:
After the fifth failed attempt the delivery is marked
failed and is not sent again. In total that is about 36 minutes. A link inside a payload is always valid for longer than that.
Redirects and 3xx answers, timeouts, connection errors and non-2xx statuses all count as failed attempts. A URL that resolves to a non-public address fails immediately and is not retried.
Order and duplicates
- Deliveries are queued in the order events happen, but retries mean they can arrive out of order. A
crawl.pagethat is being retried can arrive aftercrawl.completed. UsecreatedAtin the body to order events and the crawl status fromGET /crawl/{id}as the source of truth. - A delivery can arrive more than once. Use
id(alsoX-Geekflare-Delivery) to ignore repeats.
See what was delivered
If an event did not reach you, look at what Geekflare tried:GET /crawl/{id}containswebhook.deliveries: the 10 most recent deliveries withstatus(pending,delivered,failed),attempts,lastHttpStatus,lastErrorandnextAttemptAt.GET /crawl/{id}/webhookslists every delivery, withlimitandoffset.