---
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

## Changes

- **2025-05-29** `472f3db364d0` — 2 warning, 2 info
  - removed the optional property `error` from the response with the `400` status
  - removed the optional property `error` from the response with the `500` status
  - added the required property `errors` to the response with the `400` status
  - added the required property `errors` to the response with the `500` status
- **2025-05-29** `ec42d4a27567` — 1 breaking, 1 warning, 4 info
  - the `data` response's property type/format changed from `any`/`` to `array`/`` for status `200`
  - removed the optional property `success` from the response with the `200` status
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `500`
  - …2 more
- **2025-05-28** `9a6d6c9f0b84` — 4 breaking, 1 warning, 1 info
  - removed the media type `application/json` for the response with the status `400`
  - removed the media type `application/json` for the response with the status `500`
  - the response property `data` became optional for the status `200`
  - the `data` response's property type/format changed from `array`/`` to `any`/`` for status `200`
  - …2 more

[Change history](https://skmtc.dev/microfox-ai/apis/microfox-x-sdk-api/changes/getByUsernames/post.md)

---

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