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
🔒 Sign in to try it live
Log in to call this API with your own API key. New accounts get 100 free credits — no card required.
Log in / Sign upNo active API key found. Create one in your Dashboard, then reload this page. Dashboard →
GET
/api/project/telegram-messaging/chat-history API Response (JSON)
{} Query Result
Need Help?
If you encounter API issues or need other API requirements, please contact us.
Use Cases
- Display full conversation threads in a support or sales UI
- Sync chat history into a CRM or data warehouse
- Provide context to an LLM assistant before generating a reply