search_posts()#
- Client.search_posts()#
Search posts globally by hashtag.
If you want to get the posts count only, see
Usable by Users Botssearch_posts_count()
.- Parameters:
hashtag (
str
) – Text query string.limit (
int
, optional) – Limits the number of posts to be retrieved. By default, no limit is applied and all posts are returned.
- Returns:
Generator
– A generator yieldingMessage
objects.
Example
# Search for "#pyrogram". Get the first 50 results async for message in app.search_posts("#pyrogram", limit=50): print(message.text)