trevorhobenshield / twitter-api-client

Implementation of X/Twitter v1, v2, and GraphQL APIs
https://pypi.org/project/twitter-api-client
MIT License
1.56k stars 207 forks source link

The accuracy of the number of entries returned by `home_latest_timeline` or `home_timeline` after setting the `limit` parameter #226

Closed bwnjnOEI closed 1 month ago

bwnjnOEI commented 3 months ago

I'm not sure if I understand correctly: the limit parameter is used to upper limit the number of tweet items, but based on the actual running situation, this limit and the actual number of items obtained differ by about 1 time (specifically, it depends on the actual return of twitter, and in most cases, each cursor returns 102 items).

clipboard_2024-06-25_03-43

I referred to the _paginate function under file account.py, although I'm not very clear about the role of DUP_LIMIT, but I found that the count of rest_id is related to the limit parameter, but it doesn't accurately reflect the upper limit provided by the limit parameter.

I want to confirm whether this is a problem or a feature, why use rest_id as a counter label instead of, for example, sortIndex (this key is very robust in all request types) and whether it will be improved in the future here.