Table of Contents

Class GqlClient

Namespace
Twikit.Api
Assembly
Twikit.dll

GraphQL エンドポイント層。各メソッドは 1 つの GraphQL ドキュメントに対応し、 生の ApiResponse を返します(Client がモデルに変換します)。

public sealed class GqlClient
Inheritance
GqlClient
Inherited Members

Constructors

GqlClient(IRequestClient)

public GqlClient(IRequestClient baseClient)

Parameters

baseClient IRequestClient

Methods

AboutAccountAsync(string)

public Task<ApiResponse> AboutAccountAsync(string screenName)

Parameters

screenName string

Returns

Task<ApiResponse>

AddParticipantsMutationAsync(string, IEnumerable<string>)

public Task<ApiResponse> AddParticipantsMutationAsync(string groupId, IEnumerable<string> userIds)

Parameters

groupId string
userIds IEnumerable<string>

Returns

Task<ApiResponse>

AudioSpaceAddSharingAsync(string, string)

public Task<ApiResponse> AudioSpaceAddSharingAsync(string spaceId, string tweetId)

Parameters

spaceId string
tweetId string

Returns

Task<ApiResponse>

AudioSpaceByIdAsync(string, bool, bool)

public Task<ApiResponse> AudioSpaceByIdAsync(string spaceId, bool withReplays = true, bool withListeners = true)

Parameters

spaceId string
withReplays bool
withListeners bool

Returns

Task<ApiResponse>

AudioSpaceDeleteSharingAsync(string, string)

public Task<ApiResponse> AudioSpaceDeleteSharingAsync(string spaceId, string sharingId)

Parameters

spaceId string
sharingId string

Returns

Task<ApiResponse>

AudioSpaceSearchAsync(string, string)

public Task<ApiResponse> AudioSpaceSearchAsync(string query, string filter = "Live")

Parameters

query string
filter string

Returns

Task<ApiResponse>

Remarks

The web client executes this operation as a POST even though it is declared query; GET returns 404.

AuthenticatePeriscopeAsync()

public Task<ApiResponse> AuthenticatePeriscopeAsync()

Returns

Task<ApiResponse>

BirdWatchOneNoteAsync(string)

public Task<ApiResponse> BirdWatchOneNoteAsync(string noteId)

Parameters

noteId string

Returns

Task<ApiResponse>

BirdwatchAuthenticatedUserProfileAsync()

public Task<ApiResponse> BirdwatchAuthenticatedUserProfileAsync()

Returns

Task<ApiResponse>

BirdwatchContributorNotesSliceAsync(string, int, bool, string?)

public Task<ApiResponse> BirdwatchContributorNotesSliceAsync(string alias, int count, bool includeDrafts, string? cursor)

Parameters

alias string
count int
includeDrafts bool
cursor string

Returns

Task<ApiResponse>

BirdwatchCreateRatingAsync(string, string, JsonObject, string, bool)

public Task<ApiResponse> BirdwatchCreateRatingAsync(string noteId, string tweetId, JsonObject dataV2, string ratingSource, bool forLiveNote)

Parameters

noteId string
tweetId string
dataV2 JsonObject
ratingSource string
forLiveNote bool

Returns

Task<ApiResponse>

BirdwatchFetchNotesAsync(string)

public Task<ApiResponse> BirdwatchFetchNotesAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

BirdwatchGlobalTimelineAsync()

public Task<ApiResponse> BirdwatchGlobalTimelineAsync()

Returns

Task<ApiResponse>

BirdwatchProfileAsync(string)

public Task<ApiResponse> BirdwatchProfileAsync(string alias)

Parameters

alias string

Returns

Task<ApiResponse>

BlockedAccountsAsync(int, string?)

public Task<ApiResponse> BlockedAccountsAsync(int count, string? cursor)

Parameters

count int
cursor string

Returns

Task<ApiResponse>

BlueVerifiedFollowersAsync(string, int, string?)

public Task<ApiResponse> BlueVerifiedFollowersAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

BookmarkFolderTimelineAsync(int, string?, string)

public Task<ApiResponse> BookmarkFolderTimelineAsync(int count, string? cursor, string folderId)

Parameters

count int
cursor string
folderId string

Returns

Task<ApiResponse>

BookmarkFoldersSliceAsync(string?)

public Task<ApiResponse> BookmarkFoldersSliceAsync(string? cursor)

Parameters

cursor string

Returns

Task<ApiResponse>

BookmarkTweetToFolderAsync(string, string)

public Task<ApiResponse> BookmarkTweetToFolderAsync(string tweetId, string folderId)

Parameters

tweetId string
folderId string

Returns

Task<ApiResponse>

BookmarksAsync(int, string?)

public Task<ApiResponse> BookmarksAsync(int count, string? cursor)

Parameters

count int
cursor string

Returns

Task<ApiResponse>

BrowseSpaceTopicsAsync()

public Task<ApiResponse> BrowseSpaceTopicsAsync()

Returns

Task<ApiResponse>

CombinedListsAsync(string, int, string?)

public Task<ApiResponse> CombinedListsAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

CommunitiesMainPageTimelineAsync(int, string?)

public Task<ApiResponse> CommunitiesMainPageTimelineAsync(int count, string? cursor)

Parameters

count int
cursor string

Returns

Task<ApiResponse>

CommunityMediaTimelineAsync(string, int, string?)

public Task<ApiResponse> CommunityMediaTimelineAsync(string communityId, int count, string? cursor)

Parameters

communityId string
count int
cursor string

Returns

Task<ApiResponse>

CommunityQueryAsync(string)

public Task<ApiResponse> CommunityQueryAsync(string communityId)

Parameters

communityId string

Returns

Task<ApiResponse>

CommunityTweetSearchModuleQueryAsync(string, string, int, string?)

public Task<ApiResponse> CommunityTweetSearchModuleQueryAsync(string communityId, string query, int count, string? cursor)

Parameters

communityId string
query string
count int
cursor string

Returns

Task<ApiResponse>

CommunityTweetsTimelineAsync(string, string, int, string?)

public Task<ApiResponse> CommunityTweetsTimelineAsync(string communityId, string rankingMode, int count, string? cursor)

Parameters

communityId string
rankingMode string
count int
cursor string

Returns

Task<ApiResponse>

CreateBookmarkAsync(string)

public Task<ApiResponse> CreateBookmarkAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

CreateBookmarkFolderAsync(string)

public Task<ApiResponse> CreateBookmarkFolderAsync(string name)

Parameters

name string

Returns

Task<ApiResponse>

CreateDraftTweetAsync(string, IEnumerable<string>?, string?, string?)

public Task<ApiResponse> CreateDraftTweetAsync(string text, IEnumerable<string>? mediaIds, string? attachmentUrl, string? inReplyToTweetId = null)

Parameters

text string
mediaIds IEnumerable<string>
attachmentUrl string
inReplyToTweetId string

Returns

Task<ApiResponse>

CreateHighlightAsync(string)

public Task<ApiResponse> CreateHighlightAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

CreateListAsync(string, string, bool)

public Task<ApiResponse> CreateListAsync(string name, string description, bool isPrivate)

Parameters

name string
description string
isPrivate bool

Returns

Task<ApiResponse>

CreateScheduledTweetAsync(long, string, IEnumerable<string>?)

public Task<ApiResponse> CreateScheduledTweetAsync(long scheduledAt, string text, IEnumerable<string>? mediaIds)

Parameters

scheduledAt long
text string
mediaIds IEnumerable<string>

Returns

Task<ApiResponse>

CreateTweetAsync(bool, string, JsonArray, string?, string?, string?, string?, bool, JsonArray?, string?, string?)

public Task<ApiResponse> CreateTweetAsync(bool isNoteTweet, string text, JsonArray mediaEntities, string? pollUri, string? replyTo, string? attachmentUrl, string? communityId, bool shareWithFollowers, JsonArray? richtextOptions, string? editTweetId, string? limitMode)

Parameters

isNoteTweet bool
text string
mediaEntities JsonArray
pollUri string
replyTo string
attachmentUrl string
communityId string
shareWithFollowers bool
richtextOptions JsonArray
editTweetId string
limitMode string

Returns

Task<ApiResponse>

DeleteAllBookmarksAsync()

public Task<ApiResponse> DeleteAllBookmarksAsync()

Returns

Task<ApiResponse>

DeleteBookmarkAsync(string)

public Task<ApiResponse> DeleteBookmarkAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

DeleteBookmarkFolderAsync(string)

public Task<ApiResponse> DeleteBookmarkFolderAsync(string folderId)

Parameters

folderId string

Returns

Task<ApiResponse>

DeleteDraftTweetAsync(string)

public Task<ApiResponse> DeleteDraftTweetAsync(string draftTweetId)

Parameters

draftTweetId string

Returns

Task<ApiResponse>

DeleteDraftTweetsAsync(IEnumerable<string>)

public Task<ApiResponse> DeleteDraftTweetsAsync(IEnumerable<string> draftTweetIds)

Parameters

draftTweetIds IEnumerable<string>

Returns

Task<ApiResponse>

DeleteHighlightAsync(string)

public Task<ApiResponse> DeleteHighlightAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

DeleteListAsync(string)

public Task<ApiResponse> DeleteListAsync(string listId)

Parameters

listId string

Returns

Task<ApiResponse>

DeleteListBannerAsync(string)

public Task<ApiResponse> DeleteListBannerAsync(string listId)

Parameters

listId string

Returns

Task<ApiResponse>

DeleteRetweetAsync(string)

public Task<ApiResponse> DeleteRetweetAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

DeleteScheduledTweetAsync(string)

public Task<ApiResponse> DeleteScheduledTweetAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

DeleteTweetAsync(string)

public Task<ApiResponse> DeleteTweetAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

DmMessageDeleteMutationAsync(string)

public Task<ApiResponse> DmMessageDeleteMutationAsync(string messageId)

Parameters

messageId string

Returns

Task<ApiResponse>

EditBookmarkFolderAsync(string, string)

public Task<ApiResponse> EditBookmarkFolderAsync(string folderId, string name)

Parameters

folderId string
name string

Returns

Task<ApiResponse>

EditListBannerAsync(string, string)

public Task<ApiResponse> EditListBannerAsync(string listId, string mediaId)

Parameters

listId string
mediaId string

Returns

Task<ApiResponse>

ExplorePageAsync()

public Task<ApiResponse> ExplorePageAsync()

Returns

Task<ApiResponse>

FavoriteTweetAsync(string)

public Task<ApiResponse> FavoriteTweetAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

FavoritersAsync(string, int, string?)

public Task<ApiResponse> FavoritersAsync(string tweetId, int count, string? cursor)

Parameters

tweetId string
count int
cursor string

Returns

Task<ApiResponse>

FetchDraftTweetsAsync(bool)

public Task<ApiResponse> FetchDraftTweetsAsync(bool ascending = false)

Parameters

ascending bool

Returns

Task<ApiResponse>

FetchScheduledTweetsAsync()

public Task<ApiResponse> FetchScheduledTweetsAsync()

Returns

Task<ApiResponse>

FollowersAsync(string, int, string?)

public Task<ApiResponse> FollowersAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

FollowersYouKnowAsync(string, int, string?)

public Task<ApiResponse> FollowersYouKnowAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

FollowingAsync(string, int, string?)

public Task<ApiResponse> FollowingAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

GenericTimelineByIdAsync(string, int, JsonObject?)

public Task<ApiResponse> GenericTimelineByIdAsync(string timelineId, int count, JsonObject? extraParams = null)

Parameters

timelineId string
count int
extraParams JsonObject

Returns

Task<ApiResponse>

GqlGetAsync(string, JsonObject, JsonObject?, Dictionary<string, string>?, JsonObject?)

GET で GraphQL クエリを送ります。

public Task<ApiResponse> GqlGetAsync(string url, JsonObject variables, JsonObject? features = null, Dictionary<string, string>? headers = null, JsonObject? extraParams = null)

Parameters

url string
variables JsonObject
features JsonObject
headers Dictionary<string, string>
extraParams JsonObject

Returns

Task<ApiResponse>

GqlPostAsync(string, JsonObject, JsonObject?, Dictionary<string, string>?, JsonObject?)

POST で GraphQL ミューテーションを送ります。

public Task<ApiResponse> GqlPostAsync(string url, JsonObject variables, JsonObject? features = null, Dictionary<string, string>? headers = null, JsonObject? extraData = null)

Parameters

url string
variables JsonObject
features JsonObject
headers Dictionary<string, string>
extraData JsonObject

Returns

Task<ApiResponse>

HighlightTweetSheetQueryAsync(string)

public Task<ApiResponse> HighlightTweetSheetQueryAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

HomeLatestTimelineAsync(int, IEnumerable<string>?, string?)

public Task<ApiResponse> HomeLatestTimelineAsync(int count, IEnumerable<string>? seenTweetIds, string? cursor)

Parameters

count int
seenTweetIds IEnumerable<string>
cursor string

Returns

Task<ApiResponse>

HomeTimelineAsync(int, IEnumerable<string>?, string?)

public Task<ApiResponse> HomeTimelineAsync(int count, IEnumerable<string>? seenTweetIds, string? cursor)

Parameters

count int
seenTweetIds IEnumerable<string>
cursor string

Returns

Task<ApiResponse>

JoinCommunityAsync(string)

public Task<ApiResponse> JoinCommunityAsync(string communityId)

Parameters

communityId string

Returns

Task<ApiResponse>

LeaveCommunityAsync(string)

public Task<ApiResponse> LeaveCommunityAsync(string communityId)

Parameters

communityId string

Returns

Task<ApiResponse>

ListAddMemberAsync(string, string)

public Task<ApiResponse> ListAddMemberAsync(string listId, string userId)

Parameters

listId string
userId string

Returns

Task<ApiResponse>

ListByRestIdAsync(string)

public Task<ApiResponse> ListByRestIdAsync(string listId)

Parameters

listId string

Returns

Task<ApiResponse>

ListLatestTweetsTimelineAsync(string, int, string?)

public Task<ApiResponse> ListLatestTweetsTimelineAsync(string listId, int count, string? cursor)

Parameters

listId string
count int
cursor string

Returns

Task<ApiResponse>

ListManagementPaceTimelineAsync(int, string?)

public Task<ApiResponse> ListManagementPaceTimelineAsync(int count, string? cursor)

Parameters

count int
cursor string

Returns

Task<ApiResponse>

ListMembersAsync(string, int, string?)

public Task<ApiResponse> ListMembersAsync(string listId, int count, string? cursor)

Parameters

listId string
count int
cursor string

Returns

Task<ApiResponse>

ListRemoveMemberAsync(string, string)

public Task<ApiResponse> ListRemoveMemberAsync(string listId, string userId)

Parameters

listId string
userId string

Returns

Task<ApiResponse>

ListSubscribersAsync(string, int, string?)

public Task<ApiResponse> ListSubscribersAsync(string listId, int count, string? cursor)

Parameters

listId string
count int
cursor string

Returns

Task<ApiResponse>

MembersSliceTimelineQueryAsync(string, int, string?)

public Task<ApiResponse> MembersSliceTimelineQueryAsync(string communityId, int count, string? cursor)

Parameters

communityId string
count int
cursor string

Returns

Task<ApiResponse>

ModeratorsSliceTimelineQueryAsync(string, int, string?)

public Task<ApiResponse> ModeratorsSliceTimelineQueryAsync(string communityId, int count, string? cursor)

Parameters

communityId string
count int
cursor string

Returns

Task<ApiResponse>

MutedAccountsAsync(int, string?)

public Task<ApiResponse> MutedAccountsAsync(int count, string? cursor)

Parameters

count int
cursor string

Returns

Task<ApiResponse>

ProfileSpotlightsAsync(string)

public Task<ApiResponse> ProfileSpotlightsAsync(string screenName)

Parameters

screenName string

Returns

Task<ApiResponse>

RequestToJoinCommunityAsync(string, string?)

public Task<ApiResponse> RequestToJoinCommunityAsync(string communityId, string? answer)

Parameters

communityId string
answer string

Returns

Task<ApiResponse>

RetweetAsync(string)

public Task<ApiResponse> RetweetAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

RetweetersAsync(string, int, string?)

public Task<ApiResponse> RetweetersAsync(string tweetId, int count, string? cursor)

Parameters

tweetId string
count int
cursor string

Returns

Task<ApiResponse>

SearchCommunityAsync(string, string?)

public Task<ApiResponse> SearchCommunityAsync(string query, string? cursor)

Parameters

query string
cursor string

Returns

Task<ApiResponse>

SearchTimelineAsync(string, string, int, string?)

public Task<ApiResponse> SearchTimelineAsync(string query, string product, int count, string? cursor)

Parameters

query string
product string
count int
cursor string

Returns

Task<ApiResponse>

SimilarPostsAsync(string)

public Task<ApiResponse> SimilarPostsAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

SubscribeToScheduledSpaceAsync(string)

public Task<ApiResponse> SubscribeToScheduledSpaceAsync(string spaceId)

Parameters

spaceId string

Returns

Task<ApiResponse>

TweetDetailAsync(string, string?)

public Task<ApiResponse> TweetDetailAsync(string tweetId, string? cursor)

Parameters

tweetId string
cursor string

Returns

Task<ApiResponse>

TweetEngagementsAsync(string, int, string?, string)

public Task<ApiResponse> TweetEngagementsAsync(string tweetId, int count, string? cursor, string endpoint)

Parameters

tweetId string
count int
cursor string
endpoint string

Returns

Task<ApiResponse>

TweetResultByRestIdAsync(string)

public Task<ApiResponse> TweetResultByRestIdAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

TweetResultsByRestIdsAsync(IEnumerable<string>)

public Task<ApiResponse> TweetResultsByRestIdsAsync(IEnumerable<string> tweetIds)

Parameters

tweetIds IEnumerable<string>

Returns

Task<ApiResponse>

UnfavoriteTweetAsync(string)

public Task<ApiResponse> UnfavoriteTweetAsync(string tweetId)

Parameters

tweetId string

Returns

Task<ApiResponse>

UnsubscribeFromScheduledSpaceAsync(string)

public Task<ApiResponse> UnsubscribeFromScheduledSpaceAsync(string spaceId)

Parameters

spaceId string

Returns

Task<ApiResponse>

UpdateListAsync(string, string?, string?, bool?)

public Task<ApiResponse> UpdateListAsync(string listId, string? name, string? description, bool? isPrivate)

Parameters

listId string
name string
description string
isPrivate bool?

Returns

Task<ApiResponse>

UserByRestIdAsync(string)

public Task<ApiResponse> UserByRestIdAsync(string userId)

Parameters

userId string

Returns

Task<ApiResponse>

UserByScreenNameAsync(string)

public Task<ApiResponse> UserByScreenNameAsync(string screenName)

Parameters

screenName string

Returns

Task<ApiResponse>

UserCreatorSubscriptionsAsync(string, int, string?)

public Task<ApiResponse> UserCreatorSubscriptionsAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

UserDmReactionMutationAddMutationAsync(string, string, string)

public Task<ApiResponse> UserDmReactionMutationAddMutationAsync(string messageId, string conversationId, string emoji)

Parameters

messageId string
conversationId string
emoji string

Returns

Task<ApiResponse>

UserDmReactionMutationRemoveMutationAsync(string, string, string)

public Task<ApiResponse> UserDmReactionMutationRemoveMutationAsync(string messageId, string conversationId, string emoji)

Parameters

messageId string
conversationId string
emoji string

Returns

Task<ApiResponse>

UserHighlightsTweetsAsync(string, int, string?)

public Task<ApiResponse> UserHighlightsTweetsAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

UserLikesAsync(string, int, string?)

public Task<ApiResponse> UserLikesAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

UserMediaAsync(string, int, string?)

public Task<ApiResponse> UserMediaAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

UserTweetsAndRepliesAsync(string, int, string?)

public Task<ApiResponse> UserTweetsAndRepliesAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

UserTweetsAsync(string, int, string?)

public Task<ApiResponse> UserTweetsAsync(string userId, int count, string? cursor)

Parameters

userId string
count int
cursor string

Returns

Task<ApiResponse>

ViewerBadgeCountsAsync()

未読数を取得します。応答は data.viewer_v2.user_results.result.badge_counts に ntab_unread_count / dm_unread_count / xchat_unread_count / total_unread_count。 レート制限は 15 分 50 回なので、ポーリング間隔は 18 秒より長くすること。

public Task<ApiResponse> ViewerBadgeCountsAsync()

Returns

Task<ApiResponse>