Files
AutoGPT/docs/integrations/twitter/user_lookup.md
Nicholas Tindle c1a1767034 feat(docs): Add block documentation auto-generation system (#11707)
- Add generate_block_docs.py script that introspects block code to
generate markdown
- Support manual content preservation via <!-- MANUAL: --> markers
- Add migrate_block_docs.py to preserve existing manual content from git
HEAD
- Add CI workflow (docs-block-sync.yml) to fail if docs drift from code
- Add Claude PR review workflow (docs-claude-review.yml) for doc changes
- Add manual LLM enhancement workflow (docs-enhance.yml)
- Add GitBook configuration (.gitbook.yaml, SUMMARY.md)
- Fix non-deterministic category ordering (categories is a set)
- Add comprehensive test suite (32 tests)
- Generate docs for 444 blocks with 66 preserved manual sections

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

<!-- Clearly explain the need for these changes: -->

### Changes 🏗️

<!-- Concisely describe all of the changes made in this pull request:
-->

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  <!-- Put your test plan here: -->
  - [x] Extensively test code generation for the docs pages



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduces an automated documentation pipeline for blocks and
integrates it into CI.
> 
> - Adds `scripts/generate_block_docs.py` (+ tests) to introspect blocks
and generate `docs/integrations/**`, preserving `<!-- MANUAL: -->`
sections
> - New CI workflows: **docs-block-sync** (fails if docs drift),
**docs-claude-review** (AI review for block/docs PRs), and
**docs-enhance** (optional LLM improvements)
> - Updates existing Claude workflows to use `CLAUDE_CODE_OAUTH_TOKEN`
instead of `ANTHROPIC_API_KEY`
> - Improves numerous block descriptions/typos and links across backend
blocks to standardize docs output
> - Commits initial generated docs including
`docs/integrations/README.md` and many provider/category pages
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
631e53e0f6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 07:03:19 +00:00

4.2 KiB

Twitter User Lookup

Blocks for looking up Twitter/X user profiles and information.

Twitter Get User

What it is

This block retrieves information about a specified Twitter user.

How it works

This block queries the Twitter API v2 to retrieve detailed information about a single user. You can look up users either by their unique Twitter ID or by their username (handle). The block uses Tweepy with OAuth 2.0 authentication.

Optional expansions allow you to include additional data such as the user's pinned tweet. The response includes profile information like display name, bio, follower count, and profile image URL based on the user_fields selected.

Inputs

Input Description Type Required
expansions Choose what extra information you want to get with user data. Currently only 'pinned_tweet_id' is available to see a user's pinned tweet. UserExpansionsFilter No
tweet_fields Select what tweet information you want to see in pinned tweets. This only works if you select 'pinned_tweet_id' in expansions above. TweetFieldsFilter No
user_fields Select what user information you want to see, like username, bio, profile picture, etc. TweetUserFieldsFilter No
identifier Choose whether to identify the user by their unique Twitter ID or by their username Identifier Yes

Outputs

Output Description Type
error Error message if the operation failed str
id User ID str
username_ User username str
name_ User name str
data Complete user data Dict[str, Any]
included Additional data requested via expansions Dict[str, Any]

Possible use case

Profile Verification: Look up a user's profile to verify their identity or check their account details before engaging.

User Research: Gather information about a specific account for competitive analysis or influencer research.

Account Validation: Verify that a username or user ID exists and is active before performing other operations.


Twitter Get Users

What it is

This block retrieves information about multiple Twitter users.

How it works

This block queries the Twitter API v2 to retrieve detailed information about multiple users in a single request. You can look up users by their Twitter IDs or usernames (handles), making it efficient for batch operations.

The block uses Tweepy with OAuth 2.0 authentication and supports expansions for additional data like pinned tweets. Returns arrays of user IDs, usernames, display names, and complete user data objects.

Inputs

Input Description Type Required
expansions Choose what extra information you want to get with user data. Currently only 'pinned_tweet_id' is available to see a user's pinned tweet. UserExpansionsFilter No
tweet_fields Select what tweet information you want to see in pinned tweets. This only works if you select 'pinned_tweet_id' in expansions above. TweetFieldsFilter No
user_fields Select what user information you want to see, like username, bio, profile picture, etc. TweetUserFieldsFilter No
identifier Choose whether to identify users by their unique Twitter IDs or by their usernames Identifier Yes

Outputs

Output Description Type
error Error message if the operation failed str
ids User IDs List[str]
usernames_ User usernames List[str]
names_ User names List[str]
data Complete users data List[Dict[str, Any]]
included Additional data requested via expansions Dict[str, Any]

Possible use case

Batch Profile Lookup: Retrieve profile information for a list of users at once, such as all participants in a conversation.

Influencer Analysis: Gather profile data for multiple influencers in a specific niche for comparison.

Follow List Enrichment: Get detailed information about accounts in your following or followers list.