フォロー関係の確認
source_user_name が target_user_name をフォローしているか(following)、target_user_name が source_user_name をフォローしているか(followed_by)を確認します。1 回のリクエストで双方向の関係と、両ユーザーのユーザー名・ユーザー ID を返します。料金: $0.05 / 1,000 回。
APIリファレンスに戻る
/Followers & Following Endpoints
GET
/twitter/user/check_follow_relationshipAPI 認証
AuthorizationBearer token · header必須TwexAPIのグローバル認証トークン (Bearer Token)。ヘッダーに含める必要があります:Authorization: Bearer <YOUR_TWEXAPI_KEY>。
クエリパラメータ
source_user_namestring必須ソースユーザーのユーザー名(@ の有無は問いません)。
matches ^\s*@?[A-Za-z0-9_]{1,15}\s*$
target_user_namestring必須ターゲットユーザーのユーザー名(@ の有無は問いません)。
matches ^\s*@?[A-Za-z0-9_]{1,15}\s*$
レスポンス
200双方向のフォロー関係
codeinteger必須msgstring必須dataCheckFollowRelationshipData必須プロパティを表示プロパティを非表示
source_user_namestring必須ソースユーザーのユーザー名(X が返す表記)。
source_user_idstring | any必須ソースユーザーのユーザー ID。
プロパティを表示プロパティを非表示
Any of:
string
stringany
anytarget_user_namestring必須ターゲットユーザーのユーザー名(X が返す表記)。
target_user_idstring | any必須ターゲットユーザーのユーザー ID。
プロパティを表示プロパティを非表示
Any of:
string
stringany
anyfollowingboolean必須ソースユーザーがターゲットユーザーをフォローしているかどうか。
followed_byboolean必須ターゲットユーザーがソースユーザーをフォローしているかどうか。
400ユーザー名が未指定または無効です
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any401認証失敗
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any403ユーザーが凍結されているか、認証またはクォータが拒否されました
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any404いずれかのユーザーが見つかりません
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any429レート制限
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any500サーバーエラー
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any502上流サービスエラー
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any503サービス一時利用不可
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any504上流リクエストのタイムアウト
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any⚡インタラクティブテストGET
⚡インタラクティブテスト / Try APIGETLive Console
🌐対象サーバー:
https://api.twexapi.io● 本番環境レディ
🔍
公開データ取得(TwexAPIキーのみ、Twitter Cookie不要)
本エンドポイントは公開Twitterデータの検索・取得用です。TwitterアカウントやCookieは一切不要です!下記の「API認証」に TwexAPIプラットフォームキー (Bearer Token) を入力するだけで即座にテストできます。
🔑API 認証
⚙️リクエストパラメータ (2)
📡
暂无响应数据
请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。
リクエスト例
curl -X GET "https://api.twexapi.io/twitter/user/check_follow_relationship?source_user_name=elonmusk&target_user_name=X" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.twexapi.io/twitter/user/check_follow_relationship?source_user_name=elonmusk&target_user_name=X", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});import requests
response = requests.get(
"https://api.twexapi.io/twitter/user/check_follow_relationship?source_user_name=elonmusk&target_user_name=X",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)レスポンス例
{
"code": 200,
"msg": "success",
"data": {
"source_user_name": "elonmusk",
"source_user_id": "44196397",
"target_user_name": "X",
"target_user_id": "783214",
"following": true,
"followed_by": false
}
}{
"code": 400,
"msg": "Validation error: querystring.target_user_name: Field required",
"data": null
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 404,
"msg": "X user was not found. (50)",
"data": null
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}