Xtwitter scraper

From managedcode/dotnet-skills · View interactive version

Xtwitter scraper is an AI agent skill from the GitHub repository managedcode/dotnet-skills. Use XTwitterScraper when a .NET application needs typed access to Xquik's X automation REST API for tweet search, user lookup, posting workflows, extraction jobs, monitors, webhooks, or giveaway draws. USE FOR: integrating the XTwitterScraper NuGet package; reviewing Xquik API client usage; modeling

How to use this skill

Skill file

XTwitterScraper

Trigger On

Workflow

  1. Confirm the project actually needs Xquik API access from .NET. If it only needs prompt guidance, use a generic agent or API-design skill instead.
  2. Install the NuGet package:

```bash

dotnet add package XTwitterScraper

```

  1. Configure credentials through environment or secret storage. Prefer X_TWITTER_SCRAPER_API_KEY; keep X_TWITTER_SCRAPER_BASE_URL at its default unless a test fixture intentionally overrides it.
  2. Create XTwitterScraperClient at the composition boundary and inject it or a narrow wrapper into application services. Do not scatter client construction across handlers.
  3. Build typed Params objects for SDK calls instead of manually concatenating query strings.
  4. Treat paginated responses, extraction jobs, binary exports, and webhook events as different flow types. Do not force them through one generic helper.
  5. Preserve typed exceptions. Catch XTwitterScraperRateLimitException, authorization errors, and 5xx errors only where the application can retry, defer, or show a useful state.
  6. Validate with unit tests around your wrapper and integration tests with configured API credentials only when the environment explicitly provides them.

Architecture

flowchart LR
  A["ASP.NET Core or worker service"] --> B["Application wrapper"]
  B --> C["XTwitterScraperClient"]
  C --> D["Xquik REST API"]
  D --> E["Typed response models"]
  D --> F["Webhook events"]
  D --> G["Binary exports"]

Core Knowledge

Decision Cheatsheet

| If you need | Default approach | Why |

|---|---|---|

| Tweet search or user lookup | Use typed SDK methods and Params classes | Keeps request shape explicit |

| Application-wide client usage | Register one wrapper around XTwitterScraperClient | Keeps auth and options centralized |

| One-off option override | Use WithOptions | Avoids mutating shared client state |

| Headers or status inspection | Use WithRawResponse | Keeps normal typed flow clean |

| Extraction result download | Treat response as a stream | Avoids accidental JSON assumptions |

| Webhook handling | Map events to application commands or queue messages | Keeps delivery separate from business processing |

Common Failure Modes

Deliver

Validate

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.