Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

Expand Down
10 changes: 9 additions & 1 deletion context7.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
],
Expand Down
90 changes: 90 additions & 0 deletions docs/CONTEXT7.md
Original file line number Diff line number Diff line change
@@ -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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Hard-pinning v0.4.1 means this install command will silently stay on an old version as the SDK evolves. Using @latest keeps it current without manual doc updates.

Suggested change
go get github.com/Xquik-dev/x-twitter-scraper-go@v0.4.1
go get github.com/Xquik-dev/x-twitter-scraper-go@latest

```

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"
)
Comment on lines +16 to +19
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 The import block omits the standard-library packages (os, context, fmt) that the subsequent code snippets rely on. An AI agent or developer copying these blocks verbatim will get compile errors because os.Getenv, context.TODO(), and fmt.Printf are not imported.

Suggested change
import (
xtwitterscraper "github.com/Xquik-dev/x-twitter-scraper-go"
"github.com/Xquik-dev/x-twitter-scraper-go/option"
)
import (
"context"
"fmt"
"os"
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
<https://pkg.go.dev/github.com/Xquik-dev/x-twitter-scraper-go> for Go type
signatures.

## Public Sources

- GitHub: <https://github.com/Xquik-dev/x-twitter-scraper-go>
- Go reference: <https://pkg.go.dev/github.com/Xquik-dev/x-twitter-scraper-go>
- Xquik Go SDK docs: <https://docs.xquik.com/sdks/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>
- DeepWiki: <https://deepwiki.com/Xquik-dev/x-twitter-scraper-go>
Loading