Class Client
- Namespace
- Twikit
- Assembly
- Twikit.dll
Twitter/X API と対話するクライアント。すべてのメソッドは非同期です。
public class Client : IRequestClient, IRawHttpSession, IDisposable
- Inheritance
-
Client
- Implements
- Inherited Members
Examples
var client = new Client("ja");
client.SetCookies(new Dictionary<string, string> { ["auth_token"] = "...", ["ct0"] = "..." });
if (!await client.IsLoggedInAsync()) throw new Exception("Cookie が無効です");
var tweets = await client.SearchTweetAsync("python", "Latest");
Remarks
パスワードではなく Cookie でログインしてください。 X は LoginAsync(string, string, string?, string?, string?, bool, Func<string, Task<string>>?) が使う
オンボーディングフローを廃止しています。ブラウザでログインしたセッションの auth_token と
ct0 を SetCookies(IDictionary<string, string>, bool) に渡してください。
Python 版の impersonate=(curl_cffi によるブラウザ TLS フィンガープリントの偽装)に
相当する仕組みは .NET 標準にはありません。必要なら handler 引数に独自の
HttpMessageHandler を渡してください(Cookie とリダイレクトはこのクラスが自前で
処理するので、ハンドラー側では無効にしておきます)。
Constructors
Client(string, string?, CaptchaSolver?, string?, HttpMessageHandler?, TimeSpan?)
public Client(string language = "en-US", string? proxy = null, CaptchaSolver? captchaSolver = null, string? userAgent = null, HttpMessageHandler? handler = null, TimeSpan? timeout = null)
Parameters
languagestringAPI リクエストで使う言語コード。
proxystringプロキシの URL(例: 'http://0.0.0.0:0000'、'socks5://...')。
captchaSolverCaptchaSolverCapsolver など。
userAgentstringUser-Agent(省略時は Safari 相当)。
handlerHttpMessageHandler独自の HttpMessageHandler。HttpClientHandler / SocketsHttpHandler なら Cookie と自動リダイレクトをこちらで無効化します。
timeoutTimeSpan?HTTP のタイムアウト(既定 100 秒)。
Fields
LoginRetiredMessage
パスワードログインが X に対して動作しない理由。
public const string LoginRetiredMessage = "X no longer serves the LoginFlow onboarding task this method drives; it answers code 366, \"flow name LoginFlow is currently not accessible\". Measured against live x.com: /i/flow/login redirects to /i/jf/onboarding/web and the site now posts to /i/jfapi/onboarding/web/actions/begin_login, which requires a ~5 KB $castle_token produced by obfuscated in-page JavaScript, and offers passkey/WebAuthn as a first-factor path. None of that is reachable from a plain HTTP client. Authenticate with cookies instead - see Client.SetCookies and Client.LoadCookies."
Field Value
Properties
BaseHeaders
Twitter API リクエストの基本ヘッダー(呼び出しごとに新しい辞書)。
public Dictionary<string, string> BaseHeaders { get; }
Property Value
CaptchaSolver
captcha ソルバー。
public CaptchaSolver? CaptchaSolver { get; }
Property Value
ClientTransaction
X-Client-Transaction-Id のハンドシェイク状態。
public ClientTransaction ClientTransaction { get; }
Property Value
Cookies
Cookie ジャー。
public CookieContainer Cookies { get; }
Property Value
Gql
GraphQL エンドポイント層。
public GqlClient Gql { get; }
Property Value
Http
実際に通信する HttpClient。
public HttpClient Http { get; }
Property Value
Jetfuel
Jetfuel(クリエイタースタジオなどの server-driven UI)エンドポイント層。
public JetfuelClient Jetfuel { get; }
Property Value
Language
API リクエストで使う言語コード。
public string Language { get; set; }
Property Value
Proxy
プロキシの URL(コンストラクターで指定したもの)。
public string? Proxy { get; }
Property Value
RateLimitRemaining
直近のレスポンスに含まれる、現在のウィンドウの残りリクエスト数。
public int? RateLimitRemaining { get; }
Property Value
- int?
RateLimitReset
現在のレート制限ウィンドウがリセットされる Unix 時刻。
public long? RateLimitReset { get; }
Property Value
- long?
Spaces
X スペース(Spaces)。
public Spaces Spaces { get; }
Property Value
UserAgent
User-Agent。
public string UserAgent { get; }
Property Value
V11
v1.1 エンドポイント層。
public V11Client V11 { get; }
Property Value
Methods
AddListMemberAsync(string, string)
リストにユーザーを追加します。
public Task<TwitterList> AddListMemberAsync(string listId, string userId)
Parameters
Returns
AddMembersToGroupAsync(string, IList<string>)
グループにメンバーを追加します。
public Task<HttpResponseMessage> AddMembersToGroupAsync(string groupId, IList<string> userIds)
Parameters
Returns
AddReactionToMessageAsync(string, string, string)
メッセージにリアクション(絵文字)を付けます。
public Task<HttpResponseMessage> AddReactionToMessageAsync(string messageId, string conversationId, string emoji)
Parameters
messageIdstringメッセージの ID。
conversationIdstring会話の ID(グループ ID、または
相手ID-自分ID)。emojistring付ける絵文字。
Returns
BlockUserAsync(string)
ユーザーをブロックします。
public Task<User> BlockUserAsync(string userId)
Parameters
userIdstring
Returns
BookmarkTweetAsync(string, string?)
ツイートをブックマークに追加します。
public Task<HttpResponseMessage> BookmarkTweetAsync(string tweetId, string? folderId = null)
Parameters
Returns
ChangeGroupNameAsync(string, string)
グループ名を変更します。
public Task<HttpResponseMessage> ChangeGroupNameAsync(string groupId, string name)
Parameters
Returns
CheckMediaStatusAsync(string, bool)
アップロードしたメディアの状態を確認します。
public Task<JsonObject> CheckMediaStatusAsync(string mediaId, bool isLongVideo = false)
Parameters
Returns
Exceptions
- NotFoundException
STATUS コマンドはチャンクアップロードにしか存在せず、画像は 1 リクエストで完了して
processing_infoを持たないため 404 になります。
CreateBookmarkFolderAsync(string)
ブックマークフォルダーを作成します(Premium のみ)。
public Task<BookmarkFolder> CreateBookmarkFolderAsync(string name)
Parameters
namestring
Returns
CreateDraftTweetAsync(string, IList<string>?, string?, string?)
下書きを保存します。
public Task<string> CreateDraftTweetAsync(string text = "", IList<string>? mediaIds = null, string? attachmentUrl = null, string? inReplyToTweetId = null)
Parameters
textstring本文。
mediaIdsIList<string>添付するメディア ID の一覧。
attachmentUrlstring引用するツイートの URL。
inReplyToTweetIdstring返信先のツイート ID。
Returns
Remarks
CreateScheduledTweetAsync(long, string, IList<string>?) と同じ post_tweet_request を送ります(2026-10-23 に Web クライアントで確認)。
投稿するには PostDraftTweetAsync(DraftTweet) を使います。
Exceptions
- CouldNotTweetException
X が下書きの ID を返さなかった。
CreateGroupAsync(IList<string>, string, string?)
最初のメッセージを送ってグループ会話を作成します。X に「グループ作成」の呼び出しは無く、 複数の宛先に送った DM がグループになります。宛先が 1 人だと通常の 1 対 1 の会話になるので、2 人以上を渡してください。
public Task<Group> CreateGroupAsync(IList<string> userIds, string text, string? mediaId = null)
Parameters
Returns
CreateListAsync(string, string, bool)
リストを作成します。
public Task<TwitterList> CreateListAsync(string name, string description = "", bool isPrivate = false)
Parameters
Returns
CreateMediaMetadataAsync(string, string?, IEnumerable<string>?)
アップロードしたメディアにメタデータ(代替テキスト、センシティブ警告)を付けます。
public Task<HttpResponseMessage> CreateMediaMetadataAsync(string mediaId, string? altText = null, IEnumerable<string>? sensitiveWarning = null)
Parameters
mediaIdstringメディア ID。
altTextstring代替テキスト。
sensitiveWarningIEnumerable<string>'adult_content'、'graphic_violence'、'other' の一覧。
Returns
CreatePollAsync(IList<string>, int)
投票を作成し、card URI を返します。
public Task<string> CreatePollAsync(IList<string> choices, int durationMinutes)
Parameters
Returns
CreateScheduledTweetAsync(long, string, IList<string>?)
予約投稿を作成します。
public Task<string> CreateScheduledTweetAsync(long scheduledAt, string text = "", IList<string>? mediaIds = null)
Parameters
Returns
CreateTweetAsync(string, IList<string>?, string?, string?, string?, string?, string?, bool, bool, JsonArray?, string?)
ツイートを作成します。
public Task<Tweet> CreateTweetAsync(string text = "", IList<string>? mediaIds = null, string? pollUri = null, string? replyTo = null, string? conversationControl = null, string? attachmentUrl = null, string? communityId = null, bool shareWithFollowers = false, bool isNoteTweet = false, JsonArray? richtextOptions = null, string? editTweetId = null)
Parameters
textstring本文。
mediaIdsIList<string>添付するメディア ID の一覧(UploadMediaAsync(string, bool, double?, string?, string?, bool) で取得)。
pollUristring添付する投票の URI(CreatePollAsync(IList<string>, int) で取得)。
replyTostring返信先ツイートの ID。
conversationControlstring返信できる相手: 'followers'(フォロワーのみ)、'verified'(認証済みのみ)、'mentioned'(メンションした相手のみ)。
attachmentUrlstring引用するツイートの URL。
communityIdstring投稿先コミュニティの ID。
shareWithFollowersboolコミュニティ投稿をフォロワーにも共有するか。
isNoteTweetbool280 文字を超える長文ツイートにするか(Premium のみ)。
richtextOptionsJsonArray装飾オプション(Premium のみ)。
editTweetIdstring編集するツイートの ID(Premium のみ)。
Returns
Exceptions
- DuplicateTweetException
重複ツイート。
- CouldNotTweetException
X が投稿を拒否した(日次上限など。メッセージは X のものをそのまま含みます)。
DeleteAllBookmarksAsync()
すべてのブックマークを削除します。
public Task<HttpResponseMessage> DeleteAllBookmarksAsync()
Returns
DeleteBookmarkAsync(string)
ツイートをブックマークから削除します。
public Task<HttpResponseMessage> DeleteBookmarkAsync(string tweetId)
Parameters
tweetIdstring
Returns
DeleteBookmarkFolderAsync(string)
ブックマークフォルダーを削除します。
public Task<HttpResponseMessage> DeleteBookmarkFolderAsync(string folderId)
Parameters
folderIdstring
Returns
DeleteDmAsync(string)
DM を削除します。
public Task<HttpResponseMessage> DeleteDmAsync(string messageId)
Parameters
messageIdstring
Returns
DeleteDmConversationAsync(string)
ログイン中のアカウントの受信箱から会話を削除します。他の参加者側には残ります(X 自体の挙動と同じ)。
public Task<HttpResponseMessage> DeleteDmConversationAsync(string conversationId)
Parameters
conversationIdstring
Returns
DeleteDraftTweetAsync(string)
下書きを 1 件削除します(Web クライアントが投稿後に呼ぶ単数形の DeleteDraftTweet)。
public Task<HttpResponseMessage> DeleteDraftTweetAsync(string draftTweetId)
Parameters
draftTweetIdstring
Returns
Exceptions
- TwitterException
X が
drafttweet_delete: "Done"を返さなかった。
DeleteDraftTweetsAsync(IEnumerable<string>)
下書きをまとめて削除します。
public Task<HttpResponseMessage> DeleteDraftTweetsAsync(IEnumerable<string> draftTweetIds)
Parameters
draftTweetIdsIEnumerable<string>削除する下書きの ID。
Returns
Exceptions
- TwitterException
X が
draft_tweets_batch_delete: "Done"を返さなかった。
DeleteListAsync(string)
リストを削除します。
public Task<HttpResponseMessage> DeleteListAsync(string listId)
Parameters
listIdstring
Returns
DeleteListBannerAsync(string)
リストのバナー画像を削除します。
public Task<HttpResponseMessage> DeleteListBannerAsync(string listId)
Parameters
listIdstring
Returns
DeleteRetweetAsync(string)
リツイートを取り消します。
public Task<HttpResponseMessage> DeleteRetweetAsync(string tweetId)
Parameters
tweetIdstringリツイートされた元ツイートの ID(リツイート自身の ID ではありません)。
Returns
Remarks
X は何も取り消されなくても 200 を返し、本文は渡した ID を返すだけです。タイムラインから得た リツイートの ID を渡すと黙って何も起きません。RetweetedTweet の ID を使ってください。
DeleteScheduledTweetAsync(string)
予約投稿を削除します。
public Task<HttpResponseMessage> DeleteScheduledTweetAsync(string tweetId)
Parameters
tweetIdstring
Returns
DeleteTweetAsync(string)
ツイートを削除します。
public Task<HttpResponseMessage> DeleteTweetAsync(string tweetId)
Parameters
tweetIdstring
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
EditBookmarkFolderAsync(string, string)
ブックマークフォルダーの名前を変更します。
public Task<BookmarkFolder> EditBookmarkFolderAsync(string folderId, string name)
Parameters
Returns
EditListAsync(string, string?, string?, bool?)
リストの情報を編集します。
public Task<TwitterList> EditListAsync(string listId, string? name = null, string? description = null, bool? isPrivate = null)
Parameters
Returns
EditListBannerAsync(string, string)
リストのバナー画像を変更します。
public Task<HttpResponseMessage> EditListBannerAsync(string listId, string mediaId)
Parameters
Returns
FavoriteTweetAsync(string)
ツイートをいいねします。
public Task<HttpResponseMessage> FavoriteTweetAsync(string tweetId)
Parameters
tweetIdstring
Returns
FollowUserAsync(string)
ユーザーをフォローします。
public Task<User> FollowUserAsync(string userId)
Parameters
userIdstring
Returns
GetAboutAccountAsync(string)
ユーザーの「このアカウントについて」パネル(account_based_in、source、username_changes など)を取得します。
表示する情報が無いアカウントでは空のオブジェクトです。
public Task<JsonObject> GetAboutAccountAsync(string screenName)
Parameters
screenNamestring
Returns
Exceptions
- UserNotFoundException
ユーザーが存在しない。
GetAsync(string, RequestOptions?)
public Task<ApiResponse> GetAsync(string url, RequestOptions? options = null)
Parameters
urlstringoptionsRequestOptions
Returns
GetAvailableLocationsAsync()
トレンドを取得できる地域の一覧を取得します。
public Task<List<Location>> GetAvailableLocationsAsync()
Returns
GetBlockedUsersAsync(int, string?)
ログイン中のユーザーがブロックしているアカウントを取得します。
public Task<Result<User>> GetBlockedUsersAsync(int count = 20, string? cursor = null)
Parameters
Returns
GetBookmarkFoldersAsync(string?)
ブックマークフォルダーの一覧を取得します。
public Task<Result<BookmarkFolder>> GetBookmarkFoldersAsync(string? cursor = null)
Parameters
cursorstring
Returns
GetBookmarksAsync(int, string?, string?)
ブックマークを取得します。
public Task<Result<Tweet>> GetBookmarksAsync(int count = 20, string? cursor = null, string? folderId = null)
Parameters
Returns
GetCommunitiesTimelineAsync(int, string?)
コミュニティタイムラインのツイートを取得します。
public Task<Result<Tweet>> GetCommunitiesTimelineAsync(int count = 20, string? cursor = null)
Parameters
Returns
GetCommunityAsync(string)
ID を指定してコミュニティを取得します。
public Task<Community> GetCommunityAsync(string communityId)
Parameters
communityIdstring
Returns
Exceptions
- NotFoundException
コミュニティが存在しない。
GetCommunityMembersAsync(string, int, string?)
コミュニティのメンバーを取得します。
public Task<Result<CommunityMember>> GetCommunityMembersAsync(string communityId, int count = 20, string? cursor = null)
Parameters
Returns
GetCommunityModeratorsAsync(string, int, string?)
コミュニティのモデレーターを取得します。
public Task<Result<CommunityMember>> GetCommunityModeratorsAsync(string communityId, int count = 20, string? cursor = null)
Parameters
Returns
GetCommunityNoteAsync(string)
ID を指定してコミュニティノートを取得します。
public Task<CommunityNote> GetCommunityNoteAsync(string noteId)
Parameters
noteIdstring
Returns
Exceptions
- NotFoundException
ノートが存在しない。
- TwitterException
ノート ID が不正。
GetCommunityNotesAsync(string)
投稿に提案されたコミュニティノートをすべて取得します(BirdwatchFetchNotes)。
public Task<List<CommunityNote>> GetCommunityNotesAsync(string tweetId)
Parameters
tweetIdstring投稿の ID。
Returns
- Task<List<CommunityNote>>
ノートの一覧。誰もノートを書いていなければ空。
Remarks
「誤解を招く」側と「誤解を招かない」側の両方、表示前(NeedsMoreRatings)のものも含みます。
各ノートは RatingStatus を持ち、RateAsync(string, IEnumerable<string>?, IEnumerable<string>?, string, bool) で評価できます。
Exceptions
- NotFoundException
投稿が存在しないか見られない。
GetCommunityNotesProfileAsync(string?)
コミュニティノートの協力者プロフィール(x.com/i/communitynotes/u/<alias> の評価・執筆の統計)を取得します。
public Task<CommunityNotesProfile> GetCommunityNotesProfileAsync(string? alias = null)
Parameters
aliasstring協力者エイリアス(
considerate-vine-conureなど)。null なら自分。
Returns
Remarks
alias を省略すると自分のプロフィールで、参加状態と執筆解放までに必要な評価の効果も入ります。
RatingImpact と WritingImpact は Web クライアントと同じ式で計算します。
Exceptions
- TwitterException
自分のアカウントに協力者エイリアスが無い。
- NotFoundException
そのエイリアスのプロフィールが無い。
GetCommunityNotesTimelineAsync(string, int, string?)
コミュニティノートのホーム(x.com/i/communitynotes)の 1 タブを取得します:
評価が必要な投稿、新しいノート、「役に立った」と評価済みのノート。
public Task<Result<Tweet>> GetCommunityNotesTimelineAsync(string tab = "needs_your_help", int count = 20, string? cursor = null)
Parameters
tabstringCommunityNotesTimelineTab のいずれか。
countintnew/rated_helpfulのページサイズ。needs_your_helpは約 15 件の固定ピックで無視されます。cursorstringページ送り用カーソル。
Returns
Remarks
結果は投稿の一覧です。X がその投稿に対して選んだノートは CommunityNote(ID と本文)に入り、
投稿の全ノートを評価できる形で取るには GetCommunityNotesAsync() を使います。
needs_your_help は BirdwatchFetchGlobalTimeline、残り 2 タブはその応答が示すタイムライン ID での
GenericTimelineById です。記録時(2026-10-23)は 3 タブともカーソル無しで終端していたため、NextAsync は通常 null です。
削除済み・非公開で取得できない投稿(TweetUnavailable)は含まれません。
Exceptions
- ArgumentException
X が提供していないタブ名。
GetCommunityTweetsAsync(string, string, int, string?)
コミュニティのツイートを取得します。
public Task<Result<Tweet>> GetCommunityTweetsAsync(string communityId, string tweetType, int count = 40, string? cursor = null)
Parameters
communityIdstringコミュニティの ID。
tweetTypestring'Top'、'Latest'、'Media' のいずれか。
countint取得する件数。
cursorstringページ送り用カーソル。
Returns
GetContributorCommunityNotesAsync(string?, int, bool, string?)
協力者エイリアスで書かれたノートを新しい順に取得します(BirdwatchFetchContributorNotesSlice)。
alias を省略すると自分のノートです。
public Task<Result<CommunityNote>> GetContributorCommunityNotesAsync(string? alias = null, int count = 10, bool includeDrafts = false, string? cursor = null)
Parameters
aliasstring協力者エイリアス。null なら自分。
countint件数。
includeDraftsbooltrue で自分のプロフィールの「提案」ビュー(未公開の下書きを含む)を要求します。
cursorstringページ送り用カーソル。
Returns
Remarks
まだノートを書いていないアカウントで記録したため、空の形(items: [])しか確認していません。
ノートとして読めない項目はキーを添えた警告(TwikitWarnings)を出して読み飛ばします。
slice_info によるページ送りは配線済みですが未検証です。
GetCookies()
Cookie を名前と値の辞書として取得します。SetCookies(IDictionary<string, string>, bool) に渡せばログイン手続きを省略できます。
public Dictionary<string, string> GetCookies()
Returns
GetCreatorSubscriptionsEligibilityAsync()
クリエイターサブスクリプションの参加条件と、このアカウントの達成状況を取得します。
クリエイタースタジオの /i/jf/creators/subscriptionsv2/eligibility と同じ内容です。
public Task<CreatorEligibility> GetCreatorSubscriptionsEligibilityAsync()
Returns
Remarks
2026-10 時点の条件は「Premium に登録して認証を取得」「認証済みフォロワーが 2,000 人以上」 「過去 3 ヶ月でオーガニックインプレッションが 500 万回以上」「直近 30 日間、X で活動」「18 歳以上」「X Money の対象」。 条件を満たした後のページは未確認なので、その場合は Requirements が空になる可能性があります。
GetCsrfToken()
現在のセッションの Cookie から CSRF トークン(ct0)を取り出します。
public string? GetCsrfToken()
Returns
GetDmHistoryAsync(string, string?)
ユーザーとの DM 履歴を取得します。
public Task<Result<Message>> GetDmHistoryAsync(string userId, string? maxId = null)
Parameters
Returns
GetDmInboxAsync(string?)
DM の受信箱(会話の一覧。中身ではありません)を取得します。
public Task<Result<Conversation>> GetDmInboxAsync(string? cursor = null)
Parameters
cursorstringページ送り用カーソル。
Returns
GetDraftTweetsAsync(bool)
下書き(「未送信ポスト」→「下書き」)の一覧を取得します。
public Task<List<DraftTweet>> GetDraftTweetsAsync(bool ascending = false)
Parameters
ascendingbool古い順に並べるか。既定(false)は Web クライアントと同じ新しい順です。
Returns
- See Also
GetExplorePageAsync()
Explore ページに表示されるトレンドを取得します。
public Task<List<Trend>> GetExplorePageAsync()
Returns
GetFavoritersAsync(string, int, string?)
ツイートをいいねしたユーザーを取得します。
public Task<Result<User>> GetFavoritersAsync(string tweetId, int count = 40, string? cursor = null)
Parameters
Returns
GetFollowersIdsAsync(string?, string?, int, string?)
ユーザーのフォロワーの ID を取得します。
public Task<Result<long>> GetFollowersIdsAsync(string? userId = null, string? screenName = null, int count = 5000, string? cursor = null)
Parameters
Returns
GetFriendsIdsAsync(string?, string?, int, string?)
ユーザーがフォローしているユーザーの ID を取得します。
public Task<Result<long>> GetFriendsIdsAsync(string? userId = null, string? screenName = null, int count = 5000, string? cursor = null)
Parameters
Returns
GetGroupAsync(string)
ID を指定してグループを取得します。
public Task<Group> GetGroupAsync(string groupId)
Parameters
groupIdstring
Returns
GetGroupDmHistoryAsync(string, string?)
グループの DM 履歴を取得します。
public Task<Result<GroupMessage>> GetGroupDmHistoryAsync(string groupId, string? maxId = null)
Parameters
Returns
GetLatestFollowersAsync(string?, string?, int, string?)
最新のフォロワーを取得します(最大 200 件)。
public Task<Result<User>> GetLatestFollowersAsync(string? userId = null, string? screenName = null, int count = 200, string? cursor = null)
Parameters
Returns
GetLatestFriendsAsync(string?, string?, int, string?)
最新のフォロー中ユーザーを取得します(最大 200 件)。v1.1 の friends/list は廃止されたため、 GraphQL の Following エンドポイントを使います。
public Task<Result<User>> GetLatestFriendsAsync(string? userId = null, string? screenName = null, int count = 200, string? cursor = null)
Parameters
Returns
GetLatestTimelineAsync(int, IList<string>?, string?)
ホームタイムライン(Following)を取得します。
public Task<Result<Tweet>> GetLatestTimelineAsync(int count = 20, IList<string>? seenTweetIds = null, string? cursor = null)
Parameters
Returns
GetListAsync(string)
ID を指定してリストを取得します。
public Task<TwitterList> GetListAsync(string listId)
Parameters
listIdstring
Returns
GetListMembersAsync(string, int, string?)
リストのメンバーを取得します。
public Task<Result<User>> GetListMembersAsync(string listId, int count = 20, string? cursor = null)
Parameters
Returns
GetListSubscribersAsync(string, int, string?)
リストの購読者を取得します。
public Task<Result<User>> GetListSubscribersAsync(string listId, int count = 20, string? cursor = null)
Parameters
Returns
GetListTweetsAsync(string, int, string?)
リストのツイートを取得します。
public Task<Result<Tweet>> GetListTweetsAsync(string listId, int count = 20, string? cursor = null)
Parameters
Returns
GetListsAsync(int, string?)
ログイン中のユーザーのリストを取得します。
public Task<Result<TwitterList>> GetListsAsync(int count = 100, string? cursor = null)
Parameters
Returns
GetMutedUsersAsync(int, string?)
ログイン中のユーザーがミュートしているアカウントを取得します。
public Task<Result<User>> GetMutedUsersAsync(int count = 20, string? cursor = null)
Parameters
Returns
GetNotificationsAsync(string, int, string?)
通知を取得します。
public Task<Result<Notification>> GetNotificationsAsync(string type, int count = 40, string? cursor = null)
Parameters
typestring'All'(すべて)、'Verified'(認証済みユーザー関連)、'Mentions'(メンション)のいずれか。
countint取得する件数。
cursorstringページ送り用カーソル。
Returns
GetOriginalContentRewardsEligibilityAsync()
オリジナルコンテンツ報酬プログラム(投稿の収益化)の参加条件と、このアカウントの達成状況を取得します。
クリエイタースタジオの /i/jf/creators/original_content_rewards と同じ内容です。
public Task<CreatorEligibility> GetOriginalContentRewardsEligibilityAsync()
Returns
Remarks
2026-10 時点の条件は「Premium / Premium+ / Premium Business に登録」「18 歳以上」 「認証済みフォロワーが 500 人以上」「過去 90 日間のホームタイムラインの認証済みインプレッションが 50 万回以上(返信は含まれません)」。 数値の条件には現在値(Value)と進捗バー(Progress)が付きます。
GetPlaceAsync(string)
ID を指定して場所を取得します。
public Task<Place> GetPlaceAsync(string id)
Parameters
idstring
Returns
GetPlaceTrendsAsync(long)
指定した WOEID の上位 50 トレンドを取得します。WOEID は GetAvailableLocationsAsync() で取得できます。
public Task<PlaceTrends> GetPlaceTrendsAsync(long woeid)
Parameters
woeidlong
Returns
GetRetweetersAsync(string, int, string?)
ツイートをリツイートしたユーザーを取得します。
public Task<Result<User>> GetRetweetersAsync(string tweetId, int count = 40, string? cursor = null)
Parameters
Returns
GetScheduledTweetsAsync()
予約投稿の一覧を取得します。
public Task<List<ScheduledTweet>> GetScheduledTweetsAsync()
Returns
GetSimilarTweetsAsync(string)
指定したツイートに類似したツイートを取得します(Premium のみ)。
public Task<List<Tweet>> GetSimilarTweetsAsync(string tweetId)
Parameters
tweetIdstring
Returns
GetStreamingSessionAsync(IEnumerable<string>, bool)
ストリーミング API のセッションを取得します。
public Task<StreamingSession> GetStreamingSessionAsync(IEnumerable<string> topics, bool autoReconnect = true)
Parameters
topicsIEnumerable<string>ストリームするトピック(Topic で生成)。
autoReconnectbool切断時に自動で再接続するか。
Returns
Examples
var topics = new HashSet<string>
{
Topic.TweetEngagement("1739617652"),
Topic.DmUpdate("17544932482-174455537996"),
};
var session = await client.GetStreamingSessionAsync(topics);
await foreach (var (topic, payload) in session)
{
if (payload.DmUpdate is { } dm) Console.WriteLine($"{dm.ConversationId}: {dm.UserId} sent a message");
if (payload.TweetEngagement is { } e) Console.WriteLine($"likes: {e.LikeCount}");
}
GetThreadAsync(string)
スレッド内の任意のツイートからスレッド全体を取得します。返信先・ツイート自身・続きを繋ぎ、 他人の返信を除いた投稿者の連鎖を時系列順に返します。
public Task<List<Tweet>> GetThreadAsync(string tweetId)
Parameters
tweetIdstring
Returns
GetTimelineAsync(int, IList<string>?, string?)
ホームタイムライン(For You)を取得します。
public Task<Result<Tweet>> GetTimelineAsync(int count = 20, IList<string>? seenTweetIds = null, string? cursor = null)
Parameters
Returns
GetTrendsAsync(string, int, bool, JsonObject?)
トレンドを取得します。
public Task<List<Trend>> GetTrendsAsync(string category, int count = 20, bool retry = true, JsonObject? additionalRequestParams = null)
Parameters
categorystring'trending'、'for-you'、'news'、'sports'、'entertainment' のいずれか。
countint取得する件数。
retryboolトレンドが取れなかったとき、数回だけ再試行するか。
additionalRequestParamsJsonObjectGraphQL の variables に追加するパラメーター。
Returns
GetTweetByIdAsync(string, string?)
public Task<Tweet> GetTweetByIdAsync(string tweetId, string? cursor = null)
Parameters
Returns
Exceptions
- TweetNotAvailableException
ツイートが存在しない、または見られない。
GetTweetByUrlAsync(string)
URL を指定してツイートを取得します。クエリ文字列、/photo/1 のような末尾パス、
twitter.com / fxtwitter.com 形式のホストも受け付けます。
public Task<Tweet> GetTweetByUrlAsync(string url)
Parameters
urlstring
Returns
GetTweetsByIdsAsync(IEnumerable<string>)
複数の ID を指定してツイートを取得します。
public Task<List<Tweet>> GetTweetsByIdsAsync(IEnumerable<string> ids)
Parameters
idsIEnumerable<string>
Returns
GetUserByIdAsync(string)
ID を指定してユーザーを取得します。
public Task<User> GetUserByIdAsync(string userId)
Parameters
userIdstring
Returns
Exceptions
- TwitterException
ユーザー ID が不正。
- UserUnavailableException
ユーザーが利用できない(凍結など)。
GetUserByScreenNameAsync(string)
スクリーンネームを指定してユーザーを取得します。
public Task<User> GetUserByScreenNameAsync(string screenName)
Parameters
screenNamestring
Returns
Exceptions
- UserNotFoundException
ユーザーが存在しない。
- UserUnavailableException
ユーザーが利用できない(凍結など)。
GetUserFollowersAsync(string, int, string?)
ユーザーのフォロワーを取得します。
public Task<Result<User>> GetUserFollowersAsync(string userId, int count = 20, string? cursor = null)
Parameters
Returns
GetUserFollowersYouKnowAsync(string, int, string?)
知り合いかもしれない共通のフォロワーを取得します。
public Task<Result<User>> GetUserFollowersYouKnowAsync(string userId, int count = 20, string? cursor = null)
Parameters
Returns
GetUserFollowingAsync(string, int, string?)
ユーザーがフォローしているユーザーを取得します。
public Task<Result<User>> GetUserFollowingAsync(string userId, int count = 20, string? cursor = null)
Parameters
Returns
GetUserHighlightsTweetsAsync(string, int, string?)
ユーザーのハイライトツイートを取得します。各ツイートの Highlighted は true になります。
public Task<Result<Tweet>> GetUserHighlightsTweetsAsync(string userId, int count = 20, string? cursor = null)
Parameters
Returns
GetUserListsAsync(string, int, string?)
他のユーザーが所有・購読しているリストを取得します。GetListsAsync(int, string?) はログイン中の アカウントにしか届きませんが、これは誰の公開リストでも読めます。
public Task<Result<TwitterList>> GetUserListsAsync(string userId, int count = 100, string? cursor = null)
Parameters
Returns
GetUserMentionsAsync(string, int, string?)
ユーザーに言及しているツイートを取得します。GetNotificationsAsync(string, int, string?) と違い、 検索なのでログイン中でない任意のアカウントについて使えます。
public Task<Result<Tweet>> GetUserMentionsAsync(string screenName, int count = 20, string? cursor = null)
Parameters
Returns
GetUserSpotlightsAsync(string)
プロフィールにピン留めされたスポットライトモジュール(プロアカウントがタイムラインの上に表示するパネル)を取得します。
public Task<List<JsonNode?>> GetUserSpotlightsAsync(string screenName)
Parameters
screenNamestring
Returns
Exceptions
- UserNotFoundException
ユーザーが存在しない。
GetUserSubscriptionsAsync(string, int, string?)
ユーザーがサブスクライブしているユーザーを取得します。
public Task<Result<User>> GetUserSubscriptionsAsync(string userId, int count = 20, string? cursor = null)
Parameters
Returns
GetUserTweetsAsync(string, string, int, string?)
ユーザーのタイムラインからツイートを取得します。
public Task<Result<Tweet>> GetUserTweetsAsync(string userId, string tweetType, int count = 40, string? cursor = null)
Parameters
userIdstringユーザー ID(GetUserByScreenNameAsync(string) で取得できます)。
tweetTypestring'Tweets'、'Replies'、'Media'、'Likes' のいずれか。
countint取得する件数。
cursorstringページ送り用カーソル。
Returns
Exceptions
- UserUnavailableException
鍵・凍結・削除済みのアカウント。
GetUserVerifiedFollowersAsync(string, int, string?)
ユーザーの認証済みフォロワーを取得します。
public Task<Result<User>> GetUserVerifiedFollowersAsync(string userId, int count = 20, string? cursor = null)
Parameters
Returns
HighlightTweetAsync(string)
ツイートをプロフィールの「ハイライト」タブに追加します。
public Task<HttpResponseMessage> HighlightTweetAsync(string tweetId)
Parameters
tweetIdstringハイライトするツイートの ID。
Returns
Remarks
ハイライトは Premium 機能です。自分のツイートで、かつ有効なサブスクリプションが必要で、それ以外は X が拒否します。
Web クライアントと同じく、tweet_highlights_put.success が true でなければ失敗として扱います。
Exceptions
- TwitterException
X が変更を確認しなかった — Premium でない、自分のツイートでない、または応答に
success: trueが無い。
- See Also
IsLoggedInAsync()
現在の Cookie でまだアカウントを認証できるかを確認します。
public Task<bool> IsLoggedInAsync()
Returns
Remarks
X がセッションをまだ受け付けているかだけを報告します。ロック・凍結されたアカウントも false になります。
IsTweetHighlightedAsync(string)
ツイートが投稿者の「ハイライト」タブに入っているかを X に問い合わせます。
public Task<bool> IsTweetHighlightedAsync(string tweetId)
Parameters
tweetIdstringツイートの ID。
Returns
Remarks
Web クライアントがツイートのメニューを開いたときに走らせるクエリ(HighlightTweetSheetQuery)で、
X がこのフラグを返す唯一のドキュメントです。タイムラインやツイート取得には含まれないため、
Highlighted はこのメソッド(または IsHighlightedAsync())を呼ぶまで null のままです。
Exceptions
- TweetNotAvailableException
X がその ID のツイートを返さなかった(削除済み・非公開・不正な ID)。
JoinCommunityAsync(string)
コミュニティに参加します。
public Task<Community> JoinCommunityAsync(string communityId)
Parameters
communityIdstring
Returns
LeaveCommunityAsync(string)
コミュニティから退出します。
public Task<Community> LeaveCommunityAsync(string communityId)
Parameters
communityIdstring
Returns
LoadCookies(string)
JSON ファイルから Cookie を読み込みます。
public void LoadCookies(string path)
Parameters
pathstring
LoginAsync(string, string, string?, string?, string?, bool, Func<string, Task<string>>?)
アカウントにログインします。
public Task<JsonObject?> LoginAsync(string authInfo1, string password, string? authInfo2 = null, string? totpSecret = null, string? cookiesFile = null, bool enableUiMetrics = true, Func<string, Task<string>>? codeCallback = null)
Parameters
authInfo1stringユーザー名、メールアドレス、電話番号のいずれか。
passwordstringパスワード。
authInfo2string2 つ目の認証情報(任意、推奨)。
totpSecretstring2 段階認証の TOTP シークレット。
cookiesFilestringCookie を保存・読み込みするファイル。存在すればログインを省略します。
enableUiMetricsbool難読化された ui_metrics を評価して送るか。
codeCallbackFunc<string, Task<string>>確認コードや 2FA コードを求められたときに呼ばれるコールバック(既定は標準入力)。
Returns
Remarks
これはもう動作しません。 X はこのメソッドが使うオンボーディングフローを廃止しており、 code 366 "flow name LoginFlow is currently not accessible" を返します。代わりに SetCookies(IDictionary<string, string>, bool) または LoadCookies(string) を使ってください。
LogoutAsync()
ログアウトします。
public Task<ApiResponse> LogoutAsync()
Returns
MuteUserAsync(string)
ユーザーをミュートします。
public Task<User> MuteUserAsync(string userId)
Parameters
userIdstring
Returns
PinTweetAsync(string)
ツイートを自分のプロフィールにピン留めします。
public Task<HttpResponseMessage> PinTweetAsync(string tweetId)
Parameters
tweetIdstringピン留めするツイートの ID。
Returns
Remarks
プロフィールのピンは 1 件だけなので、別のツイートをピン留めすると現在のピンが置き換わります。 ピン留めできるのは自分のツイートだけで、他人のツイートに対して X は「status が見つからない」と答えます。 レート制限はヘッダーの値ではなく pin / unpin それぞれ 100 回です(docs/articles/ratelimits.md の脚注を参照)。
Exceptions
- NotFoundException
ツイートが存在しない、または他のアカウントのもの。
- See Also
PostAsync(string, RequestOptions?)
public Task<ApiResponse> PostAsync(string url, RequestOptions? options = null)
Parameters
urlstringoptionsRequestOptions
Returns
PostDraftTweetAsync(string)
ID で指定した下書きを投稿し、下書きを削除します(PostDraftTweetAsync(DraftTweet))。
public Task<Tweet> PostDraftTweetAsync(string draftTweetId)
Parameters
draftTweetIdstring
Returns
Exceptions
- NotFoundException
その ID の下書きが無い。
PostDraftTweetAsync(DraftTweet)
下書きを投稿し、投稿できたら下書きを削除します。
public Task<Tweet> PostDraftTweetAsync(DraftTweet draft)
Parameters
draftDraftTweet投稿する下書き。
Returns
Remarks
X に「下書きを投稿する」API は無く、Web クライアントは保存されている post_tweet_request(本文、メディア、引用 URL、返信先)から
通常の CreateTweet を送り、続けて DeleteDraftTweet を呼びます(2026-10-23 に確認)。ここでも同じ 2 リクエストを送ります。
投稿は成功したのに削除に失敗したときは、投稿を無かったことにできないので例外にせず TwikitWarnings に警告を流して
投稿したツイートを返します。thread_tweets を持つ下書き(スレッド)は Web クライアントでの送り方が未確認のため、
何も送らずに例外にします。
Exceptions
- TwitterException
下書きがスレッドを含む。
- CouldNotTweetException
投稿できなかった(下書きは残ります)。
RateCommunityNoteAsync(string, string, string, IEnumerable<string>?, IEnumerable<string>?, string, bool)
コミュニティノートを評価します(BirdwatchCreateRating)。
x.com/i/birdwatch/t/<tweet_id> の「役に立ちましたか?」フォームと同じリクエストで、同じノートを再評価すると上書きされます。
public Task<CommunityNoteRating> RateCommunityNoteAsync(string noteId, string tweetId, string helpfulness, IEnumerable<string>? helpfulTags = null, IEnumerable<string>? notHelpfulTags = null, string ratingSource = "BirdwatchPostDetail", bool forLiveNote = false)
Parameters
noteIdstringノートの ID。
tweetIdstringノートが付いた投稿の ID(TweetId)。
helpfulnessstringCommunityNoteHelpfulness のいずれか。
helpfulTagsIEnumerable<string>役に立った理由(CommunityNoteHelpfulTags)。Web のフォームは Helpful と SomewhatHelpful で尋ねます。
notHelpfulTagsIEnumerable<string>役に立たなかった理由(CommunityNoteNotHelpfulTags)。NotHelpful と SomewhatHelpful(TwitterViolationAny を除く)で尋ねます。
ratingSourcestring評価フォームが表示されていた場所(CommunityNoteRatingSource)。
forLiveNotebool
Returns
- Task<CommunityNoteRating>
X が保存した評価(レベルとタグ)。
Exceptions
- ArgumentException
不明な
helpfulnessまたはタグ。- TwitterException
X が評価を確認しなかった。
RefreshTransaction()
X-Client-Transaction-Id のハンドシェイクを強制的にやり直します。 長時間動かすプロセスで散発的な 404 が出始めたときの安価な対処です。
public void RefreshTransaction()
RemoveListMemberAsync(string, string)
リストからユーザーを削除します。
public Task<TwitterList> RemoveListMemberAsync(string listId, string userId)
Parameters
Returns
RemoveReactionFromMessageAsync(string, string, string)
メッセージからリアクションを削除します。
public Task<HttpResponseMessage> RemoveReactionFromMessageAsync(string messageId, string conversationId, string emoji)
Parameters
Returns
RequestAsync(HttpMethod, string, RequestOptions?)
X の API にリクエストを送ります。ハンドシェイク、X-Client-Transaction-Id の付与、
Cookie の整理、エラーコードから例外への変換を行います。
public Task<ApiResponse> RequestAsync(HttpMethod method, string url, RequestOptions? options = null)
Parameters
methodHttpMethodurlstringoptionsRequestOptions
Returns
RequestToJoinCommunityAsync(string, string?)
コミュニティへの参加をリクエストします。
public Task<Community> RequestToJoinCommunityAsync(string communityId, string? answer = null)
Parameters
Returns
RetweetAsync(string)
ツイートをリツイートします。取り消すときは DeleteRetweetAsync(string) に元ツイートの ID を渡してください。
public Task<HttpResponseMessage> RetweetAsync(string tweetId)
Parameters
tweetIdstring
Returns
ReverseGeocodeAsync(double, double, string?, string?, int?)
緯度・経度から周辺の場所を検索します。
public Task<List<Place>> ReverseGeocodeAsync(double lat, double lng, string? accuracy = null, string? granularity = null, int? maxResults = null)
Parameters
latdouble緯度。
lngdouble経度。
accuracystring検索する「範囲」のヒント。
granularitystring返す場所の最小粒度: neighborhood、city、admin、country。
maxResultsint?返す件数のヒント。
Returns
SaveCookies(string)
Cookie を JSON ファイルに保存します。
public void SaveCookies(string path)
Parameters
pathstring
SearchCommunityAsync(string, string?)
コミュニティを検索します。
public Task<Result<Community>> SearchCommunityAsync(string query, string? cursor = null)
Parameters
Returns
SearchCommunityTweetAsync(string, string, int, string?)
コミュニティ内のツイートを検索します。
public Task<Result<Tweet>> SearchCommunityTweetAsync(string communityId, string query, int count = 20, string? cursor = null)
Parameters
Returns
SearchGeoAsync(double?, double?, string?, string?, string?, int?)
ツイートに添付できる場所を検索します。
public Task<List<Place>> SearchGeoAsync(double? lat = null, double? lng = null, string? query = null, string? ip = null, string? granularity = null, int? maxResults = null)
Parameters
Returns
SearchListAsync(string, int, string?)
リストを検索します。
public Task<Result<TwitterList>> SearchListAsync(string query, int count = 20, string? cursor = null)
Parameters
Returns
SearchTweetAsync(string, string, int, string?)
クエリと種類を指定してツイートを検索します。
public Task<Result<Tweet>> SearchTweetAsync(string query, string product, int count = 20, string? cursor = null)
Parameters
querystring検索クエリ。
productstring'Top'、'Latest'、'Media' のいずれか。
countint取得する件数(1~20)。
cursorstringページ送り用カーソル。
Returns
SearchTweetsByDateAsync(string, string, string, string, int, string?)
期間を指定してツイートを検索します(SearchTweetAsync(string, string, int, string?) と Build(string, SearchOptions) の薄いラッパー)。
public Task<Result<Tweet>> SearchTweetsByDateAsync(string query, string since, string until, string product = "Latest", int count = 20, string? cursor = null)
Parameters
querystring検索テキスト。
sincestring開始日(YYYY-MM-DD、この日を含む)。
untilstring終了日(YYYY-MM-DD、この日を含まない)。
productstring'Top'、'Latest'、'Media'。
countint取得する件数。
cursorstringページ送り用カーソル。
Returns
SearchUserAsync(string, int, string?)
ユーザーを検索します。
public Task<Result<User>> SearchUserAsync(string query, int count = 20, string? cursor = null)
Parameters
Returns
SendAsync(HttpMethod, string, RequestOptions?)
トランザクション ID やエラー処理を挟まない生のリクエスト(Python 版の _send)。
Cookie の送受信とリダイレクト(FollowRedirects)はここで処理します。
public Task<HttpResponseMessage> SendAsync(HttpMethod method, string url, RequestOptions? options = null)
Parameters
methodHttpMethodurlstringoptionsRequestOptions
Returns
SendDmAsync(string, string, string?, string?)
ユーザーに DM を送ります。
public Task<Message> SendDmAsync(string userId, string text, string? mediaId = null, string? replyTo = null)
Parameters
userIdstring送信先ユーザーの ID。
textstring本文。
mediaIdstring添付するメディア ID(UploadMediaAsync(string, bool, double?, string?, string?, bool) で取得)。
replyTostring返信先のメッセージ ID。
Returns
SendDmToGroupAsync(string, string, string?, string?)
グループにメッセージを送ります。
public Task<GroupMessage> SendDmToGroupAsync(string groupId, string text, string? mediaId = null, string? replyTo = null)
Parameters
Returns
SetCookies(IDictionary<string, string>, bool)
Cookie を設定します。auth_token と ct0 だけで十分です。
public void SetCookies(IDictionary<string, string> cookies, bool clearCookies = false)
Parameters
cookiesIDictionary<string, string>名前と値のペア。
clearCookiesbool既存の Cookie を先に消すか。
SetCookies(JsonNode, bool)
Cookie を設定します。名前と値のオブジェクト、またはブラウザ拡張 / Playwright が書き出す
形式(name と value を持つオブジェクトの配列)を受け付けます。
public void SetCookies(JsonNode cookies, bool clearCookies = false)
Parameters
SetDelegateAccount(string?)
代理操作するアカウントを設定します(null で解除)。
public void SetDelegateAccount(string? userId)
Parameters
userIdstring
Remarks
X は内部 API の一部でしか委任を認めません。拒否するエンドポイントは 403 code 90 "Contributor access is not permitted on this endpoint" を返します(UserAsync() もその 1 つ)。
StreamAsync(IEnumerable<string>, CancellationToken)
live_pipeline のイベントストリームを開きます(GetStreamingSessionAsync(IEnumerable<string>, bool) が使います)。
public IAsyncEnumerable<(string? Topic, Payload Payload)> StreamAsync(IEnumerable<string> topics, CancellationToken cancellationToken = default)
Parameters
topicsIEnumerable<string>cancellationTokenCancellationToken
Returns
Remarks
The streaming connection is the one request that does not carry an X-Client-Transaction-Id: it goes out raw, exactly as in the Python original.
TranslateTweetAsync(string, string?)
Grok でツイートを翻訳します(「ポストを翻訳」ボタンの api.x.com/2/grok/translation.json)。
public Task<TweetTranslation> TranslateTweetAsync(string tweetId, string? dstLang = null)
Parameters
tweetIdstringツイートの ID。
dstLangstring翻訳先の言語コード(
ja、en、fi...)。省略時は Language の主タグ (en-USならen)。X はコードを検証せず、未知のコードでも 200 で Grok が推測した言語の訳を返します。
Returns
- Task<TweetTranslation>
TweetTranslation。Text が翻訳文です。
Remarks
(ツイート, 言語) の組を初めて要求したとき X は翻訳をトークンごとにストリームし、この呼び出しはストリームが 終わってから返ります(0.5 秒ほど)。以後はどのアカウントからでも X のキャッシュから全文が 1 回で返ります。 IsTranslatable や元の言語と翻訳先が同じかは確認しません。X はそれでも翻訳します。
Exceptions
- ServerErrorException
存在しないツイート ID(X は 500、code 131 を返します)。
- See Also
UiMetricsAsync()
ui_metrics チャレンジのスクリプトを取得します(twitter.com のまま)。
public Task<string> UiMetricsAsync()
Returns
UnblockUserAsync(string)
ユーザーのブロックを解除します。
public Task<User> UnblockUserAsync(string userId)
Parameters
userIdstring
Returns
UnfavoriteTweetAsync(string)
ツイートのいいねを解除します。
public Task<HttpResponseMessage> UnfavoriteTweetAsync(string tweetId)
Parameters
tweetIdstring
Returns
UnfollowUserAsync(string)
ユーザーのフォローを解除します。
public Task<User> UnfollowUserAsync(string userId)
Parameters
userIdstring
Returns
UnhighlightTweetAsync(string)
ツイートをプロフィールの「ハイライト」タブから外します。
public Task<HttpResponseMessage> UnhighlightTweetAsync(string tweetId)
Parameters
tweetIdstringハイライトを解除するツイートの ID。
Returns
Exceptions
- TwitterException
X が変更を確認しなかった(HighlightTweetAsync(string) を参照)。
UnlockAsync()
指定した captcha ソルバーでアカウントのロックを解除します。
public Task UnlockAsync()
Returns
UnmuteUserAsync(string)
ユーザーのミュートを解除します。
public Task<User> UnmuteUserAsync(string userId)
Parameters
userIdstring
Returns
UnpinTweetAsync(string)
自分のプロフィールのピン留めを外します。
public Task<HttpResponseMessage> UnpinTweetAsync(string tweetId)
Parameters
tweetIdstringピン留めを外すツイートの ID。
Returns
Remarks
ピン留めされていないツイートを渡しても何も変えずに成功します。ピン留め中のツイートを削除すると その ID は PinnedTweetIds に残り、その ID を渡すと消えます。
- See Also
UpdateProfileAsync(string?, string?, string?, string?)
ログイン中のアカウントのプロフィールを更新します。渡した項目だけが変わり、null のままの項目は 現在の値を保ちます。空文字を渡すとその項目を消せます。
public Task<User> UpdateProfileAsync(string? name = null, string? description = null, string? location = null, string? url = null)
Parameters
namestring表示名(50 文字まで)。
descriptionstring自己紹介。
locationstring場所。
urlstringプロフィールに表示する Web サイト。
Returns
UploadMediaAsync(byte[], bool, double?, string?, string?, bool)
メディアをアップロードします(バイト列)。
public Task<string> UploadMediaAsync(byte[] binary, bool waitForCompletion = false, double? statusCheckInterval = null, string? mediaType = null, string? mediaCategory = null, bool isLongVideo = false)
Parameters
binarybyte[]メディアの内容。
waitForCompletionbool処理完了を待つか。
statusCheckIntervaldouble?状態を確認する間隔(秒)。省略時は X が返す check_after_secs。
mediaTypestringMIME タイプ。省略時は内容から推定します。
mediaCategorystringメディアカテゴリ('tweet_gif'、'dm_gif' など)。
isLongVideobool2:20 を超える動画をアップロードするか(Premium のみ)。
Returns
UploadMediaAsync(string, bool, double?, string?, string?, bool)
メディアをアップロードします(ファイルパス)。
public Task<string> UploadMediaAsync(string path, bool waitForCompletion = false, double? statusCheckInterval = null, string? mediaType = null, string? mediaCategory = null, bool isLongVideo = false)
Parameters
pathstringアップロードするファイルのパス。
waitForCompletionbool処理完了を待つか。
statusCheckIntervaldouble?状態を確認する間隔(秒)。省略時は X が返す check_after_secs。
mediaTypestringMIME タイプ。省略時は内容から推定します。
mediaCategorystringメディアカテゴリ('tweet_gif'、'dm_gif' など)。
isLongVideobool2:20 を超える動画をアップロードするか(Premium のみ)。
Returns
UserAsync()
認証中のユーザーの詳細情報を取得します。
public Task<User> UserAsync()
Returns
UserIdAsync()
認証中のアカウントのユーザー ID を取得します(初回だけ問い合わせ、以後は記憶します)。
public Task<string> UserIdAsync()
Returns
VoteAsync(string, string, string, string)
投票に票を入れます。
public Task<Poll> VoteAsync(string selectedChoice, string cardUri, string tweetId, string cardName)
Parameters
selectedChoicestring選択肢の番号('1' から)。
cardUristring投票カードの URI。
tweetIdstring投票が付いた元ツイートの ID。
cardNamestring投票カードの名前。