Genesis Arbitrage

Genesis Arbitrage · · 2 min read

Webhook

A webhook is an HTTP request that a service sends on its own to a URL you registered in advance when an event happens: a message arrives, a payment goes through, a status changes. Instead of making repeated requests, your server receives incoming ones.

How a webhook works

You register a public HTTPS URL; when an event happens, the service sends a POST request with a JSON body to it, and your server replies with a 2xx code. The Telegram Bot API works this way: after a setWebhook call, every bot update arrives as an HTTPS POST to your URL. If the reply is not 2xx, Telegram repeats the request and stops after several attempts (Telegram Bot API docs).

The URL is public, so incoming requests need checking. Telegram puts the value of the secret_token parameter into the X-Telegram-Bot-Api-Secret-Token header; reject requests without it. Polling with getUpdates and a webhook do not work at the same time: Telegram allows only one way to receive updates.

Webhook or polling: an example

Hypothetical example: an event happens 5 times a day. Polling every 10 seconds means 24 × 3,600 ÷ 10 = 8,640 requests a day, and only 5 of them bring news. A webhook takes 5 requests over the same day, one per event.

In return, a webhook needs a server with a public URL that accepts requests around the clock. If your server is down longer than the service keeps retrying, you can miss the event.

Genesis API has no webhooks

Genesis API serves data only on request: every call is an HTTP GET (docs), and there are no webhooks and no WebSocket. There are two ways to hear about opportunities right away.

Without code: Telegram notifications. Genesis Arbitrage sends signals for your chosen categories and filters to your own Telegram bot. The personal bot is available on the Pro site subscription, and setup is described in the guide.

With code: poll Genesis API at your plan's freshness (the step is listed in Plans & limits) and message yourself when an opportunity shows up. That is how the Python crypto arbitrage bot works.

See also: API, REST API, latency.

Questions and answers

Can Genesis API send data to a webhook?

No, Genesis API only answers client requests. For ready-made alerts without your own code, use Genesis Arbitrage Telegram notifications.