According to Telegram docs:
Link Preview is generated server-side
I’m trying to make a bot to process the info in the link preview for links sent by users, but I couln’t find a way to get that information from the Bot API.
Is there any way to ask the API for the information the link preview shows?
2
Answers
Although there is no API method to get this information, Telegram uses the Open Graph Protocol to generate its Link Previews.
Any open graph client will provide the same information that Telegram shows in their Link Previews.
The answer would be no. The Bot API cannot process the information in the link preview.
However if you want the bot to know what is on the other side of the link, It is possible. You can use a HTML content scrapping library and a Summarizing library to get a link preview. I have attached below the libraries you can use and a Reddit bot which is somehow close to what you need. The example libraries are in python but you can essentially get or make for the language you use.
python-goose is a HTML content scrapping library
python summarizing library
another python summarizing library
sample reddit bot
Telegram MessageEntity object