Telegram Bot API
🌐 English

getUpdates

Category: Updates · Bot API 10.3 · Official documentation

Gets updates. Use the 'Start' button for long polling.

Returns: On success, returns Array of Update.

Parameters

ParameterTypeRequiredDescription
offsetIntegerOptionalOffset for next request
limitIntegerOptionalMax count (1-100)
timeoutIntegerOptionalTimeout in seconds
allowed_updatesArray of StringOptionalJSON array of types

Parameter descriptions are concise summaries; see the official documentation for the full text.

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