Skip to main content

stories.searchPosts

Globally search for stories using a hashtag or a location media area, see here » for more info on the full flow. Either hashtag or area must be set when invoking the method.

func (c *Client) StoriesSearchPosts(ctx context.Context, request *StoriesSearchPostsRequest) (*StoriesFoundStories, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.StoriesSearchPosts(ctx, &tg.StoriesSearchPostsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *StoriesFoundStories
return nil
})

Parameters

NameTypeRequiredDescription
HashtagstringHashtag (without the #)
AreaMediaAreaClassA mediaAreaGeoPoint or a mediaAreaVenue. Note mediaAreaGeoPoint areas may be searched only if they have an associated address.
PeerInputPeerClassIf set, returns only stories posted by this peer.
OffsetstringyesOffset for pagination: initially an empty string, then the next_offset from the previously returned stories.foundStories.
LimitintyesMaximum number of results to return, see pagination

Returns

*StoriesFoundStories

Possible errors

CodeTypeDescription
400HASHTAG_INVALIDThe specified hashtag is invalid.

References