Documentation
¶
Index ¶
- Constants
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type APIKey
- type APIKeyListResponse
- type APIKeyNewParams
- type APIKeyNewResponse
- type APIKeyRevokeResponse
- type APIKeyService
- func (r *APIKeyService) List(ctx context.Context, opts ...option.RequestOption) (res *APIKeyListResponse, err error)
- func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *APIKeyNewResponse, err error)
- func (r *APIKeyService) Revoke(ctx context.Context, id string, opts ...option.RequestOption) (res *APIKeyRevokeResponse, err error)
- type AccountGetResponse
- type AccountGetResponseCreditInfo
- type AccountGetResponsePlan
- type AccountService
- func (r *AccountService) Get(ctx context.Context, opts ...option.RequestOption) (res *AccountGetResponse, err error)
- func (r *AccountService) SetXUsername(ctx context.Context, body AccountSetXUsernameParams, ...) (res *AccountSetXUsernameResponse, err error)
- func (r *AccountService) UpdateLocale(ctx context.Context, body AccountUpdateLocaleParams, ...) (res *AccountUpdateLocaleResponse, err error)
- type AccountSetXUsernameParams
- type AccountSetXUsernameResponse
- type AccountUpdateLocaleParams
- type AccountUpdateLocaleParamsLocale
- type AccountUpdateLocaleResponse
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CommunityActionResult
- type ComposeNewParams
- type ComposeNewParamsGoal
- type ComposeNewParamsMediaType
- type ComposeNewParamsStep
- type ComposeNewResponse
- type ComposeService
- type CreditGetBalanceResponse
- type CreditService
- type CreditTopupBalanceParams
- type CreditTopupBalanceResponse
- type Delivery
- type Draft
- type DraftDetail
- type DraftListParams
- type DraftListResponse
- type DraftNewParams
- type DraftNewParamsGoal
- type DraftService
- func (r *DraftService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *DraftService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *DraftDetail, err error)
- func (r *DraftService) List(ctx context.Context, query DraftListParams, opts ...option.RequestOption) (res *DraftListResponse, err error)
- func (r *DraftService) New(ctx context.Context, body DraftNewParams, opts ...option.RequestOption) (res *DraftDetail, err error)
- type DrawDetail
- type DrawExportParams
- type DrawExportParamsFormat
- type DrawExportParamsType
- type DrawGetResponse
- type DrawListItem
- type DrawListParams
- type DrawListResponse
- type DrawRunParams
- type DrawRunResponse
- type DrawService
- func (r *DrawService) Export(ctx context.Context, id string, query DrawExportParams, ...) (res *http.Response, err error)
- func (r *DrawService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *DrawGetResponse, err error)
- func (r *DrawService) List(ctx context.Context, query DrawListParams, opts ...option.RequestOption) (res *DrawListResponse, err error)
- func (r *DrawService) Run(ctx context.Context, body DrawRunParams, opts ...option.RequestOption) (res *DrawRunResponse, err error)
- type Error
- type Event
- type EventDetail
- type EventListParams
- type EventListResponse
- type EventService
- type EventType
- type ExtractionEstimateCostParams
- type ExtractionEstimateCostParamsToolType
- type ExtractionEstimateCostResponse
- type ExtractionExportResultsParams
- type ExtractionExportResultsParamsFormat
- type ExtractionGetParams
- type ExtractionGetResponse
- type ExtractionJob
- type ExtractionJobStatus
- type ExtractionJobToolType
- type ExtractionListParams
- type ExtractionListParamsStatus
- type ExtractionListParamsToolType
- type ExtractionListResponse
- type ExtractionRunParams
- type ExtractionRunParamsToolType
- type ExtractionRunResponse
- type ExtractionRunResponseToolType
- type ExtractionService
- func (r *ExtractionService) EstimateCost(ctx context.Context, body ExtractionEstimateCostParams, ...) (res *ExtractionEstimateCostResponse, err error)
- func (r *ExtractionService) ExportResults(ctx context.Context, id string, query ExtractionExportResultsParams, ...) (res *http.Response, err error)
- func (r *ExtractionService) Get(ctx context.Context, id string, query ExtractionGetParams, ...) (res *ExtractionGetResponse, err error)
- func (r *ExtractionService) List(ctx context.Context, query ExtractionListParams, opts ...option.RequestOption) (res *ExtractionListResponse, err error)
- func (r *ExtractionService) Run(ctx context.Context, body ExtractionRunParams, opts ...option.RequestOption) (res *ExtractionRunResponse, err error)
- type Monitor
- type MonitorDeactivateResponse
- type MonitorListResponse
- type MonitorNewParams
- type MonitorNewResponse
- type MonitorService
- func (r *MonitorService) Deactivate(ctx context.Context, id string, opts ...option.RequestOption) (res *MonitorDeactivateResponse, err error)
- func (r *MonitorService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Monitor, err error)
- func (r *MonitorService) List(ctx context.Context, opts ...option.RequestOption) (res *MonitorListResponse, err error)
- func (r *MonitorService) New(ctx context.Context, body MonitorNewParams, opts ...option.RequestOption) (res *MonitorNewResponse, err error)
- func (r *MonitorService) Update(ctx context.Context, id string, body MonitorUpdateParams, ...) (res *Monitor, err error)
- type MonitorUpdateParams
- type PaginatedTweets
- type PaginatedUsers
- type RadarGetTrendingTopicsParams
- type RadarGetTrendingTopicsParamsCategory
- type RadarGetTrendingTopicsParamsSource
- type RadarGetTrendingTopicsResponse
- type RadarItem
- type RadarItemCategory
- type RadarItemSource
- type RadarService
- type SearchTweet
- type SearchTweetAuthor
- type StyleAnalyzeParams
- type StyleCompareParams
- type StyleCompareResponse
- type StyleGetPerformanceResponse
- type StyleGetPerformanceResponseTweet
- type StyleListResponse
- type StyleProfile
- type StyleProfileSummary
- type StyleProfileTweet
- type StyleService
- func (r *StyleService) Analyze(ctx context.Context, body StyleAnalyzeParams, opts ...option.RequestOption) (res *StyleProfile, err error)
- func (r *StyleService) Compare(ctx context.Context, query StyleCompareParams, opts ...option.RequestOption) (res *StyleCompareResponse, err error)
- func (r *StyleService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *StyleService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *StyleProfile, err error)
- func (r *StyleService) GetPerformance(ctx context.Context, id string, opts ...option.RequestOption) (res *StyleGetPerformanceResponse, err error)
- func (r *StyleService) List(ctx context.Context, opts ...option.RequestOption) (res *StyleListResponse, err error)
- func (r *StyleService) Update(ctx context.Context, id string, body StyleUpdateParams, ...) (res *StyleProfile, err error)
- type StyleUpdateParams
- type StyleUpdateParamsTweet
- type SubscribeNewResponse
- type SubscribeNewResponseStatus
- type SubscribeService
- type SupportService
- type SupportTicketGetResponse
- type SupportTicketGetResponseMessage
- type SupportTicketListResponse
- type SupportTicketListResponseTicket
- type SupportTicketNewParams
- type SupportTicketNewResponse
- type SupportTicketReplyParams
- type SupportTicketReplyResponse
- type SupportTicketService
- func (r *SupportTicketService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *SupportTicketGetResponse, err error)
- func (r *SupportTicketService) List(ctx context.Context, opts ...option.RequestOption) (res *SupportTicketListResponse, err error)
- func (r *SupportTicketService) New(ctx context.Context, body SupportTicketNewParams, opts ...option.RequestOption) (res *SupportTicketNewResponse, err error)
- func (r *SupportTicketService) Reply(ctx context.Context, id string, body SupportTicketReplyParams, ...) (res *SupportTicketReplyResponse, err error)
- func (r *SupportTicketService) Update(ctx context.Context, id string, body SupportTicketUpdateParams, ...) (res *SupportTicketUpdateResponse, err error)
- type SupportTicketUpdateParams
- type SupportTicketUpdateParamsStatus
- type SupportTicketUpdateResponse
- type TrendListParams
- type TrendListResponse
- type TrendListResponseTrend
- type TrendService
- type TweetAuthor
- type TweetDetail
- type TweetDetailMedia
- type UserProfile
- type Webhook
- type WebhookDeactivateResponse
- type WebhookListDeliveriesResponse
- type WebhookListResponse
- type WebhookNewParams
- type WebhookNewResponse
- type WebhookService
- func (r *WebhookService) Deactivate(ctx context.Context, id string, opts ...option.RequestOption) (res *WebhookDeactivateResponse, err error)
- func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *WebhookListResponse, err error)
- func (r *WebhookService) ListDeliveries(ctx context.Context, id string, opts ...option.RequestOption) (res *WebhookListDeliveriesResponse, err error)
- func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *WebhookNewResponse, err error)
- func (r *WebhookService) Test(ctx context.Context, id string, opts ...option.RequestOption) (res *WebhookTestResponse, err error)
- func (r *WebhookService) Update(ctx context.Context, id string, body WebhookUpdateParams, ...) (res *Webhook, err error)
- type WebhookTestResponse
- type WebhookUpdateParams
- type Winner
- type XAccount
- type XAccountBulkRetryResponse
- type XAccountDeleteResponse
- type XAccountDetail
- type XAccountDetailHealth
- type XAccountHealth
- type XAccountListResponse
- type XAccountNewParams
- type XAccountNewResponse
- type XAccountNewResponseHealth
- type XAccountReauthParams
- type XAccountReauthResponse
- type XAccountReauthResponseHealth
- type XAccountService
- func (r *XAccountService) BulkRetry(ctx context.Context, opts ...option.RequestOption) (res *XAccountBulkRetryResponse, err error)
- func (r *XAccountService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *XAccountDeleteResponse, err error)
- func (r *XAccountService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *XAccountDetail, err error)
- func (r *XAccountService) List(ctx context.Context, opts ...option.RequestOption) (res *XAccountListResponse, err error)
- func (r *XAccountService) New(ctx context.Context, body XAccountNewParams, opts ...option.RequestOption) (res *XAccountNewResponse, err error)
- func (r *XAccountService) Reauth(ctx context.Context, id string, body XAccountReauthParams, ...) (res *XAccountReauthResponse, err error)
- type XBookmarkGetFoldersResponse
- type XBookmarkGetFoldersResponseFolder
- type XBookmarkListParams
- type XBookmarkService
- type XCommunityDeleteParams
- type XCommunityDeleteResponse
- type XCommunityGetInfoResponse
- type XCommunityGetInfoResponseCommunity
- type XCommunityGetInfoResponseCommunityPrimaryTopic
- type XCommunityGetInfoResponseCommunityRule
- type XCommunityGetMembersParams
- type XCommunityGetModeratorsParams
- type XCommunityGetSearchParams
- type XCommunityJoinDeleteAllParams
- type XCommunityJoinNewParams
- type XCommunityJoinService
- type XCommunityNewParams
- type XCommunityNewResponse
- type XCommunityService
- func (r *XCommunityService) Delete(ctx context.Context, id string, body XCommunityDeleteParams, ...) (res *XCommunityDeleteResponse, err error)
- func (r *XCommunityService) GetInfo(ctx context.Context, id string, opts ...option.RequestOption) (res *XCommunityGetInfoResponse, err error)
- func (r *XCommunityService) GetMembers(ctx context.Context, id string, query XCommunityGetMembersParams, ...) (res *shared.PaginatedUsers, err error)
- func (r *XCommunityService) GetModerators(ctx context.Context, id string, query XCommunityGetModeratorsParams, ...) (res *shared.PaginatedUsers, err error)
- func (r *XCommunityService) GetSearch(ctx context.Context, query XCommunityGetSearchParams, ...) (res *shared.PaginatedTweets, err error)
- func (r *XCommunityService) New(ctx context.Context, body XCommunityNewParams, opts ...option.RequestOption) (res *XCommunityNewResponse, err error)
- type XCommunityTweetListByCommunityParams
- type XCommunityTweetListParams
- type XCommunityTweetService
- func (r *XCommunityTweetService) List(ctx context.Context, query XCommunityTweetListParams, ...) (res *shared.PaginatedTweets, err error)
- func (r *XCommunityTweetService) ListByCommunity(ctx context.Context, id string, query XCommunityTweetListByCommunityParams, ...) (res *shared.PaginatedTweets, err error)
- type XDmGetHistoryParams
- type XDmGetHistoryResponse
- type XDmGetHistoryResponseMessage
- type XDmSendParams
- type XDmSendResponse
- type XDmService
- type XFollowerCheckParams
- type XFollowerCheckResponse
- type XFollowerService
- type XGetArticleResponse
- type XGetArticleResponseArticle
- type XGetArticleResponseArticleContent
- type XGetHomeTimelineParams
- type XGetNotificationsParams
- type XGetNotificationsParamsType
- type XGetNotificationsResponse
- type XGetNotificationsResponseNotification
- type XGetTrendsParams
- type XGetTrendsResponse
- type XGetTrendsResponseTrend
- type XListGetFollowersParams
- type XListGetMembersParams
- type XListGetTweetsParams
- type XListService
- func (r *XListService) GetFollowers(ctx context.Context, id string, query XListGetFollowersParams, ...) (res *shared.PaginatedUsers, err error)
- func (r *XListService) GetMembers(ctx context.Context, id string, query XListGetMembersParams, ...) (res *shared.PaginatedUsers, err error)
- func (r *XListService) GetTweets(ctx context.Context, id string, query XListGetTweetsParams, ...) (res *shared.PaginatedTweets, err error)
- type XMediaDownloadParams
- type XMediaDownloadResponse
- type XMediaService
- type XMediaUploadParams
- type XMediaUploadResponse
- type XProfileService
- func (r *XProfileService) Update(ctx context.Context, body XProfileUpdateParams, opts ...option.RequestOption) (res *XProfileUpdateResponse, err error)
- func (r *XProfileService) UpdateAvatar(ctx context.Context, body XProfileUpdateAvatarParams, ...) (res *XProfileUpdateAvatarResponse, err error)
- func (r *XProfileService) UpdateBanner(ctx context.Context, body XProfileUpdateBannerParams, ...) (res *XProfileUpdateBannerResponse, err error)
- type XProfileUpdateAvatarParams
- type XProfileUpdateAvatarResponse
- type XProfileUpdateBannerParams
- type XProfileUpdateBannerResponse
- type XProfileUpdateParams
- type XProfileUpdateResponse
- type XService
- func (r *XService) GetArticle(ctx context.Context, tweetID string, opts ...option.RequestOption) (res *XGetArticleResponse, err error)
- func (r *XService) GetHomeTimeline(ctx context.Context, query XGetHomeTimelineParams, ...) (res *shared.PaginatedTweets, err error)
- func (r *XService) GetNotifications(ctx context.Context, query XGetNotificationsParams, ...) (res *XGetNotificationsResponse, err error)
- func (r *XService) GetTrends(ctx context.Context, query XGetTrendsParams, opts ...option.RequestOption) (res *XGetTrendsResponse, err error)
- type XTweetDeleteParams
- type XTweetDeleteResponse
- type XTweetGetFavoritersParams
- type XTweetGetQuotesParams
- type XTweetGetRepliesParams
- type XTweetGetResponse
- type XTweetGetRetweetersParams
- type XTweetGetThreadParams
- type XTweetLikeDeleteParams
- type XTweetLikeDeleteResponse
- type XTweetLikeNewParams
- type XTweetLikeNewResponse
- type XTweetLikeService
- type XTweetListParams
- type XTweetNewParams
- type XTweetNewResponse
- type XTweetRetweetDeleteParams
- type XTweetRetweetDeleteResponse
- type XTweetRetweetNewParams
- type XTweetRetweetNewResponse
- type XTweetRetweetService
- type XTweetSearchParams
- type XTweetSearchParamsQueryType
- type XTweetService
- func (r *XTweetService) Delete(ctx context.Context, id string, body XTweetDeleteParams, ...) (res *XTweetDeleteResponse, err error)
- func (r *XTweetService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *XTweetGetResponse, err error)
- func (r *XTweetService) GetFavoriters(ctx context.Context, id string, query XTweetGetFavoritersParams, ...) (res *shared.PaginatedUsers, err error)
- func (r *XTweetService) GetQuotes(ctx context.Context, id string, query XTweetGetQuotesParams, ...) (res *shared.PaginatedTweets, err error)
- func (r *XTweetService) GetReplies(ctx context.Context, id string, query XTweetGetRepliesParams, ...) (res *shared.PaginatedTweets, err error)
- func (r *XTweetService) GetRetweeters(ctx context.Context, id string, query XTweetGetRetweetersParams, ...) (res *shared.PaginatedUsers, err error)
- func (r *XTweetService) GetThread(ctx context.Context, id string, query XTweetGetThreadParams, ...) (res *shared.PaginatedTweets, err error)
- func (r *XTweetService) List(ctx context.Context, query XTweetListParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
- func (r *XTweetService) New(ctx context.Context, body XTweetNewParams, opts ...option.RequestOption) (res *XTweetNewResponse, err error)
- func (r *XTweetService) Search(ctx context.Context, query XTweetSearchParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
- type XUserFollowDeleteAllParams
- type XUserFollowDeleteAllResponse
- type XUserFollowNewParams
- type XUserFollowNewResponse
- type XUserFollowService
- type XUserGetBatchParams
- type XUserGetFollowersParams
- type XUserGetFollowersYouKnowParams
- type XUserGetFollowingParams
- type XUserGetLikesParams
- type XUserGetMediaParams
- type XUserGetMentionsParams
- type XUserGetSearchParams
- type XUserGetTweetsParams
- type XUserGetVerifiedFollowersParams
- type XUserService
- func (r *XUserService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *shared.UserProfile, err error)
- func (r *XUserService) GetBatch(ctx context.Context, query XUserGetBatchParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
- func (r *XUserService) GetFollowers(ctx context.Context, id string, query XUserGetFollowersParams, ...) (res *shared.PaginatedUsers, err error)
- func (r *XUserService) GetFollowersYouKnow(ctx context.Context, id string, query XUserGetFollowersYouKnowParams, ...) (res *shared.PaginatedUsers, err error)
- func (r *XUserService) GetFollowing(ctx context.Context, id string, query XUserGetFollowingParams, ...) (res *shared.PaginatedUsers, err error)
- func (r *XUserService) GetLikes(ctx context.Context, id string, query XUserGetLikesParams, ...) (res *shared.PaginatedTweets, err error)
- func (r *XUserService) GetMedia(ctx context.Context, id string, query XUserGetMediaParams, ...) (res *shared.PaginatedTweets, err error)
- func (r *XUserService) GetMentions(ctx context.Context, id string, query XUserGetMentionsParams, ...) (res *shared.PaginatedTweets, err error)
- func (r *XUserService) GetSearch(ctx context.Context, query XUserGetSearchParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
- func (r *XUserService) GetTweets(ctx context.Context, id string, query XUserGetTweetsParams, ...) (res *shared.PaginatedTweets, err error)
- func (r *XUserService) GetVerifiedFollowers(ctx context.Context, id string, query XUserGetVerifiedFollowersParams, ...) (res *shared.PaginatedUsers, err error)
Constants ¶
const EventTypeTweetNew = shared.EventTypeTweetNew
Equals "tweet.new"
const EventTypeTweetQuote = shared.EventTypeTweetQuote
Equals "tweet.quote"
const EventTypeTweetReply = shared.EventTypeTweetReply
Equals "tweet.reply"
const EventTypeTweetRetweet = shared.EventTypeTweetRetweet
Equals "tweet.retweet"
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (X_TWITTER_SCRAPER_API_KEY, X_TWITTER_SCRAPER_BEARER_TOKEN, X_TWITTER_SCRAPER_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type APIKey ¶
type APIKey struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
IsActive bool `json:"isActive" api:"required"`
Name string `json:"name" api:"required"`
Prefix string `json:"prefix" api:"required"`
LastUsedAt time.Time `json:"lastUsedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
IsActive respjson.Field
Name respjson.Field
Prefix respjson.Field
LastUsedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
API key metadata returned when listing keys.
func (*APIKey) UnmarshalJSON ¶
type APIKeyListResponse ¶
type APIKeyListResponse struct {
Keys []APIKey `json:"keys" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Keys respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (APIKeyListResponse) RawJSON ¶
func (r APIKeyListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*APIKeyListResponse) UnmarshalJSON ¶
func (r *APIKeyListResponse) UnmarshalJSON(data []byte) error
type APIKeyNewParams ¶
type APIKeyNewParams struct {
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (APIKeyNewParams) MarshalJSON ¶
func (r APIKeyNewParams) MarshalJSON() (data []byte, err error)
func (*APIKeyNewParams) UnmarshalJSON ¶
func (r *APIKeyNewParams) UnmarshalJSON(data []byte) error
type APIKeyNewResponse ¶
type APIKeyNewResponse struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
FullKey string `json:"fullKey" api:"required"`
Name string `json:"name" api:"required"`
Prefix string `json:"prefix" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
FullKey respjson.Field
Name respjson.Field
Prefix respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (APIKeyNewResponse) RawJSON ¶
func (r APIKeyNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*APIKeyNewResponse) UnmarshalJSON ¶
func (r *APIKeyNewResponse) UnmarshalJSON(data []byte) error
type APIKeyRevokeResponse ¶
type APIKeyRevokeResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (APIKeyRevokeResponse) RawJSON ¶
func (r APIKeyRevokeResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*APIKeyRevokeResponse) UnmarshalJSON ¶
func (r *APIKeyRevokeResponse) UnmarshalJSON(data []byte) error
type APIKeyService ¶
type APIKeyService struct {
// contains filtered or unexported fields
}
API key management (session auth only)
APIKeyService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIKeyService method instead.
func NewAPIKeyService ¶
func NewAPIKeyService(opts ...option.RequestOption) (r APIKeyService)
NewAPIKeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIKeyService) List ¶
func (r *APIKeyService) List(ctx context.Context, opts ...option.RequestOption) (res *APIKeyListResponse, err error)
List API keys
func (*APIKeyService) New ¶
func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *APIKeyNewResponse, err error)
Create API key
func (*APIKeyService) Revoke ¶
func (r *APIKeyService) Revoke(ctx context.Context, id string, opts ...option.RequestOption) (res *APIKeyRevokeResponse, err error)
Revoke API key
type AccountGetResponse ¶
type AccountGetResponse struct {
MonitorsAllowed int64 `json:"monitorsAllowed" api:"required"`
MonitorsUsed int64 `json:"monitorsUsed" api:"required"`
// Any of "active", "inactive".
Plan AccountGetResponsePlan `json:"plan" api:"required"`
CreditInfo AccountGetResponseCreditInfo `json:"creditInfo"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MonitorsAllowed respjson.Field
MonitorsUsed respjson.Field
Plan respjson.Field
CreditInfo respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountGetResponse) RawJSON ¶
func (r AccountGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountGetResponse) UnmarshalJSON ¶
func (r *AccountGetResponse) UnmarshalJSON(data []byte) error
type AccountGetResponseCreditInfo ¶ added in v0.4.0
type AccountGetResponseCreditInfo struct {
AutoTopupEnabled bool `json:"autoTopupEnabled" api:"required"`
Balance int64 `json:"balance" api:"required"`
LifetimePurchased int64 `json:"lifetimePurchased" api:"required"`
LifetimeUsed int64 `json:"lifetimeUsed" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AutoTopupEnabled respjson.Field
Balance respjson.Field
LifetimePurchased respjson.Field
LifetimeUsed respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountGetResponseCreditInfo) RawJSON ¶ added in v0.4.0
func (r AccountGetResponseCreditInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountGetResponseCreditInfo) UnmarshalJSON ¶ added in v0.4.0
func (r *AccountGetResponseCreditInfo) UnmarshalJSON(data []byte) error
type AccountGetResponsePlan ¶
type AccountGetResponsePlan string
const ( AccountGetResponsePlanActive AccountGetResponsePlan = "active" AccountGetResponsePlanInactive AccountGetResponsePlan = "inactive" )
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
Account info and settings
AccountService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAccountService method instead.
func NewAccountService ¶
func NewAccountService(opts ...option.RequestOption) (r AccountService)
NewAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AccountService) Get ¶
func (r *AccountService) Get(ctx context.Context, opts ...option.RequestOption) (res *AccountGetResponse, err error)
Get account info
func (*AccountService) SetXUsername ¶
func (r *AccountService) SetXUsername(ctx context.Context, body AccountSetXUsernameParams, opts ...option.RequestOption) (res *AccountSetXUsernameResponse, err error)
Set linked X username
func (*AccountService) UpdateLocale ¶
func (r *AccountService) UpdateLocale(ctx context.Context, body AccountUpdateLocaleParams, opts ...option.RequestOption) (res *AccountUpdateLocaleResponse, err error)
Update account locale
type AccountSetXUsernameParams ¶
type AccountSetXUsernameParams struct {
// X username without @
Username string `json:"username" api:"required"`
// contains filtered or unexported fields
}
func (AccountSetXUsernameParams) MarshalJSON ¶
func (r AccountSetXUsernameParams) MarshalJSON() (data []byte, err error)
func (*AccountSetXUsernameParams) UnmarshalJSON ¶
func (r *AccountSetXUsernameParams) UnmarshalJSON(data []byte) error
type AccountSetXUsernameResponse ¶
type AccountSetXUsernameResponse struct {
Success bool `json:"success" api:"required"`
XUsername string `json:"xUsername" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
XUsername respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountSetXUsernameResponse) RawJSON ¶
func (r AccountSetXUsernameResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountSetXUsernameResponse) UnmarshalJSON ¶
func (r *AccountSetXUsernameResponse) UnmarshalJSON(data []byte) error
type AccountUpdateLocaleParams ¶
type AccountUpdateLocaleParams struct {
// Any of "en", "tr", "es".
Locale AccountUpdateLocaleParamsLocale `json:"locale,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (AccountUpdateLocaleParams) MarshalJSON ¶
func (r AccountUpdateLocaleParams) MarshalJSON() (data []byte, err error)
func (*AccountUpdateLocaleParams) UnmarshalJSON ¶
func (r *AccountUpdateLocaleParams) UnmarshalJSON(data []byte) error
type AccountUpdateLocaleParamsLocale ¶
type AccountUpdateLocaleParamsLocale string
const ( AccountUpdateLocaleParamsLocaleEn AccountUpdateLocaleParamsLocale = "en" AccountUpdateLocaleParamsLocaleTr AccountUpdateLocaleParamsLocale = "tr" AccountUpdateLocaleParamsLocaleEs AccountUpdateLocaleParamsLocale = "es" )
type AccountUpdateLocaleResponse ¶
type AccountUpdateLocaleResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AccountUpdateLocaleResponse) RawJSON ¶
func (r AccountUpdateLocaleResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AccountUpdateLocaleResponse) UnmarshalJSON ¶
func (r *AccountUpdateLocaleResponse) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
// Account info and settings
Account AccountService
// API key management (session auth only)
APIKeys APIKeyService
// Subscription, billing, and credits
Subscribe SubscribeService
// AI tweet composition, drafts, writing styles, and radar
Compose ComposeService
// AI tweet composition, drafts, writing styles, and radar
Drafts DraftService
// AI tweet composition, drafts, writing styles, and radar
Styles StyleService
// AI tweet composition, drafts, writing styles, and radar
Radar RadarService
// Real-time X account monitoring
Monitors MonitorService
// Activity events from monitored accounts
Events EventService
// Bulk data extraction (20 tool types)
Extractions ExtractionService
// Giveaway draws from tweet replies
Draws DrawService
// Webhook endpoint management and delivery
Webhooks WebhookService
X XService
// Trending topics and hashtags by region
Trends TrendService
Support SupportService
// Subscription, billing, and credits
Credits CreditService
// contains filtered or unexported fields
}
Client creates a struct with services and top level methods that help with interacting with the x-twitter-scraper API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (X_TWITTER_SCRAPER_API_KEY, X_TWITTER_SCRAPER_BEARER_TOKEN, X_TWITTER_SCRAPER_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CommunityActionResult ¶
type CommunityActionResult struct {
CommunityID string `json:"communityId" api:"required"`
CommunityName string `json:"communityName" api:"required"`
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CommunityID respjson.Field
CommunityName respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Result of a community join or leave action.
func (CommunityActionResult) RawJSON ¶
func (r CommunityActionResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*CommunityActionResult) UnmarshalJSON ¶
func (r *CommunityActionResult) UnmarshalJSON(data []byte) error
type ComposeNewParams ¶
type ComposeNewParams struct {
// Workflow step
//
// Any of "compose", "refine", "score".
Step ComposeNewParamsStep `json:"step,omitzero" api:"required"`
// Extra context or URLs (refine)
AdditionalContext param.Opt[string] `json:"additionalContext,omitzero"`
// Desired call to action (refine)
CallToAction param.Opt[string] `json:"callToAction,omitzero"`
// Tweet draft text to evaluate (score)
Draft param.Opt[string] `json:"draft,omitzero"`
// Whether a link is attached (score)
HasLink param.Opt[bool] `json:"hasLink,omitzero"`
// Whether media is attached (score)
HasMedia param.Opt[bool] `json:"hasMedia,omitzero"`
// Cached style username for voice matching (compose)
StyleUsername param.Opt[string] `json:"styleUsername,omitzero"`
// Desired tone (refine)
Tone param.Opt[string] `json:"tone,omitzero"`
// Tweet topic (compose, refine)
Topic param.Opt[string] `json:"topic,omitzero"`
// Optimization goal
//
// Any of "engagement", "followers", "authority", "conversation".
Goal ComposeNewParamsGoal `json:"goal,omitzero"`
// Media type (refine)
//
// Any of "photo", "video", "none".
MediaType ComposeNewParamsMediaType `json:"mediaType,omitzero"`
// contains filtered or unexported fields
}
func (ComposeNewParams) MarshalJSON ¶
func (r ComposeNewParams) MarshalJSON() (data []byte, err error)
func (*ComposeNewParams) UnmarshalJSON ¶
func (r *ComposeNewParams) UnmarshalJSON(data []byte) error
type ComposeNewParamsGoal ¶
type ComposeNewParamsGoal string
Optimization goal
const ( ComposeNewParamsGoalEngagement ComposeNewParamsGoal = "engagement" ComposeNewParamsGoalFollowers ComposeNewParamsGoal = "followers" ComposeNewParamsGoalAuthority ComposeNewParamsGoal = "authority" ComposeNewParamsGoalConversation ComposeNewParamsGoal = "conversation" )
type ComposeNewParamsMediaType ¶
type ComposeNewParamsMediaType string
Media type (refine)
const ( ComposeNewParamsMediaTypePhoto ComposeNewParamsMediaType = "photo" ComposeNewParamsMediaTypeVideo ComposeNewParamsMediaType = "video" ComposeNewParamsMediaTypeNone ComposeNewParamsMediaType = "none" )
type ComposeNewParamsStep ¶
type ComposeNewParamsStep string
Workflow step
const ( ComposeNewParamsStepCompose ComposeNewParamsStep = "compose" ComposeNewParamsStepRefine ComposeNewParamsStep = "refine" ComposeNewParamsStepScore ComposeNewParamsStep = "score" )
type ComposeNewResponse ¶
type ComposeNewResponse struct {
// AI feedback on the draft
Feedback string `json:"feedback"`
// Engagement score (0-100)
Score float64 `json:"score"`
// Improvement suggestions
Suggestions []string `json:"suggestions"`
// Generated or refined tweet text
Text string `json:"text"`
ExtraFields map[string]any `json:"" api:"extrafields"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Feedback respjson.Field
Score respjson.Field
Suggestions respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ComposeNewResponse) RawJSON ¶ added in v0.3.0
func (r ComposeNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ComposeNewResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *ComposeNewResponse) UnmarshalJSON(data []byte) error
type ComposeService ¶
type ComposeService struct {
// contains filtered or unexported fields
}
AI tweet composition, drafts, writing styles, and radar
ComposeService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComposeService method instead.
func NewComposeService ¶
func NewComposeService(opts ...option.RequestOption) (r ComposeService)
NewComposeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ComposeService) New ¶
func (r *ComposeService) New(ctx context.Context, body ComposeNewParams, opts ...option.RequestOption) (res *ComposeNewResponse, err error)
Compose, refine, or score a tweet
type CreditGetBalanceResponse ¶
type CreditGetBalanceResponse struct {
AutoTopupEnabled bool `json:"auto_topup_enabled" api:"required"`
Balance int64 `json:"balance" api:"required"`
LifetimePurchased int64 `json:"lifetime_purchased" api:"required"`
LifetimeUsed int64 `json:"lifetime_used" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AutoTopupEnabled respjson.Field
Balance respjson.Field
LifetimePurchased respjson.Field
LifetimeUsed respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CreditGetBalanceResponse) RawJSON ¶
func (r CreditGetBalanceResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreditGetBalanceResponse) UnmarshalJSON ¶
func (r *CreditGetBalanceResponse) UnmarshalJSON(data []byte) error
type CreditService ¶
type CreditService struct {
// contains filtered or unexported fields
}
Subscription, billing, and credits
CreditService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCreditService method instead.
func NewCreditService ¶
func NewCreditService(opts ...option.RequestOption) (r CreditService)
NewCreditService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CreditService) GetBalance ¶
func (r *CreditService) GetBalance(ctx context.Context, opts ...option.RequestOption) (res *CreditGetBalanceResponse, err error)
Get credits balance
func (*CreditService) TopupBalance ¶
func (r *CreditService) TopupBalance(ctx context.Context, body CreditTopupBalanceParams, opts ...option.RequestOption) (res *CreditTopupBalanceResponse, err error)
Top up credits balance
type CreditTopupBalanceParams ¶
type CreditTopupBalanceParams struct {
// Amount to top up in credits
Amount int64 `json:"amount" api:"required"`
// contains filtered or unexported fields
}
func (CreditTopupBalanceParams) MarshalJSON ¶
func (r CreditTopupBalanceParams) MarshalJSON() (data []byte, err error)
func (*CreditTopupBalanceParams) UnmarshalJSON ¶
func (r *CreditTopupBalanceParams) UnmarshalJSON(data []byte) error
type CreditTopupBalanceResponse ¶
type CreditTopupBalanceResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CreditTopupBalanceResponse) RawJSON ¶
func (r CreditTopupBalanceResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*CreditTopupBalanceResponse) UnmarshalJSON ¶
func (r *CreditTopupBalanceResponse) UnmarshalJSON(data []byte) error
type Delivery ¶
type Delivery struct {
ID string `json:"id" api:"required"`
Attempts int64 `json:"attempts" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
Status string `json:"status" api:"required"`
StreamEventID string `json:"streamEventId" api:"required"`
DeliveredAt time.Time `json:"deliveredAt" format:"date-time"`
LastError string `json:"lastError"`
LastStatusCode int64 `json:"lastStatusCode"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Attempts respjson.Field
CreatedAt respjson.Field
Status respjson.Field
StreamEventID respjson.Field
DeliveredAt respjson.Field
LastError respjson.Field
LastStatusCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Webhook delivery attempt record with status and retry count.
func (*Delivery) UnmarshalJSON ¶
type Draft ¶
type Draft struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
Text string `json:"text" api:"required"`
Goal string `json:"goal"`
Topic string `json:"topic"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Text respjson.Field
Goal respjson.Field
Topic respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Saved tweet draft with optional topic and goal.
func (*Draft) UnmarshalJSON ¶
type DraftDetail ¶
type DraftDetail struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
Text string `json:"text" api:"required"`
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
Goal string `json:"goal"`
Topic string `json:"topic"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Text respjson.Field
UpdatedAt respjson.Field
Goal respjson.Field
Topic respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full tweet draft including update timestamp.
func (DraftDetail) RawJSON ¶
func (r DraftDetail) RawJSON() string
Returns the unmodified JSON received from the API
func (*DraftDetail) UnmarshalJSON ¶
func (r *DraftDetail) UnmarshalJSON(data []byte) error
type DraftListParams ¶
type DraftListParams struct {
// Cursor for pagination
AfterCursor param.Opt[string] `query:"afterCursor,omitzero" json:"-"`
// Maximum number of items to return (1-100, default 50)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (DraftListParams) URLQuery ¶
func (r DraftListParams) URLQuery() (v url.Values, err error)
URLQuery serializes DraftListParams's query parameters as `url.Values`.
type DraftListResponse ¶
type DraftListResponse struct {
Drafts []Draft `json:"drafts" api:"required"`
HasMore bool `json:"hasMore" api:"required"`
NextCursor string `json:"nextCursor"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Drafts respjson.Field
HasMore respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DraftListResponse) RawJSON ¶
func (r DraftListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DraftListResponse) UnmarshalJSON ¶
func (r *DraftListResponse) UnmarshalJSON(data []byte) error
type DraftNewParams ¶
type DraftNewParams struct {
Text string `json:"text" api:"required"`
Topic param.Opt[string] `json:"topic,omitzero"`
// Any of "engagement", "followers", "authority", "conversation".
Goal DraftNewParamsGoal `json:"goal,omitzero"`
// contains filtered or unexported fields
}
func (DraftNewParams) MarshalJSON ¶
func (r DraftNewParams) MarshalJSON() (data []byte, err error)
func (*DraftNewParams) UnmarshalJSON ¶
func (r *DraftNewParams) UnmarshalJSON(data []byte) error
type DraftNewParamsGoal ¶
type DraftNewParamsGoal string
const ( DraftNewParamsGoalEngagement DraftNewParamsGoal = "engagement" DraftNewParamsGoalFollowers DraftNewParamsGoal = "followers" DraftNewParamsGoalAuthority DraftNewParamsGoal = "authority" DraftNewParamsGoalConversation DraftNewParamsGoal = "conversation" )
type DraftService ¶
type DraftService struct {
// contains filtered or unexported fields
}
AI tweet composition, drafts, writing styles, and radar
DraftService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDraftService method instead.
func NewDraftService ¶
func NewDraftService(opts ...option.RequestOption) (r DraftService)
NewDraftService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DraftService) Delete ¶
func (r *DraftService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Delete a draft
func (*DraftService) Get ¶
func (r *DraftService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *DraftDetail, err error)
Get draft by ID
func (*DraftService) List ¶
func (r *DraftService) List(ctx context.Context, query DraftListParams, opts ...option.RequestOption) (res *DraftListResponse, err error)
List saved drafts
func (*DraftService) New ¶
func (r *DraftService) New(ctx context.Context, body DraftNewParams, opts ...option.RequestOption) (res *DraftDetail, err error)
Save a tweet draft
type DrawDetail ¶
type DrawDetail struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
Status string `json:"status" api:"required"`
TotalEntries int64 `json:"totalEntries" api:"required"`
TweetAuthorUsername string `json:"tweetAuthorUsername" api:"required"`
TweetID string `json:"tweetId" api:"required"`
TweetLikeCount int64 `json:"tweetLikeCount" api:"required"`
TweetQuoteCount int64 `json:"tweetQuoteCount" api:"required"`
TweetReplyCount int64 `json:"tweetReplyCount" api:"required"`
TweetRetweetCount int64 `json:"tweetRetweetCount" api:"required"`
TweetText string `json:"tweetText" api:"required"`
TweetURL string `json:"tweetUrl" api:"required" format:"uri"`
ValidEntries int64 `json:"validEntries" api:"required"`
DrawnAt time.Time `json:"drawnAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Status respjson.Field
TotalEntries respjson.Field
TweetAuthorUsername respjson.Field
TweetID respjson.Field
TweetLikeCount respjson.Field
TweetQuoteCount respjson.Field
TweetReplyCount respjson.Field
TweetRetweetCount respjson.Field
TweetText respjson.Field
TweetURL respjson.Field
ValidEntries respjson.Field
DrawnAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full giveaway draw with tweet metrics, entries, and timing.
func (DrawDetail) RawJSON ¶
func (r DrawDetail) RawJSON() string
Returns the unmodified JSON received from the API
func (*DrawDetail) UnmarshalJSON ¶
func (r *DrawDetail) UnmarshalJSON(data []byte) error
type DrawExportParams ¶
type DrawExportParams struct {
// Export output format
//
// Any of "csv", "json", "md", "md-document", "pdf", "txt", "xlsx".
Format DrawExportParamsFormat `query:"format,omitzero" json:"-"`
// Export winners or all entries
//
// Any of "winners", "entries".
Type DrawExportParamsType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (DrawExportParams) URLQuery ¶
func (r DrawExportParams) URLQuery() (v url.Values, err error)
URLQuery serializes DrawExportParams's query parameters as `url.Values`.
type DrawExportParamsFormat ¶
type DrawExportParamsFormat string
Export output format
const ( DrawExportParamsFormatCsv DrawExportParamsFormat = "csv" DrawExportParamsFormatJson DrawExportParamsFormat = "json" DrawExportParamsFormatMd DrawExportParamsFormat = "md" DrawExportParamsFormatMdDocument DrawExportParamsFormat = "md-document" DrawExportParamsFormatPdf DrawExportParamsFormat = "pdf" DrawExportParamsFormatTxt DrawExportParamsFormat = "txt" DrawExportParamsFormatXlsx DrawExportParamsFormat = "xlsx" )
type DrawExportParamsType ¶
type DrawExportParamsType string
Export winners or all entries
const ( DrawExportParamsTypeWinners DrawExportParamsType = "winners" DrawExportParamsTypeEntries DrawExportParamsType = "entries" )
type DrawGetResponse ¶
type DrawGetResponse struct {
// Full giveaway draw with tweet metrics, entries, and timing.
Draw DrawDetail `json:"draw" api:"required"`
Winners []Winner `json:"winners" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Draw respjson.Field
Winners respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DrawGetResponse) RawJSON ¶
func (r DrawGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DrawGetResponse) UnmarshalJSON ¶
func (r *DrawGetResponse) UnmarshalJSON(data []byte) error
type DrawListItem ¶
type DrawListItem struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
Status string `json:"status" api:"required"`
TotalEntries int64 `json:"totalEntries" api:"required"`
TweetURL string `json:"tweetUrl" api:"required" format:"uri"`
ValidEntries int64 `json:"validEntries" api:"required"`
DrawnAt time.Time `json:"drawnAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Status respjson.Field
TotalEntries respjson.Field
TweetURL respjson.Field
ValidEntries respjson.Field
DrawnAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Giveaway draw summary with entry counts and status.
func (DrawListItem) RawJSON ¶
func (r DrawListItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*DrawListItem) UnmarshalJSON ¶
func (r *DrawListItem) UnmarshalJSON(data []byte) error
type DrawListParams ¶
type DrawListParams struct {
// Cursor for keyset pagination
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of items to return (1-100, default 50)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (DrawListParams) URLQuery ¶
func (r DrawListParams) URLQuery() (v url.Values, err error)
URLQuery serializes DrawListParams's query parameters as `url.Values`.
type DrawListResponse ¶
type DrawListResponse struct {
Draws []DrawListItem `json:"draws" api:"required"`
HasMore bool `json:"hasMore" api:"required"`
NextCursor string `json:"nextCursor"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Draws respjson.Field
HasMore respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DrawListResponse) RawJSON ¶
func (r DrawListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DrawListResponse) UnmarshalJSON ¶
func (r *DrawListResponse) UnmarshalJSON(data []byte) error
type DrawRunParams ¶
type DrawRunParams struct {
TweetURL string `json:"tweetUrl" api:"required" format:"uri"`
BackupCount param.Opt[int64] `json:"backupCount,omitzero"`
FilterAccountAgeDays param.Opt[int64] `json:"filterAccountAgeDays,omitzero"`
FilterLanguage param.Opt[string] `json:"filterLanguage,omitzero"`
FilterMinFollowers param.Opt[int64] `json:"filterMinFollowers,omitzero"`
MustFollowUsername param.Opt[string] `json:"mustFollowUsername,omitzero"`
MustRetweet param.Opt[bool] `json:"mustRetweet,omitzero"`
UniqueAuthorsOnly param.Opt[bool] `json:"uniqueAuthorsOnly,omitzero"`
WinnerCount param.Opt[int64] `json:"winnerCount,omitzero"`
RequiredKeywords []string `json:"requiredKeywords,omitzero"`
RequiredMentions []string `json:"requiredMentions,omitzero"`
// contains filtered or unexported fields
}
func (DrawRunParams) MarshalJSON ¶
func (r DrawRunParams) MarshalJSON() (data []byte, err error)
func (*DrawRunParams) UnmarshalJSON ¶
func (r *DrawRunParams) UnmarshalJSON(data []byte) error
type DrawRunResponse ¶
type DrawRunResponse struct {
ID string `json:"id" api:"required"`
TotalEntries int64 `json:"totalEntries" api:"required"`
TweetID string `json:"tweetId" api:"required"`
ValidEntries int64 `json:"validEntries" api:"required"`
Winners []Winner `json:"winners" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
TotalEntries respjson.Field
TweetID respjson.Field
ValidEntries respjson.Field
Winners respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DrawRunResponse) RawJSON ¶
func (r DrawRunResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DrawRunResponse) UnmarshalJSON ¶
func (r *DrawRunResponse) UnmarshalJSON(data []byte) error
type DrawService ¶
type DrawService struct {
// contains filtered or unexported fields
}
Giveaway draws from tweet replies
DrawService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDrawService method instead.
func NewDrawService ¶
func NewDrawService(opts ...option.RequestOption) (r DrawService)
NewDrawService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DrawService) Export ¶
func (r *DrawService) Export(ctx context.Context, id string, query DrawExportParams, opts ...option.RequestOption) (res *http.Response, err error)
Export draw data
func (*DrawService) Get ¶
func (r *DrawService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *DrawGetResponse, err error)
Get draw details
func (*DrawService) List ¶
func (r *DrawService) List(ctx context.Context, query DrawListParams, opts ...option.RequestOption) (res *DrawListResponse, err error)
List draws
func (*DrawService) Run ¶
func (r *DrawService) Run(ctx context.Context, body DrawRunParams, opts ...option.RequestOption) (res *DrawRunResponse, err error)
Run giveaway draw
type Event ¶
type Event struct {
ID string `json:"id" api:"required"`
Data map[string]any `json:"data" api:"required"`
MonitorID string `json:"monitorId" api:"required"`
OccurredAt time.Time `json:"occurredAt" api:"required" format:"date-time"`
// Type of monitor event fired when account activity occurs.
//
// Any of "tweet.new", "tweet.reply", "tweet.retweet", "tweet.quote".
Type shared.EventType `json:"type" api:"required"`
Username string `json:"username" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
MonitorID respjson.Field
OccurredAt respjson.Field
Type respjson.Field
Username respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Monitor event summary with type, username, and occurrence time.
func (*Event) UnmarshalJSON ¶
type EventDetail ¶
type EventDetail struct {
ID string `json:"id" api:"required"`
// Event payload — shape varies by event type (JSON)
Data map[string]any `json:"data" api:"required"`
MonitorID string `json:"monitorId" api:"required"`
OccurredAt time.Time `json:"occurredAt" api:"required" format:"date-time"`
// Type of monitor event fired when account activity occurs.
//
// Any of "tweet.new", "tweet.reply", "tweet.retweet", "tweet.quote".
Type shared.EventType `json:"type" api:"required"`
Username string `json:"username" api:"required"`
XEventID string `json:"xEventId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
MonitorID respjson.Field
OccurredAt respjson.Field
Type respjson.Field
Username respjson.Field
XEventID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full monitor event including payload data and optional X event ID.
func (EventDetail) RawJSON ¶
func (r EventDetail) RawJSON() string
Returns the unmodified JSON received from the API
func (*EventDetail) UnmarshalJSON ¶
func (r *EventDetail) UnmarshalJSON(data []byte) error
type EventListParams ¶
type EventListParams struct {
// Cursor for keyset pagination
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of items to return (1-100, default 50)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Filter events by monitor ID
MonitorID param.Opt[string] `query:"monitorId,omitzero" json:"-"`
// Filter events by type
//
// Any of "tweet.new", "tweet.reply", "tweet.retweet", "tweet.quote".
EventType shared.EventType `query:"eventType,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (EventListParams) URLQuery ¶
func (r EventListParams) URLQuery() (v url.Values, err error)
URLQuery serializes EventListParams's query parameters as `url.Values`.
type EventListResponse ¶
type EventListResponse struct {
Events []Event `json:"events" api:"required"`
HasMore bool `json:"hasMore" api:"required"`
NextCursor string `json:"nextCursor"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Events respjson.Field
HasMore respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EventListResponse) RawJSON ¶
func (r EventListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*EventListResponse) UnmarshalJSON ¶
func (r *EventListResponse) UnmarshalJSON(data []byte) error
type EventService ¶
type EventService struct {
// contains filtered or unexported fields
}
Activity events from monitored accounts
EventService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEventService method instead.
func NewEventService ¶
func NewEventService(opts ...option.RequestOption) (r EventService)
NewEventService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EventService) Get ¶
func (r *EventService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *EventDetail, err error)
Get event
func (*EventService) List ¶
func (r *EventService) List(ctx context.Context, query EventListParams, opts ...option.RequestOption) (res *EventListResponse, err error)
List events
type EventType ¶
Type of monitor event fired when account activity occurs.
This is an alias to an internal type.
type ExtractionEstimateCostParams ¶
type ExtractionEstimateCostParams struct {
// Identifier for the extraction tool used to run a job.
//
// Any of "article_extractor", "community_extractor",
// "community_moderator_explorer", "community_post_extractor", "community_search",
// "follower_explorer", "following_explorer", "list_follower_explorer",
// "list_member_extractor", "list_post_extractor", "mention_extractor",
// "people_search", "post_extractor", "quote_extractor", "reply_extractor",
// "repost_extractor", "space_explorer", "thread_extractor",
// "tweet_search_extractor", "verified_follower_explorer".
ToolType ExtractionEstimateCostParamsToolType `json:"toolType,omitzero" api:"required"`
// Raw advanced query string appended to the estimate (tweet_search_extractor)
AdvancedQuery param.Opt[string] `json:"advancedQuery,omitzero"`
// Exact phrase filter for search estimation
ExactPhrase param.Opt[string] `json:"exactPhrase,omitzero"`
// Words excluded from estimated search results
ExcludeWords param.Opt[string] `json:"excludeWords,omitzero"`
SearchQuery param.Opt[string] `json:"searchQuery,omitzero"`
TargetCommunityID param.Opt[string] `json:"targetCommunityId,omitzero"`
TargetListID param.Opt[string] `json:"targetListId,omitzero"`
TargetSpaceID param.Opt[string] `json:"targetSpaceId,omitzero"`
TargetTweetID param.Opt[string] `json:"targetTweetId,omitzero"`
TargetUsername param.Opt[string] `json:"targetUsername,omitzero"`
// contains filtered or unexported fields
}
func (ExtractionEstimateCostParams) MarshalJSON ¶
func (r ExtractionEstimateCostParams) MarshalJSON() (data []byte, err error)
func (*ExtractionEstimateCostParams) UnmarshalJSON ¶
func (r *ExtractionEstimateCostParams) UnmarshalJSON(data []byte) error
type ExtractionEstimateCostParamsToolType ¶
type ExtractionEstimateCostParamsToolType string
Identifier for the extraction tool used to run a job.
const ( ExtractionEstimateCostParamsToolTypeArticleExtractor ExtractionEstimateCostParamsToolType = "article_extractor" ExtractionEstimateCostParamsToolTypeCommunityExtractor ExtractionEstimateCostParamsToolType = "community_extractor" ExtractionEstimateCostParamsToolTypeCommunityModeratorExplorer ExtractionEstimateCostParamsToolType = "community_moderator_explorer" ExtractionEstimateCostParamsToolTypeCommunityPostExtractor ExtractionEstimateCostParamsToolType = "community_post_extractor" ExtractionEstimateCostParamsToolTypeCommunitySearch ExtractionEstimateCostParamsToolType = "community_search" ExtractionEstimateCostParamsToolTypeFollowerExplorer ExtractionEstimateCostParamsToolType = "follower_explorer" ExtractionEstimateCostParamsToolTypeFollowingExplorer ExtractionEstimateCostParamsToolType = "following_explorer" ExtractionEstimateCostParamsToolTypeListFollowerExplorer ExtractionEstimateCostParamsToolType = "list_follower_explorer" ExtractionEstimateCostParamsToolTypeListMemberExtractor ExtractionEstimateCostParamsToolType = "list_member_extractor" ExtractionEstimateCostParamsToolTypeListPostExtractor ExtractionEstimateCostParamsToolType = "list_post_extractor" ExtractionEstimateCostParamsToolTypeMentionExtractor ExtractionEstimateCostParamsToolType = "mention_extractor" ExtractionEstimateCostParamsToolTypePeopleSearch ExtractionEstimateCostParamsToolType = "people_search" ExtractionEstimateCostParamsToolTypePostExtractor ExtractionEstimateCostParamsToolType = "post_extractor" ExtractionEstimateCostParamsToolTypeQuoteExtractor ExtractionEstimateCostParamsToolType = "quote_extractor" ExtractionEstimateCostParamsToolTypeReplyExtractor ExtractionEstimateCostParamsToolType = "reply_extractor" ExtractionEstimateCostParamsToolTypeRepostExtractor ExtractionEstimateCostParamsToolType = "repost_extractor" ExtractionEstimateCostParamsToolTypeSpaceExplorer ExtractionEstimateCostParamsToolType = "space_explorer" ExtractionEstimateCostParamsToolTypeThreadExtractor ExtractionEstimateCostParamsToolType = "thread_extractor" ExtractionEstimateCostParamsToolTypeTweetSearchExtractor ExtractionEstimateCostParamsToolType = "tweet_search_extractor" ExtractionEstimateCostParamsToolTypeVerifiedFollowerExplorer ExtractionEstimateCostParamsToolType = "verified_follower_explorer" )
type ExtractionEstimateCostResponse ¶
type ExtractionEstimateCostResponse struct {
Allowed bool `json:"allowed" api:"required"`
CreditsAvailable string `json:"creditsAvailable" api:"required"`
CreditsRequired string `json:"creditsRequired" api:"required"`
EstimatedResults int64 `json:"estimatedResults" api:"required"`
Source string `json:"source" api:"required"`
ResolvedXUserID string `json:"resolvedXUserId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Allowed respjson.Field
CreditsAvailable respjson.Field
CreditsRequired respjson.Field
EstimatedResults respjson.Field
Source respjson.Field
ResolvedXUserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ExtractionEstimateCostResponse) RawJSON ¶
func (r ExtractionEstimateCostResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExtractionEstimateCostResponse) UnmarshalJSON ¶
func (r *ExtractionEstimateCostResponse) UnmarshalJSON(data []byte) error
type ExtractionExportResultsParams ¶
type ExtractionExportResultsParams struct {
// Export file format
//
// Any of "csv", "json", "md", "md-document", "pdf", "txt", "xlsx".
Format ExtractionExportResultsParamsFormat `query:"format,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ExtractionExportResultsParams) URLQuery ¶
func (r ExtractionExportResultsParams) URLQuery() (v url.Values, err error)
URLQuery serializes ExtractionExportResultsParams's query parameters as `url.Values`.
type ExtractionExportResultsParamsFormat ¶
type ExtractionExportResultsParamsFormat string
Export file format
const ( ExtractionExportResultsParamsFormatCsv ExtractionExportResultsParamsFormat = "csv" ExtractionExportResultsParamsFormatJson ExtractionExportResultsParamsFormat = "json" ExtractionExportResultsParamsFormatMd ExtractionExportResultsParamsFormat = "md" ExtractionExportResultsParamsFormatMdDocument ExtractionExportResultsParamsFormat = "md-document" ExtractionExportResultsParamsFormatPdf ExtractionExportResultsParamsFormat = "pdf" ExtractionExportResultsParamsFormatTxt ExtractionExportResultsParamsFormat = "txt" ExtractionExportResultsParamsFormatXlsx ExtractionExportResultsParamsFormat = "xlsx" )
type ExtractionGetParams ¶
type ExtractionGetParams struct {
// Cursor for keyset pagination
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of results to return (1-1000, default 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ExtractionGetParams) URLQuery ¶
func (r ExtractionGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes ExtractionGetParams's query parameters as `url.Values`.
type ExtractionGetResponse ¶
type ExtractionGetResponse struct {
HasMore bool `json:"hasMore" api:"required"`
// Extraction job metadata — shape varies by tool type (JSON)
Job map[string]any `json:"job" api:"required"`
Results []map[string]any `json:"results" api:"required"`
NextCursor string `json:"nextCursor"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HasMore respjson.Field
Job respjson.Field
Results respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ExtractionGetResponse) RawJSON ¶
func (r ExtractionGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExtractionGetResponse) UnmarshalJSON ¶
func (r *ExtractionGetResponse) UnmarshalJSON(data []byte) error
type ExtractionJob ¶
type ExtractionJob struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Any of "running", "completed", "failed".
Status ExtractionJobStatus `json:"status" api:"required"`
// Identifier for the extraction tool used to run a job.
//
// Any of "article_extractor", "community_extractor",
// "community_moderator_explorer", "community_post_extractor", "community_search",
// "follower_explorer", "following_explorer", "list_follower_explorer",
// "list_member_extractor", "list_post_extractor", "mention_extractor",
// "people_search", "post_extractor", "quote_extractor", "reply_extractor",
// "repost_extractor", "space_explorer", "thread_extractor",
// "tweet_search_extractor", "verified_follower_explorer".
ToolType ExtractionJobToolType `json:"toolType" api:"required"`
TotalResults int64 `json:"totalResults" api:"required"`
CompletedAt time.Time `json:"completedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Status respjson.Field
ToolType respjson.Field
TotalResults respjson.Field
CompletedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Extraction job tracking status, tool type, and result count.
func (ExtractionJob) RawJSON ¶
func (r ExtractionJob) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExtractionJob) UnmarshalJSON ¶
func (r *ExtractionJob) UnmarshalJSON(data []byte) error
type ExtractionJobStatus ¶
type ExtractionJobStatus string
const ( ExtractionJobStatusRunning ExtractionJobStatus = "running" ExtractionJobStatusCompleted ExtractionJobStatus = "completed" ExtractionJobStatusFailed ExtractionJobStatus = "failed" )
type ExtractionJobToolType ¶
type ExtractionJobToolType string
Identifier for the extraction tool used to run a job.
const ( ExtractionJobToolTypeArticleExtractor ExtractionJobToolType = "article_extractor" ExtractionJobToolTypeCommunityExtractor ExtractionJobToolType = "community_extractor" ExtractionJobToolTypeCommunityModeratorExplorer ExtractionJobToolType = "community_moderator_explorer" ExtractionJobToolTypeCommunityPostExtractor ExtractionJobToolType = "community_post_extractor" ExtractionJobToolTypeCommunitySearch ExtractionJobToolType = "community_search" ExtractionJobToolTypeFollowerExplorer ExtractionJobToolType = "follower_explorer" ExtractionJobToolTypeFollowingExplorer ExtractionJobToolType = "following_explorer" ExtractionJobToolTypeListFollowerExplorer ExtractionJobToolType = "list_follower_explorer" ExtractionJobToolTypeListMemberExtractor ExtractionJobToolType = "list_member_extractor" ExtractionJobToolTypeListPostExtractor ExtractionJobToolType = "list_post_extractor" ExtractionJobToolTypeMentionExtractor ExtractionJobToolType = "mention_extractor" ExtractionJobToolTypePeopleSearch ExtractionJobToolType = "people_search" ExtractionJobToolTypePostExtractor ExtractionJobToolType = "post_extractor" ExtractionJobToolTypeQuoteExtractor ExtractionJobToolType = "quote_extractor" ExtractionJobToolTypeReplyExtractor ExtractionJobToolType = "reply_extractor" ExtractionJobToolTypeRepostExtractor ExtractionJobToolType = "repost_extractor" ExtractionJobToolTypeSpaceExplorer ExtractionJobToolType = "space_explorer" ExtractionJobToolTypeThreadExtractor ExtractionJobToolType = "thread_extractor" ExtractionJobToolTypeTweetSearchExtractor ExtractionJobToolType = "tweet_search_extractor" ExtractionJobToolTypeVerifiedFollowerExplorer ExtractionJobToolType = "verified_follower_explorer" )
type ExtractionListParams ¶
type ExtractionListParams struct {
// Cursor for keyset pagination
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Maximum number of items to return (1-100, default 50)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Filter by job status
//
// Any of "running", "completed", "failed".
Status ExtractionListParamsStatus `query:"status,omitzero" json:"-"`
// Filter by extraction tool type
//
// Any of "article_extractor", "community_extractor",
// "community_moderator_explorer", "community_post_extractor", "community_search",
// "follower_explorer", "following_explorer", "list_follower_explorer",
// "list_member_extractor", "list_post_extractor", "mention_extractor",
// "people_search", "post_extractor", "quote_extractor", "reply_extractor",
// "repost_extractor", "space_explorer", "thread_extractor",
// "tweet_search_extractor", "verified_follower_explorer".
ToolType ExtractionListParamsToolType `query:"toolType,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ExtractionListParams) URLQuery ¶
func (r ExtractionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ExtractionListParams's query parameters as `url.Values`.
type ExtractionListParamsStatus ¶
type ExtractionListParamsStatus string
Filter by job status
const ( ExtractionListParamsStatusRunning ExtractionListParamsStatus = "running" ExtractionListParamsStatusCompleted ExtractionListParamsStatus = "completed" ExtractionListParamsStatusFailed ExtractionListParamsStatus = "failed" )
type ExtractionListParamsToolType ¶
type ExtractionListParamsToolType string
Filter by extraction tool type
const ( ExtractionListParamsToolTypeArticleExtractor ExtractionListParamsToolType = "article_extractor" ExtractionListParamsToolTypeCommunityExtractor ExtractionListParamsToolType = "community_extractor" ExtractionListParamsToolTypeCommunityModeratorExplorer ExtractionListParamsToolType = "community_moderator_explorer" ExtractionListParamsToolTypeCommunityPostExtractor ExtractionListParamsToolType = "community_post_extractor" ExtractionListParamsToolTypeCommunitySearch ExtractionListParamsToolType = "community_search" ExtractionListParamsToolTypeFollowerExplorer ExtractionListParamsToolType = "follower_explorer" ExtractionListParamsToolTypeFollowingExplorer ExtractionListParamsToolType = "following_explorer" ExtractionListParamsToolTypeListFollowerExplorer ExtractionListParamsToolType = "list_follower_explorer" ExtractionListParamsToolTypeListMemberExtractor ExtractionListParamsToolType = "list_member_extractor" ExtractionListParamsToolTypeListPostExtractor ExtractionListParamsToolType = "list_post_extractor" ExtractionListParamsToolTypeMentionExtractor ExtractionListParamsToolType = "mention_extractor" ExtractionListParamsToolTypePeopleSearch ExtractionListParamsToolType = "people_search" ExtractionListParamsToolTypePostExtractor ExtractionListParamsToolType = "post_extractor" ExtractionListParamsToolTypeQuoteExtractor ExtractionListParamsToolType = "quote_extractor" ExtractionListParamsToolTypeReplyExtractor ExtractionListParamsToolType = "reply_extractor" ExtractionListParamsToolTypeRepostExtractor ExtractionListParamsToolType = "repost_extractor" ExtractionListParamsToolTypeSpaceExplorer ExtractionListParamsToolType = "space_explorer" ExtractionListParamsToolTypeThreadExtractor ExtractionListParamsToolType = "thread_extractor" ExtractionListParamsToolTypeTweetSearchExtractor ExtractionListParamsToolType = "tweet_search_extractor" ExtractionListParamsToolTypeVerifiedFollowerExplorer ExtractionListParamsToolType = "verified_follower_explorer" )
type ExtractionListResponse ¶
type ExtractionListResponse struct {
Extractions []ExtractionJob `json:"extractions" api:"required"`
HasMore bool `json:"hasMore" api:"required"`
NextCursor string `json:"nextCursor"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Extractions respjson.Field
HasMore respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ExtractionListResponse) RawJSON ¶
func (r ExtractionListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExtractionListResponse) UnmarshalJSON ¶
func (r *ExtractionListResponse) UnmarshalJSON(data []byte) error
type ExtractionRunParams ¶
type ExtractionRunParams struct {
// Identifier for the extraction tool used to run a job.
//
// Any of "article_extractor", "community_extractor",
// "community_moderator_explorer", "community_post_extractor", "community_search",
// "follower_explorer", "following_explorer", "list_follower_explorer",
// "list_member_extractor", "list_post_extractor", "mention_extractor",
// "people_search", "post_extractor", "quote_extractor", "reply_extractor",
// "repost_extractor", "space_explorer", "thread_extractor",
// "tweet_search_extractor", "verified_follower_explorer".
ToolType ExtractionRunParamsToolType `json:"toolType,omitzero" api:"required"`
// Raw advanced search query appended as-is (tweet_search_extractor)
AdvancedQuery param.Opt[string] `json:"advancedQuery,omitzero"`
// Exact phrase to match (tweet_search_extractor)
ExactPhrase param.Opt[string] `json:"exactPhrase,omitzero"`
// Words to exclude from results (tweet_search_extractor)
ExcludeWords param.Opt[string] `json:"excludeWords,omitzero"`
SearchQuery param.Opt[string] `json:"searchQuery,omitzero"`
TargetCommunityID param.Opt[string] `json:"targetCommunityId,omitzero"`
TargetListID param.Opt[string] `json:"targetListId,omitzero"`
TargetSpaceID param.Opt[string] `json:"targetSpaceId,omitzero"`
TargetTweetID param.Opt[string] `json:"targetTweetId,omitzero"`
TargetUsername param.Opt[string] `json:"targetUsername,omitzero"`
// contains filtered or unexported fields
}
func (ExtractionRunParams) MarshalJSON ¶
func (r ExtractionRunParams) MarshalJSON() (data []byte, err error)
func (*ExtractionRunParams) UnmarshalJSON ¶
func (r *ExtractionRunParams) UnmarshalJSON(data []byte) error
type ExtractionRunParamsToolType ¶
type ExtractionRunParamsToolType string
Identifier for the extraction tool used to run a job.
const ( ExtractionRunParamsToolTypeArticleExtractor ExtractionRunParamsToolType = "article_extractor" ExtractionRunParamsToolTypeCommunityExtractor ExtractionRunParamsToolType = "community_extractor" ExtractionRunParamsToolTypeCommunityModeratorExplorer ExtractionRunParamsToolType = "community_moderator_explorer" ExtractionRunParamsToolTypeCommunityPostExtractor ExtractionRunParamsToolType = "community_post_extractor" ExtractionRunParamsToolTypeCommunitySearch ExtractionRunParamsToolType = "community_search" ExtractionRunParamsToolTypeFollowerExplorer ExtractionRunParamsToolType = "follower_explorer" ExtractionRunParamsToolTypeFollowingExplorer ExtractionRunParamsToolType = "following_explorer" ExtractionRunParamsToolTypeListFollowerExplorer ExtractionRunParamsToolType = "list_follower_explorer" ExtractionRunParamsToolTypeListMemberExtractor ExtractionRunParamsToolType = "list_member_extractor" ExtractionRunParamsToolTypeListPostExtractor ExtractionRunParamsToolType = "list_post_extractor" ExtractionRunParamsToolTypeMentionExtractor ExtractionRunParamsToolType = "mention_extractor" ExtractionRunParamsToolTypePeopleSearch ExtractionRunParamsToolType = "people_search" ExtractionRunParamsToolTypePostExtractor ExtractionRunParamsToolType = "post_extractor" ExtractionRunParamsToolTypeQuoteExtractor ExtractionRunParamsToolType = "quote_extractor" ExtractionRunParamsToolTypeReplyExtractor ExtractionRunParamsToolType = "reply_extractor" ExtractionRunParamsToolTypeRepostExtractor ExtractionRunParamsToolType = "repost_extractor" ExtractionRunParamsToolTypeSpaceExplorer ExtractionRunParamsToolType = "space_explorer" ExtractionRunParamsToolTypeThreadExtractor ExtractionRunParamsToolType = "thread_extractor" ExtractionRunParamsToolTypeTweetSearchExtractor ExtractionRunParamsToolType = "tweet_search_extractor" ExtractionRunParamsToolTypeVerifiedFollowerExplorer ExtractionRunParamsToolType = "verified_follower_explorer" )
type ExtractionRunResponse ¶
type ExtractionRunResponse struct {
ID string `json:"id" api:"required"`
Status constant.Running `json:"status" default:"running"`
// Identifier for the extraction tool used to run a job.
//
// Any of "article_extractor", "community_extractor",
// "community_moderator_explorer", "community_post_extractor", "community_search",
// "follower_explorer", "following_explorer", "list_follower_explorer",
// "list_member_extractor", "list_post_extractor", "mention_extractor",
// "people_search", "post_extractor", "quote_extractor", "reply_extractor",
// "repost_extractor", "space_explorer", "thread_extractor",
// "tweet_search_extractor", "verified_follower_explorer".
ToolType ExtractionRunResponseToolType `json:"toolType" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
ToolType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ExtractionRunResponse) RawJSON ¶
func (r ExtractionRunResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ExtractionRunResponse) UnmarshalJSON ¶
func (r *ExtractionRunResponse) UnmarshalJSON(data []byte) error
type ExtractionRunResponseToolType ¶
type ExtractionRunResponseToolType string
Identifier for the extraction tool used to run a job.
const ( ExtractionRunResponseToolTypeArticleExtractor ExtractionRunResponseToolType = "article_extractor" ExtractionRunResponseToolTypeCommunityExtractor ExtractionRunResponseToolType = "community_extractor" ExtractionRunResponseToolTypeCommunityModeratorExplorer ExtractionRunResponseToolType = "community_moderator_explorer" ExtractionRunResponseToolTypeCommunityPostExtractor ExtractionRunResponseToolType = "community_post_extractor" ExtractionRunResponseToolTypeCommunitySearch ExtractionRunResponseToolType = "community_search" ExtractionRunResponseToolTypeFollowerExplorer ExtractionRunResponseToolType = "follower_explorer" ExtractionRunResponseToolTypeFollowingExplorer ExtractionRunResponseToolType = "following_explorer" ExtractionRunResponseToolTypeListFollowerExplorer ExtractionRunResponseToolType = "list_follower_explorer" ExtractionRunResponseToolTypeListMemberExtractor ExtractionRunResponseToolType = "list_member_extractor" ExtractionRunResponseToolTypeListPostExtractor ExtractionRunResponseToolType = "list_post_extractor" ExtractionRunResponseToolTypeMentionExtractor ExtractionRunResponseToolType = "mention_extractor" ExtractionRunResponseToolTypePeopleSearch ExtractionRunResponseToolType = "people_search" ExtractionRunResponseToolTypePostExtractor ExtractionRunResponseToolType = "post_extractor" ExtractionRunResponseToolTypeQuoteExtractor ExtractionRunResponseToolType = "quote_extractor" ExtractionRunResponseToolTypeReplyExtractor ExtractionRunResponseToolType = "reply_extractor" ExtractionRunResponseToolTypeRepostExtractor ExtractionRunResponseToolType = "repost_extractor" ExtractionRunResponseToolTypeSpaceExplorer ExtractionRunResponseToolType = "space_explorer" ExtractionRunResponseToolTypeThreadExtractor ExtractionRunResponseToolType = "thread_extractor" ExtractionRunResponseToolTypeTweetSearchExtractor ExtractionRunResponseToolType = "tweet_search_extractor" ExtractionRunResponseToolTypeVerifiedFollowerExplorer ExtractionRunResponseToolType = "verified_follower_explorer" )
type ExtractionService ¶
type ExtractionService struct {
// contains filtered or unexported fields
}
Bulk data extraction (20 tool types)
ExtractionService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewExtractionService method instead.
func NewExtractionService ¶
func NewExtractionService(opts ...option.RequestOption) (r ExtractionService)
NewExtractionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ExtractionService) EstimateCost ¶
func (r *ExtractionService) EstimateCost(ctx context.Context, body ExtractionEstimateCostParams, opts ...option.RequestOption) (res *ExtractionEstimateCostResponse, err error)
Estimate extraction cost
func (*ExtractionService) ExportResults ¶
func (r *ExtractionService) ExportResults(ctx context.Context, id string, query ExtractionExportResultsParams, opts ...option.RequestOption) (res *http.Response, err error)
Export extraction results
func (*ExtractionService) Get ¶
func (r *ExtractionService) Get(ctx context.Context, id string, query ExtractionGetParams, opts ...option.RequestOption) (res *ExtractionGetResponse, err error)
Get extraction results
func (*ExtractionService) List ¶
func (r *ExtractionService) List(ctx context.Context, query ExtractionListParams, opts ...option.RequestOption) (res *ExtractionListResponse, err error)
List extraction jobs
func (*ExtractionService) Run ¶
func (r *ExtractionService) Run(ctx context.Context, body ExtractionRunParams, opts ...option.RequestOption) (res *ExtractionRunResponse, err error)
Run extraction
type Monitor ¶
type Monitor struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Array of event types to subscribe to.
EventTypes []shared.EventType `json:"eventTypes" api:"required"`
IsActive bool `json:"isActive" api:"required"`
Username string `json:"username" api:"required"`
XUserID string `json:"xUserId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
EventTypes respjson.Field
IsActive respjson.Field
Username respjson.Field
XUserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Account monitor that tracks activity for a given X user.
func (*Monitor) UnmarshalJSON ¶
type MonitorDeactivateResponse ¶
type MonitorDeactivateResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MonitorDeactivateResponse) RawJSON ¶
func (r MonitorDeactivateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorDeactivateResponse) UnmarshalJSON ¶
func (r *MonitorDeactivateResponse) UnmarshalJSON(data []byte) error
type MonitorListResponse ¶
type MonitorListResponse struct {
Monitors []Monitor `json:"monitors" api:"required"`
Total int64 `json:"total" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Monitors respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MonitorListResponse) RawJSON ¶
func (r MonitorListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorListResponse) UnmarshalJSON ¶
func (r *MonitorListResponse) UnmarshalJSON(data []byte) error
type MonitorNewParams ¶
type MonitorNewParams struct {
// Array of event types to subscribe to.
EventTypes []shared.EventType `json:"eventTypes,omitzero" api:"required"`
// X username (without @)
Username string `json:"username" api:"required"`
// contains filtered or unexported fields
}
func (MonitorNewParams) MarshalJSON ¶
func (r MonitorNewParams) MarshalJSON() (data []byte, err error)
func (*MonitorNewParams) UnmarshalJSON ¶
func (r *MonitorNewParams) UnmarshalJSON(data []byte) error
type MonitorNewResponse ¶
type MonitorNewResponse struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Array of event types to subscribe to.
EventTypes []shared.EventType `json:"eventTypes" api:"required"`
Username string `json:"username" api:"required"`
XUserID string `json:"xUserId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
EventTypes respjson.Field
Username respjson.Field
XUserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MonitorNewResponse) RawJSON ¶
func (r MonitorNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorNewResponse) UnmarshalJSON ¶
func (r *MonitorNewResponse) UnmarshalJSON(data []byte) error
type MonitorService ¶
type MonitorService struct {
// contains filtered or unexported fields
}
Real-time X account monitoring
MonitorService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMonitorService method instead.
func NewMonitorService ¶
func NewMonitorService(opts ...option.RequestOption) (r MonitorService)
NewMonitorService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MonitorService) Deactivate ¶
func (r *MonitorService) Deactivate(ctx context.Context, id string, opts ...option.RequestOption) (res *MonitorDeactivateResponse, err error)
Deactivate monitor
func (*MonitorService) Get ¶
func (r *MonitorService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Monitor, err error)
Get monitor
func (*MonitorService) List ¶
func (r *MonitorService) List(ctx context.Context, opts ...option.RequestOption) (res *MonitorListResponse, err error)
List monitors
func (*MonitorService) New ¶
func (r *MonitorService) New(ctx context.Context, body MonitorNewParams, opts ...option.RequestOption) (res *MonitorNewResponse, err error)
Create monitor
func (*MonitorService) Update ¶
func (r *MonitorService) Update(ctx context.Context, id string, body MonitorUpdateParams, opts ...option.RequestOption) (res *Monitor, err error)
Update monitor
type MonitorUpdateParams ¶
type MonitorUpdateParams struct {
IsActive param.Opt[bool] `json:"isActive,omitzero"`
// Array of event types to subscribe to.
EventTypes []shared.EventType `json:"eventTypes,omitzero"`
// contains filtered or unexported fields
}
func (MonitorUpdateParams) MarshalJSON ¶
func (r MonitorUpdateParams) MarshalJSON() (data []byte, err error)
func (*MonitorUpdateParams) UnmarshalJSON ¶
func (r *MonitorUpdateParams) UnmarshalJSON(data []byte) error
type PaginatedTweets ¶
type PaginatedTweets = shared.PaginatedTweets
Paginated list of tweets with cursor-based navigation.
This is an alias to an internal type.
type PaginatedUsers ¶
type PaginatedUsers = shared.PaginatedUsers
Paginated list of user profiles with cursor-based navigation.
This is an alias to an internal type.
type RadarGetTrendingTopicsParams ¶
type RadarGetTrendingTopicsParams struct {
// Cursor for pagination (from prior response nextCursor).
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Lookback window in hours (1-168, default 24).
Hours param.Opt[int64] `query:"hours,omitzero" json:"-"`
// Number of items to return (1-100, default 50).
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Region filter (us, global, etc.)
Region param.Opt[string] `query:"region,omitzero" json:"-"`
// Filter by category.
//
// Any of "general", "tech", "dev", "science", "culture", "politics", "business",
// "entertainment".
Category RadarGetTrendingTopicsParamsCategory `query:"category,omitzero" json:"-"`
// Source filter. One of: github, google_trends, hacker_news, polymarket, reddit,
// trustmrr, wikipedia
//
// Any of "github", "google_trends", "hacker_news", "polymarket", "reddit",
// "trustmrr", "wikipedia".
Source RadarGetTrendingTopicsParamsSource `query:"source,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (RadarGetTrendingTopicsParams) URLQuery ¶
func (r RadarGetTrendingTopicsParams) URLQuery() (v url.Values, err error)
URLQuery serializes RadarGetTrendingTopicsParams's query parameters as `url.Values`.
type RadarGetTrendingTopicsParamsCategory ¶ added in v0.4.0
type RadarGetTrendingTopicsParamsCategory string
Filter by category.
const ( RadarGetTrendingTopicsParamsCategoryGeneral RadarGetTrendingTopicsParamsCategory = "general" RadarGetTrendingTopicsParamsCategoryTech RadarGetTrendingTopicsParamsCategory = "tech" RadarGetTrendingTopicsParamsCategoryDev RadarGetTrendingTopicsParamsCategory = "dev" RadarGetTrendingTopicsParamsCategoryScience RadarGetTrendingTopicsParamsCategory = "science" RadarGetTrendingTopicsParamsCategoryCulture RadarGetTrendingTopicsParamsCategory = "culture" RadarGetTrendingTopicsParamsCategoryPolitics RadarGetTrendingTopicsParamsCategory = "politics" RadarGetTrendingTopicsParamsCategoryBusiness RadarGetTrendingTopicsParamsCategory = "business" RadarGetTrendingTopicsParamsCategoryEntertainment RadarGetTrendingTopicsParamsCategory = "entertainment" )
type RadarGetTrendingTopicsParamsSource ¶ added in v0.3.0
type RadarGetTrendingTopicsParamsSource string
Source filter. One of: github, google_trends, hacker_news, polymarket, reddit, trustmrr, wikipedia
const ( RadarGetTrendingTopicsParamsSourceGitHub RadarGetTrendingTopicsParamsSource = "github" RadarGetTrendingTopicsParamsSourceGoogleTrends RadarGetTrendingTopicsParamsSource = "google_trends" RadarGetTrendingTopicsParamsSourceHackerNews RadarGetTrendingTopicsParamsSource = "hacker_news" RadarGetTrendingTopicsParamsSourcePolymarket RadarGetTrendingTopicsParamsSource = "polymarket" RadarGetTrendingTopicsParamsSourceReddit RadarGetTrendingTopicsParamsSource = "reddit" RadarGetTrendingTopicsParamsSourceTrustmrr RadarGetTrendingTopicsParamsSource = "trustmrr" RadarGetTrendingTopicsParamsSourceWikipedia RadarGetTrendingTopicsParamsSource = "wikipedia" )
type RadarGetTrendingTopicsResponse ¶
type RadarGetTrendingTopicsResponse struct {
HasMore bool `json:"hasMore" api:"required"`
Items []RadarItem `json:"items" api:"required"`
// Opaque cursor for the next page (present only when hasMore is true).
NextCursor string `json:"nextCursor"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HasMore respjson.Field
Items respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RadarGetTrendingTopicsResponse) RawJSON ¶
func (r RadarGetTrendingTopicsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RadarGetTrendingTopicsResponse) UnmarshalJSON ¶
func (r *RadarGetTrendingTopicsResponse) UnmarshalJSON(data []byte) error
type RadarItem ¶
type RadarItem struct {
// Internal numeric identifier (stringified bigint).
ID string `json:"id" api:"required"`
// Any of "general", "tech", "dev", "science", "culture", "politics", "business",
// "entertainment".
Category RadarItemCategory `json:"category" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
Language string `json:"language" api:"required"`
// Source-specific fields. Shape varies per source:
//
// - reddit: { subreddit: string, author: string }
// - github: { starsToday: number }
// - hacker_news: { points: number, numberComments: number }
// - google_trends: { approxTraffic: number }
// - polymarket: { volume24hr: number }
// - wikipedia: { views: number }
// - trustmrr: { mrr, growthPercent, last30Days, total, customers,
// activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
// growthMrrPercent?, multiple?, paymentProvider?, rank? }
Metadata map[string]any `json:"metadata" api:"required"`
PublishedAt time.Time `json:"publishedAt" api:"required" format:"date-time"`
Region string `json:"region" api:"required"`
Score float64 `json:"score" api:"required"`
// Any of "github", "google_trends", "hacker_news", "polymarket", "reddit",
// "trustmrr", "wikipedia".
Source RadarItemSource `json:"source" api:"required"`
// Source-specific identifier used for deduplication.
SourceID string `json:"sourceId" api:"required"`
Title string `json:"title" api:"required"`
Description string `json:"description"`
ImageURL string `json:"imageUrl"`
URL string `json:"url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Category respjson.Field
CreatedAt respjson.Field
Language respjson.Field
Metadata respjson.Field
PublishedAt respjson.Field
Region respjson.Field
Score respjson.Field
Source respjson.Field
SourceID respjson.Field
Title respjson.Field
Description respjson.Field
ImageURL respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Trending topic with score, category, source, region, language, and source-specific metadata.
func (*RadarItem) UnmarshalJSON ¶
type RadarItemCategory ¶ added in v0.4.0
type RadarItemCategory string
const ( RadarItemCategoryGeneral RadarItemCategory = "general" RadarItemCategoryTech RadarItemCategory = "tech" RadarItemCategoryDev RadarItemCategory = "dev" RadarItemCategoryScience RadarItemCategory = "science" RadarItemCategoryCulture RadarItemCategory = "culture" RadarItemCategoryPolitics RadarItemCategory = "politics" RadarItemCategoryBusiness RadarItemCategory = "business" RadarItemCategoryEntertainment RadarItemCategory = "entertainment" )
type RadarItemSource ¶ added in v0.4.0
type RadarItemSource string
const ( RadarItemSourceGitHub RadarItemSource = "github" RadarItemSourceGoogleTrends RadarItemSource = "google_trends" RadarItemSourceHackerNews RadarItemSource = "hacker_news" RadarItemSourcePolymarket RadarItemSource = "polymarket" RadarItemSourceReddit RadarItemSource = "reddit" RadarItemSourceTrustmrr RadarItemSource = "trustmrr" RadarItemSourceWikipedia RadarItemSource = "wikipedia" )
type RadarService ¶
type RadarService struct {
// contains filtered or unexported fields
}
AI tweet composition, drafts, writing styles, and radar
RadarService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRadarService method instead.
func NewRadarService ¶
func NewRadarService(opts ...option.RequestOption) (r RadarService)
NewRadarService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RadarService) GetTrendingTopics ¶
func (r *RadarService) GetTrendingTopics(ctx context.Context, query RadarGetTrendingTopicsParams, opts ...option.RequestOption) (res *RadarGetTrendingTopicsResponse, err error)
Get trending topics from curated sources
type SearchTweet ¶
type SearchTweet = shared.SearchTweet
Tweet returned from search results with inline author info.
This is an alias to an internal type.
type SearchTweetAuthor ¶
type SearchTweetAuthor = shared.SearchTweetAuthor
This is an alias to an internal type.
type StyleAnalyzeParams ¶
type StyleAnalyzeParams struct {
// X username to analyze
Username string `json:"username" api:"required"`
// contains filtered or unexported fields
}
func (StyleAnalyzeParams) MarshalJSON ¶
func (r StyleAnalyzeParams) MarshalJSON() (data []byte, err error)
func (*StyleAnalyzeParams) UnmarshalJSON ¶
func (r *StyleAnalyzeParams) UnmarshalJSON(data []byte) error
type StyleCompareParams ¶
type StyleCompareParams struct {
// First username to compare
Username1 string `query:"username1" api:"required" json:"-"`
// Second username to compare
Username2 string `query:"username2" api:"required" json:"-"`
// contains filtered or unexported fields
}
func (StyleCompareParams) URLQuery ¶
func (r StyleCompareParams) URLQuery() (v url.Values, err error)
URLQuery serializes StyleCompareParams's query parameters as `url.Values`.
type StyleCompareResponse ¶
type StyleCompareResponse struct {
// Full style profile with sampled tweets used for tone analysis.
Style1 StyleProfile `json:"style1" api:"required"`
// Full style profile with sampled tweets used for tone analysis.
Style2 StyleProfile `json:"style2" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Style1 respjson.Field
Style2 respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StyleCompareResponse) RawJSON ¶
func (r StyleCompareResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*StyleCompareResponse) UnmarshalJSON ¶
func (r *StyleCompareResponse) UnmarshalJSON(data []byte) error
type StyleGetPerformanceResponse ¶
type StyleGetPerformanceResponse struct {
TweetCount int64 `json:"tweetCount" api:"required"`
Tweets []StyleGetPerformanceResponseTweet `json:"tweets" api:"required"`
XUsername string `json:"xUsername" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
TweetCount respjson.Field
Tweets respjson.Field
XUsername respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StyleGetPerformanceResponse) RawJSON ¶
func (r StyleGetPerformanceResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*StyleGetPerformanceResponse) UnmarshalJSON ¶
func (r *StyleGetPerformanceResponse) UnmarshalJSON(data []byte) error
type StyleGetPerformanceResponseTweet ¶
type StyleGetPerformanceResponseTweet struct {
ID string `json:"id" api:"required"`
Text string `json:"text" api:"required"`
CreatedAt string `json:"createdAt"`
LikeCount int64 `json:"likeCount"`
ReplyCount int64 `json:"replyCount"`
RetweetCount int64 `json:"retweetCount"`
ViewCount int64 `json:"viewCount"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Text respjson.Field
CreatedAt respjson.Field
LikeCount respjson.Field
ReplyCount respjson.Field
RetweetCount respjson.Field
ViewCount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StyleGetPerformanceResponseTweet) RawJSON ¶
func (r StyleGetPerformanceResponseTweet) RawJSON() string
Returns the unmodified JSON received from the API
func (*StyleGetPerformanceResponseTweet) UnmarshalJSON ¶
func (r *StyleGetPerformanceResponseTweet) UnmarshalJSON(data []byte) error
type StyleListResponse ¶
type StyleListResponse struct {
Styles []StyleProfileSummary `json:"styles" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Styles respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StyleListResponse) RawJSON ¶
func (r StyleListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*StyleListResponse) UnmarshalJSON ¶
func (r *StyleListResponse) UnmarshalJSON(data []byte) error
type StyleProfile ¶
type StyleProfile struct {
FetchedAt time.Time `json:"fetchedAt" api:"required" format:"date-time"`
IsOwnAccount bool `json:"isOwnAccount" api:"required"`
TweetCount int64 `json:"tweetCount" api:"required"`
Tweets []StyleProfileTweet `json:"tweets" api:"required"`
XUsername string `json:"xUsername" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FetchedAt respjson.Field
IsOwnAccount respjson.Field
TweetCount respjson.Field
Tweets respjson.Field
XUsername respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full style profile with sampled tweets used for tone analysis.
func (StyleProfile) RawJSON ¶
func (r StyleProfile) RawJSON() string
Returns the unmodified JSON received from the API
func (*StyleProfile) UnmarshalJSON ¶
func (r *StyleProfile) UnmarshalJSON(data []byte) error
type StyleProfileSummary ¶
type StyleProfileSummary struct {
FetchedAt time.Time `json:"fetchedAt" api:"required" format:"date-time"`
IsOwnAccount bool `json:"isOwnAccount" api:"required"`
TweetCount int64 `json:"tweetCount" api:"required"`
XUsername string `json:"xUsername" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FetchedAt respjson.Field
IsOwnAccount respjson.Field
TweetCount respjson.Field
XUsername respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Style profile summary with tweet count and ownership flag.
func (StyleProfileSummary) RawJSON ¶
func (r StyleProfileSummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*StyleProfileSummary) UnmarshalJSON ¶
func (r *StyleProfileSummary) UnmarshalJSON(data []byte) error
type StyleProfileTweet ¶
type StyleProfileTweet struct {
ID string `json:"id" api:"required"`
Text string `json:"text" api:"required"`
AuthorUsername string `json:"authorUsername"`
CreatedAt string `json:"createdAt"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Text respjson.Field
AuthorUsername respjson.Field
CreatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StyleProfileTweet) RawJSON ¶
func (r StyleProfileTweet) RawJSON() string
Returns the unmodified JSON received from the API
func (*StyleProfileTweet) UnmarshalJSON ¶
func (r *StyleProfileTweet) UnmarshalJSON(data []byte) error
type StyleService ¶
type StyleService struct {
// contains filtered or unexported fields
}
AI tweet composition, drafts, writing styles, and radar
StyleService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStyleService method instead.
func NewStyleService ¶
func NewStyleService(opts ...option.RequestOption) (r StyleService)
NewStyleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*StyleService) Analyze ¶
func (r *StyleService) Analyze(ctx context.Context, body StyleAnalyzeParams, opts ...option.RequestOption) (res *StyleProfile, err error)
Analyze writing style from recent tweets
func (*StyleService) Compare ¶
func (r *StyleService) Compare(ctx context.Context, query StyleCompareParams, opts ...option.RequestOption) (res *StyleCompareResponse, err error)
Compare two style profiles
func (*StyleService) Delete ¶
func (r *StyleService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Delete a style profile
func (*StyleService) Get ¶
func (r *StyleService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *StyleProfile, err error)
Get cached style profile
func (*StyleService) GetPerformance ¶
func (r *StyleService) GetPerformance(ctx context.Context, id string, opts ...option.RequestOption) (res *StyleGetPerformanceResponse, err error)
Get engagement metrics for style tweets
func (*StyleService) List ¶
func (r *StyleService) List(ctx context.Context, opts ...option.RequestOption) (res *StyleListResponse, err error)
List cached style profiles
func (*StyleService) Update ¶
func (r *StyleService) Update(ctx context.Context, id string, body StyleUpdateParams, opts ...option.RequestOption) (res *StyleProfile, err error)
Save style profile with custom tweets
type StyleUpdateParams ¶
type StyleUpdateParams struct {
// Display label for the style
Label string `json:"label" api:"required"`
// Array of tweet objects
Tweets []StyleUpdateParamsTweet `json:"tweets,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (StyleUpdateParams) MarshalJSON ¶
func (r StyleUpdateParams) MarshalJSON() (data []byte, err error)
func (*StyleUpdateParams) UnmarshalJSON ¶
func (r *StyleUpdateParams) UnmarshalJSON(data []byte) error
type StyleUpdateParamsTweet ¶
type StyleUpdateParamsTweet struct {
Text string `json:"text" api:"required"`
// contains filtered or unexported fields
}
The property Text is required.
func (StyleUpdateParamsTweet) MarshalJSON ¶
func (r StyleUpdateParamsTweet) MarshalJSON() (data []byte, err error)
func (*StyleUpdateParamsTweet) UnmarshalJSON ¶
func (r *StyleUpdateParamsTweet) UnmarshalJSON(data []byte) error
type SubscribeNewResponse ¶
type SubscribeNewResponse struct {
URL string `json:"url" api:"required" format:"uri"`
Message string `json:"message"`
// Any of "checkout_created", "already_subscribed", "payment_issue".
Status SubscribeNewResponseStatus `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
URL respjson.Field
Message respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SubscribeNewResponse) RawJSON ¶
func (r SubscribeNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SubscribeNewResponse) UnmarshalJSON ¶
func (r *SubscribeNewResponse) UnmarshalJSON(data []byte) error
type SubscribeNewResponseStatus ¶
type SubscribeNewResponseStatus string
const ( SubscribeNewResponseStatusCheckoutCreated SubscribeNewResponseStatus = "checkout_created" SubscribeNewResponseStatusAlreadySubscribed SubscribeNewResponseStatus = "already_subscribed" SubscribeNewResponseStatusPaymentIssue SubscribeNewResponseStatus = "payment_issue" )
type SubscribeService ¶
type SubscribeService struct {
// contains filtered or unexported fields
}
Subscription, billing, and credits
SubscribeService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSubscribeService method instead.
func NewSubscribeService ¶
func NewSubscribeService(opts ...option.RequestOption) (r SubscribeService)
NewSubscribeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SubscribeService) New ¶
func (r *SubscribeService) New(ctx context.Context, opts ...option.RequestOption) (res *SubscribeNewResponse, err error)
Get checkout or billing URL
type SupportService ¶
type SupportService struct {
// Support ticket management
Tickets SupportTicketService
// contains filtered or unexported fields
}
SupportService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSupportService method instead.
func NewSupportService ¶
func NewSupportService(opts ...option.RequestOption) (r SupportService)
NewSupportService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type SupportTicketGetResponse ¶
type SupportTicketGetResponse struct {
CreatedAt time.Time `json:"createdAt" format:"date-time"`
Messages []SupportTicketGetResponseMessage `json:"messages"`
PublicID string `json:"publicId"`
Status string `json:"status"`
Subject string `json:"subject"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Messages respjson.Field
PublicID respjson.Field
Status respjson.Field
Subject respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SupportTicketGetResponse) RawJSON ¶
func (r SupportTicketGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SupportTicketGetResponse) UnmarshalJSON ¶
func (r *SupportTicketGetResponse) UnmarshalJSON(data []byte) error
type SupportTicketGetResponseMessage ¶
type SupportTicketGetResponseMessage struct {
Body string `json:"body"`
CreatedAt time.Time `json:"createdAt" format:"date-time"`
Sender string `json:"sender"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Body respjson.Field
CreatedAt respjson.Field
Sender respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SupportTicketGetResponseMessage) RawJSON ¶
func (r SupportTicketGetResponseMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*SupportTicketGetResponseMessage) UnmarshalJSON ¶
func (r *SupportTicketGetResponseMessage) UnmarshalJSON(data []byte) error
type SupportTicketListResponse ¶
type SupportTicketListResponse struct {
Tickets []SupportTicketListResponseTicket `json:"tickets"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Tickets respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SupportTicketListResponse) RawJSON ¶
func (r SupportTicketListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SupportTicketListResponse) UnmarshalJSON ¶
func (r *SupportTicketListResponse) UnmarshalJSON(data []byte) error
type SupportTicketListResponseTicket ¶
type SupportTicketListResponseTicket struct {
CreatedAt time.Time `json:"createdAt" format:"date-time"`
MessageCount int64 `json:"messageCount"`
PublicID string `json:"publicId"`
Status string `json:"status"`
Subject string `json:"subject"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
MessageCount respjson.Field
PublicID respjson.Field
Status respjson.Field
Subject respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SupportTicketListResponseTicket) RawJSON ¶
func (r SupportTicketListResponseTicket) RawJSON() string
Returns the unmodified JSON received from the API
func (*SupportTicketListResponseTicket) UnmarshalJSON ¶
func (r *SupportTicketListResponseTicket) UnmarshalJSON(data []byte) error
type SupportTicketNewParams ¶
type SupportTicketNewParams struct {
Body string `json:"body" api:"required"`
Subject string `json:"subject" api:"required"`
// contains filtered or unexported fields
}
func (SupportTicketNewParams) MarshalJSON ¶
func (r SupportTicketNewParams) MarshalJSON() (data []byte, err error)
func (*SupportTicketNewParams) UnmarshalJSON ¶
func (r *SupportTicketNewParams) UnmarshalJSON(data []byte) error
type SupportTicketNewResponse ¶
type SupportTicketNewResponse struct {
PublicID string `json:"publicId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PublicID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SupportTicketNewResponse) RawJSON ¶
func (r SupportTicketNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SupportTicketNewResponse) UnmarshalJSON ¶
func (r *SupportTicketNewResponse) UnmarshalJSON(data []byte) error
type SupportTicketReplyParams ¶
type SupportTicketReplyParams struct {
Body string `json:"body" api:"required"`
// contains filtered or unexported fields
}
func (SupportTicketReplyParams) MarshalJSON ¶
func (r SupportTicketReplyParams) MarshalJSON() (data []byte, err error)
func (*SupportTicketReplyParams) UnmarshalJSON ¶
func (r *SupportTicketReplyParams) UnmarshalJSON(data []byte) error
type SupportTicketReplyResponse ¶
type SupportTicketReplyResponse struct {
PublicID string `json:"publicId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PublicID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SupportTicketReplyResponse) RawJSON ¶
func (r SupportTicketReplyResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SupportTicketReplyResponse) UnmarshalJSON ¶
func (r *SupportTicketReplyResponse) UnmarshalJSON(data []byte) error
type SupportTicketService ¶
type SupportTicketService struct {
// contains filtered or unexported fields
}
Support ticket management
SupportTicketService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSupportTicketService method instead.
func NewSupportTicketService ¶
func NewSupportTicketService(opts ...option.RequestOption) (r SupportTicketService)
NewSupportTicketService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SupportTicketService) Get ¶
func (r *SupportTicketService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *SupportTicketGetResponse, err error)
Get ticket with all messages
func (*SupportTicketService) List ¶
func (r *SupportTicketService) List(ctx context.Context, opts ...option.RequestOption) (res *SupportTicketListResponse, err error)
List user's support tickets
func (*SupportTicketService) New ¶
func (r *SupportTicketService) New(ctx context.Context, body SupportTicketNewParams, opts ...option.RequestOption) (res *SupportTicketNewResponse, err error)
Create a support ticket
func (*SupportTicketService) Reply ¶
func (r *SupportTicketService) Reply(ctx context.Context, id string, body SupportTicketReplyParams, opts ...option.RequestOption) (res *SupportTicketReplyResponse, err error)
Reply to a support ticket
func (*SupportTicketService) Update ¶
func (r *SupportTicketService) Update(ctx context.Context, id string, body SupportTicketUpdateParams, opts ...option.RequestOption) (res *SupportTicketUpdateResponse, err error)
Update ticket status
type SupportTicketUpdateParams ¶
type SupportTicketUpdateParams struct {
// Any of "open", "resolved", "closed".
Status SupportTicketUpdateParamsStatus `json:"status,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (SupportTicketUpdateParams) MarshalJSON ¶
func (r SupportTicketUpdateParams) MarshalJSON() (data []byte, err error)
func (*SupportTicketUpdateParams) UnmarshalJSON ¶
func (r *SupportTicketUpdateParams) UnmarshalJSON(data []byte) error
type SupportTicketUpdateParamsStatus ¶
type SupportTicketUpdateParamsStatus string
const ( SupportTicketUpdateParamsStatusOpen SupportTicketUpdateParamsStatus = "open" SupportTicketUpdateParamsStatusResolved SupportTicketUpdateParamsStatus = "resolved" SupportTicketUpdateParamsStatusClosed SupportTicketUpdateParamsStatus = "closed" )
type SupportTicketUpdateResponse ¶
type SupportTicketUpdateResponse struct {
PublicID string `json:"publicId"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PublicID respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SupportTicketUpdateResponse) RawJSON ¶
func (r SupportTicketUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SupportTicketUpdateResponse) UnmarshalJSON ¶
func (r *SupportTicketUpdateResponse) UnmarshalJSON(data []byte) error
type TrendListParams ¶
type TrendListParams struct {
// Number of trending topics to return (1-50, default 30)
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey)
Woeid param.Opt[int64] `query:"woeid,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TrendListParams) URLQuery ¶
func (r TrendListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TrendListParams's query parameters as `url.Values`.
type TrendListResponse ¶
type TrendListResponse struct {
Total int64 `json:"total" api:"required"`
Trends []TrendListResponseTrend `json:"trends" api:"required"`
Woeid int64 `json:"woeid" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Total respjson.Field
Trends respjson.Field
Woeid respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrendListResponse) RawJSON ¶
func (r TrendListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrendListResponse) UnmarshalJSON ¶
func (r *TrendListResponse) UnmarshalJSON(data []byte) error
type TrendListResponseTrend ¶
type TrendListResponseTrend struct {
Name string `json:"name" api:"required"`
Description string `json:"description"`
Query string `json:"query"`
Rank int64 `json:"rank"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Description respjson.Field
Query respjson.Field
Rank respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TrendListResponseTrend) RawJSON ¶
func (r TrendListResponseTrend) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrendListResponseTrend) UnmarshalJSON ¶
func (r *TrendListResponseTrend) UnmarshalJSON(data []byte) error
type TrendService ¶
type TrendService struct {
// contains filtered or unexported fields
}
Trending topics and hashtags by region
TrendService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTrendService method instead.
func NewTrendService ¶
func NewTrendService(opts ...option.RequestOption) (r TrendService)
NewTrendService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TrendService) List ¶
func (r *TrendService) List(ctx context.Context, query TrendListParams, opts ...option.RequestOption) (res *TrendListResponse, err error)
Get trending hashtags and topics by region (alias)
type TweetAuthor ¶
type TweetAuthor struct {
ID string `json:"id" api:"required"`
Followers int64 `json:"followers" api:"required"`
Username string `json:"username" api:"required"`
Verified bool `json:"verified" api:"required"`
ProfilePicture string `json:"profilePicture"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Followers respjson.Field
Username respjson.Field
Verified respjson.Field
ProfilePicture respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Author of a tweet with follower count and verification status.
func (TweetAuthor) RawJSON ¶
func (r TweetAuthor) RawJSON() string
Returns the unmodified JSON received from the API
func (*TweetAuthor) UnmarshalJSON ¶
func (r *TweetAuthor) UnmarshalJSON(data []byte) error
type TweetDetail ¶
type TweetDetail struct {
ID string `json:"id" api:"required"`
BookmarkCount int64 `json:"bookmarkCount" api:"required"`
LikeCount int64 `json:"likeCount" api:"required"`
QuoteCount int64 `json:"quoteCount" api:"required"`
ReplyCount int64 `json:"replyCount" api:"required"`
RetweetCount int64 `json:"retweetCount" api:"required"`
Text string `json:"text" api:"required"`
ViewCount int64 `json:"viewCount" api:"required"`
// ID of the root tweet in the conversation thread
ConversationID string `json:"conversationId"`
CreatedAt string `json:"createdAt"`
// Parsed entities from the tweet text (URLs, mentions, hashtags, media)
Entities map[string]any `json:"entities"`
// Whether this is a Note Tweet (long-form post, up to 25,000 characters)
IsNoteTweet bool `json:"isNoteTweet"`
// Whether this tweet quotes another tweet
IsQuoteStatus bool `json:"isQuoteStatus"`
// Whether this tweet is a reply to another tweet
IsReply bool `json:"isReply"`
// Attached media items, omitted when the tweet has no media
Media []TweetDetailMedia `json:"media"`
// The quoted tweet object, present when isQuoteStatus is true
QuotedTweet map[string]any `json:"quoted_tweet"`
// Client application used to post this tweet
Source string `json:"source"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BookmarkCount respjson.Field
LikeCount respjson.Field
QuoteCount respjson.Field
ReplyCount respjson.Field
RetweetCount respjson.Field
Text respjson.Field
ViewCount respjson.Field
ConversationID respjson.Field
CreatedAt respjson.Field
Entities respjson.Field
IsNoteTweet respjson.Field
IsQuoteStatus respjson.Field
IsReply respjson.Field
Media respjson.Field
QuotedTweet respjson.Field
Source respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full tweet with text, engagement metrics, media, and metadata.
func (TweetDetail) RawJSON ¶
func (r TweetDetail) RawJSON() string
Returns the unmodified JSON received from the API
func (*TweetDetail) UnmarshalJSON ¶
func (r *TweetDetail) UnmarshalJSON(data []byte) error
type TweetDetailMedia ¶ added in v0.3.0
type TweetDetailMedia struct {
MediaURL string `json:"mediaUrl"`
// Any of "photo", "video", "animated_gif".
Type string `json:"type"`
URL string `json:"url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MediaURL respjson.Field
Type respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TweetDetailMedia) RawJSON ¶ added in v0.3.0
func (r TweetDetailMedia) RawJSON() string
Returns the unmodified JSON received from the API
func (*TweetDetailMedia) UnmarshalJSON ¶ added in v0.3.0
func (r *TweetDetailMedia) UnmarshalJSON(data []byte) error
type UserProfile ¶
type UserProfile = shared.UserProfile
X user profile with bio, follower counts, and verification status.
This is an alias to an internal type.
type Webhook ¶
type Webhook struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Array of event types to subscribe to.
EventTypes []shared.EventType `json:"eventTypes" api:"required"`
IsActive bool `json:"isActive" api:"required"`
URL string `json:"url" api:"required" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
EventTypes respjson.Field
IsActive respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Webhook endpoint registered to receive event deliveries.
func (*Webhook) UnmarshalJSON ¶
type WebhookDeactivateResponse ¶
type WebhookDeactivateResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookDeactivateResponse) RawJSON ¶
func (r WebhookDeactivateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookDeactivateResponse) UnmarshalJSON ¶
func (r *WebhookDeactivateResponse) UnmarshalJSON(data []byte) error
type WebhookListDeliveriesResponse ¶
type WebhookListDeliveriesResponse struct {
Deliveries []Delivery `json:"deliveries" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Deliveries respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookListDeliveriesResponse) RawJSON ¶
func (r WebhookListDeliveriesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListDeliveriesResponse) UnmarshalJSON ¶
func (r *WebhookListDeliveriesResponse) UnmarshalJSON(data []byte) error
type WebhookListResponse ¶
type WebhookListResponse struct {
Webhooks []Webhook `json:"webhooks" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Webhooks respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookListResponse) RawJSON ¶
func (r WebhookListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListResponse) UnmarshalJSON ¶
func (r *WebhookListResponse) UnmarshalJSON(data []byte) error
type WebhookNewParams ¶
type WebhookNewParams struct {
// Array of event types to subscribe to.
EventTypes []shared.EventType `json:"eventTypes,omitzero" api:"required"`
// HTTPS URL
URL string `json:"url" api:"required" format:"uri"`
// contains filtered or unexported fields
}
func (WebhookNewParams) MarshalJSON ¶
func (r WebhookNewParams) MarshalJSON() (data []byte, err error)
func (*WebhookNewParams) UnmarshalJSON ¶
func (r *WebhookNewParams) UnmarshalJSON(data []byte) error
type WebhookNewResponse ¶
type WebhookNewResponse struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Array of event types to subscribe to.
EventTypes []shared.EventType `json:"eventTypes" api:"required"`
Secret string `json:"secret" api:"required"`
URL string `json:"url" api:"required" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
EventTypes respjson.Field
Secret respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookNewResponse) RawJSON ¶
func (r WebhookNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookNewResponse) UnmarshalJSON ¶
func (r *WebhookNewResponse) UnmarshalJSON(data []byte) error
type WebhookService ¶
type WebhookService struct {
// contains filtered or unexported fields
}
Webhook endpoint management and delivery
WebhookService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.
func NewWebhookService ¶
func NewWebhookService(opts ...option.RequestOption) (r WebhookService)
NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WebhookService) Deactivate ¶
func (r *WebhookService) Deactivate(ctx context.Context, id string, opts ...option.RequestOption) (res *WebhookDeactivateResponse, err error)
Deactivate webhook
func (*WebhookService) List ¶
func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *WebhookListResponse, err error)
List webhooks
func (*WebhookService) ListDeliveries ¶
func (r *WebhookService) ListDeliveries(ctx context.Context, id string, opts ...option.RequestOption) (res *WebhookListDeliveriesResponse, err error)
List webhook deliveries
func (*WebhookService) New ¶
func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *WebhookNewResponse, err error)
Create webhook
func (*WebhookService) Test ¶
func (r *WebhookService) Test(ctx context.Context, id string, opts ...option.RequestOption) (res *WebhookTestResponse, err error)
Test webhook endpoint
func (*WebhookService) Update ¶
func (r *WebhookService) Update(ctx context.Context, id string, body WebhookUpdateParams, opts ...option.RequestOption) (res *Webhook, err error)
Update webhook
type WebhookTestResponse ¶
type WebhookTestResponse struct {
StatusCode int64 `json:"statusCode" api:"required"`
Success bool `json:"success" api:"required"`
Error string `json:"error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
StatusCode respjson.Field
Success respjson.Field
Error respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookTestResponse) RawJSON ¶
func (r WebhookTestResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookTestResponse) UnmarshalJSON ¶
func (r *WebhookTestResponse) UnmarshalJSON(data []byte) error
type WebhookUpdateParams ¶
type WebhookUpdateParams struct {
IsActive param.Opt[bool] `json:"isActive,omitzero"`
URL param.Opt[string] `json:"url,omitzero" format:"uri"`
// Array of event types to subscribe to.
EventTypes []shared.EventType `json:"eventTypes,omitzero"`
// contains filtered or unexported fields
}
func (WebhookUpdateParams) MarshalJSON ¶
func (r WebhookUpdateParams) MarshalJSON() (data []byte, err error)
func (*WebhookUpdateParams) UnmarshalJSON ¶
func (r *WebhookUpdateParams) UnmarshalJSON(data []byte) error
type Winner ¶
type Winner struct {
AuthorUsername string `json:"authorUsername" api:"required"`
IsBackup bool `json:"isBackup" api:"required"`
Position int64 `json:"position" api:"required"`
TweetID string `json:"tweetId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AuthorUsername respjson.Field
IsBackup respjson.Field
Position respjson.Field
TweetID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Giveaway draw winner with position and backup flag.
func (*Winner) UnmarshalJSON ¶
type XAccount ¶
type XAccount struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user
// must submit fresh credentials. `locked` = X locked the account; unlock on x.com
// first. `suspended` = X banned the account. `recovering` = past cooldown, will
// auto-retry on next use. `temporaryIssue` = transient backend problem; retry
// shortly.
//
// Any of "healthy", "locked", "needsReauth", "recovering", "suspended",
// "temporaryIssue".
Health XAccountHealth `json:"health" api:"required"`
Status string `json:"status" api:"required"`
XUserID string `json:"xUserId" api:"required"`
XUsername string `json:"xUsername" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Health respjson.Field
Status respjson.Field
XUserID respjson.Field
XUsername respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Linked X account summary with username and connection status.
func (*XAccount) UnmarshalJSON ¶
type XAccountBulkRetryResponse ¶ added in v0.3.0
type XAccountBulkRetryResponse struct {
// Number of accounts cleared
Cleared int64 `json:"cleared" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Cleared respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XAccountBulkRetryResponse) RawJSON ¶ added in v0.3.0
func (r XAccountBulkRetryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XAccountBulkRetryResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *XAccountBulkRetryResponse) UnmarshalJSON(data []byte) error
type XAccountDeleteResponse ¶
type XAccountDeleteResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XAccountDeleteResponse) RawJSON ¶
func (r XAccountDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XAccountDeleteResponse) UnmarshalJSON ¶
func (r *XAccountDeleteResponse) UnmarshalJSON(data []byte) error
type XAccountDetail ¶
type XAccountDetail struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Any of "healthy", "locked", "needsReauth", "recovering", "suspended",
// "temporaryIssue".
Health XAccountDetailHealth `json:"health" api:"required"`
Status string `json:"status" api:"required"`
XUserID string `json:"xUserId" api:"required"`
XUsername string `json:"xUsername" api:"required"`
CookiesObtainedAt time.Time `json:"cookiesObtainedAt" format:"date-time"`
ProxyCountry string `json:"proxyCountry"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Health respjson.Field
Status respjson.Field
XUserID respjson.Field
XUsername respjson.Field
CookiesObtainedAt respjson.Field
ProxyCountry respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Full X account details including proxy, cookies, and update timestamp.
func (XAccountDetail) RawJSON ¶
func (r XAccountDetail) RawJSON() string
Returns the unmodified JSON received from the API
func (*XAccountDetail) UnmarshalJSON ¶
func (r *XAccountDetail) UnmarshalJSON(data []byte) error
type XAccountDetailHealth ¶ added in v0.4.0
type XAccountDetailHealth string
const ( XAccountDetailHealthHealthy XAccountDetailHealth = "healthy" XAccountDetailHealthLocked XAccountDetailHealth = "locked" XAccountDetailHealthNeedsReauth XAccountDetailHealth = "needsReauth" XAccountDetailHealthRecovering XAccountDetailHealth = "recovering" XAccountDetailHealthSuspended XAccountDetailHealth = "suspended" XAccountDetailHealthTemporaryIssue XAccountDetailHealth = "temporaryIssue" )
type XAccountHealth ¶ added in v0.4.0
type XAccountHealth string
Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user must submit fresh credentials. `locked` = X locked the account; unlock on x.com first. `suspended` = X banned the account. `recovering` = past cooldown, will auto-retry on next use. `temporaryIssue` = transient backend problem; retry shortly.
const ( XAccountHealthHealthy XAccountHealth = "healthy" XAccountHealthLocked XAccountHealth = "locked" XAccountHealthNeedsReauth XAccountHealth = "needsReauth" XAccountHealthRecovering XAccountHealth = "recovering" XAccountHealthSuspended XAccountHealth = "suspended" XAccountHealthTemporaryIssue XAccountHealth = "temporaryIssue" )
type XAccountListResponse ¶
type XAccountListResponse struct {
Accounts []XAccount `json:"accounts" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Accounts respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XAccountListResponse) RawJSON ¶
func (r XAccountListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XAccountListResponse) UnmarshalJSON ¶
func (r *XAccountListResponse) UnmarshalJSON(data []byte) error
type XAccountNewParams ¶
type XAccountNewParams struct {
// Account email
Email string `json:"email" api:"required"`
// Account password
Password string `json:"password" api:"required"`
// X username
Username string `json:"username" api:"required"`
// Proxy country code
ProxyCountry param.Opt[string] `json:"proxy_country,omitzero"`
// TOTP secret for 2FA
TotpSecret param.Opt[string] `json:"totp_secret,omitzero"`
// contains filtered or unexported fields
}
func (XAccountNewParams) MarshalJSON ¶
func (r XAccountNewParams) MarshalJSON() (data []byte, err error)
func (*XAccountNewParams) UnmarshalJSON ¶
func (r *XAccountNewParams) UnmarshalJSON(data []byte) error
type XAccountNewResponse ¶
type XAccountNewResponse struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Any of "healthy", "locked", "needsReauth", "recovering", "suspended",
// "temporaryIssue".
Health XAccountNewResponseHealth `json:"health" api:"required"`
Status string `json:"status" api:"required"`
XUserID string `json:"xUserId" api:"required"`
XUsername string `json:"xUsername" api:"required"`
// ISO-3166-1 alpha-2 country code of the Driver consumer device used for this
// login. Present only when the US fallback was triggered because Driver had no
// capacity in the declared region. Omitted otherwise.
LoginCountry string `json:"loginCountry"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Health respjson.Field
Status respjson.Field
XUserID respjson.Field
XUsername respjson.Field
LoginCountry respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Sanitized X account summary returned by connect and reauth. Includes an optional `loginCountry` field surfaced only when the declared proxy region had no Driver capacity and the login fell back to a single US consumer device for this one-time action. Future activity continues to use the selected `proxy_country`; the field is omitted on normal logins.
func (XAccountNewResponse) RawJSON ¶
func (r XAccountNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XAccountNewResponse) UnmarshalJSON ¶
func (r *XAccountNewResponse) UnmarshalJSON(data []byte) error
type XAccountNewResponseHealth ¶ added in v0.4.0
type XAccountNewResponseHealth string
const ( XAccountNewResponseHealthHealthy XAccountNewResponseHealth = "healthy" XAccountNewResponseHealthLocked XAccountNewResponseHealth = "locked" XAccountNewResponseHealthNeedsReauth XAccountNewResponseHealth = "needsReauth" XAccountNewResponseHealthRecovering XAccountNewResponseHealth = "recovering" XAccountNewResponseHealthSuspended XAccountNewResponseHealth = "suspended" XAccountNewResponseHealthTemporaryIssue XAccountNewResponseHealth = "temporaryIssue" )
type XAccountReauthParams ¶
type XAccountReauthParams struct {
// Updated account password
Password string `json:"password" api:"required"`
// Email for the X account (updates stored email)
Email param.Opt[string] `json:"email,omitzero"`
// Two-letter country code for login proxy region
ProxyCountry param.Opt[string] `json:"proxy_country,omitzero"`
// TOTP secret for 2FA re-authentication
TotpSecret param.Opt[string] `json:"totp_secret,omitzero"`
// contains filtered or unexported fields
}
func (XAccountReauthParams) MarshalJSON ¶
func (r XAccountReauthParams) MarshalJSON() (data []byte, err error)
func (*XAccountReauthParams) UnmarshalJSON ¶
func (r *XAccountReauthParams) UnmarshalJSON(data []byte) error
type XAccountReauthResponse ¶
type XAccountReauthResponse struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Any of "healthy", "locked", "needsReauth", "recovering", "suspended",
// "temporaryIssue".
Health XAccountReauthResponseHealth `json:"health" api:"required"`
Status string `json:"status" api:"required"`
XUserID string `json:"xUserId" api:"required"`
XUsername string `json:"xUsername" api:"required"`
// ISO-3166-1 alpha-2 country code of the Driver consumer device used for this
// login. Present only when the US fallback was triggered because Driver had no
// capacity in the declared region. Omitted otherwise.
LoginCountry string `json:"loginCountry"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Health respjson.Field
Status respjson.Field
XUserID respjson.Field
XUsername respjson.Field
LoginCountry respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Sanitized X account summary returned by connect and reauth. Includes an optional `loginCountry` field surfaced only when the declared proxy region had no Driver capacity and the login fell back to a single US consumer device for this one-time action. Future activity continues to use the selected `proxy_country`; the field is omitted on normal logins.
func (XAccountReauthResponse) RawJSON ¶
func (r XAccountReauthResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XAccountReauthResponse) UnmarshalJSON ¶
func (r *XAccountReauthResponse) UnmarshalJSON(data []byte) error
type XAccountReauthResponseHealth ¶ added in v0.4.0
type XAccountReauthResponseHealth string
const ( XAccountReauthResponseHealthHealthy XAccountReauthResponseHealth = "healthy" XAccountReauthResponseHealthLocked XAccountReauthResponseHealth = "locked" XAccountReauthResponseHealthNeedsReauth XAccountReauthResponseHealth = "needsReauth" XAccountReauthResponseHealthRecovering XAccountReauthResponseHealth = "recovering" XAccountReauthResponseHealthSuspended XAccountReauthResponseHealth = "suspended" XAccountReauthResponseHealthTemporaryIssue XAccountReauthResponseHealth = "temporaryIssue" )
type XAccountService ¶
type XAccountService struct {
// contains filtered or unexported fields
}
Connected X account management
XAccountService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXAccountService method instead.
func NewXAccountService ¶
func NewXAccountService(opts ...option.RequestOption) (r XAccountService)
NewXAccountService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XAccountService) BulkRetry ¶ added in v0.3.0
func (r *XAccountService) BulkRetry(ctx context.Context, opts ...option.RequestOption) (res *XAccountBulkRetryResponse, err error)
Clears loginFailedAt and loginFailureReason for all accounts with transient or automated failure reasons, making them eligible for retry on next use.
func (*XAccountService) Delete ¶
func (r *XAccountService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *XAccountDeleteResponse, err error)
Disconnect X account
func (*XAccountService) Get ¶
func (r *XAccountService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *XAccountDetail, err error)
Get X account details
func (*XAccountService) List ¶
func (r *XAccountService) List(ctx context.Context, opts ...option.RequestOption) (res *XAccountListResponse, err error)
List connected X accounts
func (*XAccountService) New ¶
func (r *XAccountService) New(ctx context.Context, body XAccountNewParams, opts ...option.RequestOption) (res *XAccountNewResponse, err error)
Connect X account
func (*XAccountService) Reauth ¶
func (r *XAccountService) Reauth(ctx context.Context, id string, body XAccountReauthParams, opts ...option.RequestOption) (res *XAccountReauthResponse, err error)
Re-authenticate X account
type XBookmarkGetFoldersResponse ¶
type XBookmarkGetFoldersResponse struct {
Folders []XBookmarkGetFoldersResponseFolder `json:"folders" api:"required"`
HasNextPage bool `json:"has_next_page" api:"required"`
NextCursor string `json:"next_cursor" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Folders respjson.Field
HasNextPage respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XBookmarkGetFoldersResponse) RawJSON ¶
func (r XBookmarkGetFoldersResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XBookmarkGetFoldersResponse) UnmarshalJSON ¶
func (r *XBookmarkGetFoldersResponse) UnmarshalJSON(data []byte) error
type XBookmarkGetFoldersResponseFolder ¶
type XBookmarkGetFoldersResponseFolder struct {
ID string `json:"id" api:"required"`
Name string `json:"name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XBookmarkGetFoldersResponseFolder) RawJSON ¶
func (r XBookmarkGetFoldersResponseFolder) RawJSON() string
Returns the unmodified JSON received from the API
func (*XBookmarkGetFoldersResponseFolder) UnmarshalJSON ¶
func (r *XBookmarkGetFoldersResponseFolder) UnmarshalJSON(data []byte) error
type XBookmarkListParams ¶
type XBookmarkListParams struct {
// Pagination cursor for bookmarks
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Optional bookmark folder ID
FolderID param.Opt[string] `query:"folderId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XBookmarkListParams) URLQuery ¶
func (r XBookmarkListParams) URLQuery() (v url.Values, err error)
URLQuery serializes XBookmarkListParams's query parameters as `url.Values`.
type XBookmarkService ¶
type XBookmarkService struct {
// contains filtered or unexported fields
}
Look up, search, and analyze individual tweets
XBookmarkService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXBookmarkService method instead.
func NewXBookmarkService ¶
func NewXBookmarkService(opts ...option.RequestOption) (r XBookmarkService)
NewXBookmarkService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XBookmarkService) GetFolders ¶
func (r *XBookmarkService) GetFolders(ctx context.Context, opts ...option.RequestOption) (res *XBookmarkGetFoldersResponse, err error)
Get bookmark folders
func (*XBookmarkService) List ¶
func (r *XBookmarkService) List(ctx context.Context, query XBookmarkListParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
Get bookmarked tweets
type XCommunityDeleteParams ¶
type XCommunityDeleteParams struct {
// X account (@username or ID) deleting the community
Account string `json:"account" api:"required"`
// Community name for confirmation
CommunityName string `json:"community_name" api:"required"`
// contains filtered or unexported fields
}
func (XCommunityDeleteParams) MarshalJSON ¶
func (r XCommunityDeleteParams) MarshalJSON() (data []byte, err error)
func (*XCommunityDeleteParams) UnmarshalJSON ¶
func (r *XCommunityDeleteParams) UnmarshalJSON(data []byte) error
type XCommunityDeleteResponse ¶
type XCommunityDeleteResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XCommunityDeleteResponse) RawJSON ¶
func (r XCommunityDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XCommunityDeleteResponse) UnmarshalJSON ¶
func (r *XCommunityDeleteResponse) UnmarshalJSON(data []byte) error
type XCommunityGetInfoResponse ¶
type XCommunityGetInfoResponse struct {
// Community info object
Community XCommunityGetInfoResponseCommunity `json:"community" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Community respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XCommunityGetInfoResponse) RawJSON ¶
func (r XCommunityGetInfoResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XCommunityGetInfoResponse) UnmarshalJSON ¶
func (r *XCommunityGetInfoResponse) UnmarshalJSON(data []byte) error
type XCommunityGetInfoResponseCommunity ¶ added in v0.3.0
type XCommunityGetInfoResponseCommunity struct {
// Unique community identifier
ID string `json:"id" api:"required"`
// Community banner image URL
BannerURL string `json:"banner_url"`
// Community creation timestamp
CreatedAt string `json:"created_at"`
// About text for the community
Description string `json:"description"`
// Join policy (open or restricted)
JoinPolicy string `json:"join_policy"`
// Total member count
MemberCount int64 `json:"member_count"`
// Total moderator count
ModeratorCount int64 `json:"moderator_count"`
// Display name of the community
Name string `json:"name"`
// Primary topic
PrimaryTopic XCommunityGetInfoResponseCommunityPrimaryTopic `json:"primary_topic"`
// Community rules
Rules []XCommunityGetInfoResponseCommunityRule `json:"rules"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BannerURL respjson.Field
CreatedAt respjson.Field
Description respjson.Field
JoinPolicy respjson.Field
MemberCount respjson.Field
ModeratorCount respjson.Field
Name respjson.Field
PrimaryTopic respjson.Field
Rules respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Community info object
func (XCommunityGetInfoResponseCommunity) RawJSON ¶ added in v0.3.0
func (r XCommunityGetInfoResponseCommunity) RawJSON() string
Returns the unmodified JSON received from the API
func (*XCommunityGetInfoResponseCommunity) UnmarshalJSON ¶ added in v0.3.0
func (r *XCommunityGetInfoResponseCommunity) UnmarshalJSON(data []byte) error
type XCommunityGetInfoResponseCommunityPrimaryTopic ¶ added in v0.3.0
type XCommunityGetInfoResponseCommunityPrimaryTopic struct {
ID string `json:"id"`
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Primary topic
func (XCommunityGetInfoResponseCommunityPrimaryTopic) RawJSON ¶ added in v0.3.0
func (r XCommunityGetInfoResponseCommunityPrimaryTopic) RawJSON() string
Returns the unmodified JSON received from the API
func (*XCommunityGetInfoResponseCommunityPrimaryTopic) UnmarshalJSON ¶ added in v0.3.0
func (r *XCommunityGetInfoResponseCommunityPrimaryTopic) UnmarshalJSON(data []byte) error
type XCommunityGetInfoResponseCommunityRule ¶ added in v0.3.0
type XCommunityGetInfoResponseCommunityRule struct {
ID string `json:"id"`
Description string `json:"description"`
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Description respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XCommunityGetInfoResponseCommunityRule) RawJSON ¶ added in v0.3.0
func (r XCommunityGetInfoResponseCommunityRule) RawJSON() string
Returns the unmodified JSON received from the API
func (*XCommunityGetInfoResponseCommunityRule) UnmarshalJSON ¶ added in v0.3.0
func (r *XCommunityGetInfoResponseCommunityRule) UnmarshalJSON(data []byte) error
type XCommunityGetMembersParams ¶
type XCommunityGetMembersParams struct {
// Pagination cursor
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XCommunityGetMembersParams) URLQuery ¶
func (r XCommunityGetMembersParams) URLQuery() (v url.Values, err error)
URLQuery serializes XCommunityGetMembersParams's query parameters as `url.Values`.
type XCommunityGetModeratorsParams ¶
type XCommunityGetModeratorsParams struct {
// Pagination cursor for community moderators
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XCommunityGetModeratorsParams) URLQuery ¶
func (r XCommunityGetModeratorsParams) URLQuery() (v url.Values, err error)
URLQuery serializes XCommunityGetModeratorsParams's query parameters as `url.Values`.
type XCommunityGetSearchParams ¶
type XCommunityGetSearchParams struct {
// Search query
Q string `query:"q" api:"required" json:"-"`
// Pagination cursor for community search
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Sort order (Latest or Top)
QueryType param.Opt[string] `query:"queryType,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XCommunityGetSearchParams) URLQuery ¶
func (r XCommunityGetSearchParams) URLQuery() (v url.Values, err error)
URLQuery serializes XCommunityGetSearchParams's query parameters as `url.Values`.
type XCommunityJoinDeleteAllParams ¶
type XCommunityJoinDeleteAllParams struct {
// X account identifier (@username or account ID)
Account string `json:"account" api:"required"`
// contains filtered or unexported fields
}
func (XCommunityJoinDeleteAllParams) MarshalJSON ¶
func (r XCommunityJoinDeleteAllParams) MarshalJSON() (data []byte, err error)
func (*XCommunityJoinDeleteAllParams) UnmarshalJSON ¶
func (r *XCommunityJoinDeleteAllParams) UnmarshalJSON(data []byte) error
type XCommunityJoinNewParams ¶
type XCommunityJoinNewParams struct {
// X account identifier (@username or account ID)
Account string `json:"account" api:"required"`
// contains filtered or unexported fields
}
func (XCommunityJoinNewParams) MarshalJSON ¶
func (r XCommunityJoinNewParams) MarshalJSON() (data []byte, err error)
func (*XCommunityJoinNewParams) UnmarshalJSON ¶
func (r *XCommunityJoinNewParams) UnmarshalJSON(data []byte) error
type XCommunityJoinService ¶
type XCommunityJoinService struct {
// contains filtered or unexported fields
}
X write actions (tweets, likes, follows, DMs)
XCommunityJoinService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXCommunityJoinService method instead.
func NewXCommunityJoinService ¶
func NewXCommunityJoinService(opts ...option.RequestOption) (r XCommunityJoinService)
NewXCommunityJoinService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XCommunityJoinService) DeleteAll ¶
func (r *XCommunityJoinService) DeleteAll(ctx context.Context, id string, body XCommunityJoinDeleteAllParams, opts ...option.RequestOption) (res *CommunityActionResult, err error)
Leave community
func (*XCommunityJoinService) New ¶
func (r *XCommunityJoinService) New(ctx context.Context, id string, body XCommunityJoinNewParams, opts ...option.RequestOption) (res *CommunityActionResult, err error)
Join community
type XCommunityNewParams ¶
type XCommunityNewParams struct {
// X account (@username or ID) creating the community
Account string `json:"account" api:"required"`
// Community name
Name string `json:"name" api:"required"`
// Community description
Description param.Opt[string] `json:"description,omitzero"`
// contains filtered or unexported fields
}
func (XCommunityNewParams) MarshalJSON ¶
func (r XCommunityNewParams) MarshalJSON() (data []byte, err error)
func (*XCommunityNewParams) UnmarshalJSON ¶
func (r *XCommunityNewParams) UnmarshalJSON(data []byte) error
type XCommunityNewResponse ¶
type XCommunityNewResponse struct {
CommunityID string `json:"communityId" api:"required"`
Success bool `json:"success" api:"required"`
CommunityName string `json:"communityName"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CommunityID respjson.Field
Success respjson.Field
CommunityName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XCommunityNewResponse) RawJSON ¶
func (r XCommunityNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XCommunityNewResponse) UnmarshalJSON ¶
func (r *XCommunityNewResponse) UnmarshalJSON(data []byte) error
type XCommunityService ¶
type XCommunityService struct {
// X write actions (tweets, likes, follows, DMs)
Join XCommunityJoinService
// X Community info, members, and tweets
Tweets XCommunityTweetService
// contains filtered or unexported fields
}
XCommunityService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXCommunityService method instead.
func NewXCommunityService ¶
func NewXCommunityService(opts ...option.RequestOption) (r XCommunityService)
NewXCommunityService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XCommunityService) Delete ¶
func (r *XCommunityService) Delete(ctx context.Context, id string, body XCommunityDeleteParams, opts ...option.RequestOption) (res *XCommunityDeleteResponse, err error)
Delete community
func (*XCommunityService) GetInfo ¶
func (r *XCommunityService) GetInfo(ctx context.Context, id string, opts ...option.RequestOption) (res *XCommunityGetInfoResponse, err error)
Get community name, description and member count
func (*XCommunityService) GetMembers ¶
func (r *XCommunityService) GetMembers(ctx context.Context, id string, query XCommunityGetMembersParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
List members of a community
func (*XCommunityService) GetModerators ¶
func (r *XCommunityService) GetModerators(ctx context.Context, id string, query XCommunityGetModeratorsParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
List moderators of a community
func (*XCommunityService) GetSearch ¶
func (r *XCommunityService) GetSearch(ctx context.Context, query XCommunityGetSearchParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
Search for communities by keyword
func (*XCommunityService) New ¶
func (r *XCommunityService) New(ctx context.Context, body XCommunityNewParams, opts ...option.RequestOption) (res *XCommunityNewResponse, err error)
Create community
type XCommunityTweetListByCommunityParams ¶ added in v0.3.0
type XCommunityTweetListByCommunityParams struct {
// Pagination cursor for community tweets
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XCommunityTweetListByCommunityParams) URLQuery ¶ added in v0.3.0
func (r XCommunityTweetListByCommunityParams) URLQuery() (v url.Values, err error)
URLQuery serializes XCommunityTweetListByCommunityParams's query parameters as `url.Values`.
type XCommunityTweetListParams ¶
type XCommunityTweetListParams struct {
// Search query for cross-community tweets
Q string `query:"q" api:"required" json:"-"`
// Pagination cursor for cross-community results
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Sort order for cross-community results (Latest or Top)
QueryType param.Opt[string] `query:"queryType,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XCommunityTweetListParams) URLQuery ¶
func (r XCommunityTweetListParams) URLQuery() (v url.Values, err error)
URLQuery serializes XCommunityTweetListParams's query parameters as `url.Values`.
type XCommunityTweetService ¶
type XCommunityTweetService struct {
// contains filtered or unexported fields
}
X Community info, members, and tweets
XCommunityTweetService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXCommunityTweetService method instead.
func NewXCommunityTweetService ¶
func NewXCommunityTweetService(opts ...option.RequestOption) (r XCommunityTweetService)
NewXCommunityTweetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XCommunityTweetService) List ¶
func (r *XCommunityTweetService) List(ctx context.Context, query XCommunityTweetListParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
List tweets across all communities
func (*XCommunityTweetService) ListByCommunity ¶ added in v0.3.0
func (r *XCommunityTweetService) ListByCommunity(ctx context.Context, id string, query XCommunityTweetListByCommunityParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
List tweets posted in a community
type XDmGetHistoryParams ¶
type XDmGetHistoryParams struct {
// Pagination cursor for DM history
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Legacy pagination cursor (backward compat)
MaxID param.Opt[string] `query:"maxId,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XDmGetHistoryParams) URLQuery ¶
func (r XDmGetHistoryParams) URLQuery() (v url.Values, err error)
URLQuery serializes XDmGetHistoryParams's query parameters as `url.Values`.
type XDmGetHistoryResponse ¶
type XDmGetHistoryResponse struct {
HasNextPage bool `json:"has_next_page" api:"required"`
Messages []XDmGetHistoryResponseMessage `json:"messages" api:"required"`
NextCursor string `json:"next_cursor" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HasNextPage respjson.Field
Messages respjson.Field
NextCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XDmGetHistoryResponse) RawJSON ¶
func (r XDmGetHistoryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XDmGetHistoryResponse) UnmarshalJSON ¶
func (r *XDmGetHistoryResponse) UnmarshalJSON(data []byte) error
type XDmGetHistoryResponseMessage ¶
type XDmGetHistoryResponseMessage struct {
ID string `json:"id" api:"required"`
CreatedAt string `json:"createdAt"`
ReceiverID string `json:"receiverId"`
SenderID string `json:"senderId"`
Text string `json:"text"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
ReceiverID respjson.Field
SenderID respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XDmGetHistoryResponseMessage) RawJSON ¶
func (r XDmGetHistoryResponseMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*XDmGetHistoryResponseMessage) UnmarshalJSON ¶
func (r *XDmGetHistoryResponseMessage) UnmarshalJSON(data []byte) error
type XDmSendParams ¶
type XDmSendParams struct {
// X account (@username or ID) sending the DM
Account string `json:"account" api:"required"`
Text string `json:"text" api:"required"`
ReplyToMessageID param.Opt[string] `json:"reply_to_message_id,omitzero"`
MediaIDs []string `json:"media_ids,omitzero"`
// contains filtered or unexported fields
}
func (XDmSendParams) MarshalJSON ¶
func (r XDmSendParams) MarshalJSON() (data []byte, err error)
func (*XDmSendParams) UnmarshalJSON ¶
func (r *XDmSendParams) UnmarshalJSON(data []byte) error
type XDmSendResponse ¶
type XDmSendResponse struct {
MessageID string `json:"messageId" api:"required"`
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MessageID respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XDmSendResponse) RawJSON ¶
func (r XDmSendResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XDmSendResponse) UnmarshalJSON ¶
func (r *XDmSendResponse) UnmarshalJSON(data []byte) error
type XDmService ¶
type XDmService struct {
// contains filtered or unexported fields
}
XDmService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXDmService method instead.
func NewXDmService ¶
func NewXDmService(opts ...option.RequestOption) (r XDmService)
NewXDmService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XDmService) GetHistory ¶
func (r *XDmService) GetHistory(ctx context.Context, userID string, query XDmGetHistoryParams, opts ...option.RequestOption) (res *XDmGetHistoryResponse, err error)
Get DM conversation history
func (*XDmService) Send ¶
func (r *XDmService) Send(ctx context.Context, userID string, body XDmSendParams, opts ...option.RequestOption) (res *XDmSendResponse, err error)
Send direct message
type XFollowerCheckParams ¶
type XFollowerCheckParams struct {
// Username to check (without @)
Source string `query:"source" api:"required" json:"-"`
// Target username (without @)
Target string `query:"target" api:"required" json:"-"`
// contains filtered or unexported fields
}
func (XFollowerCheckParams) URLQuery ¶
func (r XFollowerCheckParams) URLQuery() (v url.Values, err error)
URLQuery serializes XFollowerCheckParams's query parameters as `url.Values`.
type XFollowerCheckResponse ¶
type XFollowerCheckResponse struct {
IsFollowedBy bool `json:"isFollowedBy" api:"required"`
IsFollowing bool `json:"isFollowing" api:"required"`
SourceUsername string `json:"sourceUsername" api:"required"`
TargetUsername string `json:"targetUsername" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
IsFollowedBy respjson.Field
IsFollowing respjson.Field
SourceUsername respjson.Field
TargetUsername respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XFollowerCheckResponse) RawJSON ¶
func (r XFollowerCheckResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XFollowerCheckResponse) UnmarshalJSON ¶
func (r *XFollowerCheckResponse) UnmarshalJSON(data []byte) error
type XFollowerService ¶
type XFollowerService struct {
// contains filtered or unexported fields
}
Look up, search, and explore user profiles and relationships
XFollowerService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXFollowerService method instead.
func NewXFollowerService ¶
func NewXFollowerService(opts ...option.RequestOption) (r XFollowerService)
NewXFollowerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XFollowerService) Check ¶
func (r *XFollowerService) Check(ctx context.Context, query XFollowerCheckParams, opts ...option.RequestOption) (res *XFollowerCheckResponse, err error)
Check if one user follows another
type XGetArticleResponse ¶
type XGetArticleResponse struct {
Article XGetArticleResponseArticle `json:"article" api:"required"`
// Author of a tweet with follower count and verification status.
Author TweetAuthor `json:"author"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Article respjson.Field
Author respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XGetArticleResponse) RawJSON ¶
func (r XGetArticleResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XGetArticleResponse) UnmarshalJSON ¶
func (r *XGetArticleResponse) UnmarshalJSON(data []byte) error
type XGetArticleResponseArticle ¶
type XGetArticleResponseArticle struct {
Contents []XGetArticleResponseArticleContent `json:"contents"`
CoverImageURL string `json:"coverImageUrl"`
CreatedAt string `json:"createdAt"`
LikeCount int64 `json:"likeCount"`
PreviewText string `json:"previewText"`
QuoteCount int64 `json:"quoteCount"`
ReplyCount int64 `json:"replyCount"`
Title string `json:"title"`
ViewCount int64 `json:"viewCount"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Contents respjson.Field
CoverImageURL respjson.Field
CreatedAt respjson.Field
LikeCount respjson.Field
PreviewText respjson.Field
QuoteCount respjson.Field
ReplyCount respjson.Field
Title respjson.Field
ViewCount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XGetArticleResponseArticle) RawJSON ¶
func (r XGetArticleResponseArticle) RawJSON() string
Returns the unmodified JSON received from the API
func (*XGetArticleResponseArticle) UnmarshalJSON ¶
func (r *XGetArticleResponseArticle) UnmarshalJSON(data []byte) error
type XGetArticleResponseArticleContent ¶
type XGetArticleResponseArticleContent struct {
Height int64 `json:"height"`
Text string `json:"text"`
// Block type: unstyled, header-one, header-two, header-three, unordered-list-item,
// ordered-list-item, image, gif, divider
Type string `json:"type"`
// Media URL for image/gif blocks
URL string `json:"url"`
Width int64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Height respjson.Field
Text respjson.Field
Type respjson.Field
URL respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XGetArticleResponseArticleContent) RawJSON ¶
func (r XGetArticleResponseArticleContent) RawJSON() string
Returns the unmodified JSON received from the API
func (*XGetArticleResponseArticleContent) UnmarshalJSON ¶
func (r *XGetArticleResponseArticleContent) UnmarshalJSON(data []byte) error
type XGetHomeTimelineParams ¶
type XGetHomeTimelineParams struct {
// Pagination cursor for timeline
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Comma-separated tweet IDs to exclude from results
SeenTweetIDs param.Opt[string] `query:"seenTweetIds,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XGetHomeTimelineParams) URLQuery ¶
func (r XGetHomeTimelineParams) URLQuery() (v url.Values, err error)
URLQuery serializes XGetHomeTimelineParams's query parameters as `url.Values`.
type XGetNotificationsParams ¶
type XGetNotificationsParams struct {
// Pagination cursor for notifications
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Notification type filter
//
// Any of "All", "Verified", "Mentions".
Type XGetNotificationsParamsType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XGetNotificationsParams) URLQuery ¶
func (r XGetNotificationsParams) URLQuery() (v url.Values, err error)
URLQuery serializes XGetNotificationsParams's query parameters as `url.Values`.
type XGetNotificationsParamsType ¶
type XGetNotificationsParamsType string
Notification type filter
const ( XGetNotificationsParamsTypeAll XGetNotificationsParamsType = "All" XGetNotificationsParamsTypeVerified XGetNotificationsParamsType = "Verified" XGetNotificationsParamsTypeMentions XGetNotificationsParamsType = "Mentions" )
type XGetNotificationsResponse ¶
type XGetNotificationsResponse struct {
HasNextPage bool `json:"has_next_page" api:"required"`
NextCursor string `json:"next_cursor" api:"required"`
Notifications []XGetNotificationsResponseNotification `json:"notifications" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HasNextPage respjson.Field
NextCursor respjson.Field
Notifications respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XGetNotificationsResponse) RawJSON ¶
func (r XGetNotificationsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XGetNotificationsResponse) UnmarshalJSON ¶
func (r *XGetNotificationsResponse) UnmarshalJSON(data []byte) error
type XGetNotificationsResponseNotification ¶
type XGetNotificationsResponseNotification struct {
ID string `json:"id" api:"required"`
Message string `json:"message"`
Timestamp string `json:"timestamp"`
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Message respjson.Field
Timestamp respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XGetNotificationsResponseNotification) RawJSON ¶
func (r XGetNotificationsResponseNotification) RawJSON() string
Returns the unmodified JSON received from the API
func (*XGetNotificationsResponseNotification) UnmarshalJSON ¶
func (r *XGetNotificationsResponseNotification) UnmarshalJSON(data []byte) error
type XGetTrendsParams ¶ added in v0.4.0
type XGetTrendsParams struct {
// Number of trending topics to return (1-50, default 30)
Count param.Opt[int64] `query:"count,omitzero" json:"-"`
// Region WOEID (1=Worldwide, 23424977=US, 23424975=UK, 23424969=Turkey)
Woeid param.Opt[int64] `query:"woeid,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XGetTrendsParams) URLQuery ¶ added in v0.4.0
func (r XGetTrendsParams) URLQuery() (v url.Values, err error)
URLQuery serializes XGetTrendsParams's query parameters as `url.Values`.
type XGetTrendsResponse ¶ added in v0.3.0
type XGetTrendsResponse struct {
Count int64 `json:"count" api:"required"`
Trends []XGetTrendsResponseTrend `json:"trends" api:"required"`
Woeid int64 `json:"woeid" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Trends respjson.Field
Woeid respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XGetTrendsResponse) RawJSON ¶ added in v0.3.0
func (r XGetTrendsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XGetTrendsResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *XGetTrendsResponse) UnmarshalJSON(data []byte) error
type XGetTrendsResponseTrend ¶ added in v0.3.0
type XGetTrendsResponseTrend struct {
Name string `json:"name" api:"required"`
Description string `json:"description"`
Query string `json:"query"`
Rank int64 `json:"rank"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Description respjson.Field
Query respjson.Field
Rank respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XGetTrendsResponseTrend) RawJSON ¶ added in v0.3.0
func (r XGetTrendsResponseTrend) RawJSON() string
Returns the unmodified JSON received from the API
func (*XGetTrendsResponseTrend) UnmarshalJSON ¶ added in v0.3.0
func (r *XGetTrendsResponseTrend) UnmarshalJSON(data []byte) error
type XListGetFollowersParams ¶
type XListGetFollowersParams struct {
// Pagination cursor for list followers
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XListGetFollowersParams) URLQuery ¶
func (r XListGetFollowersParams) URLQuery() (v url.Values, err error)
URLQuery serializes XListGetFollowersParams's query parameters as `url.Values`.
type XListGetMembersParams ¶
type XListGetMembersParams struct {
// Pagination cursor for list members
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XListGetMembersParams) URLQuery ¶
func (r XListGetMembersParams) URLQuery() (v url.Values, err error)
URLQuery serializes XListGetMembersParams's query parameters as `url.Values`.
type XListGetTweetsParams ¶
type XListGetTweetsParams struct {
// Pagination cursor for list tweets
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Include replies (default false)
IncludeReplies param.Opt[bool] `query:"includeReplies,omitzero" json:"-"`
// Unix timestamp - filter after
SinceTime param.Opt[string] `query:"sinceTime,omitzero" json:"-"`
// Unix timestamp - filter before
UntilTime param.Opt[string] `query:"untilTime,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XListGetTweetsParams) URLQuery ¶
func (r XListGetTweetsParams) URLQuery() (v url.Values, err error)
URLQuery serializes XListGetTweetsParams's query parameters as `url.Values`.
type XListService ¶
type XListService struct {
// contains filtered or unexported fields
}
X List followers, members, and tweets
XListService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXListService method instead.
func NewXListService ¶
func NewXListService(opts ...option.RequestOption) (r XListService)
NewXListService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XListService) GetFollowers ¶
func (r *XListService) GetFollowers(ctx context.Context, id string, query XListGetFollowersParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
List followers of an X List
func (*XListService) GetMembers ¶
func (r *XListService) GetMembers(ctx context.Context, id string, query XListGetMembersParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
List members of an X List
func (*XListService) GetTweets ¶
func (r *XListService) GetTweets(ctx context.Context, id string, query XListGetTweetsParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
List tweets from an X List
type XMediaDownloadParams ¶
type XMediaDownloadParams struct {
// Tweet URL or ID (single tweet)
TweetInput param.Opt[string] `json:"tweetInput,omitzero"`
// Array of tweet URLs or IDs (bulk, max 50)
TweetIDs []string `json:"tweetIds,omitzero"`
// contains filtered or unexported fields
}
func (XMediaDownloadParams) MarshalJSON ¶
func (r XMediaDownloadParams) MarshalJSON() (data []byte, err error)
func (*XMediaDownloadParams) UnmarshalJSON ¶
func (r *XMediaDownloadParams) UnmarshalJSON(data []byte) error
type XMediaDownloadResponse ¶
type XMediaDownloadResponse struct {
CacheHit bool `json:"cacheHit"`
GalleryURL string `json:"galleryUrl"`
TotalMedia int64 `json:"totalMedia"`
TotalTweets int64 `json:"totalTweets"`
TweetID string `json:"tweetId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CacheHit respjson.Field
GalleryURL respjson.Field
TotalMedia respjson.Field
TotalTweets respjson.Field
TweetID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XMediaDownloadResponse) RawJSON ¶
func (r XMediaDownloadResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XMediaDownloadResponse) UnmarshalJSON ¶
func (r *XMediaDownloadResponse) UnmarshalJSON(data []byte) error
type XMediaService ¶
type XMediaService struct {
// contains filtered or unexported fields
}
Media upload and download
XMediaService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXMediaService method instead.
func NewXMediaService ¶
func NewXMediaService(opts ...option.RequestOption) (r XMediaService)
NewXMediaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XMediaService) Download ¶
func (r *XMediaService) Download(ctx context.Context, body XMediaDownloadParams, opts ...option.RequestOption) (res *XMediaDownloadResponse, err error)
Download images and videos from tweets
func (*XMediaService) Upload ¶
func (r *XMediaService) Upload(ctx context.Context, body XMediaUploadParams, opts ...option.RequestOption) (res *XMediaUploadResponse, err error)
Upload media
type XMediaUploadParams ¶
type XMediaUploadParams struct {
// X account (@username or ID) uploading media
Account string `json:"account" api:"required"`
// Media file to upload
File io.Reader `json:"file,omitzero" api:"required" format:"binary"`
IsLongVideo param.Opt[bool] `json:"is_long_video,omitzero"`
// contains filtered or unexported fields
}
func (XMediaUploadParams) MarshalMultipart ¶
func (r XMediaUploadParams) MarshalMultipart() (data []byte, contentType string, err error)
type XMediaUploadResponse ¶
type XMediaUploadResponse struct {
MediaID string `json:"mediaId" api:"required"`
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MediaID respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XMediaUploadResponse) RawJSON ¶
func (r XMediaUploadResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XMediaUploadResponse) UnmarshalJSON ¶
func (r *XMediaUploadResponse) UnmarshalJSON(data []byte) error
type XProfileService ¶
type XProfileService struct {
// contains filtered or unexported fields
}
X write actions (tweets, likes, follows, DMs)
XProfileService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXProfileService method instead.
func NewXProfileService ¶
func NewXProfileService(opts ...option.RequestOption) (r XProfileService)
NewXProfileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XProfileService) Update ¶
func (r *XProfileService) Update(ctx context.Context, body XProfileUpdateParams, opts ...option.RequestOption) (res *XProfileUpdateResponse, err error)
Update X profile
func (*XProfileService) UpdateAvatar ¶
func (r *XProfileService) UpdateAvatar(ctx context.Context, body XProfileUpdateAvatarParams, opts ...option.RequestOption) (res *XProfileUpdateAvatarResponse, err error)
Update profile avatar
func (*XProfileService) UpdateBanner ¶
func (r *XProfileService) UpdateBanner(ctx context.Context, body XProfileUpdateBannerParams, opts ...option.RequestOption) (res *XProfileUpdateBannerResponse, err error)
Update profile banner
type XProfileUpdateAvatarParams ¶
type XProfileUpdateAvatarParams struct {
// X account (@username or ID) for avatar update
Account string `json:"account" api:"required"`
// Avatar image (max 716KB)
File io.Reader `json:"file,omitzero" api:"required" format:"binary"`
// contains filtered or unexported fields
}
func (XProfileUpdateAvatarParams) MarshalMultipart ¶
func (r XProfileUpdateAvatarParams) MarshalMultipart() (data []byte, contentType string, err error)
type XProfileUpdateAvatarResponse ¶
type XProfileUpdateAvatarResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XProfileUpdateAvatarResponse) RawJSON ¶
func (r XProfileUpdateAvatarResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XProfileUpdateAvatarResponse) UnmarshalJSON ¶
func (r *XProfileUpdateAvatarResponse) UnmarshalJSON(data []byte) error
type XProfileUpdateBannerParams ¶
type XProfileUpdateBannerParams struct {
// X account (@username or ID) for banner update
Account string `json:"account" api:"required"`
// Banner image (max 2MB)
File io.Reader `json:"file,omitzero" api:"required" format:"binary"`
// contains filtered or unexported fields
}
func (XProfileUpdateBannerParams) MarshalMultipart ¶
func (r XProfileUpdateBannerParams) MarshalMultipart() (data []byte, contentType string, err error)
type XProfileUpdateBannerResponse ¶
type XProfileUpdateBannerResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XProfileUpdateBannerResponse) RawJSON ¶
func (r XProfileUpdateBannerResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XProfileUpdateBannerResponse) UnmarshalJSON ¶
func (r *XProfileUpdateBannerResponse) UnmarshalJSON(data []byte) error
type XProfileUpdateParams ¶
type XProfileUpdateParams struct {
// X account (@username or ID) to update profile
Account string `json:"account" api:"required"`
// Bio description
Description param.Opt[string] `json:"description,omitzero"`
Location param.Opt[string] `json:"location,omitzero"`
// Display name
Name param.Opt[string] `json:"name,omitzero"`
// Website URL
URL param.Opt[string] `json:"url,omitzero"`
// contains filtered or unexported fields
}
func (XProfileUpdateParams) MarshalJSON ¶
func (r XProfileUpdateParams) MarshalJSON() (data []byte, err error)
func (*XProfileUpdateParams) UnmarshalJSON ¶
func (r *XProfileUpdateParams) UnmarshalJSON(data []byte) error
type XProfileUpdateResponse ¶
type XProfileUpdateResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XProfileUpdateResponse) RawJSON ¶
func (r XProfileUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XProfileUpdateResponse) UnmarshalJSON ¶
func (r *XProfileUpdateResponse) UnmarshalJSON(data []byte) error
type XService ¶
type XService struct {
Tweets XTweetService
// Look up, search, and explore user profiles and relationships
Users XUserService
// Look up, search, and explore user profiles and relationships
Followers XFollowerService
Dm XDmService
// Media upload and download
Media XMediaService
// X write actions (tweets, likes, follows, DMs)
Profile XProfileService
Communities XCommunityService
// Connected X account management
Accounts XAccountService
// Look up, search, and analyze individual tweets
Bookmarks XBookmarkService
// X List followers, members, and tweets
Lists XListService
// contains filtered or unexported fields
}
XService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXService method instead.
func NewXService ¶
func NewXService(opts ...option.RequestOption) (r XService)
NewXService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XService) GetArticle ¶
func (r *XService) GetArticle(ctx context.Context, tweetID string, opts ...option.RequestOption) (res *XGetArticleResponse, err error)
Retrieve the full content of an X Article (long-form post) by tweet ID.
func (*XService) GetHomeTimeline ¶
func (r *XService) GetHomeTimeline(ctx context.Context, query XGetHomeTimelineParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
Get home timeline
func (*XService) GetNotifications ¶
func (r *XService) GetNotifications(ctx context.Context, query XGetNotificationsParams, opts ...option.RequestOption) (res *XGetNotificationsResponse, err error)
Get notifications
func (*XService) GetTrends ¶
func (r *XService) GetTrends(ctx context.Context, query XGetTrendsParams, opts ...option.RequestOption) (res *XGetTrendsResponse, err error)
Get trending hashtags and topics from X by region
type XTweetDeleteParams ¶
type XTweetDeleteParams struct {
// X account identifier (@username or account ID)
Account string `json:"account" api:"required"`
// contains filtered or unexported fields
}
func (XTweetDeleteParams) MarshalJSON ¶
func (r XTweetDeleteParams) MarshalJSON() (data []byte, err error)
func (*XTweetDeleteParams) UnmarshalJSON ¶
func (r *XTweetDeleteParams) UnmarshalJSON(data []byte) error
type XTweetDeleteResponse ¶
type XTweetDeleteResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XTweetDeleteResponse) RawJSON ¶
func (r XTweetDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XTweetDeleteResponse) UnmarshalJSON ¶
func (r *XTweetDeleteResponse) UnmarshalJSON(data []byte) error
type XTweetGetFavoritersParams ¶
type XTweetGetFavoritersParams struct {
// Pagination cursor for favoriters
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XTweetGetFavoritersParams) URLQuery ¶
func (r XTweetGetFavoritersParams) URLQuery() (v url.Values, err error)
URLQuery serializes XTweetGetFavoritersParams's query parameters as `url.Values`.
type XTweetGetQuotesParams ¶
type XTweetGetQuotesParams struct {
// Pagination cursor for quote tweets
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Include reply quotes (default false)
IncludeReplies param.Opt[bool] `query:"includeReplies,omitzero" json:"-"`
// Unix timestamp - return quotes posted after this time
SinceTime param.Opt[string] `query:"sinceTime,omitzero" json:"-"`
// Unix timestamp - return quotes posted before this time
UntilTime param.Opt[string] `query:"untilTime,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XTweetGetQuotesParams) URLQuery ¶
func (r XTweetGetQuotesParams) URLQuery() (v url.Values, err error)
URLQuery serializes XTweetGetQuotesParams's query parameters as `url.Values`.
type XTweetGetRepliesParams ¶
type XTweetGetRepliesParams struct {
// Pagination cursor for tweet replies
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Unix timestamp - return replies posted after this time
SinceTime param.Opt[string] `query:"sinceTime,omitzero" json:"-"`
// Unix timestamp - return replies posted before this time
UntilTime param.Opt[string] `query:"untilTime,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XTweetGetRepliesParams) URLQuery ¶
func (r XTweetGetRepliesParams) URLQuery() (v url.Values, err error)
URLQuery serializes XTweetGetRepliesParams's query parameters as `url.Values`.
type XTweetGetResponse ¶
type XTweetGetResponse struct {
// Full tweet with text, engagement metrics, media, and metadata.
Tweet TweetDetail `json:"tweet" api:"required"`
// Author of a tweet with follower count and verification status.
Author TweetAuthor `json:"author"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Tweet respjson.Field
Author respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XTweetGetResponse) RawJSON ¶
func (r XTweetGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XTweetGetResponse) UnmarshalJSON ¶
func (r *XTweetGetResponse) UnmarshalJSON(data []byte) error
type XTweetGetRetweetersParams ¶
type XTweetGetRetweetersParams struct {
// Pagination cursor for retweeters
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XTweetGetRetweetersParams) URLQuery ¶
func (r XTweetGetRetweetersParams) URLQuery() (v url.Values, err error)
URLQuery serializes XTweetGetRetweetersParams's query parameters as `url.Values`.
type XTweetGetThreadParams ¶
type XTweetGetThreadParams struct {
// Pagination cursor for thread tweets
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XTweetGetThreadParams) URLQuery ¶
func (r XTweetGetThreadParams) URLQuery() (v url.Values, err error)
URLQuery serializes XTweetGetThreadParams's query parameters as `url.Values`.
type XTweetLikeDeleteParams ¶
type XTweetLikeDeleteParams struct {
// X account identifier (@username or account ID)
Account string `json:"account" api:"required"`
// contains filtered or unexported fields
}
func (XTweetLikeDeleteParams) MarshalJSON ¶
func (r XTweetLikeDeleteParams) MarshalJSON() (data []byte, err error)
func (*XTweetLikeDeleteParams) UnmarshalJSON ¶
func (r *XTweetLikeDeleteParams) UnmarshalJSON(data []byte) error
type XTweetLikeDeleteResponse ¶
type XTweetLikeDeleteResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XTweetLikeDeleteResponse) RawJSON ¶
func (r XTweetLikeDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XTweetLikeDeleteResponse) UnmarshalJSON ¶
func (r *XTweetLikeDeleteResponse) UnmarshalJSON(data []byte) error
type XTweetLikeNewParams ¶
type XTweetLikeNewParams struct {
// X account identifier (@username or account ID)
Account string `json:"account" api:"required"`
// contains filtered or unexported fields
}
func (XTweetLikeNewParams) MarshalJSON ¶
func (r XTweetLikeNewParams) MarshalJSON() (data []byte, err error)
func (*XTweetLikeNewParams) UnmarshalJSON ¶
func (r *XTweetLikeNewParams) UnmarshalJSON(data []byte) error
type XTweetLikeNewResponse ¶
type XTweetLikeNewResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XTweetLikeNewResponse) RawJSON ¶
func (r XTweetLikeNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XTweetLikeNewResponse) UnmarshalJSON ¶
func (r *XTweetLikeNewResponse) UnmarshalJSON(data []byte) error
type XTweetLikeService ¶
type XTweetLikeService struct {
// contains filtered or unexported fields
}
X write actions (tweets, likes, follows, DMs)
XTweetLikeService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXTweetLikeService method instead.
func NewXTweetLikeService ¶
func NewXTweetLikeService(opts ...option.RequestOption) (r XTweetLikeService)
NewXTweetLikeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XTweetLikeService) Delete ¶
func (r *XTweetLikeService) Delete(ctx context.Context, id string, body XTweetLikeDeleteParams, opts ...option.RequestOption) (res *XTweetLikeDeleteResponse, err error)
Unlike tweet
func (*XTweetLikeService) New ¶
func (r *XTweetLikeService) New(ctx context.Context, id string, body XTweetLikeNewParams, opts ...option.RequestOption) (res *XTweetLikeNewResponse, err error)
Like tweet
type XTweetListParams ¶
type XTweetListParams struct {
// Comma-separated tweet IDs (max 100)
IDs string `query:"ids" api:"required" json:"-"`
// contains filtered or unexported fields
}
func (XTweetListParams) URLQuery ¶
func (r XTweetListParams) URLQuery() (v url.Values, err error)
URLQuery serializes XTweetListParams's query parameters as `url.Values`.
type XTweetNewParams ¶
type XTweetNewParams struct {
// X account (@username or account ID)
Account string `json:"account" api:"required"`
AttachmentURL param.Opt[string] `json:"attachment_url,omitzero"`
CommunityID param.Opt[string] `json:"community_id,omitzero"`
IsNoteTweet param.Opt[bool] `json:"is_note_tweet,omitzero"`
ReplyToTweetID param.Opt[string] `json:"reply_to_tweet_id,omitzero"`
// Tweet text (optional when media is provided)
Text param.Opt[string] `json:"text,omitzero"`
// Array of media URLs to attach (mutually exclusive with media_ids)
Media []string `json:"media,omitzero"`
// Array of media IDs to attach (mutually exclusive with media)
MediaIDs []string `json:"media_ids,omitzero"`
// contains filtered or unexported fields
}
func (XTweetNewParams) MarshalJSON ¶
func (r XTweetNewParams) MarshalJSON() (data []byte, err error)
func (*XTweetNewParams) UnmarshalJSON ¶
func (r *XTweetNewParams) UnmarshalJSON(data []byte) error
type XTweetNewResponse ¶
type XTweetNewResponse struct {
Success bool `json:"success" api:"required"`
TweetID string `json:"tweetId" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
TweetID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XTweetNewResponse) RawJSON ¶
func (r XTweetNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XTweetNewResponse) UnmarshalJSON ¶
func (r *XTweetNewResponse) UnmarshalJSON(data []byte) error
type XTweetRetweetDeleteParams ¶
type XTweetRetweetDeleteParams struct {
// X account identifier (@username or account ID)
Account string `json:"account" api:"required"`
// contains filtered or unexported fields
}
func (XTweetRetweetDeleteParams) MarshalJSON ¶
func (r XTweetRetweetDeleteParams) MarshalJSON() (data []byte, err error)
func (*XTweetRetweetDeleteParams) UnmarshalJSON ¶
func (r *XTweetRetweetDeleteParams) UnmarshalJSON(data []byte) error
type XTweetRetweetDeleteResponse ¶
type XTweetRetweetDeleteResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XTweetRetweetDeleteResponse) RawJSON ¶
func (r XTweetRetweetDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XTweetRetweetDeleteResponse) UnmarshalJSON ¶
func (r *XTweetRetweetDeleteResponse) UnmarshalJSON(data []byte) error
type XTweetRetweetNewParams ¶
type XTweetRetweetNewParams struct {
// X account identifier (@username or account ID)
Account string `json:"account" api:"required"`
// contains filtered or unexported fields
}
func (XTweetRetweetNewParams) MarshalJSON ¶
func (r XTweetRetweetNewParams) MarshalJSON() (data []byte, err error)
func (*XTweetRetweetNewParams) UnmarshalJSON ¶
func (r *XTweetRetweetNewParams) UnmarshalJSON(data []byte) error
type XTweetRetweetNewResponse ¶
type XTweetRetweetNewResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XTweetRetweetNewResponse) RawJSON ¶
func (r XTweetRetweetNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XTweetRetweetNewResponse) UnmarshalJSON ¶
func (r *XTweetRetweetNewResponse) UnmarshalJSON(data []byte) error
type XTweetRetweetService ¶
type XTweetRetweetService struct {
// contains filtered or unexported fields
}
X write actions (tweets, likes, follows, DMs)
XTweetRetweetService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXTweetRetweetService method instead.
func NewXTweetRetweetService ¶
func NewXTweetRetweetService(opts ...option.RequestOption) (r XTweetRetweetService)
NewXTweetRetweetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XTweetRetweetService) Delete ¶
func (r *XTweetRetweetService) Delete(ctx context.Context, id string, body XTweetRetweetDeleteParams, opts ...option.RequestOption) (res *XTweetRetweetDeleteResponse, err error)
Unretweet
func (*XTweetRetweetService) New ¶
func (r *XTweetRetweetService) New(ctx context.Context, id string, body XTweetRetweetNewParams, opts ...option.RequestOption) (res *XTweetRetweetNewResponse, err error)
Retweet
type XTweetSearchParams ¶
type XTweetSearchParams struct {
// Search query (keywords,
Q string `query:"q" api:"required" json:"-"`
// Pagination cursor from previous response
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Max tweets to return (server paginates internally). Omit for single page (~20).
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// ISO 8601 timestamp — only return tweets after this time
SinceTime param.Opt[string] `query:"sinceTime,omitzero" json:"-"`
// ISO 8601 timestamp — only return tweets before this time
UntilTime param.Opt[string] `query:"untilTime,omitzero" json:"-"`
// Sort order — Latest (chronological) or Top (engagement-ranked)
//
// Any of "Latest", "Top".
QueryType XTweetSearchParamsQueryType `query:"queryType,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XTweetSearchParams) URLQuery ¶
func (r XTweetSearchParams) URLQuery() (v url.Values, err error)
URLQuery serializes XTweetSearchParams's query parameters as `url.Values`.
type XTweetSearchParamsQueryType ¶
type XTweetSearchParamsQueryType string
Sort order — Latest (chronological) or Top (engagement-ranked)
const ( XTweetSearchParamsQueryTypeLatest XTweetSearchParamsQueryType = "Latest" XTweetSearchParamsQueryTypeTop XTweetSearchParamsQueryType = "Top" )
type XTweetService ¶
type XTweetService struct {
// X write actions (tweets, likes, follows, DMs)
Like XTweetLikeService
// X write actions (tweets, likes, follows, DMs)
Retweet XTweetRetweetService
// contains filtered or unexported fields
}
XTweetService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXTweetService method instead.
func NewXTweetService ¶
func NewXTweetService(opts ...option.RequestOption) (r XTweetService)
NewXTweetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XTweetService) Delete ¶
func (r *XTweetService) Delete(ctx context.Context, id string, body XTweetDeleteParams, opts ...option.RequestOption) (res *XTweetDeleteResponse, err error)
Delete tweet
func (*XTweetService) Get ¶
func (r *XTweetService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *XTweetGetResponse, err error)
Get tweet with full text, author, metrics and media
func (*XTweetService) GetFavoriters ¶
func (r *XTweetService) GetFavoriters(ctx context.Context, id string, query XTweetGetFavoritersParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
List users who liked a tweet
func (*XTweetService) GetQuotes ¶
func (r *XTweetService) GetQuotes(ctx context.Context, id string, query XTweetGetQuotesParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
List quote tweets of a tweet
func (*XTweetService) GetReplies ¶
func (r *XTweetService) GetReplies(ctx context.Context, id string, query XTweetGetRepliesParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
List replies to a tweet
func (*XTweetService) GetRetweeters ¶
func (r *XTweetService) GetRetweeters(ctx context.Context, id string, query XTweetGetRetweetersParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
List users who retweeted a tweet
func (*XTweetService) GetThread ¶
func (r *XTweetService) GetThread(ctx context.Context, id string, query XTweetGetThreadParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
Get full conversation thread for a tweet
func (*XTweetService) List ¶
func (r *XTweetService) List(ctx context.Context, query XTweetListParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
Get multiple tweets by IDs
func (*XTweetService) New ¶
func (r *XTweetService) New(ctx context.Context, body XTweetNewParams, opts ...option.RequestOption) (res *XTweetNewResponse, err error)
Create tweet
func (*XTweetService) Search ¶
func (r *XTweetService) Search(ctx context.Context, query XTweetSearchParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
Search tweets with X query operators and pagination
type XUserFollowDeleteAllParams ¶
type XUserFollowDeleteAllParams struct {
// X account identifier (@username or account ID)
Account string `json:"account" api:"required"`
// contains filtered or unexported fields
}
func (XUserFollowDeleteAllParams) MarshalJSON ¶
func (r XUserFollowDeleteAllParams) MarshalJSON() (data []byte, err error)
func (*XUserFollowDeleteAllParams) UnmarshalJSON ¶
func (r *XUserFollowDeleteAllParams) UnmarshalJSON(data []byte) error
type XUserFollowDeleteAllResponse ¶
type XUserFollowDeleteAllResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XUserFollowDeleteAllResponse) RawJSON ¶
func (r XUserFollowDeleteAllResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XUserFollowDeleteAllResponse) UnmarshalJSON ¶
func (r *XUserFollowDeleteAllResponse) UnmarshalJSON(data []byte) error
type XUserFollowNewParams ¶
type XUserFollowNewParams struct {
// X account identifier (@username or account ID)
Account string `json:"account" api:"required"`
// contains filtered or unexported fields
}
func (XUserFollowNewParams) MarshalJSON ¶
func (r XUserFollowNewParams) MarshalJSON() (data []byte, err error)
func (*XUserFollowNewParams) UnmarshalJSON ¶
func (r *XUserFollowNewParams) UnmarshalJSON(data []byte) error
type XUserFollowNewResponse ¶
type XUserFollowNewResponse struct {
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (XUserFollowNewResponse) RawJSON ¶
func (r XUserFollowNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*XUserFollowNewResponse) UnmarshalJSON ¶
func (r *XUserFollowNewResponse) UnmarshalJSON(data []byte) error
type XUserFollowService ¶
type XUserFollowService struct {
// contains filtered or unexported fields
}
X write actions (tweets, likes, follows, DMs)
XUserFollowService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXUserFollowService method instead.
func NewXUserFollowService ¶
func NewXUserFollowService(opts ...option.RequestOption) (r XUserFollowService)
NewXUserFollowService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XUserFollowService) DeleteAll ¶
func (r *XUserFollowService) DeleteAll(ctx context.Context, id string, body XUserFollowDeleteAllParams, opts ...option.RequestOption) (res *XUserFollowDeleteAllResponse, err error)
Unfollow user
func (*XUserFollowService) New ¶
func (r *XUserFollowService) New(ctx context.Context, id string, body XUserFollowNewParams, opts ...option.RequestOption) (res *XUserFollowNewResponse, err error)
Follow user
type XUserGetBatchParams ¶
type XUserGetBatchParams struct {
// Comma-separated user IDs (max 100)
IDs string `query:"ids" api:"required" json:"-"`
// contains filtered or unexported fields
}
func (XUserGetBatchParams) URLQuery ¶
func (r XUserGetBatchParams) URLQuery() (v url.Values, err error)
URLQuery serializes XUserGetBatchParams's query parameters as `url.Values`.
type XUserGetFollowersParams ¶
type XUserGetFollowersParams struct {
// Pagination cursor for followers list
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Items per page (20-200, default 200)
PageSize param.Opt[int64] `query:"pageSize,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XUserGetFollowersParams) URLQuery ¶
func (r XUserGetFollowersParams) URLQuery() (v url.Values, err error)
URLQuery serializes XUserGetFollowersParams's query parameters as `url.Values`.
type XUserGetFollowersYouKnowParams ¶
type XUserGetFollowersYouKnowParams struct {
// Pagination cursor for followers-you-know
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XUserGetFollowersYouKnowParams) URLQuery ¶
func (r XUserGetFollowersYouKnowParams) URLQuery() (v url.Values, err error)
URLQuery serializes XUserGetFollowersYouKnowParams's query parameters as `url.Values`.
type XUserGetFollowingParams ¶
type XUserGetFollowingParams struct {
// Pagination cursor for following list
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Results per page (20-200, default 200)
PageSize param.Opt[int64] `query:"pageSize,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XUserGetFollowingParams) URLQuery ¶
func (r XUserGetFollowingParams) URLQuery() (v url.Values, err error)
URLQuery serializes XUserGetFollowingParams's query parameters as `url.Values`.
type XUserGetLikesParams ¶
type XUserGetLikesParams struct {
// Pagination cursor for liked tweets
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XUserGetLikesParams) URLQuery ¶
func (r XUserGetLikesParams) URLQuery() (v url.Values, err error)
URLQuery serializes XUserGetLikesParams's query parameters as `url.Values`.
type XUserGetMediaParams ¶
type XUserGetMediaParams struct {
// Pagination cursor for media tweets
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XUserGetMediaParams) URLQuery ¶
func (r XUserGetMediaParams) URLQuery() (v url.Values, err error)
URLQuery serializes XUserGetMediaParams's query parameters as `url.Values`.
type XUserGetMentionsParams ¶
type XUserGetMentionsParams struct {
// Pagination cursor for mentions
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Unix timestamp - return mentions after this time
SinceTime param.Opt[string] `query:"sinceTime,omitzero" json:"-"`
// Unix timestamp - return mentions before this time
UntilTime param.Opt[string] `query:"untilTime,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XUserGetMentionsParams) URLQuery ¶
func (r XUserGetMentionsParams) URLQuery() (v url.Values, err error)
URLQuery serializes XUserGetMentionsParams's query parameters as `url.Values`.
type XUserGetSearchParams ¶
type XUserGetSearchParams struct {
// User search query
Q string `query:"q" api:"required" json:"-"`
// Pagination cursor for user search
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XUserGetSearchParams) URLQuery ¶
func (r XUserGetSearchParams) URLQuery() (v url.Values, err error)
URLQuery serializes XUserGetSearchParams's query parameters as `url.Values`.
type XUserGetTweetsParams ¶
type XUserGetTweetsParams struct {
// Pagination cursor for user tweets
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Include parent tweet for replies
IncludeParentTweet param.Opt[bool] `query:"includeParentTweet,omitzero" json:"-"`
// Include reply tweets
IncludeReplies param.Opt[bool] `query:"includeReplies,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XUserGetTweetsParams) URLQuery ¶
func (r XUserGetTweetsParams) URLQuery() (v url.Values, err error)
URLQuery serializes XUserGetTweetsParams's query parameters as `url.Values`.
type XUserGetVerifiedFollowersParams ¶
type XUserGetVerifiedFollowersParams struct {
// Pagination cursor for verified followers
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (XUserGetVerifiedFollowersParams) URLQuery ¶
func (r XUserGetVerifiedFollowersParams) URLQuery() (v url.Values, err error)
URLQuery serializes XUserGetVerifiedFollowersParams's query parameters as `url.Values`.
type XUserService ¶
type XUserService struct {
// X write actions (tweets, likes, follows, DMs)
Follow XUserFollowService
// contains filtered or unexported fields
}
Look up, search, and explore user profiles and relationships
XUserService contains methods and other services that help with interacting with the x-twitter-scraper API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewXUserService method instead.
func NewXUserService ¶
func NewXUserService(opts ...option.RequestOption) (r XUserService)
NewXUserService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*XUserService) Get ¶
func (r *XUserService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *shared.UserProfile, err error)
Get user profile with follower counts and verification
func (*XUserService) GetBatch ¶
func (r *XUserService) GetBatch(ctx context.Context, query XUserGetBatchParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
Look up multiple users by IDs in one call
func (*XUserService) GetFollowers ¶
func (r *XUserService) GetFollowers(ctx context.Context, id string, query XUserGetFollowersParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
List followers of a user
func (*XUserService) GetFollowersYouKnow ¶
func (r *XUserService) GetFollowersYouKnow(ctx context.Context, id string, query XUserGetFollowersYouKnowParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
List mutual followers between you and a user
func (*XUserService) GetFollowing ¶
func (r *XUserService) GetFollowing(ctx context.Context, id string, query XUserGetFollowingParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
List accounts a user follows
func (*XUserService) GetLikes ¶
func (r *XUserService) GetLikes(ctx context.Context, id string, query XUserGetLikesParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
List tweets liked by a user
func (*XUserService) GetMedia ¶
func (r *XUserService) GetMedia(ctx context.Context, id string, query XUserGetMediaParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
List media tweets posted by a user
func (*XUserService) GetMentions ¶
func (r *XUserService) GetMentions(ctx context.Context, id string, query XUserGetMentionsParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
List tweets mentioning a user
func (*XUserService) GetSearch ¶
func (r *XUserService) GetSearch(ctx context.Context, query XUserGetSearchParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
Search users by name or username
func (*XUserService) GetTweets ¶
func (r *XUserService) GetTweets(ctx context.Context, id string, query XUserGetTweetsParams, opts ...option.RequestOption) (res *shared.PaginatedTweets, err error)
List recent tweets posted by a user
func (*XUserService) GetVerifiedFollowers ¶
func (r *XUserService) GetVerifiedFollowers(ctx context.Context, id string, query XUserGetVerifiedFollowersParams, opts ...option.RequestOption) (res *shared.PaginatedUsers, err error)
List verified followers of a user
Source Files
¶
- account.go
- aliases.go
- apikey.go
- client.go
- compose.go
- credit.go
- draft.go
- draw.go
- event.go
- extraction.go
- field.go
- monitor.go
- radar.go
- style.go
- subscribe.go
- support.go
- supportticket.go
- trend.go
- webhook.go
- x.go
- xaccount.go
- xbookmark.go
- xcommunity.go
- xcommunityjoin.go
- xcommunitytweet.go
- xdm.go
- xfollower.go
- xlist.go
- xmedia.go
- xprofile.go
- xtweet.go
- xtweetlike.go
- xtweetretweet.go
- xuser.go
- xuserfollow.go
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|