Try Live
Add Docs
Rankings
Pricing
Docs
Install
Theme
Install
Docs
Pricing
More...
More...
Try Live
Rankings
Enterprise
Create API Key
Add Docs
Xquik Skill
https://github.com/xquik-dev/x-twitter-scraper
Admin
Xquik Skill is an AI agent skill for building integrations with the Xquik X (Twitter) real-time data
...
Tokens:
75,028
Snippets:
426
Trust Score:
7.5
Update:
1 week ago
Context
Skills
Chat
Benchmark
89.2
Suggestions
Latest
Show doc for...
Code
Info
Show Results
Context Summary (auto-generated)
Raw
Copy
Link
# Xquik - X (Twitter) Real-Time Data Platform Xquik is a comprehensive X (Twitter) data platform that provides 120 REST API endpoints, 2 MCP tools, and HMAC-signed webhooks for real-time event delivery. The platform covers tweet search and lookup, user profile data, bulk data extraction (23 tools), account monitoring, giveaway draws, media downloads, trending topics, write actions (posting, liking, following), and workflow automations. It's designed as an AI agent skill that integrates with 40+ coding assistants including Claude Code, OpenAI Codex, Cursor, and GitHub Copilot. The platform offers the most affordable X data access available, with reads starting at $0.00015/call (33x cheaper than the official X API). Core features include real-time account monitoring with webhook delivery, transparent giveaway draws from tweet replies, bulk extraction of followers/replies/quotes/mentions, algorithm-optimized tweet composition, and full write capabilities through connected X accounts. Authentication uses API keys (`x-api-key` header) with keys prefixed `xq_`, and all endpoints are HTTPS-only at `https://xquik.com/api/v1`. --- ## Get Tweet by ID Retrieve a single tweet with full engagement metrics including likes, retweets, replies, quotes, views, and bookmarks. Returns author information and attached media URLs. ```bash curl -X GET "https://xquik.com/api/v1/x/tweets/1893556789012345678" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: # { # "id": "1893556789012345678", # "text": "Hello world", # "createdAt": "2026-02-24T16:45:00.000Z", # "likeCount": 3200, # "retweetCount": 890, # "replyCount": 245, # "quoteCount": 120, # "viewCount": 150000, # "bookmarkCount": 450, # "media": [ # { "mediaUrl": "https://pbs.twimg.com/media/...", "type": "photo", "url": "https://t.co/..." } # ], # "author": { # "id": "44196397", # "username": "elonmusk", # "followers": 195000000, # "verified": true, # "profilePicture": "https://pbs.twimg.com/..." # } # } ``` --- ## Search Tweets Search tweets by keyword, hashtag, or advanced X search operators. Returns tweet info with engagement metrics and attached media. ```bash curl -X GET "https://xquik.com/api/v1/x/tweets/search?q=%23AI%20from%3Aelonmusk&limit=10" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: # { # "tweets": [ # { # "id": "1893456789012345678", # "text": "AI will transform everything...", # "createdAt": "2026-02-24T10:30:00.000Z", # "likeCount": 5200, # "retweetCount": 1200, # "replyCount": 890, # "author": { # "id": "44196397", # "username": "elonmusk", # "name": "Elon Musk", # "verified": true # } # } # ], # "hasMore": true, # "nextCursor": "MjAyNi0wMi0yNFQxMDozMDowMC4wMDBa..." # } ``` --- ## Get User Profile Retrieve a user's profile information including bio, follower/following counts, verification status, and account metadata. ```bash curl -X GET "https://xquik.com/api/v1/x/users/elonmusk" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: # { # "id": "44196397", # "username": "elonmusk", # "name": "Elon Musk", # "description": "Mars, Cars, AI", # "followers": 195000000, # "following": 850, # "verified": true, # "profilePicture": "https://pbs.twimg.com/...", # "location": "Austin, Texas", # "createdAt": "2009-06-02T20:12:29.000Z", # "statusesCount": 45000 # } ``` --- ## Check Follow Relationship Check if two accounts follow each other. Returns bidirectional follow status. ```bash curl -X GET "https://xquik.com/api/v1/x/followers/check?source=elonmusk&target=BillGates" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: # { # "sourceUsername": "elonmusk", # "targetUsername": "BillGates", # "isFollowing": false, # "isFollowedBy": true # } ``` --- ## Create Monitor Set up real-time monitoring for an X account to track tweets, replies, quotes, retweets, and follower changes. ```bash curl -X POST "https://xquik.com/api/v1/monitors" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "username": "elonmusk", "eventTypes": ["tweet.new", "tweet.reply", "tweet.quote", "follower.gained"] }' # Response: # { # "id": "7", # "username": "elonmusk", # "xUserId": "44196397", # "eventTypes": ["tweet.new", "tweet.reply", "tweet.quote", "follower.gained"], # "isActive": true, # "createdAt": "2026-02-24T10:30:00.000Z" # } ``` --- ## Create Webhook Register an HTTPS endpoint to receive real-time events with HMAC-SHA256 signature verification. ```bash curl -X POST "https://xquik.com/api/v1/webhooks" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-server.com/webhook", "eventTypes": ["tweet.new", "tweet.reply", "follower.gained"] }' # Response: # { # "id": "12", # "url": "https://your-server.com/webhook", # "eventTypes": ["tweet.new", "tweet.reply", "follower.gained"], # "secret": "whsec_abc123...", // SAVE THIS - shown only once # "isActive": true, # "createdAt": "2026-02-24T10:30:00.000Z" # } ``` --- ## Webhook Handler (Node.js) Receive and verify webhook events with HMAC-SHA256 signature validation and idempotency handling. ```javascript import express from "express"; import { createHmac, timingSafeEqual, createHash } from "node:crypto"; const WEBHOOK_SECRET = process.env.XQUIK_WEBHOOK_SECRET; const processedHashes = new Set(); // Use Redis/DB in production function verifySignature(payload, signature, secret) { const expected = "sha256=" + createHmac("sha256", secret).update(payload).digest("hex"); return timingSafeEqual(Buffer.from(expected), Buffer.from(signature)); } const app = express(); app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => { const signature = req.headers["x-xquik-signature"]; const payload = req.body.toString(); // 1. Verify HMAC signature if (!signature || !verifySignature(payload, signature, WEBHOOK_SECRET)) { return res.status(401).send("Invalid signature"); } // 2. Deduplicate (retries can deliver the same event twice) const payloadHash = createHash("sha256").update(payload).digest("hex"); if (processedHashes.has(payloadHash)) { return res.status(200).send("Already processed"); } processedHashes.add(payloadHash); // 3. Parse and route by event type const event = JSON.parse(payload); // event: { eventType: "tweet.new", username: "elonmusk", data: { tweetId, text, metrics } } switch (event.eventType) { case "tweet.new": console.log(`New tweet from @${event.username}: ${event.data.text}`); break; case "follower.gained": console.log(`@${event.username} gained follower: @${event.data.followerUsername}`); break; } res.status(200).send("OK"); }); app.listen(3000); ``` --- ## Webhook Handler (Python/Flask) Python equivalent for receiving and verifying webhook events. ```python import hmac, hashlib, json, os from flask import Flask, request app = Flask(__name__) WEBHOOK_SECRET = os.environ["XQUIK_WEBHOOK_SECRET"] processed_hashes = set() # Use Redis/DB in production def verify_signature(payload: bytes, signature: str, secret: str) -> bool: expected = "sha256=" + hmac.new(secret.encode(), payload, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, signature) @app.route("/webhook", methods=["POST"]) def webhook(): signature = request.headers.get("X-Xquik-Signature", "") payload = request.get_data() if not verify_signature(payload, signature, WEBHOOK_SECRET): return "Invalid signature", 401 payload_hash = hashlib.sha256(payload).hexdigest() if payload_hash in processed_hashes: return "Already processed", 200 processed_hashes.add(payload_hash) event = json.loads(payload) if event["eventType"] == "tweet.new": print(f"New tweet from @{event['username']}: {event['data']['text']}") return "OK", 200 ``` --- ## Poll Events Retrieve monitor events via polling instead of webhooks. Supports filtering by monitor and event type with cursor pagination. ```bash curl -X GET "https://xquik.com/api/v1/events?monitorId=7&eventType=tweet.new&limit=50" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: # { # "events": [ # { # "id": "9010", # "type": "tweet.new", # "monitorId": "7", # "username": "elonmusk", # "occurredAt": "2026-02-24T16:45:00.000Z", # "data": { # "tweetId": "1893556789012345678", # "text": "Hello world", # "metrics": { "likes": 3200, "retweets": 890, "replies": 245 } # } # } # ], # "hasMore": true, # "nextCursor": "MjAyNi0wMi0yNFQxNjozMDowMC4wMDBa..." # } ``` --- ## Run Extraction (Bulk Data) Create a bulk extraction job to collect large datasets like all followers, replies, or community members. 23 extraction tool types available. ```bash # Step 1: Estimate cost first curl -X POST "https://xquik.com/api/v1/extractions/estimate" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "toolType": "follower_explorer", "targetUsername": "elonmusk", "resultsLimit": 1000 }' # Response: { "allowed": true, "estimatedResults": 195000000, "projectedPercent": 48 } # Step 2: Create extraction job curl -X POST "https://xquik.com/api/v1/extractions" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "toolType": "follower_explorer", "targetUsername": "elonmusk", "resultsLimit": 1000 }' # Response: # { # "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", # "toolType": "follower_explorer", # "status": "running" # } # Step 3: Get results (poll until completed) curl -X GET "https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: # { # "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", # "toolType": "follower_explorer", # "status": "completed", # "totalResults": 1000, # "results": [ # { "xUserId": "123456", "xUsername": "user1", "xFollowersCount": 5000, "xVerified": false } # ], # "hasMore": true, # "nextCursor": "..." # } ``` --- ## Extraction Tool Types All 23 extraction tool types with their required parameters. ```javascript // Tweet-based (require targetTweetId) const tweetExtractions = { reply_extractor: "Users who replied to a tweet", repost_extractor: "Users who retweeted a tweet", quote_extractor: "Users who quote-tweeted", thread_extractor: "All tweets in a thread", article_extractor: "Article content from tweet", favoriters: "Users who favorited a tweet" }; // User-based (require targetUsername) const userExtractions = { follower_explorer: "Followers of an account", following_explorer: "Accounts followed by a user", verified_follower_explorer: "Verified followers", mention_extractor: "Tweets mentioning an account", post_extractor: "Posts from an account" }; // User ID-based (require targetUserId) const userIdExtractions = { user_likes: "Tweets liked by a user", user_media: "Media tweets from a user" }; // Community-based (require targetCommunityId) const communityExtractions = { community_extractor: "Members of a community", community_moderator_explorer: "Community moderators", community_post_extractor: "Posts from a community", community_search: "Search within community (+ searchQuery)" }; // List-based (require targetListId) const listExtractions = { list_member_extractor: "Members of a list", list_post_extractor: "Posts from a list", list_follower_explorer: "Followers of a list" }; // Search-based (require searchQuery) const searchExtractions = { people_search: "Search for users by keyword", tweet_search_extractor: "Bulk tweet search (up to 1,000)" }; // Space-based (require targetSpaceId) const spaceExtractions = { space_explorer: "Participants of a Space" }; ``` --- ## Run Giveaway Draw Run a transparent, auditable giveaway draw from tweet replies with configurable filters. ```bash curl -X POST "https://xquik.com/api/v1/draws" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "tweetUrl": "https://x.com/burakbayir/status/1893456789012345678", "winnerCount": 3, "backupCount": 2, "uniqueAuthorsOnly": true, "mustRetweet": true, "mustFollowUsername": "burakbayir", "filterMinFollowers": 50, "filterAccountAgeDays": 30, "filterLanguage": "en", "requiredHashtags": ["#giveaway"] }' # Response: # { # "id": "42", # "tweetId": "1893456789012345678", # "status": "completed", # "totalEntries": 1500, # "validEntries": 890, # "createdAt": "2026-02-24T10:00:00.000Z" # } # Get winners curl -X GET "https://xquik.com/api/v1/draws/42" \ -H "x-api-key: xq_YOUR_API_KEY" # Response includes winners array: # "winners": [ # { "position": 1, "authorUsername": "winner1", "tweetId": "...", "isBackup": false }, # { "position": 2, "authorUsername": "winner2", "tweetId": "...", "isBackup": false }, # { "position": 3, "authorUsername": "winner3", "tweetId": "...", "isBackup": false }, # { "position": 4, "authorUsername": "backup1", "tweetId": "...", "isBackup": true }, # { "position": 5, "authorUsername": "backup2", "tweetId": "...", "isBackup": true } # ] ``` --- ## Download Tweet Media Download images, videos, and GIFs from tweets with permanent hosted URLs. Supports single or bulk downloads. ```bash # Single tweet curl -X POST "https://xquik.com/api/v1/x/media/download" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "tweetInput": "https://x.com/user/status/1893456789012345678" }' # Response: { "tweetId": "1893456789012345678", "galleryUrl": "https://xquik.com/gallery/abc123", "cacheHit": false } # Bulk download (up to 50 tweets) curl -X POST "https://xquik.com/api/v1/x/media/download" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "tweetIds": ["1893456789012345678", "1893456789012345679", "1893456789012345680"] }' # Response: { "galleryUrl": "https://xquik.com/gallery/def456", "totalTweets": 3, "totalMedia": 7 } ``` --- ## Get Trending Topics Retrieve trending topics by region (WOEID). Cached and refreshes every 15 minutes. ```bash curl -X GET "https://xquik.com/api/v1/trends?woeid=1&count=30" \ -H "x-api-key: xq_YOUR_API_KEY" # WOEIDs: 1 (Worldwide), 23424977 (US), 23424975 (UK), 23424969 (Turkey), 23424856 (Japan) # Response: # { # "trends": [ # { "name": "#AI", "description": "Artificial Intelligence discussions", "rank": 1, "query": "#AI" }, # { "name": "Elon Musk", "description": "...", "rank": 2, "query": "Elon Musk" } # ], # "total": 30, # "woeid": 1 # } ``` --- ## Get Radar (Trending News) Free endpoint to get trending topics and news from 7 sources: Google Trends, Hacker News, Polymarket, TrustMRR, Wikipedia, GitHub, Reddit. ```bash curl -X GET "https://xquik.com/api/v1/radar?source=hacker_news&category=tech&limit=20" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: # { # "items": [ # { # "id": "12345", # "title": "Claude 4.6 Released", # "description": "Anthropic releases Claude 4.6 with improved reasoning...", # "url": "https://example.com/article", # "source": "hacker_news", # "category": "tech", # "score": 450, # "metadata": { "points": 450, "numberComments": 132, "author": "pgdev" }, # "publishedAt": "2026-03-05T10:00:00.000Z" # } # ], # "hasMore": true, # "nextCursor": "..." # } ``` --- ## Compose Tweet (Algorithm-Optimized) Free 3-step workflow to compose algorithm-optimized tweets with scoring. ```bash # Step 1: Get composition rules and algorithm insights curl -X POST "https://xquik.com/api/v1/compose" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "step": "compose", "topic": "AI startup launch", "goal": "engagement" }' # Response includes: contentRules, scorerWeights, followUpQuestions, algorithmInsights, engagementMultipliers, topPenalties # Step 2: Refine with user preferences curl -X POST "https://xquik.com/api/v1/compose" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "step": "refine", "topic": "AI startup launch", "tone": "professional", "callToAction": "visit website" }' # Response includes: compositionGuidance, examplePatterns # Step 3: Score a draft curl -X POST "https://xquik.com/api/v1/compose" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "step": "score", "draft": "We just launched our AI startup! Check it out at example.com", "hasLink": true, "hasMedia": false }' # Response: # { # "totalChecks": 12, # "passedCount": 9, # "topSuggestion": "Add a visual element - tweets with images get 150% more engagement", # "checklist": [ # { "factor": "Hook in first line", "passed": true }, # { "factor": "Contains media", "passed": false, "suggestion": "Add an image or video" } # ] # } ``` --- ## Connect X Account (Write Actions) Connect an X account to enable write actions (posting, liking, following). ```bash curl -X POST "https://xquik.com/api/v1/x/accounts" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "username": "myaccount", "email": "me@example.com", "password": "securepassword123", "totp_secret": "JBSWY3DPEHPK3PXP" }' # Response: { "id": "acc_123", "username": "myaccount", "isActive": true, "createdAt": "..." } ``` --- ## Post Tweet Create a tweet through a connected X account. Supports replies, media attachments, and long-form notes. ```bash # Simple tweet curl -X POST "https://xquik.com/api/v1/x/tweets" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "account": "myaccount", "text": "Hello world from Xquik API!" }' # Response: { "tweetId": "1893556789012345678", "success": true } # Reply to a tweet curl -X POST "https://xquik.com/api/v1/x/tweets" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "account": "myaccount", "text": "Great point!", "reply_to_tweet_id": "1893456789012345678" }' # Tweet with media (upload media first) curl -X POST "https://xquik.com/api/v1/x/media" \ -H "x-api-key: xq_YOUR_API_KEY" \ -F "account=myaccount" \ -F "file=@image.png" # Response: { "mediaId": "media_abc123" } curl -X POST "https://xquik.com/api/v1/x/tweets" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "account": "myaccount", "text": "Check out this image!", "media_ids": ["media_abc123"] }' ``` --- ## Like, Retweet, Follow Actions Perform engagement actions through a connected X account. ```bash # Like a tweet curl -X POST "https://xquik.com/api/v1/x/tweets/1893456789012345678/like" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "account": "myaccount" }' # Unlike a tweet curl -X DELETE "https://xquik.com/api/v1/x/tweets/1893456789012345678/like" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "account": "myaccount" }' # Retweet curl -X POST "https://xquik.com/api/v1/x/tweets/1893456789012345678/retweet" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "account": "myaccount" }' # Follow a user (requires user ID, get from user lookup first) curl -X POST "https://xquik.com/api/v1/x/users/44196397/follow" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "account": "myaccount" }' # Unfollow curl -X DELETE "https://xquik.com/api/v1/x/users/44196397/follow" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "account": "myaccount" }' ``` --- ## Send Direct Message Send DMs through a connected X account. ```bash curl -X POST "https://xquik.com/api/v1/x/dm/44196397" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "account": "myaccount", "text": "Hey, thanks for following!" }' # Response: { "success": true } # Get DM history curl -X GET "https://xquik.com/api/v1/x/dm/44196397/history" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: { "messages": [...], "hasMore": true, "nextCursor": "..." } ``` --- ## Create Automation Flow Set up trigger-driven workflow automation with monitor events, schedules, or inbound webhooks. ```bash # Create a flow triggered by new followers curl -X POST "https://xquik.com/api/v1/automations" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Welcome New Followers", "triggerType": "monitor_event", "triggerConfig": { "eventType": "follower.gained" } }' # Response: { "id": "flow_123", "slug": "welcome-new-followers", "isActive": false, ... } # Add a DM action step curl -X POST "https://xquik.com/api/v1/automations/welcome-new-followers/steps" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "stepType": "action", "actionType": "send_dm", "branch": "main", "config": { "message": "Thanks for following! Feel free to reach out anytime." }, "position": 0 }' # Activate the flow curl -X PATCH "https://xquik.com/api/v1/automations/welcome-new-followers" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "expectedUpdatedAt": "2026-02-24T10:30:00.000Z", "isActive": true }' ``` --- ## Create Telegram Integration Set up Telegram notifications for monitor events. ```bash curl -X POST "https://xquik.com/api/v1/integrations" \ -H "x-api-key: xq_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "telegram", "name": "My Telegram Alerts", "config": { "chatId": "-1001234567890" }, "eventTypes": ["tweet.new", "tweet.reply", "extraction.completed"] }' # Response: { "id": "int_123", "type": "telegram", "name": "My Telegram Alerts", "isActive": true, ... } # Test the integration curl -X POST "https://xquik.com/api/v1/integrations/int_123/test" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: { "success": true } ``` --- ## Check Credits and Account Status Monitor your credit balance and subscription status. ```bash # Get credit balance curl -X GET "https://xquik.com/api/v1/credits" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: { "balance": 50000, "lifetimePurchased": 100000, "lifetimeUsed": 50000, "autoTopUp": false } # Get account status curl -X GET "https://xquik.com/api/v1/account" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: # { # "plan": "active", # "monitorsAllowed": 1, # "monitorsUsed": 1, # "currentPeriod": { # "start": "2026-02-01T00:00:00.000Z", # "end": "2026-03-01T00:00:00.000Z", # "usagePercent": 45 # } # } # Top up credits (returns Stripe checkout URL) curl -X POST "https://xquik.com/api/v1/credits/topup" \ -H "x-api-key: xq_YOUR_API_KEY" # Response: { "url": "https://checkout.stripe.com/c/pay/..." } ``` --- ## MCP Server Integration The MCP server at `https://xquik.com/mcp` provides 2 tools for AI agent integration. ```javascript // MCP tool: explore - Search the API spec (free, no network calls) async () => spec.endpoints.filter(e => e.category === 'twitter'); async () => spec.endpoints.filter(e => e.summary.toLowerCase().includes('tweet')); async () => spec.endpoints.filter(e => e.free); // MCP tool: xquik - Execute API calls (auth injected automatically) async () => xquik.request('/api/v1/x/tweets/1893556789012345678'); async () => xquik.request('/api/v1/x/users/elonmusk'); async () => xquik.request('/api/v1/monitors', { method: 'POST', body: { username: 'elonmusk', eventTypes: ['tweet.new'] } }); async () => xquik.request('/api/v1/radar', { query: { source: 'hacker_news', limit: '20' } }); // Never pass API keys - auth is injected automatically // Use explore first to find endpoints, then xquik to call them ``` --- ## Retry with Exponential Backoff (JavaScript) Production-ready retry logic for handling rate limits and transient errors. ```javascript const API_KEY = "xq_YOUR_KEY_HERE"; const BASE = "https://xquik.com/api/v1"; const headers = { "x-api-key": API_KEY, "Content-Type": "application/json" }; async function xquikFetch(path, options = {}) { const baseDelay = 1000; for (let attempt = 0; attempt <= 3; attempt++) { const response = await fetch(`${BASE}${path}`, { ...options, headers: { ...headers, ...options.headers }, }); if (response.ok) return response.json(); const retryable = response.status === 429 || response.status >= 500; if (!retryable || attempt === 3) { const error = await response.json(); throw new Error(`Xquik API ${response.status}: ${error.error}`); } const retryAfter = response.headers.get("Retry-After"); const delay = retryAfter ? parseInt(retryAfter, 10) * 1000 : baseDelay * Math.pow(2, attempt) + Math.random() * 1000; await new Promise((resolve) => setTimeout(resolve, delay)); } } // Usage const tweet = await xquikFetch("/x/tweets/1893556789012345678"); const user = await xquikFetch("/x/users/elonmusk"); const events = await xquikFetch("/events?monitorId=7&limit=50"); ``` --- ## Cursor Pagination Pattern Handle paginated results for events, extractions, and draws. ```javascript async function fetchAllPages(path, dataKey) { const results = []; let cursor; while (true) { const params = new URLSearchParams({ limit: "100" }); if (cursor) params.set("after", cursor); const data = await xquikFetch(`${path}?${params}`); results.push(...data[dataKey]); if (!data.hasMore) break; cursor = data.nextCursor; } return results; } // Fetch all events const allEvents = await fetchAllPages("/events", "events"); // Fetch all extraction results const allResults = await fetchAllPages("/extractions/abc123", "results"); ``` --- Xquik serves as a comprehensive X data platform for building social media monitoring systems, engagement automation, influencer analytics, giveaway management, and content optimization tools. The API supports common integration patterns including real-time webhook-based alerting, batch data extraction for analytics, automated engagement workflows, and AI-powered tweet composition. Most users start with monitoring and webhooks for real-time alerts, then expand to extractions for bulk data analysis and write actions for automation. For AI coding agents, the MCP server provides seamless integration through 2 tools that cover all 120 REST endpoints. The `explore` tool searches the API spec for endpoint discovery, while the `xquik` tool executes authenticated API calls. Common workflows include: monitoring setup (`POST /monitors` -> `POST /webhooks`), bulk extraction (`POST /extractions/estimate` -> `POST /extractions` -> `GET /extractions/{id}`), giveaway execution (`POST /draws`), and tweet posting (`GET /x/accounts` -> `POST /x/tweets`). The platform's credit-based pricing (1 credit = $0.00015) makes it cost-effective for high-volume operations while free endpoints (radar, compose, drafts, monitors, webhooks) enable rich functionality without per-call costs.