---
title: "Retrieve multiple users by their usernames"
method: POST
path: "/getByUsernames"
---

# Retrieve multiple users by their usernames

`POST /getByUsernames`

This function fetches multiple users from X using their usernames. It allows for retrieving information about up to 100 users in a single request, with optional expansions for additional data. The function returns detailed user information including profile data and public metrics.

## Request body

- object
  - `body` object — Body of the getByUsernames sls call
    - `arguments` unknown[], required
      - unknown
    - `auth` object — Authentication object
      - `strategy` 'apikey' — Authentication strategy
      - `variables` unknown[] — Variables for the authentication strategy
        - unknown
    - `packageName` string — @microfox/twitter

## Response `200`

Successful response with user data

- object
  - `data` object[], required
    - `id` string, required — The unique identifier of the user
    - `name` string, required — The name of the user
    - `username` string, required — The username of the user
    - `created_at` string, date-time — The creation time of the user's account
    - `protected` boolean — Whether the user's tweets are protected
    - `profile_image_url` string — The URL of the user's profile image
    - `description` string — The user's bio
    - `location` string — The user's location
    - `url` string — The user's profile URL
    - `verified` boolean — Whether the user is verified
    - `verified_type` string — The type of verification the user has
    - `public_metrics` object
      - `followers_count` integer — The number of followers the user has
      - `following_count` integer — The number of users the user is following
      - `tweet_count` integer — The number of tweets the user has posted
      - `listed_count` integer — The number of lists the user is included in
  - `errors` object[]
    - `detail` string — A detailed description of the error
    - `status` integer — The HTTP status code of the error
    - `title` string — The title of the error
    - `type` string — The type of the error

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

[API](https://skmtc.net/microfox-ai/apis/microfox-x-sdk-api.md) · [All operations](https://skmtc.net/microfox-ai/apis/microfox-x-sdk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/microfox-ai/microfox-x-sdk-api/versions/329b4bca235b/schema)
