The /api/v2/search endpoint (and /api/v1/search) accepts a limit query parameter (e.g. GET /api/v2/search?q=aptly&type=statuses&limit=40), but Mastodon.search() / Mastodon.search_v2() / Mastodon.search_v1() do not expose it:
>>> from mastodon import Mastodon
>>> import inspect
>>> inspect.signature(Mastodon.search)
(self, q: str, resolve: bool = True, result_type: Optional[str] = None, account_id=None, offset: Optional[int] = None, min_id=None, max_id=None, exclude_unreviewed: bool = True) -> Union[Search, SearchV2]
Calling with limit= raises:
>>> Mastodon.search(None, q='test', limit=5)
TypeError: search() got an unexpected keyword argument 'limit'
Mastodon.py version: 2.2.1
Could limit be added as a passthrough parameter to search()/search_v1()/search_v2(), similar to how it's supported on other list-returning endpoints (e.g. account_search)? Currently the only workaround is to over-fetch and truncate client-side.
The
/api/v2/searchendpoint (and/api/v1/search) accepts alimitquery parameter (e.g.GET /api/v2/search?q=aptly&type=statuses&limit=40), butMastodon.search()/Mastodon.search_v2()/Mastodon.search_v1()do not expose it:Calling with
limit=raises:Mastodon.py version: 2.2.1
Could
limitbe added as a passthrough parameter tosearch()/search_v1()/search_v2(), similar to how it's supported on other list-returning endpoints (e.g.account_search)? Currently the only workaround is to over-fetch and truncate client-side.