diff --git a/README.md b/README.md index 472f356..e254ae9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Xquik Go SDK for the X (Twitter) Scraper API: typed REST access for tweet search Use it in Go services that need X data, social media API workflows, or automation jobs without building scraping infrastructure. Start with the generated [API map](api.md), the [Go package reference](https://pkg.go.dev/github.com/Xquik-dev/x-twitter-scraper-go), or the [REST API docs](https://docs.xquik.com/api-reference/overview). -[Go Reference](https://pkg.go.dev/github.com/Xquik-dev/x-twitter-scraper-go) | [REST API Docs](https://docs.xquik.com/api-reference/overview) | [OpenAPI Spec](https://xquik.com/openapi.json) | [Webhooks](https://docs.xquik.com/api-reference/webhooks/create) | [MCP Server](https://xquik.com/mcp) +[Go Reference](https://pkg.go.dev/github.com/Xquik-dev/x-twitter-scraper-go) | [REST API Docs](https://docs.xquik.com/api-reference/overview) | [OpenAPI Spec](https://xquik.com/openapi.json) | [Context7](https://context7.com/xquik-dev/x-twitter-scraper-go) | [Webhooks](https://docs.xquik.com/api-reference/webhooks/create) | [MCP Server](https://xquik.com/mcp) It is generated with [Stainless](https://www.stainless.com/). diff --git a/context7.json b/context7.json index 0dfc95e..6f103ba 100644 --- a/context7.json +++ b/context7.json @@ -3,11 +3,19 @@ "projectTitle": "Xquik Go SDK", "description": "Official Go SDK for Xquik's X/Twitter API with typed REST methods for tweet search, user lookup, monitors, webhooks, media workflows, and extractions.", "branch": "main", + "excludeFolders": [".github"], + "excludeFiles": [ + "CHANGELOG.md", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md" + ], "rules": [ "Install with go get github.com/Xquik-dev/x-twitter-scraper-go.", "Authenticate with option.WithAPIKey or the X_TWITTER_SCRAPER_API_KEY environment variable.", "Use client.X.Tweets.Search for tweet search and client.X.Users for user lookup and follower workflows.", - "Use README.md first for install, API key setup, first request, package links, webhooks, MCP, and common Go workflows.", + "Use README.md and docs/CONTEXT7.md first for install, API key setup, first request, package links, webhooks, MCP, and common Go workflows.", "Use api.md for generated method coverage and pkg.go.dev for Go type signatures.", "Never expose API keys, webhook signing values, or user credentials in examples, logs, or commits." ], diff --git a/docs/CONTEXT7.md b/docs/CONTEXT7.md new file mode 100644 index 0000000..c147a2b --- /dev/null +++ b/docs/CONTEXT7.md @@ -0,0 +1,90 @@ +# Context7 Guide + +Use this page as the compact Context7-facing guide for the Xquik Go SDK. It +focuses on install, authentication, first requests, and common X automation +workflows. + +## Install + +```sh +go get github.com/Xquik-dev/x-twitter-scraper-go@v0.4.1 +``` + +Import the SDK as `xtwitterscraper`: + +```go +import ( + xtwitterscraper "github.com/Xquik-dev/x-twitter-scraper-go" + "github.com/Xquik-dev/x-twitter-scraper-go/option" +) +``` + +## Authenticate + +Set an API key in the process environment: + +```sh +export X_TWITTER_SCRAPER_API_KEY="your-api-key" +``` + +Then create a client: + +```go +client := xtwitterscraper.NewClient( + option.WithAPIKey(os.Getenv("X_TWITTER_SCRAPER_API_KEY")), +) +``` + +Never place API keys, webhook signing values, or user credentials in source +files, logs, examples, issues, or commits. + +## First Request + +Search recent tweets with X query operators: + +```go +paginatedTweets, err := client.X.Tweets.Search(context.TODO(), xtwitterscraper.XTweetSearchParams{ + Q: "from:elonmusk", + Limit: xtwitterscraper.Int(10), +}) +if err != nil { + panic(err) +} + +for _, tweet := range paginatedTweets.Tweets { + fmt.Printf("@%s: %s\n", tweet.Author.Username, tweet.Text) +} +``` + +## Common Workflows + +| Workflow | SDK entry point | +| --- | --- | +| Tweet search | `client.X.Tweets.Search` | +| Tweet lookup | `client.X.Tweets.Get` | +| User lookup | `client.X.Users.Get` | +| User search | `client.X.Users.GetSearch` | +| Follower export | `client.X.Users.GetFollowers` | +| Following export | `client.X.Users.GetFollowing` | +| Media upload | `client.X.Media.Upload` | +| Media download | `client.X.Media.Download` | +| Account monitoring | `client.Monitors.New` | +| Monitor events | `client.Events.List` | +| HMAC webhooks | `client.Webhooks.New` | +| Giveaway draws | `client.Draws.Run` | +| Bulk extractions | `client.Extractions.Run` | +| Regional trends | `client.Trends.List` | + +Use `api.md` for generated method coverage and + for Go type +signatures. + +## Public Sources + +- GitHub: +- Go reference: +- Xquik Go SDK docs: +- REST API docs: +- OpenAPI spec: +- Context7: +- DeepWiki: