Sand AISand AI MAGI-2MAGI-2 が SandBase に登場しました: ネイティブ音声付き 1080p 動画今すぐ試す

Twitter (X) User Profile

APIドキュメント
https://api.sandbase.ai/v1/api/twitter/web/user-profile

Get a Twitter / X user profile by screen name or user ID: name, bio, follower and following counts, post and media counts, verification and creation date.

料金
$0.001USD / 回
メソッド
POST
レスポンス
JSON
パラメータ
必須 0 件 · 任意 2 件
毎日 100 回まで無料1日あたり最初の 100 回は無料です(組織内で共有)· 00:00 UTC にリセットされます。それ以降は従量課金です。

プレイグラウンド

入力
User ID, for example: 44196397, if the user ID is used, the username will be ignored, only one of them can be selected.
Screen Name, for example: elonmusk, can be obtained from the user's homepage link, for example: elonmusk in https://twitter.com/elonmusk
出力例
レスポンスoutputs · 548 B · 26 行
[
  {
    "data": {
      "affiliates": null,
      "avatar": null,
      "blue_verified": null,
      "business_account": null,
      "created_at": null,
      "desc": null,
      "friends": null,
      "header_image": null,
      "id": null,
      "location": null,
      "media_count": null,
      "name": null,
      "pinned_tweet_ids_str": null,
      "profile": null,
      "protected": null,
      "rest_id": null,
      "status": "notfound",
      "statuses_count": null,
      "sub_count": null,
      "verification_type": null
    }
  }
]

例

例を選択すると、その入力と結果がプレイグラウンドに読み込まれます。

API README

Twitter (X) User Profile API

Returns the public profile of a Twitter / X account: name, bio, location, website, verification status, creation date and activity counts. Send either screen_name (for example NASA) or the numeric rest_id.

Use cases

  • Review displayed verification fields as profile signals; they do not independently verify identity or a partnership.
  • Resolve a handle to its stable numeric rest_id for use in other calls.
  • Record sub_count and statuses_count on a schedule to chart account growth.
  • Pull the bio, location, website and banner image to fill a profile card.

Request

curl -X POST "https://api.sandbase.ai/v1/api/twitter/web/user-profile" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"screen_name": "NASA"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
rest_idintegerNoUser ID, for example: 44196397, if the user ID is used, the username will be ignored, only one of them can be selected.
screen_namestringNoScreen Name, for example: elonmusk, can be obtained from the user's homepage link, for example: elonmusk in https://twitter.com/elonmusk

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "affiliates": [],
  "avatar": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg",
  "blue_verified": true,
  "business_account": {
    "affiliates_count": 85
  },
  "created_at": "Wed Dec 19 20:20:32 +0000 2007",
  "desc": "Making the seemingly impossible, possible. ✨",
  "friends": 115,
  "header_image": "https://pbs.twimg.com/profile_banners/11348282/1788992290",
  "id": "11348282",
  "location": "Pale Blue Dot",
  "media_count": 28223,
  "name": "NASA"
}

Response fields

FieldMeaning
rest_id / idNumeric user ID of the account, returned as a string. It stays the same if the handle changes.
name / profileDisplay name of the account. In this response both fields hold NASA.
descBio text of the account.
sub_countFollower count of the account.
friendsNumber of accounts this user follows.
statuses_count / media_countTotal number of posts and total number of media posts for the account.
blue_verified / verification_typeblue_verified is a displayed verification flag, not independent proof of payment or identity. verification_type gives the kind of verification, such as Government.
created_atDate and time the account was created, in the format Wed Dec 19 20:20:32 +0000 2007.
pinned_tweet_ids_str[]IDs of the tweets pinned to the profile, as strings.
avatar / header_image / website / locationProfile image URL, banner image URL, website link and free-text location from the profile.

Notes

  • Send only one input. If you send rest_id, the API ignores screen_name.
  • Take screen_name from the profile URL. For https://twitter.com/elonmusk, use elonmusk.
  • Pass an ID from pinned_tweet_ids_str[] to Twitter Tweet Detail to read the pinned post.
  • Reading posts is a separate task; inspect the selected endpoint before making another request.

Pricing

$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Read one profile by a selected handle

Send screen_name with a bare handle, such as NASA, when that is the account identifier you have. The alternative rest_id is an integer; it is not the camel-case restId string used by the other route. Choose one identifier. The contract says rest_id overrides screen_name when both are sent, so do not combine a new handle with an unrelated saved ID.

The selected full saved example was created on August 20, 2026 with an empty input object. Its business status is notfound and its identity and counters are null. It is negative evidence, not a successful NASA lookup. The NASA-shaped response in the shortened README is a separate, undated reference. A valid teaching body with screen_name does not retroactively turn that saved empty-input request into a tested success.

Check the returned string rest_id or id and preserve the selected handle with it. Reject missing identity and conflicting returned IDs before storing a successful record. A handle can change; do not merge unrelated profiles merely because display names match. Store exact IDs as strings. For JavaScript integer rest_id inputs, reject unsafe integers before serialization; converting an already rounded Number to a string cannot recover the original ID.

The reference describes sub_count as followers and friends as following. Keep missing counts unknown and retain observation time; one profile cannot measure growth, reach or campaign results. Free-text location is not verified geography, and blue_verified or verification_type does not independently verify identity, partnership or payment history. Optional affiliates and business_account structures differ across the two route examples, so preserve them instead of enforcing one shared nested shape.

Need an exact large ID as a string? Separately select User Detail and review its price. This task does not retrieve pinned posts, followers, media or a timeline, and it does not contact the account.

Give your agent one known-account task

Choose a handle lookup or an exact-ID lookup before running. A connected agent needs that identifier, the selected endpoint and the result you want. For a new integration, share the setup Skill, Markdown quickstart and chosen task. Keep SANDBASE_API_KEY locally and use POST /v1/api/ with Bearer authentication.

Validate completed SandBase status and an object at outputs[0].data, then check the business result. The selected references describe flat profile fields, not a nested user or data.data wrapper. An explicit status notfound or missing usable identity is not a successful empty profile. Do not invent a universal code/message success flag; preserve unknown optional fields rather than coercing them into zero or false.

Pricing checked on 2026-11-08: Web User Profile lists $0.001 per call; User Detail lists $0.014286 per call. Both show eligibility for 100 daily calls shared across eligible data APIs in the organization, resetting at 00:00 UTC. Eligibility is not remaining allowance. Check current pricing and do not silently retry against the other, differently priced route. No new business request was made for this revision. The X/Twitter Python profile guide distinguishes historical illustrations, public references and offline validation.

さらに探索

関連 APIs

すべての APIs
API価格レスポンス
Twitter$0.001 / 回JSON
Twitter$0.001 / 回JSON
Twitter$0.001 / 回JSON
Twitter$0.001 / 回JSON
Twitter$0.001 / 回JSON
Twitter$0.001 / 回JSON

ガイド:X API alternative: pay per call, not per postBest Twitter API in 2026: X API Pricing Compared

質問

FAQ

Twitter (X) User Profile API はどのように使いますか?

Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/twitter/web/user-profile に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。

Twitter (X) User Profile API の料金はいくらですか?

1回あたり $0.001。各組織には UTC 日ごとに 100 回の無料呼び出しが付与され、この API を含む対象の SandBase API 全体で共有されます。それ以降は、各呼び出しが SandBase 残高からこの料金で課金されます。サブスクリプションはありません。

Twitter (X) User Profile API はどのパラメータを受け付けますか?

このプロフィールリクエストでは、screen_name を文字列として、または rest_id を整数として選択してください。スキーマ上は両方とも個別に任意ですが、最初の空のリクエストではアカウントは選択されません。両方を指定した場合は rest_id が優先され、screen_name は無視されます。意図した識別子を1つ送信してください。

Twitter (X) User Profile API は何を返しますか?

同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。

Twitter の開発者アカウントまたは API key は必要ですか?

いいえ。Twitter (X) User Profile は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Twitter の API アクセスを別途申請する必要はありません。

screen_name、rest_id、どちらを送ればよいですか?

どちらか一方を選んでください。screen_name は文字列の handle、rest_id は整数です。両方送信された場合、契約上は rest_id が優先されます。個別フィールドが任意でも、空の最初の body で動作するとは限りません。シリアライズ前に安全でない JavaScript の整数 ID は拒否してください。丸められた数値は後から修復できません。

保存された空入力の例は、profile リクエストの成功を証明しますか?

いいえ。8月20日の保存済み例は status notfound で、identity/count フィールドは null です。NASA 風の README は別の、日付のない参考資料です。完了した SandBase のエンベロープが、notfound の business response を成功した profile に変えることはありません。

profile のカウンターやバッジは、オーディエンスの質やパートナーシップを測定しますか?

いいえ。フォロワー/フォロー中のカウンタ、null 値、観測時刻は保持してください。1 回のスナップショットでは増加やリーチは証明できず、認証フラグや組織ラベルも本人確認や提携関係を独立に裏付けるものではありません。この読み取りではアカウントには接続しません。