- Retweeters - Get Retweeters
- RetweetersPage - Get Retweeters by Page
- Quotes - Get Quote Tweets
- QuotesPage - Get Quote Tweets by Page
Retrieve retweeters in a single request. Automatically paginates until count is reached or no more results. Minimum 10, maximum 5000 users.
package main
import(
"context"
"os"
xapiscraper "github.com/twexapi-dev/x-api-scraper-go"
"github.com/twexapi-dev/x-api-scraper-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := xapiscraper.New(
xapiscraper.WithSecurity(os.Getenv("X_API_SCRAPER_BEARER_AUTH")),
)
res, err := s.Tweets.Engagement.Retweeters(ctx, operations.TweetsEngagementRetweetersRequest{
TweetID: "<id>",
TargetCount: 100,
})
if err != nil {
log.Fatal(err)
}
if res.SearchUserResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.TweetsEngagementRetweetersRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.TweetsEngagementRetweetersResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.HTTPValidationError | 422 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve retweeters using cursor-based pagination. Each page returns up to 20 users. Pass next_cursor from the previous response to continue.
package main
import(
"context"
"os"
xapiscraper "github.com/twexapi-dev/x-api-scraper-go"
"github.com/twexapi-dev/x-api-scraper-go/optionalnullable"
"github.com/twexapi-dev/x-api-scraper-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := xapiscraper.New(
xapiscraper.WithSecurity(os.Getenv("X_API_SCRAPER_BEARER_AUTH")),
)
res, err := s.Tweets.Engagement.RetweetersPage(ctx, components.GetRetweetersCursorQuery{
TweetID: "<id>",
NextCursor: optionalnullable.From(xapiscraper.Pointer("eyJpZCI6IjIwNjAwNTE1Mzg3OTQ0Mzg2NzciLCJmbG9ja0N1cnNvciI6IjQ2MTE2ODYwMTg2Mjg5ODcxNzkiLCJvcmlnaW5hbERpcmVjdGlvbiI6IkRlc2NlbmRpbmcifQ==-999995")),
})
if err != nil {
log.Fatal(err)
}
if res.GetRetweetersCursorResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.GetRetweetersCursorQuery | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.TweetsEngagementRetweetersPageResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.HTTPValidationError | 422 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve quote tweets in a single request. Automatically paginates until count is reached or no more results. Use Latest for chronological order or Top for ranked results. Minimum 10, maximum 5000 tweets.
package main
import(
"context"
"os"
xapiscraper "github.com/twexapi-dev/x-api-scraper-go"
"github.com/twexapi-dev/x-api-scraper-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := xapiscraper.New(
xapiscraper.WithSecurity(os.Getenv("X_API_SCRAPER_BEARER_AUTH")),
)
res, err := s.Tweets.Engagement.Quotes(ctx, components.GetQuotesQuery{
TweetID: "<id>",
Count: 100,
})
if err != nil {
log.Fatal(err)
}
if res.GetQuotesResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.GetQuotesQuery | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.TweetsEngagementQuotesResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.HTTPValidationError | 422 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve quote tweets using cursor-based pagination. Each page returns up to 20 tweets. Use Latest for chronological order or Top for ranked results. Pass next_cursor from the previous response to continue.
package main
import(
"context"
"os"
xapiscraper "github.com/twexapi-dev/x-api-scraper-go"
"github.com/twexapi-dev/x-api-scraper-go/optionalnullable"
"github.com/twexapi-dev/x-api-scraper-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := xapiscraper.New(
xapiscraper.WithSecurity(os.Getenv("X_API_SCRAPER_BEARER_AUTH")),
)
res, err := s.Tweets.Engagement.QuotesPage(ctx, components.GetQuotesCursorQuery{
TweetID: "<id>",
NextCursor: optionalnullable.From(xapiscraper.Pointer("scroll:thGQYTMwMjU5NDA4ODc4ODc6MjU5NDA4ODc4ODc6")),
})
if err != nil {
log.Fatal(err)
}
if res.GetQuotesCursorResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.GetQuotesCursorQuery | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.TweetsEngagementQuotesPageResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.HTTPValidationError | 422 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |