resolve_twitter_handles

Documentation for eth_defi.feed.twitter_api.resolve_twitter_handles function.

resolve_twitter_handles(handles, bearer_token, cache, *, max_age_days=30)

Resolve Twitter handles to user IDs, using the cache for known entries.

Only looks up handles that are missing from the cache or stale. Returns a mapping of handle → user_id.

The X API get_users response may include an errors list describing why specific handles could not be resolved (suspended, not found, renamed, etc.). These reasons are logged so operators can take corrective action on the corresponding YAML files.

Parameters
Return type

dict[str, str]