Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xquik.com/llms.txt

Use this file to discover all available pages before exploring further.

Use the Go SDK when you want typed parameters, context-aware requests, generated response models, and Go-native error handling.

Install

go get github.com/Xquik-dev/x-twitter-scraper-go

Authenticate

export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE"
client := xtwitterscraper.NewClient(
	option.WithAPIKey(os.Getenv("X_TWITTER_SCRAPER_API_KEY")),
)

Basic Example

package main

import (
	"context"
	"fmt"

	"github.com/Xquik-dev/x-twitter-scraper-go"
	"github.com/Xquik-dev/x-twitter-scraper-go/option"
)

func main() {
	client := xtwitterscraper.NewClient(option.WithAPIKey("xq_YOUR_KEY_HERE"))

	tweets, err := client.X.Tweets.Search(context.TODO(), xtwitterscraper.XTweetSearchParams{
		Q:     "from:elonmusk",
		Limit: xtwitterscraper.Int(10),
	})
	if err != nil {
		panic(err)
	}

	fmt.Printf("%+v\n", tweets.HasNextPage)
}

Error Handling

Generated Go methods return error for connection failures and non-success API responses. Check the concrete error type from the SDK when you need status-code specific handling, and use the error handling guide for response semantics. Common retryable cases are connection errors, 408, 409, 429, and 5xx responses.

Pagination

List and search responses expose generated pagination fields such as HasNextPage. Pass cursor parameters from the previous response when the endpoint supports cursor pagination.
if tweets.HasNextPage {
	fmt.Println("More results are available")
}

Webhooks & References