Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.x.com/llms.txt

Use this file to discover all available pages before exploring further.

The User Search endpoint lets you search for users by keyword. Find users by name, username, or content in their bio.

Overview

Keyword search

Search by name, username, or bio

Discover users

Find relevant accounts

Endpoint

MethodEndpointDescription
GET/2/users/searchSearch for users

Example request

curl "https://api.x.com/2/users/search?\
query=python%20developer&\
user.fields=description,verified,public_metrics" \
  -H "Authorization: Bearer $BEARER_TOKEN"

Example response

{
  "data": [
    {
      "id": "1234567890",
      "name": "Python Developer",
      "username": "pythondev",
      "description": "Building cool things with Python",
      "verified": false,
      "public_metrics": {
        "followers_count": 5000,
        "following_count": 200,
        "tweet_count": 1500
      }
    }
  ],
  "meta": {
    "result_count": 1
  }
}

Getting started

Prerequisites

User lookup

Look up users by ID or username

API Reference

Full endpoint documentation