Skip to content

Pagination limited to 500 users despite X.com API supporting more #50

@moisestohias

Description

@moisestohias

Description

The twitter-cli tool caps the number of followers/following users it can fetch at 500, regardless of the --max flag value. This limit is imposed by the tool itself, not by X.com's API.

Root Cause

In client.py:

  • Line 72: _ABSOLUTE_MAX_COUNT = 500 (hardcoded ceiling)
  • Line 148: self._max_count = min(int(rl.get("maxCount", 200)), _ABSOLUTE_MAX_COUNT)
  • Line 802 in _fetch_user_list(): count = min(count, self._max_count) applies the cap before pagination begins

Evidence

The pagination logic itself works correctly - it fetches up to 40 users per page with cursor-based pagination. However, the loop at line 809 (while len(users) < count) uses the capped count, so it stops at 500 regardless of X.com's capability.

Request

Either:

  1. Increase _ABSOLUTE_MAX_COUNT to a higher value (e.g., 1000 or 2000)
  2. Remove the hardcoded ceiling entirely and let users configure it via config
  3. Or document this limitation clearly

Users who follow many accounts (>500) cannot retrieve their full following list with the current implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions