getUpdates
Gets updates. Use the 'Start' button for long polling.
Returns: On success, returns Array of Update.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
offset | Integer | Optional | Offset for next request |
limit | Integer | Optional | Max count (1-100) |
timeout | Integer | Optional | Timeout in seconds |
allowed_updates | Array of String | Optional | JSON array of types |
Example request
curl
curl -s "https://api.telegram.org/bot$TOKEN/getUpdates"
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.get(f"https://api.telegram.org/bot{TOKEN}/getUpdates", timeout=30)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getUpdates`);
console.log(await res.json());
Step-by-step guide: How to Get a Telegram Chat ID for a User, Group, Channel or Topic
Related methods
getWebhookInfoReturns webhook info.setWebhookSets a webhook.deleteWebhookDeletes a webhook.