Fetch Chat History

View All Telegram Messaging API APIs →

Fetch recent messages for a peer live from the server (not the in-memory cache), newest first. Provide the sessionId and the peer (@username, +phone, me, or a user:<id> / chat:<id> / channel:<id> peer from chat or inbox responses). Each message includes its numeric id, chatJid, sender, fromMe flag, type, text, and timestamp. Use limit to control how many are returned (default 20).

API Features

Live from server Fetches history directly from Telegram, not just the in-memory cache
Newest-first Returns the latest messages first for quick access to recent context
Adjustable depth Use limit to fetch just the latest few or a longer slice of history

Live API Demo

GET /api/project/telegram-messaging/chat-history

API Response (JSON)

{}
📢
Need Help?
If you encounter API issues or need other API requirements, please contact us.
Contact Us

Use Cases

View Subscription Plans →