Install
Authenticate
Basic example
Search tweets and write durable JSON Lines handoff rows.TypeScript SDK workflows
Tweet replies workflow to CSV, JSON, or XLSX
Use this workflow when a TypeScript worker needs every reply under one tweet. The replies come as a saved extraction or a JSON Lines handoff. They can also come as a CSV, JSON, or XLSX export. It usesclient.extractions.estimateCost, run, retrieve, and exportResults.
Reuse the polling, JSON Lines pagination, and export structure from the follower workflow. Only the tool type, target field, and filenames change.reply_extractor requires targetTweetId. client.extractions.retrieve returns results, hasMore, and nextCursor. The shared pagination loop passes nextCursor back as cursor. Use xquik-replies.jsonl for queue replay or warehouse loads, and xquik-replies.json for app ingestion. Use xquik-replies.csv for CRM import and xquik-replies.xlsx for analyst handoff. client.extractions.exportResults supports csv, json, and xlsx for file handoff. The cost is 1 credit per reply extracted or returned.Error handling
The SDK throws typed errors for API failures.400 Bad request
Throws
BadRequestError.401 Unauthenticated
Throws
AuthenticationError.403 Permission denied
Throws
PermissionDeniedError.404 Not found
Throws
NotFoundError.422 Unprocessable entity
Throws
UnprocessableEntityError.429 Rate limited
Throws
RateLimitError.5xx server error
Throws
InternalServerError.maxRetries to tune retry behavior.Cost, limits & retries
Tweet search costs 1 credit per tweet returned. If credits cannot cover a boundedlimit request, the API can return fewer tweets. If credits cover no results, it returns 402 insufficient_credits. Xquik rate-limits read calls. 429 responses include Retry-After.
The client retries connection errors, 408, 409, 429, and 5xx responses by default. Handle RateLimitError with backoff. Fix 400, 401, 403, 404, or 422 responses before retrying.Pagination
Search and list endpoints return page objects. When you need another page, checkhas_next_page. Then pass the generated cursor fields documented on each endpoint.Webhooks & references
- Webhook Overview
- Verify HMAC Signatures
- Twitter Scraper API Overview
- Download the OpenAPI schema with
curl -o openapi.json https://xquik.com/openapi.json - Source Repository