# Xquik > This file is very large and may be truncated. For an index of this content, please refer to https://docs.xquik.com/llms.txt instead. > Search tweets, export followers and replies, retrieve profiles and timelines, monitor accounts, post tweets, and use webhooks, SDKs & MCP. Not affiliated with X Corp. # Apify alternative for X (Twitter) tweets & followers Source: https://docs.xquik.com/alternatives/apify Xquik beats Apify's Tweet Scraper V2 per useful tweet, USD 0.000155 against USD 0.000623, & runs 13.6 times faster. Compare datasets, monitors, webhooks & MCP. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over Apify's X (Twitter) scrapers Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. Tweet Scraper V2 shows its own speed table without public runs or test dates. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [Tweet Scraper V2's Store page](https://apify.com/apidojo/tweet-scraper) lists USD 0.40 per 1,000 tweets. That is USD 0.0004 per tweet. Each of its queries must return at least 50 tweets. In the October benchmark, it cost USD 0.000623 per useful tweet. Xquik's X Tweet Scraper cost USD 0.000155. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where Apify fits Compare Apify, Xquik, and Xquik's Apify Actors. Match Actor inputs, dataset rows, exports, and automation needs for one X/Twitter job. > [!NOTE] > > Verify current Apify actor pricing, actor inputs, dataset exports, and platform terms before buying. Check them on the official Apify pages. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. It adds writes, 1-second monitors, signed webhooks, SDKs & MCP. > [card] Use Xquik on Apify when > > You want Apify-native Actor runs and datasets for focused X (Twitter) data jobs. > Keep the option to move deeper workflows to Xquik. > [card] When Apify may fit > > You scrape many websites beyond X with custom Actors. ## Source-backed Apify scope Apify's official docs define Actors as serverless automation programs. Each Actor accepts structured JSON input and can produce structured output. Choose an Actor, start its run, then read its dataset items. The dataset docs define each run's default dataset as append-only storage. Store web scraping, crawling, or processing results there. Export table-like dataset rows as `json`, `jsonl`, `csv`, `html`, `xlsx`, `xml`, or `rss`. Apify's Store API docs say `/v2/store` lists public Actors. It supports `username`, `search`, `limit`, `offset`, `sortBy`, `category`, `pricingModel`, and `responseFormat=agent`. The response includes stats and pricing metadata. Verify costs on each Actor page. Apify webhook docs describe webhooks as system-event actions. Current webhook actions send a POST HTTP request to the configured URL. Actor run events include created, succeeded, failed, aborted, timed out, and resurrected states. ## Xquik on Apify Xquik publishes Actors for focused X (Twitter) data jobs. The public profile lists 22 Actors. 16 scrapers cost USD 0.00015 per row. 6 AI analysis Actors cost USD 0.0003 per analyzed tweet. > [card] [X Tweet Scraper](https://apify.com/xquik/x-tweet-scraper) > > Scrapes tweets from searches, profile timelines, Lists & tweet IDs with 50+ filters & flat > exports. It also translates tweets & returns their embed HTML. Use it when you need tweet data > without analysis. From \$0.00015 per row. > [card] [X Profile Scraper](https://apify.com/xquik/x-profile-scraper) > > Scrapes profiles plus their posts, replies, media & followers from handles, IDs or URLs. It also > checks whether each account is active, suspended or not found. Use it when you start from > accounts rather than searches. From \$0.00015 per row. > [card] [X Reply Scraper](https://apify.com/xquik/x-reply-scraper) > > Scrapes replies, comments & whole conversations under posts with 25+ filters. Use it when you > need the discussion beneath tweets. From \$0.00015 per row. > [card] [X Engagement Scraper](https://apify.com/xquik/x-engagement-scraper) > > Scrapes replies, quotes, retweeters, likers & threads for post URLs or IDs in bulk. It also > checks whether named accounts replied, reposted or quoted. It checks whether they follow the > author or belong to a Community. It writes 1 row per account & post. Use it when you measure who > engaged with posts. From \$0.00015 per row. > [card] [X Quote Tweets Scraper](https://apify.com/xquik/x-quote-tweets-scraper) > > Scrapes the quote tweets of posts with text, media, counts, authors & 11 filters. It reads many > posts in 1 run, newest first or by X's Top order. Use it when you study who quoted posts & what > they said. From \$0.00015 per tweet. > [card] [X Post Tracker](https://apify.com/xquik/x-twitter-post-tracker) > > Records the views, likes, reposts, replies, quotes & bookmarks of chosen posts on each run. Pass > an earlier run's dataset. Each row then adds the change since that run & since the first run. > Use it when you track how posts perform over time. From \$0.00015 per snapshot. > [card] [X Follower Scraper](https://apify.com/xquik/x-follower-scraper) > > Scrapes followers, following, List members, subscribers & Community members as profile rows. It > also lists the accounts X (Twitter) shows as similar to an account. Use it when you need > audience or member lists. From \$0.00015 per profile. > [card] [X User Search Scraper](https://apify.com/xquik/x-user-search-scraper) > > Searches users by handle, bio & location with follower, verification, age & location filters. > Use it when you build account lists from search. From \$0.00015 per profile. > [card] [X Account Location Scraper](https://apify.com/xquik/x-account-location-scraper) > > Checks where accounts are based with X's Account based in label. It also adds connected via & > username changes. It reads usernames, profile URLs & user IDs with no cookies. Use it when you > vet where accounts are based. From \$0.00015 per account. > [card] [X Email Scraper](https://apify.com/xquik/x-email-scraper) > > Gets the emails, phones & links accounts publish on their profiles. It starts from handles, > followers or user searches. It delivers & charges only profiles that publish an email. Use it > when you need the emails profiles publish. From \$0.00015 per profile. > [card] [X List Scraper](https://apify.com/xquik/x-list-scraper) > > Scrapes List posts, members & followers from List URLs or IDs. Use it when a curated List > defines your sources. From \$0.00015 per row. > [card] [X Community Scraper](https://apify.com/xquik/x-community-scraper) > > Scrapes Community info, posts, searches, members & moderators. Use it when your sources are X > Communities. From \$0.00015 per row. > [card] [X Trends Scraper](https://apify.com/xquik/x-trends-scraper) > > Scrapes real-time trends by location with rank, volume, query & WOEID. Use it when you track > what is trending where. From \$0.00015 per trend. > [card] [X Article Scraper](https://apify.com/xquik/x-article-scraper) > > Scrapes long-form X Articles as Markdown & text with covers, authors, dates & metrics. Use it > when you need article bodies, not tweets. From \$0.00015 per article. > [card] [X Media Downloader](https://apify.com/xquik/x-media-downloader) > > Extracts or stores photos, videos & GIFs from posts or profiles with MP4 & metadata options. It > also returns the subtitles of a post's videos. Use it when you need the media files themselves. > From \$0.00015 per media row. > [card] [X Jobs Scraper](https://apify.com/xquik/x-job-scraper) > > Scrapes X job listings by keyword, place, workplace, seniority & company. It returns salary, > apply link & full description. It also finds job location IDs by name. Use it when you track > hiring on X. From \$0.00015 per job. > [card] [X Space Scraper](https://apify.com/xquik/x-space-scraper) > > Finds X (Twitter) Spaces by keyword, host or hashtag. It also reads Spaces by URL or ID. It > returns titles, states, times, listener counts, hosts & speakers. It reads broadcasts too & adds > the replay of a Space that is over. Use it when you track audio rooms. From \$0.00015 per Space > or broadcast. > [card] [X (Twitter) Brand Monitoring with AI Analysis](https://apify.com/xquik/x-twitter-brand-monitoring) > > Tracks brand mentions with AI relevance, sentiment & customer-experience answers & compares > runs. Use it when you watch a brand over time. From \$0.0003 per analyzed tweet. > [card] [X Tweet Sentiment Analysis with AI](https://apify.com/xquik/x-tweet-sentiment-analysis) > > Labels attitude, intensity & sarcasm probability for every tweet with AI. Use it when you need > general sentiment on any topic. From \$0.0003 per analyzed tweet. > [card] [X (Twitter) Stock & Crypto AI Trading Signals](https://apify.com/xquik/x-twitter-stock-crypto-signals) > > Labels bullish, bearish, neutral or mixed stance, content type, conviction & asset relevance > with AI. Use it when you follow stocks, crypto or trading talk. From \$0.0003 per analyzed tweet. > [card] [X (Twitter) News Monitor with AI Analysis](https://apify.com/xquik/x-twitter-news-monitor) > > Labels news posts by format, source attribution & topic relevance with AI. Use it when you > separate reporting from commentary. From \$0.0003 per analyzed tweet. > [card] [X (Twitter) Tweet Classifier with AI Analysis](https://apify.com/xquik/x-twitter-tweet-classifier) > > Answers your own category, score & yes/no questions for every tweet with AI. Use it when the > preset analyses do not fit your labels. From \$0.0003 per analyzed tweet. > [card] [X Tweet Viral Score Analyzer with AI](https://apify.com/xquik/x-tweet-viral-score-analyzer) > > Estimates a viral score for every tweet with AI. It keeps each score beside the real engagement. > Use it when you study why tweets spread or flop. From \$0.0003 per analyzed tweet. > [!NOTE] > > Store badges, ranking positions, user counts, and run totals change. Verify the current Xquik Apify profile or Store API before citing marketplace placement. ## Tweet Scraper V2 vs X Tweet Scraper Tweet Scraper V2 is apidojo/tweet-scraper on the Apify Store. On 2026-10-15, its page listed USD 0.40 per 1,000 tweets. That is USD 0.0004 per tweet. Xquik's X Tweet Scraper lists USD 0.00015 per row. Its listed price bills each tweet written to the dataset. The benchmark counts only useful tweets. Tweet Scraper V2 cost USD 0.000623 per useful tweet. That is about 1.6 times its listed price. Xquik's X Tweet Scraper cost USD 0.000155, & its median run was 13.6 times faster. | Actor | Cost per useful tweet | Useful tweets per second | Fields per row | Public run | | - | - | - | - | - | | xquik/x-tweet-scraper | USD 0.000155 | 150.5 | 67 | [Run 1](https://console.apify.com/view/runs/km8s0cIJjtggX86Um) | | xquik/x-tweet-scraper | USD 0.000155 | 171.1 | 67 | [Run 2](https://console.apify.com/view/runs/blvgyrkWnFcPVMBRe) | | xquik/x-tweet-scraper | USD 0.000155 | 172.4 | 67 | [Run 3](https://console.apify.com/view/runs/LZJylnFyBIP2E9tPc) | | xquik/x-tweet-scraper | USD 0.000155 | 169.3 | 67 | [Run 4](https://console.apify.com/view/runs/X0uaFNfgQZlr6FTTU) | | scrapesmith/twitter-x-scraper-tweets-profiles-replies | USD 0.000173 | 10.7 | 35 | [Run 1](https://console.apify.com/view/runs/BBDAikcjXaGHb6hTC) | | kaitoeasyapi/twitter-x-data-tweet-scraper-pay-per-result-cheapest | USD 0.000222 | 8.1 | 46 | [Run 1](https://console.apify.com/view/runs/rINRh514vU77bjCRV) | | apidojo/twitter-scraper-lite | USD 0.000434 | 9.3 | 54 | [Run 1](https://console.apify.com/view/runs/giM6ORTDaqcuTiWXd) | | apidojo/tweet-scraper | USD 0.000623 | 12.5 | 55 | [Run 1](https://console.apify.com/view/runs/mPhpJSQHvEcC8HdoK) | Every Actor ran on 2026-10-15 with the same search & filters for 1,000 results. Xquik's X Tweet Scraper returned the most fields per row. The [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper) lists all 5 Actors & the REST API. Follower exports show the same gap. The follower benchmark ran on 2026-10-15. | Actor | Cost per useful profile | Useful profiles per second | Public run | | - | - | - | - | | xquik/x-follower-scraper | USD 0.000155 | 76.5 | [Run 1](https://console.apify.com/view/runs/MxjD0zdsTQm6FiBDR) | | kaitoeasyapi/premium-x-follower-scraper-following-data | USD 0.000519 | 25.6 | [Run 1](https://console.apify.com/view/runs/FAVT3YDzrb1ARJnKC) | | api-ninja/x-twitter-followers-scraper | USD 0.000687 | 5.5 | [Run 1](https://console.apify.com/view/runs/VubKrZpDJ7vTtaggf) | | altimis/scweet | USD 0.001 | 15.9 | [Run 1](https://console.apify.com/view/runs/X5t2sCi6GOyKePkEG) | | apidojo/twitter-user-scraper | USD 0.001194 | 16.6 | [Run 1](https://console.apify.com/view/runs/tZaM1KGNutasbPJNE) | The follower benchmark compared 5 Actors. Xquik's X (Twitter) Follower Scraper had the lowest cost in all 8 runs. Read the [follower benchmark](https://xquik.com/en/benchmarks#benchmark-x-follower-scraper) for every run. ## Apify actor handoff Use Xquik's Apify Actors when your team already receives data through Apify datasets. You may need direct API calls, account actions, monitors, or agent access. If so, move the same job to Xquik REST, exports, webhooks, or MCP. | Job | Start on Apify | Dataset handoff | Move deeper to Xquik when | | - | - | - | - | | Scrape tweets by keyword, hashtag, profile timeline, With Replies tab, account date window, URL, or batch tweet ID | Run `xquik/x-tweet-scraper` | Tweet rows with text, IDs, engagement metrics, author profiles, and media. Export JSON, CSV, or XLSX | You need `GET /x/tweets/search`, `tweet_search_extractor`, pagination, 1-second monitors, signed webhooks, SDKs, or MCP | | Scrape followers, following, verified followers, or list members | Run `xquik/x-follower-scraper` | User rows with profile fields and filter-ready metadata. Export JSON, CSV, or XLSX | You need follower exports from the API, CRM handoff, or repeat syncs that your own system runs | | Export replies beneath one tweet | Run `xquik/x-reply-scraper` | Reply rows with author, text, media, and engagement fields | You need direct cursor pagination or durable extraction jobs | | Read trends by location | Run `xquik/x-trends-scraper` | Ranked trend rows with query, volume, and location fields | You need direct trend API responses or scheduling inside your own app | | Export profile data and related timelines | Run `xquik/x-profile-scraper` | Profile, tweet, media, follower, and following rows | You need separate endpoint calls or per-resource pagination control | | Check whether accounts are active, suspended, or not found | Run `xquik/x-profile-scraper` | 1 row per account in `accountStatus` mode, with the full profile when active | You need `GET /x/users/{id}` in your own app | | Export community data | Run `xquik/x-community-scraper` | Community, tweet, member, moderator, or search rows | You need direct community endpoints and response envelopes | | Export list data | Run `xquik/x-list-scraper` | List tweet, member, or follower rows | You need direct list endpoints and cursors that your code stores | | Export job listings | Run `xquik/x-job-scraper` | Job rows with title, location, salary, company, apply link, and description | You need `GET /x/jobs/search`, job lookups by ID, or location IDs in your own app | | Find or read Spaces | Run `xquik/x-space-scraper` | Space rows with title, state, times, listener counts, hosts, and speakers | You need `GET /x/spaces/search`, Space lookups by ID, or replay URLs in your own app | | Search users | Run `xquik/x-user-search-scraper` | Filtered user profile rows | You need direct user search pagination or SDK types | | Check where accounts are based | Run `xquik/x-account-location-scraper` | Account rows with the Account based in label, connected via, username changes, and the public profile | You need `GET /x/users/{id}` in your own app, or the same fields on follower and search rows | | Get the emails profiles publish | Run `xquik/x-email-scraper` | Profile rows with the email first, then phones, links, and the public profile | You need `GET /x/users/{id}` in your own app, or `hasEmail` on any profile list | | Export the quote tweets of posts | Run `xquik/x-quote-tweets-scraper` | Quote rows with text, media, counts, the author profile, the quoted post, and its source post | You need `GET /x/tweets/{id}/quotes` in your own app, with its cursors and filters | | Track how posts perform over time | Run `xquik/x-twitter-post-tracker` | Snapshot rows with the 6 counts, the change since an earlier run, and the change since the first snapshot | You need `GET /monitors/posts/{id}/metrics` from a post monitor, or `GET /x/tweets/{id}` on your own schedule | Use `profileReplies` or a `/with_replies` profile URL. Match reply rows against `GET /x/users/{id}/replies`. Compare profile timelines with `GET /x/users/{id}/tweets` when moving Apify datasets to REST. ### Reply recovery Reply Scraper 1.2.67 starts full & nested scopes with complete reply extraction. Use `collectionStrategy: "auto"` for this behavior. Incomplete extraction keeps replies before trying conversation search & direct recovery. Scope, depth, sort & author controls apply before complete response limits. The Actor keeps collected replies & removes duplicates before billing. Explicit strategies & supplied cursors keep their selected collection route. Recovery continues toward requested results after reaching the 80% diagnostic threshold. Recovery follows remaining pages & counts earlier results toward your requested limit. Filters still determine which replies count toward your requested result limit. Recovery keeps reply depth when filtered results omit ancestors. Depth limits use metadata tied to the requested root. The diagnostic threshold does not prove source exhaustion. Page limits, stalled pages, missing data, or errors keep recovery incomplete. Review diagnostics when recovery remains incomplete. A successful Apify run does not establish complete reply coverage. ### Actor field order Start with targets, result limits & common filters in each Actor's Input tab. Advanced controls & compatibility inputs appear in later sections. Forms expose these fields without changing their names, types, defaults, or validation. Output tabs & dataset views put useful results before secondary metadata. Tweet & reply views prioritize text, links & authors. Profile views prioritize usernames, names & account details. Article views start with article content. Media views start with download details. Trend views start with rank, name & volume. Diagnostics remain available alongside the result views. ### Read optional output Output availability depends on the Actor mode, output preset, & source data. Missing fields do not mean `0` or `false`. Explicit `null` indicates unavailable data. Successful extraction can still omit optional metadata. Profile `location` is free-form text entered by the account owner. `accountBasedIn` contains X's public country or region label when available. Its `observedAt` timestamp records observation time, not account creation time. Premium checkmarks, legacy verification, & identity verification are separate signals. See [X's profile-label definitions](https://help.x.com/en/rules-and-policies/profile-labels). Post & Tweet describe the same X content. Repost replaces the legacy term Retweet. Existing JSON field names remain compatible. ### Actor output contract to compare When testing Xquik on Apify, inspect dataset rows first. Do this before comparing cost or migrating the same job to REST. > [card] Tweet actor rows > > `xquik/x-tweet-scraper` can write tweet rows, engagement user rows, article > rows, and diagnostic rows. When loading the dataset into a warehouse, keep > `resultType`, `sourceTweetId`, and `engagementMode`. Keep author profile > fields, media URLs, and article fields in that load too. > [card] Follower actor rows > > `xquik/x-follower-scraper` writes compact user rows by default. Use full or > raw output modes for optional profile metadata and raw profile objects. They > can also include source targets, relations, URLs, or overlap fields. > [card] Spend caps > > Use Apify's max cost per run or API `maxTotalChargeUsd` as the hard spend > cap. Use `maxItems` only when you want a smaller row cap than the budget > allows. > [card] Empty or filtered runs > > Empty, invalid, filtered, or zero-output runs can write one diagnostic row. > The row uses `resultType: "diagnostic"`. Its status can be `no-input`, > `invalid-input`, or `zero-output`. ### Date-window tweet scraping on Apify For account backfills, pass a Search Terms value such as `from:username since:2026-05-01 until:2026-05-02`. You can also use `from`, `since`, `until`, `since_time`, and `until_time`. The X Tweet Scraper Actor applies the account and time bounds first. It writes dataset rows after that. `maxItems` still caps the run or each `searchTerms` entry. Before production use, open the current Actor page. Verify inputs, pricing, event limits, dataset fields, and export formats. Call the public Store API at `https://api.apify.com/v2/store?username=xquik&limit=20&responseFormat=agent`. It lists current Xquik Actors, badges, categories, ratings, and stats. ## Comparison | Area | Apify | Xquik | | - | - | - | | Use when | Teams need broad web automation, custom Actors, Actor Store tools, datasets, scheduled runs, and platform-level scraping infrastructure. | Teams need tweet search, follower exports, write actions, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Actor platform, Store marketplace, datasets, API clients, scheduling, monitoring, and MCP for web scraping jobs. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | X/Twitter path | Choose an Actor, pass its input, wait, then read dataset items. Browse the Xquik profile for the current catalog. | Call a documented REST endpoint, dashboard tool, SDK, export, webhook, or MCP tool. | | Returned data | Actor run objects, datasets, key-value stores, and export formats such as JSON, CSV, XLSX, XML, or RSS. | API responses, CSV, JSON & XLSX exports, monitor events, webhook payloads, action logs, and MCP responses. | | Cost model | Actor pricing can be pay per event, pay per usage, or rental, with platform and dataset usage details to verify per Actor. | Starter is USD 20/month with 140,000 included credits. Top-ups are USD 0.00015/credit, webhook management is free, and active monitors bill only while enabled. | | Integration effort | Select an Actor, review its input schema, call Apify API or SDK clients, track runs, read datasets, and handle actor-specific changes. | Start with a dashboard tool, then automate the same task through REST, webhooks, SDKs, exports, or MCP. | | Summary | Apify fits work across many websites or custom Actors. | Xquik fits tweet search, profile lookup, follower and reply exports, timelines, account actions, monitors, webhooks, SDKs, and agents. | ## Operating model Apify starts with an Actor run and returns dataset items. Xquik starts with a documented X task. It returns API, export, webhook, or MCP data. Test request shape, fields, pagination, export format, delivery, and retries end to end. ## Trial checklist **1. Pick one X job** Use 1 job. Try tweet search, follower export, account monitor, media upload, direct-message history, or webhook delivery. **2. Run it both ways** On Apify, select the Actor, run it, wait for completion, and read dataset items. On Xquik, call the endpoint or dashboard tool and inspect the returned records. **3. Compare the handoff** Confirm where the output goes next. Pick a dataset, CSV, JSON, XLSX, or webhook. Or pick an SDK call, MCP tool, queue, CRM, or warehouse. **4. Price the real workload** Compare per-Actor pricing, platform usage, dataset access, Xquik credits, and active monitor billing. Also compare engineering time for retries, storage, and alerts. ## Migration path Move one X/Twitter job first, not the whole scraping stack. Pick a job with fixed output fields and a named next-step owner. 1. Export the same tweet or follower sample from Apify and Xquik. 2. Compare IDs, usernames, timestamps, text fields, engagement fields, media links, pagination, and error states. 3. Xquik may already return the fields your receiving system needs. If so, replace run polling with a REST call, export, or signed webhook. 4. Keep Apify for broad web scraping jobs that do not belong to Xquik. ## Official sources to verify > [card] [Apify API](https://apify.com/api) > > Verify Actor runs, datasets, API clients, retries, and export formats. > [card] [Apify Store API](https://docs.apify.com/api/v2/store) > > Verify that the Store lists public Actors and how Store discovery works. > [card] [Apify Actor pricing models](https://docs.apify.com/platform/actors/running/actors-in-store) > > Verify pay-per-event, pay-per-usage, rental, and dataset usage details. > [card] [Example Tweet Scraper Actor](https://apify.com/apidojo/tweet-scraper) > > Verify current X/Twitter actor capabilities, maintainer, pricing, inputs, and output fields. > [card] [Xquik Apify profile](https://apify.com/xquik) > > Verify the current Xquik Actor count, user stats, and run success rate. Also verify the listed public Actors. > [card] [Xquik Store API search](https://api.apify.com/v2/store?username=xquik\&limit=20\&responseFormat=agent) > > Verify current Xquik Actor badges, categories, ratings, and Store stats. Use the public Store API. ## Xquik next steps > [card] [Xquik API overview](/api-reference/overview) > > Review authentication, endpoint groups, response conventions, pagination, and errors. > [card] [Extraction workflow](/guides/extraction-workflow) > > Estimate costs, run jobs, paginate results, and export CSV, JSON, or XLSX files. > [card] [Workflows](/guides/workflows) > > Map tweet monitoring, signed webhooks, and MCP agents to API calls. Map follower exports and tweet composition to API calls too. > [card] [Billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. # Brand24 alternative with full X (Twitter) post text Source: https://docs.xquik.com/alternatives/brand24 Xquik beats the Brand24 API per useful result. Brand24 plans start at USD 249 a month for 2,000 mentions. Xquik bills USD 0.00015 per tweet with full X text. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over Brand24 Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. Brand24 publishes none. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [Brand24's pricing](https://brand24.com/prices/) sells fixed monthly plans with mention caps. Individual costs USD 249 a month for 2,000 mentions. At full use, that is USD 0.1245 per mention. On Xquik, 2,000 tweets cost USD 0.30. That makes Xquik the cheapest per useful result. Xquik also returns full tweet text. [Brand24's API page](https://brand24.com/social-listening-api/) says X text fields come back empty. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where Brand24 fits Brand24 is a media & social monitoring tool. It says it tracks over 25,000,000 online sources, X among them. This guide compares Brand24 & Xquik on X (Twitter) mentions. It covers mention tracking, update speed, API access, writes & agent connections. > [!NOTE] > > Facts on this page come from Brand24's official pages, read on 2026-10-15. Verify current pricing & terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. It returns full X text, checks every second & adds writes & exports. > [card] When Brand24 may fit > > Your PR team also tracks news, reviews & podcasts in 1 dashboard. ## Source-backed Brand24 scope * Brand24's sources include X, Facebook, Instagram, YouTube, TikTok, Reddit, news & blogs. * Plans cost USD 249, USD 349, USD 499 & USD 699 a month. * Annual billing lowers Individual to USD 199 a month. * Enterprise starts at USD 1,499 a month, billed annually. * Monthly mention caps run from 2,000 on Individual to 100,000 on Business. * Individual updates every 12 hours. Team updates every hour. Pro & Business update in real time. * AI sentiment analysis labels mentions positive, negative or neutral. * Alerts go to email, Slack & Teams. A mobile app is also available. * API access costs extra on Business. Enterprise includes it. * The API returns empty text fields for X posts, citing platform terms. * API pages hold up to 500 rows. Each date range covers up to 31 days. * Brand24 also lists an MCP connection for AI assistants. * Reports export to PDF, Excel & PowerPoint. * The first 14 days are free, with no credit card. ## Comparison | Area | Brand24 | Xquik | | - | - | - | | Billing unit | Monthly plans from USD 249, capped at 2,000 mentions. | 1 credit per returned tweet, USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Plan needed | Yes. Each plan has a fixed monthly fee. | No plan needed. Pay-as-you-go credits work for every call. | | X post text | API text fields come back empty for X posts. | Full tweet text, author, media & engagement fields. | | Update speed | Every 12 hours on Individual, real time on Pro. | Account & keyword monitors check every second. | | API access | Extra fee on Business. Included on Enterprise. | Included for every account, with pay-as-you-go reads. | | Write actions | None listed. | 24 write actions from connected accounts. Posting a tweet costs 30 credits. | | Agent tooling | MCP connection for AI assistants. | Remote MCP server with OAuth or API key. | | SDKs | REST API with an `X-Api-Key` header. | TypeScript, Python, Go, Java, Kotlin, PHP, Ruby & C#. Also a CLI & Terraform provider. | | Exports | PDF, Excel & PowerPoint reports. | CSV, XLSX, JSON & Markdown exports. | ## What to test in Xquik Track your Brand24 X (Twitter) keywords in Xquik for 1 week. Compare mention counts, text, delay & cost. Xquik bills only the tweets you keep. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Move your X (Twitter) keywords from Brand24 to Xquik keyword monitors first. Send events to your signed webhook or Telegram. Keep Brand24 for news & review sources if you need them. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Keyword monitors API](/api-reference/monitors/create-keyword) > > Create keyword monitors & receive signed webhook events. > [card] [Official Brand24 pricing](https://brand24.com/prices/) > > Verify current prices before making a final decision. # Bright Data alternative for X (Twitter) data by API Source: https://docs.xquik.com/alternatives/bright-data Xquik beats Bright Data and its competitors on X per result. Bright Data lists USD 0.0015 per record, & Xquik USD 0.00015. Xquik adds search, monitors & writes. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over Bright Data Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Bright Data publishes no reproducible X benchmark runs of its own. Xquik publishes every benchmark run with its run ID. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [Bright Data's pricing](https://brightdata.com/pricing/web-scraper) lists USD 0.0015 per record on pay as you go. Xquik charges USD 0.00015 per result, 90% less. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where Bright Data fits Bright Data's X (Twitter) scraper collects public posts and profiles. Each request triggers a live scrape. It takes post and profile URLs as input. Bright Data also sells pre-collected X datasets. This guide compares Bright Data and Xquik on specific X tasks. It covers tweet search, follower exports, account monitors, publishing, webhooks, and agent connections. > [!NOTE] > > Facts on this page come from Bright Data's official pages, read on 2026-10-15. Verify current pricing and terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. It also adds keyword search, 1-second monitors, writes from connected accounts & exports. > [card] When Bright Data may fit > > You want results delivered to your own cloud storage. ## Source-backed Bright Data scope * The web scraper pricing page lists pay as you go and a free tier. Pay as you go costs USD 1.5 per 1,000 records. The free tier covers 5,000 records a month. * The page says there are no charges for failed deliveries. * The X endpoints take post and profile URLs. Keyword search, lists, communities, and Spaces aren't described, and no write actions are offered. * Results arrive by API download, webhook, or cloud storage such as Amazon S3. * The product page lists Python and Node.js SDKs, a CLI, and an MCP server. ## Bright Data competitors for X (Twitter) data These services also sell X (Twitter) data. Each page lists its price per result and links its sources. * [Apify](/alternatives/apify) runs X (Twitter) scrapers as paid Actors. * [SocialData](/alternatives/socialdata) sells an X (Twitter) data API billed per result. * [TwitterAPI.io](/alternatives/twitterapi-io) sells an X (Twitter) data API with a minimum charge per call. * [ScrapeCreators](/alternatives/scrapecreators) sells social data APIs billed per request. * [Sorsa](/alternatives/sorsa) sells X (Twitter) data plans from USD 49 a month. Xquik bills USD 0.00015 per delivered result, with no plan needed. ## Comparison | Area | Bright Data | Xquik | | - | - | - | | Price | USD 1.5 per 1,000 records on pay as you go. | 1 credit per row, which is USD 0.00015 with pay-as-you-go credits. | | Input | Post and profile URLs. | Keywords, operators, accounts, tweet IDs, URLs, and Lists. | | Write actions | None. | Posts, replies, likes, reposts, follows, DMs, and media from connected accounts. | | Monitoring | No real-time stream or account monitor described. | Account and keyword monitors that check every second, with signed webhooks. | | Delivery | API download, webhook, or cloud storage. | REST responses, signed webhooks, and CSV, XLSX, JSON, or Markdown exports. | ## What to test in Xquik Price the whole task. Count how you find the posts in the first place. Then count the rows, monitors, and exports. Choose Xquik when the job starts from a search. Also choose it when the job needs events pushed to you. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Run the same posts or query in both products. Then compare fields, rows, and cost. Move the task only after the systems that read the data accept Xquik's output. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Search tweets API](/api-reference/x/search-tweets) > > Query parameters, filters, cursors, and response fields. > [card] [Official Bright Data pricing](https://brightdata.com/pricing/web-scraper) > > Verify current prices before making a final decision. # Buffer app alternatives for tweet scheduling by API Source: https://docs.xquik.com/alternatives/buffer Compare Buffer with Xquik for social media scheduling, tweet search, follower exports, posting, tweet monitors, webhooks, SDKs, and MCP. Includes pricing. > For the complete documentation index, see [llms.txt](/llms.txt). This guide compares Buffer and Xquik for a social media scheduling workflow. Compare tasks such as planning posts, scheduling threads, managing comments, and analyzing posts. Add tweet search, follower exports, and account or keyword monitors. Also add webhooks and app or agent connections. > [!NOTE] > > Before buying, check Buffer's official site. Verify current pricing, supported channels, scheduled-post limits, and approval workflows there. Also verify Community features, analytics exports, and product terms. ## Quick answer > [card] Choose Buffer when > > You need a social content calendar, queue, and visual schedule across many channels. You also need AI-assisted post drafts, comment replies, analytics, and team approvals across them. > [card] Choose Xquik when > > You need the X part in code. Examples are tweet search, follower exports, post tweets, media uploads, and DMs. Other examples are 1-second monitors, signed webhooks, SDKs, and MCP. ## Source-backed Buffer scope Buffer's pricing page lists a Free plan for up to 3 channels. The Free plan allows 10 scheduled posts per channel. Essentials costs USD 5/channel/month and Team costs USD 10/channel/month with yearly billing. Paid options add analytics, Community inbox, hashtag management, first-comment scheduling, access levels, and approvals. Team lists unlimited members. Buffer's help center sets a 5,000-post fair-use cap per channel. Buffer's official Publish pages describe supported channels for Bluesky, Facebook, and Google Business Profile. They also cover Instagram, LinkedIn, Mastodon, Pinterest, Threads, TikTok, X, and YouTube. The pages also describe queues, calendars, channel-specific customization, threads, carousels, and videos. They list first-comment scheduling on plans above Free, AI Assistant, and approval workflows. Buffer's official Community pages describe comment management across Instagram, Facebook, LinkedIn, and Threads. They also cover Bluesky, X, TikTok, Google Business Profile, YouTube, and Mastodon. They list notifications, filters and sorting, comment score, and saved replies. They also list AI replies, direct replies from Buffer, and turning comments into posts. ## Buffer app alternatives for X Buffer schedules posts across many networks. These pages compare other X publishing tools with Xquik. * [Typefully](/alternatives/typefully) writes and schedules X (Twitter) threads. * [Hypefury](/alternatives/hypefury) schedules recurring X posts and Auto-DMs. * [Hootsuite](/alternatives/hootsuite) adds inboxes, listening and team approvals. * [Tweet Hunter](/alternatives/tweet-hunter) adds AI writing and creator analytics. * [Late / Zernio](/alternatives/late) schedules through 1 API for many networks. Choose Xquik when X posts must come from your own code, agent or workflow. Xquik also adds tweet search, follower exports and monitors. ## Comparison | Area | Buffer | Xquik | | - | - | - | | Use when | Creators, small businesses, agencies, or teams need one queue for multi-channel posts, comment replies, analytics, and content approvals. | Teams need tweet search, follower exports, post tweets, media uploads, DMs, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Social media scheduling, publishing, analytics, community, and collaboration platform. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Buffer's official pages describe supported channels, queues, calendars, channel-specific posts, threaded posts, AI Assistant, first-comment scheduling, hashtag manager, Community replies, notifications, filters, comment score, saved replies, AI replies, and approval workflows. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | Official pricing lists Free for 3 channels with 10 scheduled posts per channel, Essentials at USD 5/channel/month yearly, and Team at USD 10/channel/month yearly with unlimited team members and approval workflows. | Xquik starts at USD 20/month with 140,000 included credits. Tweet search and follower exports cost 1 credit/result. Common X write calls cost 10 credits/call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Connect channels, plan queues, manage scheduled posts, reply to comments, review analytics, and use no-code integrations to pass results on. | Use a dashboard tool first, then call the same X task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | Buffer helps teams plan, schedule, publish, reply, analyze, and approve social posts across channels. | Xquik handles X records, account actions, monitors, API access, signed webhooks, and export files. | | Channel scope | Multi-channel social scheduling, community replies, analytics, and approvals. | Tweet search, follower exports, post actions, media uploads, DMs, monitors, SDKs, MCP, and webhooks. | | API use case | Social publishing calendar and comment workflow. | API calls for extraction, account actions, monitors, exports, and webhooks. | | Exports | Analytics reports for post and channel performance. | Raw tweet, profile, follower & reply exports plus account-action results. | ## Operating model Compare Buffer and Xquik by output, cost, and handoff. Buffer helps teams plan, schedule, publish, reply, analyze, and approve social posts across channels. Xquik handles X records, account actions, monitors, API access, signed webhooks, and export files. > [card] Use when > > Buffer covers multi-channel content calendar, queue, comment replies, analytics, and approvals. Xquik covers tweet, profile, follower, and reply data plus account actions through an API. > [card] Setup & API > > Buffer covers channels, queues, scheduled posts, Community replies, reports, and team approvals. Xquik covers API keys, webhooks, SDKs, exports, and MCP. > [card] Output > > Buffer covers scheduled posts, comment workflows, analytics reports, and approvals. Xquik covers tweet JSON, follower CSV & XLSX, monitor events, and webhook payloads. ## Current cost checkpoint Use Buffer when the main job is a content calendar across many social channels. Use Xquik when the job needs tweet search, follower exports, media posts, or monitors. Use it too for connected-account actions, SDKs, or MCP. | Task | Buffer unit to price | Xquik unit to price | | - | - | - | | Schedule 3 low-volume social channels | Free supports up to 3 channels and 10 scheduled posts per channel. | A text-only tweet or reply costs 30 credits/call. Xquik publishes to connected X accounts only. | | Schedule 5 active channels | Essentials yearly pricing is USD 5/channel/month, so 5 channels price at USD 25/month. | Xquik Starter is USD 20/month with 140,000 included credits for X tasks. Use it when the work is X-only and needs data or automation around publishing. | | Run team approvals | Team yearly pricing is USD 10/channel/month and includes unlimited team members plus content approval workflows. | Xquik does not replace a multi-channel approval calendar. Use it for X operations such as tweet search, exports, monitors, webhooks, SDK jobs, and connected-account writes. | | Reply to comments and track engagement | Buffer Community covers comment replies, notifications, filters, saved replies, AI replies, comment score, and turning comments into posts across supported channels. | Xquik is not a social inbox. Use it when comments, replies, or mentions need API records, CSV, JSON & XLSX exports, monitor events, or signed webhook delivery. | | Search tweets, export followers, or monitor X (Twitter) accounts | Buffer does not list this task. Its pages cover publishing, analytics, and community management. | Search tweets and follower exports cost 1 credit/result. Active monitors check every 1 second and cost 30 credits per monitor-hour. | Choose Buffer when scheduling and approvals across channels matter most. When X is the main channel, choose Xquik for any of the following needs. They are raw records, export files, signed webhooks, REST endpoints, SDKs, MCP, and DMs. ## What to test in Xquik For social scheduling comparisons, test the steps before and after the post. Find source tweets, upload media, post tweets, and send DMs. Also export replies, monitor keywords, and notify other tools. Choose Xquik when publishing must include API records, export files, or monitor events. Choose it too when publishing must include signed webhooks. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Schedule an X (Twitter) thread, reply to comments, export followers, or upload media. Or send a DM. Or search tweets for a campaign term, monitor an account, or deliver a webhook. **2. Inspect the output** Compare draft flow, queue controls, approval state, tweet IDs, author IDs, and timestamps. Also compare post results, CSV, JSON & XLSX exports, webhook signatures, and error handling. **3. Price the handoff** List Buffer channels, scheduled-post volume, Community replies, analytics reports, approval workflows, and integrations. Compare that list with Xquik credits, active monitor billing, top-ups, and engineering time. ## Migration path Buffer covers multi-channel planning, queues, threaded posts, comment replies, analytics, and approval workflows. If your team already works that way, keep it for those tasks. Move one X-only task when its output must become API data or files. Do the same when its output must become signed webhooks or MCP tool results. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Use Xquik for X work that needs tweet search, follower export, or post actions. It also fits media uploads, DMs, tweet monitoring, webhook delivery, SDK calls, or MCP. Compare Buffer and Xquik by channel count, scheduled-post volume, and approval needs. Then compare X (Twitter) data needs, export format, webhooks, and API handoff. Price the real workload. On Buffer, price connected channels, scheduled-post volume, analytics, community inbox, and approvals. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official Buffer pricing](https://buffer.com/pricing) > > Verify current channel pricing, post limits, and plan features before making a final decision. > [card] [Official Buffer publish](https://buffer.com/publish) > > Verify current supported channels, queue, calendar, threaded-post, and first-comment scheduling features. > [card] [Official Buffer community](https://buffer.com/community) > > Verify current comment reply, notification, filter, saved reply, AI reply, and comment score features. > [card] [Buffer scheduling limits](https://support.buffer.com/article/643-how-many-posts-can-i-schedule-in-advance) > > Verify current Free, Essentials, Team, and fair-use scheduled-post limits. > [card] [Buffer Community help](https://support.buffer.com/article/921-engaging-with-community-comments-in-buffer) > > Verify current comment sorting, liking, notifications, and reply behavior. # Circleboom Twitter alternative to delete tweets Source: https://docs.xquik.com/alternatives/circleboom Circleboom's monthly Twitter plans cost USD 29.99 to 69.99. Xquik deletes tweets, shows who unfollowed you and finds fake followers. Plans start at USD 20. > For the complete documentation index, see [llms.txt](/llms.txt). Circleboom is a Twitter management tool. It deletes tweets, manages followers and schedules posts. This page lists its Twitter plans as its pricing page showed them. It then maps each Circleboom job to an Xquik tool. > [!NOTE] > > Check [Circleboom's pricing page](https://circleboom.com/twitter-management-tool/plans-and-pricing) for its current plans before you compare. ## Circleboom Twitter pricing in 2026 On 2026-11-20, Circleboom's Twitter pricing page loaded these paid plans. It sizes most plans by the account's follower count. | Plan | Monthly | Yearly | Account size | | - | - | - | - | | Limited | USD 29.99 | USD 155.88 | Mainly for tweet and like deletion | | Pro | USD 47.99 | USD 383.88 | Up to 25,000 followers | | Plus | USD 58.99 | USD 479.88 | Up to 100,000 followers | | Premium | USD 69.99 | USD 563.88 | Up to 300,000 followers | | Elite | None | USD 1,199.88 | Up to 3,000,000 followers | It also lists a Free plan. Its Who Unfollowed Me feature covers accounts with up to 25,000 followers. Pro includes 10 searches a month, Plus 30 and Premium 150. ## Delete tweets in bulk The [Tweet Deleter](https://xquik.com/en/tweet-deleter) removes posts, replies and reposts from your connected X account. Find them by date, type, words, hashtag, likes or language. You can also paste post links. Mark the posts to keep, then confirm. X lists only your newest 3,200 posts. The deleter reads older posts too, with no archive upload. Each post it reads costs 1 credit. Each deleted post costs 10 credits. So 1,000 posts cost 11,000 credits. A write that needs a fresh X sign-in adds 10 credits. The USD 20 plan includes 140,000 credits a month. The [Tweet Unliker](https://xquik.com/en/tweet-unliker) removes 1 like by its post URL. [Undo Retweets](https://xquik.com/en/tweet-unretweeter) removes 1 repost the same way. For many, call the same actions through the API or MCP. ## See who unfollowed you on Twitter The [Unfollowers Tracker](https://xquik.com/en/twitter-unfollowers-tracker) labels each lost follower with a date and reason. Its first read saves your followers. The list fills from the next change. It names lost followers for accounts with up to 100,000 followers. Above that, it covers the newest followers only. It also lists who doesn't follow you back. Tracking runs as an account monitor at 30 credits per hour. That is 720 credits a day. Tracking needs no connected X account. Unfollow and remove actions need one. ## Circleboom Twitter jobs and their Xquik tools Circleboom's Twitter tool page lists these jobs. Each one has an Xquik tool. | Circleboom job | Xquik tool | | - | - | | Bulk delete tweets & retweets | [Tweet Deleter](https://xquik.com/en/tweet-deleter) | | Who unfollowed me on X | [Unfollowers Tracker](https://xquik.com/en/twitter-unfollowers-tracker) | | Mass unfollow low-quality accounts | Bulk unfollow in the [Unfollowers Tracker](https://xquik.com/en/twitter-unfollowers-tracker) | | Remove fake & bot followers | [Fake Follower Checker](https://xquik.com/en/twitter-fake-follower-checker) | | Monitor Twitter follower growth | [Follower Tracker](https://xquik.com/en/twitter-follower-tracker) | | Check Twitter engagement analytics | [Account Analyzer](https://xquik.com/en/twitter-account-analyzer) | | Search Twitter bios by keyword | [User Search](https://xquik.com/en/twitter-user-search) | | Twitter historical search | [Advanced Search](https://xquik.com/en/twitter-advanced-search) | | Track Twitter hashtags | [Hashtag Tracker](https://xquik.com/en/twitter-hashtag-tracker) | | Twitter competitor analysis | [Compare Accounts](https://xquik.com/en/compare-twitter-accounts) | | Automate Twitter DM outreach | [DM Sender](https://xquik.com/en/dm-sender) | | Pick Twitter giveaway winners | [Giveaway Picker](https://xquik.com/en/twitter-giveaway-picker) | Circleboom also runs a Twitter shadowban test. The Xquik [Shadowban Checker](https://xquik.com/en/twitter-shadowban-checker) shows if X hides an account from search or replies. Read tools cost 1 credit per post, profile or follower read. Unfollows, removals and DMs cost 10 credits each. ## Circleboom vs Xquik | Area | Circleboom | Xquik | | - | - | - | | Pricing | Monthly plans from USD 29.99 to 69.99, sized by followers. | USD 20 a month for 140,000 credits, or pay-as-you-go credits. | | Unfollower tracking | Accounts with up to 25,000 followers. | Accounts with up to 100,000 followers, then the newest ones. | | Deleting tweets | The Limited plan is mainly for tweet and like deletion. | 10 credits per deleted post, on any plan. | | Scheduling | Schedules posts with an AI writer. | The Tweet Composer posts at once. Xquik doesn't schedule posts. | ## Move from Circleboom to Xquik **1. Connect your X account** Sign in to Xquik and connect the account on the [X accounts page](https://dashboard.xquik.com/en/x-accounts). Read tools need no connected account. **2. Clean up posts and follows** Delete posts in the Tweet Deleter. Unfollow or remove followers in bulk from the Unfollowers Tracker. **3. Start tracking** Press Start tracking in the Unfollowers Tracker. Lost followers show up from the next change. > [card] [Tweet Deleter](https://xquik.com/en/tweet-deleter) > > Bulk delete posts by date, type or words, and keep the ones you mark. > [card] [Unfollowers Tracker](https://xquik.com/en/twitter-unfollowers-tracker) > > See who unfollowed you on Twitter, with the date and reason. > [card] [Fake Follower Checker](https://xquik.com/en/twitter-fake-follower-checker) > > Score an account's followers and flag the likely fake ones. > [card] [Billing guide](/guides/billing) > > See credit prices for reads, writes and monitors. # Hootsuite vs Xquik for X (Twitter) monitoring by API Source: https://docs.xquik.com/alternatives/hootsuite Hootsuite pricing starts at USD 99 per user a month, billed annually. Compare it with Xquik's pay-per-result X API for search, exports, monitors & posts. > For the complete documentation index, see [llms.txt](/llms.txt). This guide compares Hootsuite and Xquik for the X part of a workflow. That workflow is social media management. Compare tasks such as scheduling posts, reviewing inboxes, and analyzing campaigns. Add tweet search, follower exports, and account or keyword monitors. Also add webhooks and app or agent connections. > [!NOTE] > > Before buying, check Hootsuite's official site. Verify current pricing, plan limits, listening access, inbox features, analytics exports, and product terms. ## Quick answer > [card] Choose Hootsuite when > > You need a cross-channel social media management suite. It must cover publishing, approvals, inboxes, analytics, social listening, ads, integrations, and team reporting. > [card] Choose Xquik when > > You need the X part in code. Examples are tweet search, follower exports, post tweets, media uploads, and DMs. Other examples are 1-second monitors, signed webhooks, SDKs, and MCP. ## Source-backed Hootsuite scope Hootsuite has an official plans page, read on 2026-11-04. It lists Standard with up to 10 social accounts and unlimited scheduling. Standard includes AI posts and images, one inbox, and brand and competitor monitoring. Hootsuite's Professional plan adds unlimited social accounts and custom performance reports. It also automates inbox replies and workflows. It also forecasts social trends up to 90 days ahead. The Advanced plan adds team approvals, message assignment and routing, and team performance reports. Hootsuite's publishing pages describe list and calendar views, plus AI posts and images. They also describe custom approvals, task assignments, posting-time suggestions, and Whiteboard planning. Hootsuite's inbox tools cover comments, DMs, saved replies, and automated replies. They also cover routing, agent collisions, and customer surveys. Social listening covers trends, topics, mentions, hashtags, sentiment, and websites. Enterprise options include SSO, advanced analytics and inboxes, and employee advocacy. They also include review management, compliance, chatbots, and Salesforce. Hootsuite's plans page lists Standard at USD 99 per user/month with 10 social accounts. Professional costs USD 199 per user/month and Advanced USD 399 per user/month. Both list unlimited social accounts. All 3 prices use annual billing and leave out taxes. Enterprise uses contact pricing. Each paid plan lists a free 14-day trial. ## Hootsuite pricing vs Xquik pricing Check these prices before comparing Hootsuite with Xquik. | Job | Hootsuite price | Xquik price | | - | - | - | | Manage a small social workspace | Standard starts at USD 99 per user/month billed annually with 10 social accounts. | Starter is USD 20/month with 140,000 credits for X tasks and API access. | | Manage more social accounts and reports | Professional starts at USD 199 per user/month billed annually with unlimited social accounts. | Xquik bills credits for reads, writes, and active monitors. It does not bill social account seats. | | Add enterprise governance | Enterprise uses contact pricing with a customized plan, custom user access permissions, support, and services. | Xquik covers X only, with tweet and profile records, follower exports, account actions, monitors, webhooks, SDKs, MCP, and exports. | | Add inbox, analytics, and listening workflows | Professional adds custom reports and automated inbox replies. Advanced adds approvals and routing at USD 399 per user/month. | Tweet search, follower exports, monitor events, CSV, JSON & XLSX files, and webhook delivery use the Xquik credit model. | ## Comparison | Area | Hootsuite | Xquik | | - | - | - | | Use when | Marketing, support, and enterprise social teams need one workspace for multi-network publishing, approvals, inboxes, analytics, listening, ads, and integrations. | Teams need tweet search, follower exports, post tweets, media uploads, DMs, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Social media management, publishing, engagement, listening, analytics, ads, and enterprise collaboration suite. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Hootsuite's official pages describe social scheduling, AI content help, recommended posting times, bulk scheduling, calendar and list views, approval workflows, inboxes, saved replies, automated responses, automated routing, analytics exports, competitor benchmarks, listening, SSO, advanced inbox, compliance integration, chatbot, and Salesforce integration. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | Check seats, social accounts, analytics exports, report scheduling, inbox access, listening access, approval workflows, SSO, compliance, and Enterprise add-ons. | Xquik starts at USD 20/month with 140,000 included credits. Many read calls cost 1 credit per result or call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Plan for suite setup, channels, approval flows, inbox routing, reports, listening topics, CRM or team integrations, and an owner for exported data. | Use a dashboard tool first, then call the same X task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | Hootsuite covers cross-channel planning, publishing, inboxes, analytics, listening, ads, approvals, and enterprise controls. | Xquik handles X records, account actions, monitors, API access, signed webhooks, and export files. | | How you buy | Social suite procurement, user permissions, approvals, and an owner for reports. | Self-serve signup. Tweet, profile, follower, and reply data plus account actions through an API. | | Team process | Planning, approvals, inbox routing, analytics, listening topics, and ads reporting. | X extraction, post actions, media uploads, DMs, monitoring, and webhooks. | | Implementation | Team process, social account setup, report templates, workflows, and integrations. | Dashboard setup plus API keys, webhook signing, SDK calls, exports, and MCP. | ## Operating model Compare Hootsuite and Xquik by output, cost, and handoff. Hootsuite covers cross-channel planning, publishing, inboxes, analytics, listening, ads, approvals, and enterprise controls. Xquik handles X records, account actions, monitors, API access, signed webhooks, and export files. > [card] How you buy > > Hootsuite covers social suite procurement, permissions, approvals, and an owner for reports. Xquik covers self-serve signup, X (Twitter) data, and account actions through an API. > [card] Setup & API > > Hootsuite covers channels, approval flows, inbox routing, reports, listening topics, and integrations. Xquik covers API keys, webhooks, SDKs, exports, and MCP. > [card] Output > > Hootsuite covers reports, inbox work, campaign views, and social listening alerts. Xquik covers tweet JSON, follower CSV & XLSX, monitor events, and webhook payloads. ## What to test in Xquik For social media management comparisons, test the steps before and after the post. Find source tweets, upload media, send DMs, and export replies. Also monitor keywords and notify other tools. Choose Xquik when the X workflow must produce API responses, files, or signed events. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run one social media management job** Use a real task. Schedule a campaign post, search tweets for a product term, or export followers. Or upload media, send a DM, monitor an account, or deliver a webhook. **2. Inspect the output** Compare approval needs, inbox routing, analytics exports, tweet IDs, and author IDs. Also compare timestamps, post results, CSV, JSON & XLSX exports, webhook signatures, and error handling. **3. Price the handoff** Compare Hootsuite seats, social accounts, analytics, approvals, listening, and Enterprise add-ons with Xquik costs. Those costs are credits, active monitor billing, top-ups, and engineering time. ## Migration path Hootsuite covers cross-channel planning, inboxes, approvals, analytics, ads, and listening. Keep using it if your team already works that way. Move one X-only task when its output must become API data or files. Do the same when its output must become signed webhooks or MCP tool results. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Use Xquik for X work that needs tweet search, follower export, or post actions. It also fits media uploads, DMs, tweet monitoring, webhook delivery, SDK calls, or MCP. Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official Hootsuite platform](https://www.hootsuite.com/platform) > > Verify current publishing, engagement, listening, analytics, ads, and integration features. > [card] [Official Hootsuite plans](https://www.hootsuite.com/plans) > > Verify current plan limits, analytics exports, inbox access, listening access, and add-ons. > [card] [Hootsuite publishing](https://www.hootsuite.com/platform/publishing) > > Verify current calendar, approval, AI writing, best-time, bulk scheduling, and planning features. > [card] [Hootsuite Enterprise](https://www.hootsuite.com/plans/enterprise) > > Verify current SSO, advanced analytics, advanced inbox, listening, advocacy, chatbot, compliance, and Salesforce options. # Hypefury alternative for tweet publishing APIs Source: https://docs.xquik.com/alternatives/hypefury Compare Hypefury with Xquik for tweet publishing, tweet search, follower exports, replies, monitors, signed webhooks, REST APIs, SDKs, and MCP. Covers pricing. > For the complete documentation index, see [llms.txt](/llms.txt). This guide compares Hypefury and Xquik on specific X tasks. It covers tweet search, follower exports, and account or keyword monitors. It also covers publishing, webhooks, and app or agent connections. > [!NOTE] > > Before buying, verify current pricing, access rules, and product terms on Hypefury's official site. ## Quick answer > [card] Choose Hypefury when > > Your team mainly needs creator scheduling, recurring posts, Auto-DM campaigns, autoplugs, analytics, and cross-posting. > [card] Choose Xquik when > > You need one account for publishing, tweet search, follower exports, media uploads, and DMs. That account must also cover monitors, signed webhooks, SDKs, and MCP. ## Source-backed Hypefury scope Hypefury's pricing page lists Starter, Creator, Business, and Agency plans with 7-day trials. Starter costs USD 29/month. It schedules up to 1 month for 6 social accounts, including 1 X account. It also covers long posts, autoplugs, cross-posting, thread hooks, and templates. Starter covers Auto-DM, engagement tools, Gumroad sales, and support too. Creator is USD 65/month. It includes scheduling up to 3 months and 250 Auto-DMs/day. It covers 30 social accounts with 5 X accounts. It also includes 10 Tweet-to-Reels automations/month and weekend support. Its engagement builder access is for 100 users and 10 keywords. Business is USD 97/month with 60 social accounts, 10 X accounts, and 300 Auto-DMs/day. It also has 50 Tweet-to-Reels automations/month and engagement builder access for 20 keywords. Agency is USD 199/month with 90 social accounts, 15 X accounts, and 400 Auto-DMs/day. It also has 300 Tweet-to-Reels automations/month and engagement builder access for 50 keywords. Hypefury no longer offers a free plan, but offers a 7-day trial on Starter. The same official page says so. It says Hypefury supports Instagram business accounts, LinkedIn posts and carousels, Threads, and X/Twitter. Its plan comparison lists Instagram, Facebook Pages, LinkedIn, Threads, and TikTok. Hypefury has an official publish page. It describes creating content once, scheduling it, and distributing it to other social channels. It lists inspiration from 15+ hand-curated niches, 30+ tweet templates, and recurrent posting plans. It also lists a minimal editor. The official Auto DMs help page says DMs run in batches every 30 minutes. It says campaigns last 3 days and the number of DMs/day depends on plan. It also says edited tweets can break Auto DM because the tweet ID changes. It says DM recipients must follow the account. ## Comparison | Area | Hypefury | Xquik | | - | - | - | | Use when | Creators want X-first content scheduling, recurring posts, Auto-DM campaigns, autoplugs, engagement builder, analytics, and cross-posting. | Teams need tweet search, follower exports, write actions, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Creator publishing and social automation dashboard. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Official pricing lists scheduling, long posts, autoplugs, automatic cross-posting, viral hooks and templates, Auto-DMs, watched users, watched keywords, Gumroad sales, Tweet-to-Reels, analytics, and social account limits by plan. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | Official pricing lists Starter at USD 29/month, Creator at USD 65/month, Business at USD 97/month, and Agency at USD 199/month, each with a 7-day trial. Plan value depends on social accounts, X accounts, scheduling horizon, Auto-DM limits, engagement builder limits, and cross-posting needs. | Xquik starts at USD 20/month with 140,000 included credits. Many read calls cost 1 credit per result or call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Plan for handoffs when content needs tweet search, follower export, monitor events, webhook delivery, SDK calls, or MCP beyond the publishing dashboard. | Use a dashboard tool first, then call the same task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | Hypefury fits creator scheduling, cross-posting, Auto-DM campaigns, recurring posts, and creator analytics. | Xquik fits teams that also need tweet search, follower exports, account monitors, signed webhooks, SDKs, and API calls. | | Primary use | Creator publishing, recurring posts, and cross-posting. | Tweet, follower, reply, and profile data, posting, monitors, and exports. | | Automation | Publishing dashboard automation, Auto-DMs, engagement builder lists, and cross-posting. | REST endpoints, webhooks, MCP, and dashboard actions. | | Team fit | Creators and small content teams. | Creators, developers, growth teams, and ops teams. | ## Operating model Compare Hypefury and Xquik by output, cost, and handoff. Hypefury fits creator publishing, Auto-DM campaigns, engagement builder work, and cross-posting. Xquik fits teams that also need tweet search, follower exports, and account monitors. It also fits teams that need signed webhooks, SDKs, and API calls. > [card] Primary use > > Hypefury covers creator publishing and queue management. Xquik covers tweet, follower, reply, and profile data, posting, monitors, and exports. > [card] Automation > > Hypefury automates publishing, Auto-DMs, and cross-posting from its dashboard. Xquik covers REST endpoints, webhooks, MCP, and dashboard actions. > [card] Team fit > > Hypefury suits creators and small content teams. Xquik suits creators, developers, growth teams, and ops teams. ## Current cost checkpoint Use current Hypefury plan limits when the job is creator publishing. Use Xquik units when the job needs tweet search, follower exports, monitors, or DMs. Use them too for media uploads, webhooks, SDKs, or MCP. | Task | Hypefury unit to price | Xquik unit to price | | - | - | - | | Schedule creator posts | Starter is USD 29/month for scheduling up to 1 month, 6 social accounts, and 1 X account. Creator is USD 65/month for scheduling up to 3 months, 30 social accounts, and 5 X accounts. | Compose, refine, and score are free. A text-only tweet or reply costs 30 credits/call from a connected X account. | | Run Auto-DM campaigns | Starter lists 1 Auto-DM tweet per week with a 100 DMs/day limit. Creator, Business, and Agency list 250, 300, and 400 Auto-DMs/day. Hypefury says Auto-DM batches run every 30 minutes and campaigns last 3 days. | Send DM costs 10 credits/call. Use Xquik when the same workflow needs media upload, follower export, webhook delivery, SDK calls, or event storage. | | Search tweets or export followers | Validate this during trial. Hypefury's current public pricing covers creator publishing, engagement builder, social accounts, and Auto-DM limits. | Search tweets and follower exports cost 1 credit/result, with CSV, JSON, XLSX, Markdown, API, SDK, and MCP handoff options. | | Monitor accounts or keywords | Engagement builder tracks watched users and keywords inside the creator workflow. | Active monitors check every 1 second and cost 30 credits per monitor-hour. Stored events and signed webhook delivery management are included. | | Connect backend jobs or agents | Validate REST, SDK, webhook, and MCP handoff needs before buying. | REST API, signed webhooks, SDKs, MCP, and CSV, JSON, XLSX & Markdown exports. | ## What to test in Xquik For publishing comparisons, test the steps before and after the post. Find source tweets, upload media, send DMs, and export replies. Also monitor keywords and notify other tools. Choose Xquik when publishing must include those steps. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Try a keyword search, follower export, media upload, DM, account monitor, or webhook delivery. Compare outputs, not feature labels. **2. Inspect the output** Confirm draft flow, media handling, scheduling needs, export formats, and API access. Also confirm whether data or monitoring matters after publishing. Then compare seats, included volume, top-ups, and engineering time. **3. Check the next integration** Decide where the result goes next. Pick CSV, JSON, webhook, SDK call, MCP tool, dashboard review, or another API. ## Hypefury trial evidence Test scheduled publishing and post-publication research. Use the same account, draft, media, and review window. For Hypefury, record the draft, schedule, approval, post, and queue failures. For Xquik, record media uploads, write receipts, Tweet IDs, and replies. Keep followers and monitor events. Score Hypefury on calendar features. Score Xquik on API coverage. The tools may work together. Keep Hypefury for planning. Keep Xquik for traceable X operations. ## Migration path Start with one publishing or reporting task. Validate exports, API access, monitoring, and alerts in Xquik. Keep the content calendar stable while you do. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Switch only when the Xquik output matches the required records. It must also reduce integration work or cost. Check live Hypefury pricing and Xquik pricing because public plans change. Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official Hypefury pricing](https://hypefury.com/features-pricing/) > > Verify current plan limits, Auto-DM limits, scheduling horizons, and supported social channels. Then make a final decision. # Keyhole alternative for X (Twitter) hashtag data Source: https://docs.xquik.com/alternatives/keyhole Xquik beats Keyhole per useful result. Keyhole sells post-capped plans with pricing on request. Xquik bills USD 0.00015 per tweet & tracks hashtags each second. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over Keyhole Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. Keyhole publishes none. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [Keyhole's plans page](https://keyhole.co/select-plan/) lists Team & Enterprise plans with post caps & no prices. Its pricing link opens a demo request. A historical X (Twitter) report starts at USD 50. On Xquik, 10,000 tweets from a past date range cost USD 1.50. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where Keyhole fits Keyhole sells social listening, profile analytics & hashtag tracking. Its social listening is now available on Muck Rack. This guide compares Keyhole & Xquik on X (Twitter) hashtag & keyword data. It covers tracking, history, exports, writes & agent connections. > [!NOTE] > > Facts on this page come from Keyhole's official pages, read on 2026-10-15. Keyhole lists pricing on request, so ask for a quote before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. It returns raw X rows, checks every second & has public prices. > [card] When Keyhole may fit > > Your PR team runs Muck Rack & wants listening in the same place. ## Source-backed Keyhole scope * Keyhole offers social listening, profile analytics & hashtag tracking. * Its social listening is available on Muck Rack. * The plans page lists Team & Enterprise with no prices. * Team includes 5 topics, 10k posts, 10 profiles & 3 users. * Enterprise includes 15+ topics, 20k posts & historical data. * Team reports export to PDF & XLS. * Historical X (Twitter) reports start at USD 50, priced by tweet volume. * A historical report arrives within 1 business day, in PDF & Excel. * One-time historical reports have no trial. Keyhole offers a sample report. * The X (Twitter) hashtag analytics trial needs no credit card. ## Comparison | Area | Keyhole | Xquik | | - | - | - | | Pricing | Pricing on request. Plans cap listening posts. | 1 credit per returned tweet, USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Post volume | 10k posts on Team, 20k posts on Enterprise. | Billed per delivered row, with no plan needed. | | X history | Reports from USD 50, delivered within 1 day. | Search by date range through the API, billed per returned row. | | Live tracking | Hashtag & keyword topics in dashboards. | Account & keyword monitors that check every second. | | Delivery | Dashboards & reports. | Signed webhooks or Telegram, plus REST & stored events. | | Write actions | None listed. | 24 write actions from connected accounts. Posting a tweet costs 30 credits. | | Agent tooling | None listed. | Remote MCP server with OAuth or API key. | | SDKs | None listed. | TypeScript, Python, Go, Java, Kotlin, PHP, Ruby & C#. Also a CLI & Terraform provider. | | Exports | PDF & XLS reports. | CSV, XLSX, JSON & Markdown exports. | ## What to test in Xquik Pull last month's tweets for your campaign hashtag in Xquik. Compare volume, fields & cost with a Keyhole quote. Xquik bills only the tweets you keep. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Search your Keyhole hashtags & keywords in Xquik first. Add a keyword monitor for each live campaign. Export rows to CSV or XLSX for the reports your team already builds. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Search tweets API](/api-reference/x/search-tweets) > > Search tweets by keyword, hashtag, account & date range. > [card] [Official Keyhole plans](https://keyhole.co/select-plan/) > > Verify current plans before making a final decision. # Late / Zernio alternative for social scheduling Source: https://docs.xquik.com/alternatives/late Compare Zernio, formerly Late, for social scheduling and cross-posting with Xquik tweet search, follower exports, monitors, signed webhooks, SDKs, and MCP. > For the complete documentation index, see [llms.txt](/llms.txt). This guide compares Zernio, formerly Late, and Xquik on specific X tasks. It covers tweet search, follower exports, and account or keyword monitors. It also covers publishing, webhooks, and app or agent connections. > [!NOTE] > > Before buying, verify current pricing, access rules, and product terms on Zernio's official site. ## Quick answer > [card] Choose Zernio when > > You need one API across many social networks. You need it for posting, analytics, comments, messaging, or ads. > [card] Choose Xquik when > > You need tweet search, follower exports, or write actions from one product. Or you need 1-second monitors, signed webhooks, SDKs, or MCP from it. ## Source-backed Zernio scope Zernio's official rebrand page says Late is now Zernio. Zernio keeps the same API, team, webhooks, `/api/v1` endpoints, route parameters, and response schemas. The page says `getlate.dev` redirects to `zernio.com`. It also says old SDK packages keep working during the grace period. It says integrations do not require code changes immediately. Zernio's official docs describe a social media scheduling API at `https://zernio.com/api/v1`. It is for managing and publishing content across major platforms. The docs cover Bearer authentication, profile creation, scheduled posts, and immediate posts. They also cover cross-posting to multiple accounts. Zernio's pricing docs describe pay-per-connected-account billing. The first 2 connected accounts are free. Accounts 3-10 cost USD 6/account/month, and accounts 11-100 cost USD 3/account/month. Accounts 101-2,000 cost USD 1/account/month. More than 2,000 accounts require custom pricing. Zernio's May 2026 pricing post lists what each connected account includes. Each account includes analytics, comments, DMs, ads, webhooks, and MCP server. It also includes CLI, SDKs, dashboard, and team members. Zernio bills X/Twitter usage separately at USD 0.005/read, USD 0.010/write, and USD 0.015/DM. Zernio's platform docs list X (Twitter) limitations for DMs and cached reply search. They also list API reference areas for account connection, post scheduling, and media upload. The areas also include analytics, ads, messages, comments, reviews, webhooks, and account settings. ## Comparison | Area | Zernio | Xquik | | - | - | - | | Use when | Developers need one social API across many channels. | Teams need tweet search, follower exports, write actions, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Multi-platform social API. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Zernio docs describe publishing, scheduling, cross-posting, analytics, inbox work, ads, webhooks, MCP, CLI, SDKs, and dashboard workflows across connected social accounts. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | Zernio prices each connected account. The first 2 accounts are free, then graduated monthly account rates apply. Zernio says it passes X/Twitter usage through separately at USD 0.005/read, USD 0.010/write, and USD 0.015/DM. Verify live rates before buying. | Xquik starts at USD 20/month with 140,000 included credits. Many read calls cost 1 credit per result or call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Plan for handoffs when content needs data, exports, monitoring, alerts, or automation beyond the calendar. | Use a dashboard tool first, then call the same task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | Zernio provides a unified social media API for multi-platform posting and engagement. | Xquik covers more X tasks, such as tweet search, follower exports, media uploads, DMs, monitors, event logs, signed webhooks, SDKs, and MCP. | | Channel scope | One API for many social networks. | One platform for X, with tweet search, profile lookup, follower exports, reply scraping, and account actions. | | Use case | Scheduling, publishing, analytics, comments, messaging, and ads. | Search, followers, extractions, monitors, events, and draws. | | Data exports | Publishing and social management responses. | Portable exports, event logs, webhook payloads, and API data. | ## Operating model Compare Zernio and Xquik by output, cost, and handoff. Zernio provides one API across many social networks. Xquik covers more X tasks. Examples are tweet search, follower exports, media uploads, DMs, and monitors. Other examples are event logs, signed webhooks, SDKs, and MCP. > [card] Channel scope > > Zernio offers one API for many social networks. Xquik offers one platform for X. It has tweet search, profile lookup, follower exports, reply scraping, and account actions. > [card] Use case > > Zernio covers scheduling, publishing, analytics, comments, messaging, and ads. Xquik covers search, followers, extractions, monitors, events, and draws. > [card] Data exports > > Zernio covers publishing and social management responses. Xquik covers portable exports, event logs, webhook payloads, and API data. ## What to test in Xquik For publishing comparisons, test the steps before and after the post. Find source tweets, upload media, send DMs, and export replies. Also monitor keywords and notify other tools. Choose Xquik when publishing must include those steps. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Try a keyword search, follower export, media upload, DM, account monitor, or webhook delivery. Compare outputs, not feature labels. **2. Inspect the output** Confirm draft flow, media handling, scheduling needs, export formats, and API access. Also confirm whether data or monitoring matters after publishing. Then compare seats, included volume, top-ups, and engineering time. **3. Check the next integration** Decide where the result goes next. Pick CSV, JSON, webhook, SDK call, MCP tool, dashboard review, or another API. ## Migration path Start with one publishing or reporting task. Validate exports, API access, monitoring, and alerts in Xquik. Keep the content calendar stable while you do. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Switch only when the Xquik output matches the required records. It must also reduce integration work or cost. Compare Zernio and Xquik by connected-account count and X usage charges. Test tweet search, profile lookup, follower and reply exports, timeline depth, and webhook delivery. Use the X usage line item as the first cost test. Zernio's [May 2026 pricing post](https://zernio.com/blog/pay-per-account-pricing) lists X reads at USD 0.005/read. It lists writes at USD 0.010/write and DMs at USD 0.015/DM. On Xquik, many X reads use 1 credit. Common non-tweet write or DM actions use 10 credits. Tweet or reply posts use 30 credits before media surcharges. At top-up pricing, before included monthly credits, a 1-credit read is USD 0.00015. At that rate, a 10-credit write or DM is USD 0.0015. At that rate, a 30-credit tweet or reply is USD 0.0045. Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official Zernio pricing](https://zernio.com/pricing) > > Verify current connected-account and X usage pricing before making a final decision. # Nitter alternative to read and follow X (Twitter) Source: https://docs.xquik.com/alternatives/nitter nitter.net shows no posts and its repository is archived. Xquik reads X (Twitter) with no X account. It sends each new post to Discord, Telegram or Slack. > For the complete documentation index, see [llms.txt](/llms.txt). Nitter is an open-source X (Twitter) front end. It showed profiles, posts and RSS feeds with no X account. This page shows its state today. It then maps each Nitter job to Xquik. > [!NOTE] > > Check [nitter.net](https://nitter.net) for its current state before you plan around it. ## What happened to Nitter On 2026-11-20, nitter.net showed only an update from its developer, dated October 10. Profile and post links showed that same update. Its developer archived the [Nitter repository](https://github.com/zedeus/nitter) on October 9, 2026. It is now read-only. XCancel, a public Nitter instance, showed a notice that its service is suspended. Nitter's README calls its RSS feeds "instance-specific, often disabled due to abuse". ## Read X (Twitter) without an X account The [X (Twitter) Viewer](https://xquik.com/en/twitter-viewer) opens public profiles, posts, threads and replies. It also opens hashtags, keyword searches, lists and communities. You need no X account, and you sign in to Xquik to run it. Paste a username or a Nitter link, such as `nitter.net/NASA`. The viewer also opens XCancel, FxTwitter and VxTwitter links. Each post row holds its text, media, date, likes, reposts, replies, quotes and views. Export the rows as CSV, Excel, JSON or Markdown. Each result costs 1 credit, or USD 0.00015 with pay-as-you-go credits. Private accounts stay private, since the viewer reads public accounts only. ## Follow accounts without a Nitter RSS feed Nitter readers often followed accounts through its RSS feeds. An Xquik account monitor does that job with alerts. It checks the account every second and sends each new post where you pick. * A Telegram chat, through @XquikBot. * A Discord channel webhook or a Slack incoming webhook. * Your own HTTPS endpoint, as a signed webhook. A keyword monitor does the same for a search, a hashtag or a mention. Each active monitor costs 30 credits per hour, or 720 credits per day. The USD 20 plan includes 140,000 credits a month. That keeps 6 monitors on all month. Xquik sends alerts and API pages, not RSS files. An RSS reader can't subscribe to a monitor today. ## Nitter pages and their Xquik calls Scripts that scraped Nitter pages can call the same data from the Xquik API. | Nitter page | Xquik call | | - | - | | `/` | [User tweets](/api-reference/x/user-tweets) | | `//with_replies` | [User replies](/api-reference/x/user-replies) | | `//media` | [User media](/api-reference/x/user-media) | | `//status/` | [Tweet thread](/api-reference/x/tweet-thread) | | `/search?q=` | [Search tweets](/api-reference/x/search-tweets) | | `/i/lists/` | [List tweets](/api-reference/x/list-tweets) | | `//rss` | [Account monitor](/api-reference/monitors/create) with a webhook | This call reads the same posts as `nitter.net/NASA`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/NASA/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Each returned tweet costs 1 credit. Continue with `next_cursor` to read the next page. ## Nitter vs Xquik | Area | Nitter | Xquik | | - | - | - | | State today | nitter.net shows an update and no posts. Its developer archived the repo. | The viewer, search, timelines and monitors work today. | | X account | None needed to read. | None needed. You sign in to Xquik or use an Xquik API key. | | Hosting | You find a working instance or run one yourself. | Xquik runs every read on its own infrastructure. | | Follow accounts | RSS feeds, where an instance kept them on. | Alerts by Telegram, Discord, Slack or signed webhook. | | Output | HTML pages and RSS feeds. | Pages, CSV, Excel, JSON and Markdown exports, and API JSON. | | Cost | Free under AGPL-3.0. | 1 credit per result, and 30 credits per active monitor hour. | ## Move a Nitter habit to Xquik **1. Open the viewer** Paste the Nitter link you used to open. The viewer reads the same profile, post or search. **2. Turn feeds into monitors** Add 1 account monitor for each account feed you followed. Add a keyword monitor for each search feed. Pick Telegram, Discord, Slack or a webhook. **3. Swap scraper calls** Replace each Nitter page your script read with its call from the table above. > [card] [X (Twitter) Viewer](https://xquik.com/en/twitter-viewer) > > Open a profile, post, hashtag or Nitter link with no X account. > [card] [Webhooks overview](/webhooks/overview) > > Send monitor alerts to Discord, Telegram, Slack or your server. > [card] [snscrape comparison](/alternatives/snscrape) > > Compare snscrape, whose Twitter scrapes have failed since June 2023, with Xquik. > [card] [Nitter's own site](https://nitter.net) > > Read the developer's latest update. # OpenTweet alternative for X posting & data Source: https://docs.xquik.com/alternatives/opentweet Xquik beats OpenTweet per useful result. OpenTweet sells plans from USD 19.99 a month with daily post caps. Xquik posts for USD 0.0045 a tweet with no plan. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over OpenTweet Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. OpenTweet publishes none. Xquik bills only delivered, unique, filter-matching results & each published post. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [OpenTweet's pricing](https://opentweet.io/pricing) sells monthly plans with daily post caps. Pro costs USD 19.99 a month for up to 20 posts a day. At full use, that is about USD 0.033 per post. Xquik posts a tweet for USD 0.0045 with no plan. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where OpenTweet fits OpenTweet calls itself the posting layer for X, built for AI agents. It schedules posts, threads & articles, & drafts them with AI. This guide compares OpenTweet & Xquik on X tasks for agents. It covers posting, reads, monitors, MCP tools & SDKs. > [!NOTE] > > Facts on this page come from OpenTweet's official pages, read on 2026-10-15. Verify current pricing & terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. Agents can post, read, search & monitor X (Twitter) through 1 MCP server. > [card] When OpenTweet may fit > > You want a visual content calendar & an evergreen repost queue. ## Source-backed OpenTweet scope * Plans cost USD 19.99, USD 29 & USD 49 a month. * Daily post caps are 20, 100 & 300 posts. * Posts with links are capped at 30, 300 & 600 a month. * API limits run from 60 to 600 requests a minute. * Daily API caps run from 1,000 to 30,000 requests. * Every plan includes the REST API, a CLI & an MCP server. * The MCP server has 43 tools for posts, threads, scheduling, articles & analytics. * Its only search tool looks up saved & public tweets for inspiration. * Paid Advanced allows 20 X (Twitter) searches a day. * It cross-posts to X, Bluesky & LinkedIn from 1 draft. * Every plan starts with a 7-day trial that needs a card. ## Comparison | Area | OpenTweet | Xquik | | - | - | - | | Billing unit | Monthly plans from USD 19.99 with daily post caps. | Credits per post & per returned row. No plan needed. | | Post a tweet | Within a plan cap of 20 to 300 posts a day. | 30 credits, USD 0.0045 with pay-as-you-go credits. | | Other writes | DM campaigns & evergreen reposts on paid plans. | 24 write actions, such as likes, follows & DMs, at 10 credits each. | | Read & search | 1 inspiration search tool. Advanced allows 20 X (Twitter) searches a day. | 23 extraction tools for tweets, replies, followers, lists & more. | | Monitoring | None listed. | Account & keyword monitors that check every second, at 30 credits an hour. | | Agent tooling | Hosted MCP server with 43 tools. | Remote MCP server with OAuth or API key. | | SDKs | REST API & a CLI. | TypeScript, Python, Go, Java, Kotlin, PHP, Ruby & C#. Also a CLI & Terraform provider. | | Exports | None listed. | CSV, XLSX, JSON & Markdown exports. | ## What to test in Xquik Post 1 week of your queue through Xquik. Compare publish results, errors & cost per post. Then pull replies & followers for the same posts. Xquik bills each post & each row you keep. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Point your agent's posting step at Xquik's create tweet endpoint or MCP server. Connect your X account once. Add monitors when the agent must react to replies or mentions. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Create tweet API](/api-reference/x-write/create-tweet) > > Post tweets & replies from a connected account. > [card] [Official OpenTweet pricing](https://opentweet.io/pricing) > > Verify current prices before making a final decision. # Postproxy alternatives for X (Twitter) posting Source: https://docs.xquik.com/alternatives/postproxy Postproxy alternatives for X (Twitter) posting, led by Xquik. Post, reply & schedule from connected accounts, then add tweet search, exports & monitors. > For the complete documentation index, see [llms.txt](/llms.txt). This guide compares Postproxy and Xquik on specific X tasks. It covers tweet search, follower exports, and account or keyword monitors. It also covers publishing, webhooks, and app or agent connections. > [!NOTE] > > Before buying, check Postproxy's [official pricing page](https://postproxy.dev/pricing/). Verify current pricing, post limits, supported platforms, and product terms there. ## Quick answer > [card] Choose Postproxy when > > Your team mainly needs one publishing API for multi-platform posts, queues, or analytics. Or it mainly needs that API for publish logs, webhooks, MCP, or workflow tools. > [card] Choose Xquik when > > You need one account for publishing, tweet search, follower exports, media uploads, and DMs. That account must also cover monitors, signed webhooks, SDKs, and MCP. ## Source-backed Postproxy scope Postproxy's official homepage describes one API for creating social posts. It works across Facebook, Instagram, TikTok, LinkedIn, YouTube, X, Threads, and Pinterest. The homepage also lists publishing integrations. These include MCP, skills, n8n, Zapier, Make, Needle, and other workflow tools. The official API overview says Postproxy can create and manage social media posts. It names Facebook, Instagram, TikTok, LinkedIn, YouTube, X, and Threads as the platforms. The getting-started guide describes built-in scheduling, error handling, retry management, and authentication. It also describes a connected social account requirement. The official pricing page lists Free, Build, Scale, and Enterprise plans. Free includes 2 profile groups and 10 posts/month. Build costs USD 17/month. It lists 10 profile groups, 120 posts/month, comments, analytics, 30-day publish logs, and webhooks. Scale costs USD 99/month. It lists 50 profile groups and no listed monthly post-count cap. It also lists 180-day publish logs, webhooks, and priority support. Enterprise starts at USD 699/month. The pricing page says one published post counts as one post. That holds even when you cross-post it to multiple platforms. The page also says rate limit quotas from Postproxy and social platforms still apply. Postproxy webhooks cover `post.processed`, `platform_post.published`, `platform_post.failed`, `platform_post.failed_waiting_for_retry`, `platform_post.insights`, `profile.disconnected`, `profile.connected`, and `media.failed`. Postproxy's X guide says X has strict rate limits and separate media upload limits. It says X also has shared-app publishing limits. Postproxy also has a BYO developer credentials guide. It covers X profiles connected with your own X developer credentials. Those profiles are exempt from the shared 24-hour posting quota. X credit balance and platform per-app limits still apply. ## Comparison | Area | Postproxy | Xquik | | - | - | - | | Use when | Teams want one API for publishing posts across Facebook, Instagram, TikTok, LinkedIn, YouTube, X, Threads, and Pinterest. | Teams need X tweet search, follower exports, write actions, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Social publishing API. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Create and manage social posts, profile groups, queues, comments, analytics, publish logs, webhooks, media URLs, MCP, skills, workflow tools, and publishing retries across supported platforms. | Tweet and profile reads, exports, X actions, monitors, webhooks, SDKs, MCP, and pay-per-use reads. | | Pricing & value | Official pricing lists Free at USD 0 for 10 posts/month, Build at USD 17/month for 120 posts/month, Scale at USD 99/month with no listed monthly post-count cap, and Enterprise from USD 699/month. A shared quota caps Twitter/X publishing unless profiles use their own X developer credentials. | Xquik starts at USD 20/month with 140,000 included credits. Tweet search and follower exports cost 1 credit/result. Common X write calls cost 10 credits/call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Use Bearer auth, profile groups, post queues, media URLs, per-platform parameters, webhooks, and publish status handling. | Use a dashboard tool first, then call the same X task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | Postproxy provides a unified social media publishing API for posting to X, Instagram, LinkedIn, TikTok, Threads, YouTube, Facebook, and Pinterest. | Xquik fits teams that need X search, extractions, monitors, signed webhooks, SDKs, MCP, dashboard tools, and X write actions. | | Channel scope | Multi-platform publishing through one social API. | Tweet search, follower exports, media posts, account monitors, and exports. | | Data needs | Publishing status, retries, and per-platform outcomes. | Search, follower exports, extractions, monitors, webhooks, and event logs. | | Agent support | Publishing integrations for MCP, n8n, Zapier, and skills. | MCP, REST API, SDKs, webhooks, and dashboard tools for X tasks. | ## Operating model Compare Postproxy and Xquik by output, cost, and handoff. Postproxy provides a unified social media publishing API. It posts to X, Instagram, LinkedIn, TikTok, Threads, YouTube, Facebook, and Pinterest. Xquik fits teams that need X search, extractions, monitors, and X write actions. Those teams also need signed webhooks, SDKs, MCP, and dashboard tools. > [card] Channel scope > > Postproxy covers multi-platform publishing through one social API. Xquik covers tweet search, follower exports, media posts, account monitors, and exports. > [card] Data needs > > Postproxy covers publishing status, retries, and per-platform outcomes. Xquik covers search, follower exports, extractions, monitors, webhooks, and event logs. > [card] Agent support > > Postproxy covers publishing integrations for MCP, n8n, Zapier, and skills. Xquik covers MCP, REST API, SDKs, webhooks, and dashboard tools for X tasks. ## Current cost checkpoint Use the current Postproxy plan limits when the job is social publishing. Use Xquik units when the job needs tweet search, follower exports, or monitors. Use them too for account actions beyond publishing. | Task | Postproxy unit to price | Xquik unit to price | | - | - | - | | Publish 100 posts across social channels | Build includes 120 posts/month at USD 17/month. Cross-posting the same content to multiple platforms counts as 1 post in Postproxy. | A text-only tweet or reply costs 30 credits/call. A separate media upload costs 10 credits/call. Xquik publishes to connected X accounts. | | Publish more than 120 posts/month | Postproxy lists Scale at USD 99/month with no listed monthly post-count cap, subject to Postproxy and platform quotas. Postproxy says X shared publishing includes 20 posts per 24 hours, while BYO developer credentials use the account's X credits and app limits. | Price each X write call. Top-up credits cost USD 0.00015/credit, so a 30-credit create-tweet call costs USD 0.0045 before included monthly credits. | | Search tweets or export followers | Postproxy is a publishing API. It does not list this task. | Search tweets and follower exports cost 1 credit/result, with CSV, JSON, XLSX, Markdown, API, SDK, and MCP handoff options. | | Monitor accounts and deliver events | Use Postproxy webhooks for post events. | Active monitors check every 1 second and cost 30 credits per monitor-hour. Stored events and signed webhook delivery management are included. | Choose Postproxy when the main task is multi-platform publishing. When X is the main channel, choose Xquik for any of the following needs. They are reads, exports, DMs, media uploads, 1-second monitors, signed webhooks, SDKs, and MCP. ## What to test in Xquik For API comparisons, price the whole task. Include endpoint access, pagination, retries, storage, exports, alerts, webhooks, SDKs, and maintenance. Choose Xquik when you need all of them from one product. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Try a keyword search, follower export, media upload, DM, account monitor, or webhook delivery. Compare outputs, not feature labels. **2. Inspect the output** Confirm returned data, pagination, retry behavior, webhook payloads, and export formats. Also confirm how much code each call needs. Then compare total cost for the same task. Count access, included volume, top-ups, and engineering time. **3. Check the next integration** Decide where the result goes next. Pick CSV, JSON, webhook, SDK call, MCP tool, dashboard review, or another API. ## Postproxy webhook & quota trial Test one profile group before migrating a publishing queue. Connect only the social profiles required for the trial. Keep the Postproxy profile-group ID beside each scheduled post. Publish one text post and one media post. Cross-post each item only where the campaign requires it. Record the Postproxy post ID and every platform-specific result. Subscribe a test receiver to Postproxy post events. Capture these documented states when they occur. * `post.processed` for the completed parent post job. * `platform_post.published` for a successful platform result. * `platform_post.failed` for a final platform failure. * `platform_post.failed_waiting_for_retry` during retry handling. * `platform_post.insights` when refreshed engagement becomes available. * `profile.disconnected` when a connected profile needs attention. * `media.failed` when an attached media item cannot publish. Store the event name, Postproxy post ID, platform, delivery time, and receiver result. This separates a queue failure from an X-only publishing failure. Run the X portion once with shared publishing limits. Run it again with your own X developer credentials when the trial permits. Compare accepted posts, retries, X credit use, and platform errors. Do not infer quota behavior from monthly Postproxy post limits alone. Use Xquik for the surrounding X workflow. Search source tweets before writing. Retrieve the published Tweet ID afterward. Then export replies, quotes, reposts, and visible likers through their own routes. Use an account monitor when new post alerts must outlast the publishing job. ## Other Postproxy alternatives The [X (Twitter) API alternatives comparison](/twitter-api-alternatives) lists more publishing tools. Compare [Typefully](/alternatives/typefully), [Buffer](/alternatives/buffer) & [Hootsuite](/alternatives/hootsuite) too. ## Migration path Start with one API-backed task. Keep the current integration running. Meanwhile, compare output shape, latency, pagination, retries, exports, and alert delivery in Xquik. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Confirm Xquik returns every required tweet, reply, follower, profile, and media field. Switch only when Xquik needs less code or costs less. Price the real workload. On Postproxy, price monthly post volume, profile groups, publish logs, and comments. Also price analytics, webhooks, and platform quota needs. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official Postproxy pricing](https://postproxy.dev/pricing/) > > Verify current plan limits, post caps, and platform terms before making a final decision. # ScrapeBadger alternatives for X (Twitter) data Source: https://docs.xquik.com/alternatives/scrapebadger ScrapeBadger alternatives for X (Twitter) data, led by Xquik. It bills only delivered rows, wins public Apify speed runs & adds writes, monitors & exports. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over ScrapeBadger Xquik is the fastest X (Twitter) data service. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. ScrapeBadger publishes none. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. ScrapeBadger charges for each X call as well as for each item it returns. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where ScrapeBadger fits ScrapeBadger is a scraping API for many sites, including X. Its X endpoints read tweets, users, lists, communities, and trends. It lists no write actions. This guide compares ScrapeBadger and Xquik on specific X tasks. It covers tweet search, follower exports, account monitors, publishing, webhooks, and agent connections. > [!NOTE] > > Facts on this page come from ScrapeBadger's official pages, read on 2026-10-15. Verify its current terms on its site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & bills only delivered rows. It also adds writes from connected accounts, 1-second keyword monitors, exports & SDKs. > [card] When ScrapeBadger may fit > > You scrape many sites, not only X, from 1 account. ## Source-backed ScrapeBadger scope * X tweet and user endpoints charge per call as well as per item returned. * Its pricing page says failed requests are never charged, including empty responses. * No write actions are listed for X. * Twitter Streams track accounts or search queries and deliver by WebSocket or signed webhook. * A hosted MCP server covers its APIs, with 49 tools for X. ## Comparison | Area | ScrapeBadger | Xquik | | - | - | - | | Billing model | Per X call, plus per item returned. | Per delivered row only. | | Empty request | Never charged. | Billed only for returned rows, so 0 rows cost nothing. | | Write actions | None listed. | Posts, replies, likes, reposts, follows, DMs, and media from connected accounts. | | Monitoring | Streams that track accounts or search queries, by WebSocket or signed webhook. | Account and keyword monitors that check every second, with signed webhooks. | | Exports | API responses. | CSV, XLSX, JSON, and Markdown exports from the dashboard or API. | ## What to test in Xquik Test the whole task with your real queries. Compare rows, fields, monitors, and exports. Choose Xquik when the job also acts on X or needs files. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Other ScrapeBadger alternatives The [X (Twitter) API alternatives comparison](/twitter-api-alternatives) ranks more scraping APIs by price per result. Compare [SocialData](/alternatives/socialdata), [TwitterAPI.io](/alternatives/twitterapi-io) & [Apify](/alternatives/apify) too. ## Migration path Run the same query in both products, then compare rows, fields, and cost. Move the task only after the systems that read the data accept Xquik's output. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Search tweets API](/api-reference/x/search-tweets) > > Query parameters, filters, cursors, and response fields. # ScrapeCreators alternative for X (Twitter) search Source: https://docs.xquik.com/alternatives/scrapecreators Xquik beats ScrapeCreators on X. ScrapeCreators bills each request, empty search pages included. Xquik bills USD 0.00015 per result & searches X natively. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over ScrapeCreators Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). ScrapeCreators publishes Instagram benchmarks, but none for X. Xquik publishes every X benchmark run with its run ID. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [ScrapeCreators' pricing](https://scrapecreators.com/#pricing) bills 1 credit per request, & empty search pages still cost a credit. On the Freelance pack, that is USD 0.00188 per page. An empty Xquik search costs 0, & each result costs USD 0.00015. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where ScrapeCreators fits ScrapeCreators returns profiles, posts & comments from 20+ platforms through 1 API. Its X (Twitter) API page lists 7 endpoints. Xquik adds X writes, monitors & file exports. This guide compares ScrapeCreators and Xquik on specific X tasks. It covers tweet search, lookups, writes, monitors & agent connections. > [!NOTE] > > Facts on this page come from ScrapeCreators' official pages, read on 2026-10-15. Verify current pricing and terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. It also adds native X (Twitter) search, writes, 1-second monitors & file exports. > [card] When ScrapeCreators may fit > > You need TikTok, Instagram or YouTube data next to X. ## Source-backed ScrapeCreators scope * The X (Twitter) API page lists 7 endpoints. They cover search, profiles, user tweets, tweet details, transcripts & communities. * Search finds posts through Google-indexed results, not native X (Twitter) search. * The docs say recent posts can be missing from search. Google ranks the results, not recency. * Each successful search page costs 1 credit, including empty results. * User tweets returns about 100 of a user's most popular tweets, not the latest. * Most endpoints cost 1 credit per request. Cached results cost 0 credits. * Freelance costs USD 47 for 25,000 credits, which is USD 0.00188 per request. * Business costs USD 497 for 500,000 credits, which is USD 0.000994 per request. Credits never expire. * No account-level rate or concurrency caps apply. The homepage suggests staying under 500 concurrent requests. * Requests use an `x-api-key` header. The hosted MCP server takes OAuth or that header. ## Comparison | Area | ScrapeCreators | Xquik | | - | - | - | | Billing unit | 1 credit per request on most endpoints, USD 0.000994 to USD 0.00188. | 1 credit per returned row, USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Tweet or profile lookup | 1 credit per lookup, from USD 0.000994. | 1 credit, USD 0.00015 with pay-as-you-go credits. | | Search | Google-indexed results. Each page costs 1 credit, also when empty. | Billed only for returned rows, so 0 rows cost nothing. | | Write actions | Its 7 X endpoints are all reads. | 24 write actions from connected accounts. Posting a tweet costs 30 credits. | | Agent tooling | Hosted MCP server with OAuth or API key, plus a CLI. | Remote MCP server with OAuth or API key, plus a CLI. | | SDKs | No SDK required. | TypeScript, Python, Go, Java, Kotlin, PHP, Ruby & C#, plus a Terraform provider. | | Exports | JSON API responses. | CSV, XLSX, JSON & Markdown exports. | ## What to test in Xquik Price the X part of the task. A ScrapeCreators request costs from USD 0.000994. An Xquik tweet or profile costs USD 0.00015. Check search results for recent posts in both products. Add writes, monitors & exports if the workflow needs them. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Run the same X lookups in both products. Compare recent posts, fields, empty pages & cost. Move the task once the systems that read the data accept Xquik's output. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Search tweets API](/api-reference/x/search-tweets) > > Query parameters, filters, cursors, and response fields. > [card] [Official ScrapeCreators pricing](https://scrapecreators.com/#pricing) > > Verify current prices before making a final decision. # SnitchFeed alternatives with 1-second X monitors Source: https://docs.xquik.com/alternatives/snitchfeed SnitchFeed alternatives for X (Twitter) alerts, led by Xquik. SnitchFeed bills each X scan, found posts or not. Xquik bills per tweet & checks every second. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over SnitchFeed Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. SnitchFeed publishes none. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [SnitchFeed's credit docs](https://snitchfeed.com/docs/credits) bill 2 credits each time a keyword's X scan runs. They bill per search, not per post found. Starter sells 7,000 credits for USD 59 a month, about USD 0.0084 each. So 1 X scan costs about USD 0.0169, even when it finds nothing. On Xquik, a search that keeps 3 tweets costs USD 0.00045. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where SnitchFeed fits SnitchFeed is an AI social listening tool for startups & B2B SaaS teams. It scores mentions for relevance, intent & sentiment. On Starter & Pro, it scans X hourly. This guide compares SnitchFeed & Xquik on X monitoring. It covers scan speed, billing, delivery, writes & agent connections. > [!NOTE] > > Facts on this page come from SnitchFeed's official pages, read on 2026-10-15. Verify current pricing & terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. Its X monitors check every second, not hourly, & add writes & exports. > [card] When SnitchFeed may fit > > You hunt B2B leads on LinkedIn & Reddit as much as on X. ## Source-backed SnitchFeed scope * SnitchFeed watches LinkedIn, X, Reddit, Bluesky & more. * X & LinkedIn scan hourly on Starter & Pro. Scale scans in real time. * Starter costs USD 59 a month, or USD 47 a month billed yearly. It includes 7,000 credits. * Pro costs USD 119 a month, or USD 95 a month billed yearly. It includes 21,000 credits. * Scale starts at USD 399 a month. * An X keyword scan or X API search costs 2 credits. * AI scoring costs 0.5 credits per stored mention. * The X search API returns up to 20 posts per call. * Alerts go to email, Slack & Discord. Webhooks & CSV exports need Pro. * Every plan includes the API & MCP. * New accounts get 1,000 free credits with no card. ## Comparison | Area | SnitchFeed | Xquik | | - | - | - | | Billing unit | 2 credits per X scan or search, plus 0.5 per mention. | 1 credit per returned tweet, USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Empty X scan | 2 credits each time the scan runs. | Billed only for returned rows, so 0 rows cost nothing. | | X scan speed | Hourly on Starter & Pro. Real time on Scale. | Account & keyword monitors check every second. | | Monitor price | 1,440 credits for 1 keyword scanned hourly for 30 days. | 30 credits an hour, USD 3.24 for 30 days, events & webhooks included. | | Delivery | Email, Slack & Discord. Webhooks need Pro. | Signed webhooks or Telegram, plus stored events you can poll. | | Write actions | None listed. | 24 write actions from connected accounts. Posting a tweet costs 30 credits. | | Agent tooling | API & MCP on every plan. | Remote MCP server with OAuth or API key. | | SDKs | REST API with a bearer token. | TypeScript, Python, Go, Java, Kotlin, PHP, Ruby & C#. Also a CLI & Terraform provider. | | Exports | CSV exports on Pro. | CSV, XLSX, JSON & Markdown exports. | ## What to test in Xquik Run your SnitchFeed X terms as Xquik keyword monitors for 1 week. Count alerts, delay & cost. Xquik bills only the tweets you keep, & its monitors check every second. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Other SnitchFeed alternatives The [X (Twitter) API alternatives comparison](/twitter-api-alternatives) lists more monitoring tools. Compare [Syften](/alternatives/syften), [Brand24](/alternatives/brand24) & [Keyhole](/alternatives/keyhole) too. ## Migration path Copy each SnitchFeed X term into an Xquik keyword monitor. Send events to your signed webhook or Telegram. Keep SnitchFeed for LinkedIn & Reddit if you still need them. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Keyword monitors API](/api-reference/monitors/create-keyword) > > Create keyword monitors & receive signed webhook events. > [card] [Official SnitchFeed pricing](https://snitchfeed.com/pricing) > > Verify current prices before making a final decision. # snscrape alternative for Twitter scraping in Python Source: https://docs.xquik.com/alternatives/snscrape snscrape Twitter scrapes have failed since June 2023. Xquik searches tweets from Python with no X account or cookies, at USD 0.00015 a tweet. See the code. > For the complete documentation index, see [llms.txt](/llms.txt). snscrape is an open-source Python scraper for social networks. Its Twitter module stopped working in 2023. This page shows what broke and how to run the same jobs with Xquik. > [!NOTE] > > Check the snscrape repository for its current state before you plan around it. ## What happened to snscrape on Twitter [Issue #846](https://github.com/JustAnotherArchivist/snscrape/issues/846) reported in April 2023 that Twitter searches failed with `blocked (403)`. [Issue #996](https://github.com/JustAnotherArchivist/snscrape/issues/996) opened on 2023-06-30. It says all Twitter scrapes fail with `blocked (404)`. It was still open on 2026-11-04. The last snscrape release, v0.7.0.20230622, came out 8 days before that issue. The repository has had no commit since then. ## Search tweets without an X account Xquik's Python SDK runs each search on Xquik's infrastructure. You add no X account and no cookies. So no account of yours can get banned. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} pip install x_twitter_scraper export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from x_twitter_scraper import XTwitterScraper client = XTwitterScraper() page = client.x.tweets.search(q="python since:2026-10-01 until:2026-10-02", limit=10) for tweet in page.tweets: print(tweet.id, tweet.text) ``` Each returned tweet costs 1 credit, or USD 0.00015 with pay-as-you-go credits. Empty searches cost nothing. Continue with `next_cursor` to read the next page. Xquik keeps the X (Twitter) search operators you send, like `from:`, `since:` and `until:`. The [operator list](https://github.com/Xquik-dev/x-twitter-advanced-search) covers the rest. ## snscrape scrapers and their Xquik calls | snscrape scraper | Xquik call | | - | - | | `TwitterSearchScraper` | [Search tweets](/api-reference/x/search-tweets) | | `TwitterHashtagScraper` and `TwitterCashtagScraper` | [Search tweets](/api-reference/x/search-tweets) with `#` or `$` | | `TwitterUserScraper` and `TwitterProfileScraper` | [User tweets](/api-reference/x/user-tweets) | | `TwitterTweetScraper` | [Tweet thread](/api-reference/x/tweet-thread) | | `TwitterListPostsScraper` | [List tweets](/api-reference/x/list-tweets) | | `TwitterCommunityScraper` | [Community tweets](/api-reference/x/community-tweets) | | `TwitterUsersScraper` | [Batch users](/api-reference/x/batch-users) | | `TwitterTrendsScraper` | [Trends](/api-reference/trends/list) | ## snscrape vs Xquik | Area | snscrape | Xquik | | - | - | - | | Twitter status | Every Twitter scrape fails, per issue #996. | Search, timelines, replies and followers work today. | | X account | None needed while it worked. | None needed. Xquik needs only its own API key. | | Cost | Free under GPL-3.0. | 1 credit per returned tweet, USD 0.00015 pay-as-you-go. | | Output | Python objects, or JSON Lines from the CLI. | JSON pages, plus CSV, JSON or XLSX export files. | | Upkeep | You fix the scraper when X changes. | Xquik keeps the API working when X changes. | ## Move a snscrape job to Xquik **1. Copy the query** Keep the search string you passed to snscrape. Xquik reads the same operators. **2. Swap the call** Replace the scraper class with the Xquik call from the table above. Map each field you stored to the new response. **3. Page and store** Read `next_cursor` until it is empty. Store tweet IDs so a rerun skips rows you already have. **4. Export large pulls** Run an extraction job for thousands of tweets. Download the result as CSV, JSON or XLSX. > [card] [Python SDK](/sdks/python) > > Install the SDK, set the API key and run your first search. > [card] [Search tweets by date](/guides/search-tweets-by-date) > > Pull tweets from a fixed date window with `since:` and `until:`. > [card] [twscrape comparison](/alternatives/twscrape) > > Compare the account-based twscrape library with Xquik. > [card] [Official snscrape repository](https://github.com/JustAnotherArchivist/snscrape) > > Check the current code and open issues. # SocialCrawl alternatives for X (Twitter) APIs Source: https://docs.xquik.com/alternatives/socialcrawl SocialCrawl alternatives for X (Twitter) data, led by Xquik. Compare profile & tweet APIs with follower exports, write actions, monitors, webhooks & MCP. > For the complete documentation index, see [llms.txt](/llms.txt). ## Where SocialCrawl fits SocialCrawl returns normalized social data from many networks. It offers one response envelope, computed fields, credit tiers, OpenAPI, and agent packages. Read this page when you need multi-platform collection more than X coverage. This guide compares SocialCrawl and Xquik on specific X tasks. It covers tweet search, follower exports, and account or keyword monitors. It also covers publishing, webhooks, and app or agent connections. > [!NOTE] > > Before buying, check SocialCrawl's official site. Verify current pricing, access rules, and product terms there. ## Quick answer > [card] Choose SocialCrawl when > > Your team needs a cross-network social data API. It must have normalized response envelopes, computed fields, credit tiers, and agent packages. > [card] Choose Xquik when > > You want one maintained API and dashboard. It must cover collection, exports, monitoring, account operations, API access, and webhook delivery. ## Source-backed SocialCrawl scope SocialCrawl's official docs describe it as a unified social media data API. They say it is for developers and AI agents. Current SocialCrawl pages give different coverage counts. The docs introduction says 21 platforms and 108 endpoints. The pricing page says 27 platforms and 133 APIs. The docs introduction says responses use a consistent format across platforms. It says responses also include computed fields such as `engagement_rate`, `language`, `content_category`, and `estimated_reach`. Authentication docs say requests use the `x-api-key` header. Missing or malformed credentials return `401 MISSING_API_KEY` or `401 INVALID_API_KEY`. Accounts can keep up to 5 active keys. The credits page describes credit-based pay-as-you-go billing. Each credential has a 50 concurrent request ceiling. Standard requests cost 1 credit across 84 endpoints. Advanced requests cost 5 credits across 18 endpoints. Premium requests cost 10 credits across 6 endpoints. The response schema includes `success`, `platform`, `endpoint`, `data`, `credits_used`, `credits_remaining`, `request_id`, and `cached`. List endpoints return `items`, optional `next_cursor`, and optional `total`. SocialCrawl docs say cache hits cost 0 credits and every response includes `credits_remaining`. `GET /v1/credits/balance` costs 0 credits. The docs add that idempotent replays deduct 0 new credits within a 24-hour TTL. The pricing page lists Free with 400 one-time credits. Starter has 2,500 credits for GBP 15. Growth has 20,000 credits for GBP 49. Pro has 150,000 credits for GBP 299. Enterprise has custom credits. The AI agent docs publish `/llms.txt`, `/llms-full.txt`, OpenAPI JSON and YAML. They also publish per-platform llms files. The Twitter/X llms file lists profile, user tweets, and tweet detail endpoints. It also lists community detail, community tweets, video transcript, and AI-powered X search endpoints. The Skills & MCP docs list a `socialcrawl-mcp` package on npm and MCP Registry. It has 4 tools, `socialcrawl_list_platforms`, `socialcrawl_list_endpoints`, `socialcrawl_request`, and `socialcrawl_get_docs`. ## Comparison | Area | SocialCrawl | Xquik | | - | - | - | | Use when | Builders need social data from many networks. | Teams need tweet search, follower exports, write actions, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Cross-network social data API with Skills and MCP packages. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Official pages list either 21 platforms with 108 endpoints or 27 platforms with 133 APIs. Validate the platform list for the workload. | Tweet and profile reads, exports, X actions, monitors, webhooks, SDKs, MCP, and pay-per-use reads. | | Pricing & value | Credit packs range from Free 400 credits to Pro 150,000 credits for GBP 299, with request tiers at 1, 5, and 10 credits. | Xquik starts at USD 20/month with 140,000 included credits. Many read calls cost 1 credit per result or call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Plan for `x-api-key` auth, normalized envelopes, credit headers, idempotent retries, optional cursors, agent packages, and X/Twitter endpoint coverage. | Use a dashboard tool first, then call the same task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | SocialCrawl covers cross-network social data through a unified envelope, computed fields, OpenAPI, llms files, Skills, and MCP. | Xquik covers X account actions, follower exports, monitors, webhooks, SDKs, MCP, and dashboard tools. | | Platform coverage | Multi-platform social data. Docs and pricing pages list different platform counts. | X reads, write actions, extractions, and monitors. | | Agent fit | Skills and MCP packages for broad social collection. | MCP and REST tools for tweet search, profile lookup, follower or reply exports, account actions, and monitors. | | Scope | Cross-network profiles, posts, comments, search, transcripts, ad libraries, and computed fields. | X search, account monitors, giveaway draws, exports, and signed webhooks. | ## Operating model Compare SocialCrawl and Xquik by output, cost, and handoff. SocialCrawl covers cross-network social data through a unified envelope and computed fields. It also covers OpenAPI, llms files, Skills, and MCP. Xquik covers X account actions, follower exports, monitors, webhooks, SDKs, MCP, and dashboard tools. > [card] Platform coverage > > SocialCrawl covers multi-platform social data. Its docs and pricing pages list different platform counts. Xquik covers X reads, write actions, extractions, and monitors. > [card] Agent fit > > SocialCrawl provides Skills and MCP packages for broad social collection. > Xquik provides MCP and REST tools for tweet search and profile lookup. It > also provides these tools for follower or reply exports, account actions, > and monitors. > [card] Scope > > SocialCrawl covers cross-network profiles, posts, comments, search, transcripts, ad libraries, and computed fields. Xquik covers X search, account monitors, giveaway draws, exports, and signed webhooks. ## Current cost checkpoint Use SocialCrawl units when the job needs cross-network social data with normalized responses. Use Xquik units when the job is X-specific and needs search or follower exports. Use them too when such a job needs media upload, DMs, or write actions. The same goes for monitors, webhook events, SDKs, exports, or MCP. | Task | SocialCrawl unit to price | Xquik unit to price | | - | - | - | | Run broad social data collection | Confirm the needed platform on current docs because public counts differ between docs and pricing pages. | Use Xquik when the job is specifically X search, users, followers, media, DMs, posts, monitors, events, or exports. | | Parse returned data | Responses use a consistent envelope with `data`, `credits_used`, `credits_remaining`, `request_id`, `cached`, and optional list cursors. | Xquik returns task-specific X API responses, extraction rows, export files, monitor events, and webhook payloads. | | Price request volume | Standard, Advanced, and Premium requests cost 1, 5, and 10 credits, with 400 Free credits and paid packs from GBP 15 to GBP 299. | Many Xquik read calls cost 1 credit/result or call. A text-only tweet or reply costs 30 credits/call, and active monitors cost 30 credits/hour while enabled. | | Connect agents | SocialCrawl publishes OpenAPI, llms files, Skills, and a 4-tool MCP server for its social data API. | Xquik publishes OpenAPI, SDKs, MCP, workflow docs, signed webhooks, and exports for X-specific operations. | | Search X or export followers | SocialCrawl's Twitter/X llms file lists profile, user tweets, tweet details, communities, video transcripts, and AI-powered X search. | Xquik adds follower exports, tweet search exports, media upload, DMs, write actions, monitors, webhooks, SDKs, and MCP handoffs. | ## What to test in Xquik For API comparisons, price the whole task. Include endpoint access, pagination, retries, storage, exports, alerts, webhooks, SDKs, and maintenance. Choose Xquik when you need all of them from one product. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Try a keyword search, follower export, media upload, DM, account monitor, or webhook delivery. Compare outputs, not feature labels. **2. Inspect the output** Confirm returned data, pagination, retry behavior, webhook payloads, and export formats. Also confirm how much code each call needs. Then compare total cost for the same task. Count access, included volume, top-ups, and engineering time. **3. Check the next integration** Decide where the result goes next. Pick CSV, JSON, webhook, SDK call, MCP tool, dashboard review, or another API. ## Other SocialCrawl alternatives The [X (Twitter) API alternatives comparison](/twitter-api-alternatives) ranks more social data APIs by price. Compare [ScrapeCreators](/alternatives/scrapecreators), [Xpoz](/alternatives/xpoz) & [Apify](/alternatives/apify) too. ## Migration path Run the same query in both products. Then compare record completeness, deduplication, error states, and export shape. Move the task only after the systems reading the data accept the Xquik output. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Switch only when the Xquik output matches the required records. It must also reduce integration work or cost. Compare SocialCrawl and Xquik by platform coverage and X endpoint count. Also compare export formats and agent tools. Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official SocialCrawl site](https://www.socialcrawl.dev/) > > Verify current product details before making a final decision. # SocialData alternative, 25% cheaper per result Source: https://docs.xquik.com/alternatives/socialdata Xquik beats SocialData on price & speed. It bills USD 0.00015 per result against USD 0.0002, adds 1-second monitors, writes & MCP, and publishes benchmarks. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over SocialData Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. SocialData publishes none. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [SocialData's pricing](https://docs.socialdata.tools/getting-started/pricing) lists USD 0.0002 per tweet or profile. Xquik charges USD 0.00015, 25% less on every result. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where SocialData fits SocialData calls itself the X API for public data, priced per result. It is read-only, so it never posts or acts for an account. Xquik reads the same kinds of public data and also runs account actions. This guide compares SocialData and Xquik on specific X tasks. It covers tweet search, follower exports, account monitors, publishing, webhooks, and agent connections. > [!NOTE] > > Facts on this page come from SocialData's official pages, read on 2026-10-15. Verify current pricing and terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. It also adds writes from connected accounts, 1-second monitors, exports, SDKs & remote MCP. > [card] When SocialData may fit > > You want a service that is read-only by design. ## Source-backed SocialData scope * The homepage lists USD 0.0002 per tweet or user profile. That is USD 0.20 per 1,000 results. The balance never expires. * The pricing docs say requests that return no data don't consume balance by default. Failed requests don't either. * The homepage says SocialData is read-only and never acts on your behalf. * User monitors deliver an event up to 30 seconds after a change on X. The docs say they don't promise real-time delivery. * Requests use a bearer API key. A hosted MCP server offers 14 read-only tools. * Each user can send 120 requests per minute across all endpoints. ## Comparison | Area | SocialData | Xquik | | - | - | - | | Tweet price | USD 0.0002 per tweet or profile. | 1 credit per tweet or profile, which is USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Empty search | No charge by default. | Billed only for returned rows, so 0 rows cost nothing. | | Write actions | None. Read-only by design. | Posts, replies, likes, reposts, follows, DMs, and media from connected accounts. | | Monitoring | Events up to 30 seconds after a change, by webhook. | 1-second account and keyword monitors with signed webhooks, at 30 credits an hour each. | | Agent tooling | Hosted MCP server with 14 read-only tools. | Remote MCP server with reads and writes, plus REST, SDKs, and signed webhooks. | | Exports | API responses. | CSV, XLSX, JSON, and Markdown exports from the dashboard or API. | ## What to test in Xquik Price the whole task. Count results, monitors, exports, and any write step the workflow needs. Choose Xquik when the job reads and acts on X. Also choose it when the job needs faster monitor events. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Run the same query in both products. Then compare rows, fields, monitor timing, and cost. Move the task only after the systems that read the data accept Xquik's output. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Monitors API](/api-reference/monitors/create) > > Create account monitors and receive signed webhook events. > [card] [Official SocialData pricing](https://docs.socialdata.tools/getting-started/pricing) > > Verify current prices before making a final decision. # Sorsa alternative with X writes & 1-second monitors Source: https://docs.xquik.com/alternatives/sorsa Xquik beats Sorsa per useful result. Sorsa sells plans from USD 49 a month & bills each call. Xquik bills USD 0.00015 per row with no plan & adds writes. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over Sorsa Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. Sorsa publishes none. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [Sorsa's pricing](https://api.sorsa.io/pricing) starts at USD 49 a month for 10,000 requests. Each call counts once, however few tweets it returns. On that plan, a search that finds 3 tweets costs USD 0.0049. On Xquik, the same search costs USD 0.00045. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where Sorsa fits Sorsa calls itself a read-only REST API for public X (Twitter) data. It sells monthly request plans, and 1 call counts as 1 request. Xquik bills per returned row and also runs account actions. This guide compares Sorsa and Xquik on specific X tasks. It covers tweet search, follower lists, monitors, writes, webhooks & agent connections. > [!NOTE] > > Facts on this page come from Sorsa's official pages, read on 2026-10-15. Verify current pricing and terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. It also adds pay-as-you-go billing, writes, 1-second monitors, webhooks & file exports. ## Source-backed Sorsa scope * Plans start at USD 49 a month for 10,000 requests, USD 0.0049 per request. * Pro costs USD 199 a month for 100,000 requests, USD 0.00199 each. * 1 call counts as 1 request, however much it returns. A search page holds up to 20 tweets. * Past the monthly quota, extra requests bill at the plan's rate. Failed requests are not billed. * New accounts get 100 free requests with no card and no expiry. * Sorsa does not provide a streaming firehose or webhooks. Monitoring works by polling. * Every plan allows 20 requests per second. Requests use an `ApiKey` header. * The MCP server runs locally through npx and exposes 40 read-only tools. ## Comparison | Area | Sorsa | Xquik | | - | - | - | | Billing unit | Monthly plans from USD 49. 1 call counts as 1 request. | 1 credit per returned row, USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Search tweets | 1 request per call, however few tweets return. | 1 credit per tweet, USD 0.00015 with pay-as-you-go credits. | | Empty search | 1 request, however much data it returns. | Billed only for returned rows, so 0 rows cost nothing. | | Write actions | None. Sorsa is read-only. | 24 write actions from connected accounts. Posting a tweet costs 30 credits. | | Monitoring | No webhooks. You poll at up to 20 requests per second. | Account & keyword monitors check every second and send signed webhooks. Each costs 30 credits an hour. | | Agent tooling | Local MCP server through npx, with 40 read-only tools. | Remote MCP server with OAuth or API key. | | SDKs | No SDK required. Guides cover Python, Node.js, Go & PHP. | TypeScript, Python, Go, Java, Kotlin, PHP, Ruby & C#, plus a CLI & a Terraform provider. | | Exports | JSON API responses. | CSV, XLSX, JSON & Markdown exports. | ## What to test in Xquik Price a full month of the task. Count the plan fee, empty searches & sparse pages. Xquik needs no plan, and an empty search costs 0. Add writes, monitors & exports if the workflow needs them. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Run the same query in both products. Compare rows, fields, monthly volume & cost. Move the task once the systems that read the data accept Xquik's output. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Monitors API](/api-reference/monitors/create) > > Create account monitors and receive signed webhook events. > [card] [Official Sorsa pricing](https://api.sorsa.io/pricing) > > Verify current prices before making a final decision. # Twitter web viewer to replace Sotwe and TwStalker Source: https://docs.xquik.com/alternatives/sotwe-twstalker Sotwe and TwStalker show tweets with no account, but they block scripts. View Twitter without an account in Xquik's web viewer, its API or tweet alerts. > For the complete documentation index, see [llms.txt](/llms.txt). Sotwe and TwStalker are third-party Twitter web viewers. They show public profiles, tweets and trends with no account. This page shows how each one answers today. It then maps each job to Xquik. ## Sotwe and TwStalker today The Wayback Machine saved Sotwe's home page on November 11, 2026. It calls Sotwe a "Twitter Web Viewer & Trend Analyzer & Downloader". TwStalker's newest saved home page is from April 30, 2026. It calls TwStalker "a free Twitter web viewer" that needs no account. On 2026-11-20, both sites answered scripts with a Cloudflare page and HTTP 403. A feed reader or a script gets that page, not the posts. ## View Twitter without an account The [X (Twitter) Viewer](https://xquik.com/en/twitter-viewer) opens public profiles, posts, threads and replies. It also opens hashtags, keyword searches, lists and communities. You need no X account, and you sign in to Xquik to run it. Paste the username from a Sotwe or TwStalker link, such as `NASA`. Each post row holds its text, media, date, likes, reposts, replies, quotes and views. Export the rows as CSV, Excel, JSON or Markdown. Each result costs 1 credit, or USD 0.00015 with pay-as-you-go credits. Private accounts stay private, since the viewer reads public accounts only. ## Twitter trends and video downloads [X (Twitter) Trends](https://xquik.com/en/twitter-trends) shows a place's trends, now or on a past date. Each trend comes in rank order with a search link. The [X (Twitter) Video Downloader](https://xquik.com/en/twitter-video-downloader) saves a post's video as MP4, MP3 or GIF. Paste the post link and pick a quality up to 1080p. ## Tweet alerts for accounts you follow An Xquik account monitor checks 1 account every second. It sends each new post to Telegram, Discord, Slack or a signed webhook. A keyword monitor does the same for a search, a hashtag or a mention. Each active monitor costs 30 credits per hour, or 720 credits per day. The USD 20 plan includes 140,000 credits a month. That keeps 6 monitors on all month. ## Twitter API calls for Sotwe and TwStalker jobs Scripts that read either site can call the same data from the Xquik API. | Job | Xquik call | | - | - | | A profile's posts | [User tweets](/api-reference/x/user-tweets) | | A search | [Search tweets](/api-reference/x/search-tweets) | | Trends for a place | [Trends](/api-reference/x/trends) | | Photos and videos | [Download media](/api-reference/x/download-media) | | New posts as they go | [Account monitor](/api-reference/monitors/create) with a [webhook](/webhooks/overview) | This call reads the same posts as a Sotwe or TwStalker `NASA` profile. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/NASA/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Each returned tweet costs 1 credit. Continue with `next_cursor` to read the next page. A trends call costs 1 credit. ## Sotwe and TwStalker vs Xquik | Area | Sotwe and TwStalker | Xquik | | - | - | - | | X account | None needed to read. | None needed. You sign in to Xquik or use an Xquik API key. | | Scripts | Both answered scripts with HTTP 403 on 2026-11-20. | A REST API with an API key, plus SDKs. | | Follow | No alerts named on either home page. | Alerts by Telegram, Discord, Slack or signed webhook. | | Output | Web pages. | Pages, CSV, Excel, JSON and Markdown exports, and API JSON. | | Cost | Sotwe sells ad-free browsing. TwStalker calls itself free. | 1 credit per result, and 30 credits per active monitor hour. | > [card] [X (Twitter) Viewer](https://xquik.com/en/twitter-viewer) > > Open a profile, post, hashtag or search with no X account. > [card] [Nitter alternative](/alternatives/nitter) > > Read what nitter.net shows today and move each Nitter job to Xquik. > [card] [Regional trends](/guides/trends) > > Get ranked trends by region, then search the posts behind each one. > [card] [Webhooks overview](/webhooks/overview) > > Send monitor alerts to Discord, Telegram, Slack or your server. # Sprout Social alternative for X (Twitter) monitoring Source: https://docs.xquik.com/alternatives/sprout-social Compare Sprout Social scheduling, Smart Inbox, listening, and analytics with Xquik tweet search, follower exports, account monitors, webhooks, SDKs, and MCP. > For the complete documentation index, see [llms.txt](/llms.txt). This guide covers the X part of social media management workflows. It compares Sprout Social and Xquik. Compare tasks such as planning posts, managing a Smart Inbox, and analyzing reports. Add tweet search, follower exports, and account or keyword monitors. Also add webhooks and app or agent connections. > [!NOTE] > > Verify current Sprout Social pricing, plan limits, and Listening and Premium Analytics add-ons. Also verify Smart Inbox features, analytics exports, and product terms. Check them on the official site before buying. ## Quick answer > [card] Choose Sprout Social when > > You need a cross-channel social media management suite. It must cover publishing, Smart Inbox engagement, approval workflows, and analytics. It must also cover listening, customer care, and team reporting. > [card] Choose Xquik when > > You need the X part in code. Examples are tweet search, follower exports, post tweets, media uploads, and DMs. Other examples are 1-second monitors, signed webhooks, SDKs, and MCP. ## Source-backed Sprout Social scope Sprout Social's features page describes Smart Inbox, Contact Views, and conversation history. Brand Keywords search X by keyword, hashtag, and location. Publishing covers multiple profiles, media, ViralPost timing, approvals, and bulk scheduling. Reporting includes PDF & CSV exports, X competitor reports, and X keyword reports. The page also lists CRM integrations and chatbots. Sprout's official publishing page describes a social media calendar. It also describes Optimal Send Times based on 16 weeks of audience data. Other items are AI caption and alt-text help, approval workflows, and an asset library. The page also lists URL tracking and Campaign Planner workflows. Sprout's analytics pages describe network, cross-network, paid, competitive, and internal reports. Named reports cover tags, post performance, competitors, case teams, and networks. The pricing pages also list Premium Analytics, Listening, Advocacy, Influencer Marketing, and Enterprise options. Sprout's pricing page lists annual billing and a trial without a credit card. Standard costs USD 199 per seat/month with 5 profiles. Professional costs USD 299 with no listed profile cap. Advanced costs USD 399 with the Sprout API and Helpdesk integrations. Enterprise uses custom pricing with onboarding, SSO, and priority support. The page lists analytics, listening, advocacy, services, and influencer add-ons separately. ## Current cost checkpoint Check these prices before comparing Sprout Social with Xquik. | Job | Sprout Social price | Xquik price | | - | - | - | | Manage a few social profiles with inbox work | Standard starts at USD 199 per seat/month with 5 social profiles. | Starter is USD 20/month with 140,000 credits for X tasks and API access. | | Manage many social profiles | Professional starts at USD 299 per seat/month and has no listed social-profile cap. | Xquik bills credits for reads, writes, and active monitors. It does not bill social profile seats. | | Add API or helpdesk integrations | Advanced starts at USD 399 per seat/month and lists the Sprout API plus Helpdesk integrations. | Xquik includes REST authentication, endpoints, SDKs, MCP, exports, and signed webhooks. | | Add deeper reports or listening | Premium Analytics and Listening are add-ons on Standard and up. | Tweet search, follower exports, monitor events, CSV, JSON & XLSX files, and webhook delivery use the Xquik credit model. | | Add advocacy, services, or influencer workflows | Standard and higher plans can add Employee Advocacy and Professional Services. Influencer Marketing requires a sales call. | Xquik covers X only, with tweet and profile records, follower exports, account actions, monitors, webhooks, SDKs, and MCP. | ## Comparison | Area | Sprout Social | Xquik | | - | - | - | | Use when | Marketing, support, and enterprise social teams need one workspace for multi-profile publishing, Smart Inbox engagement, approval workflows, reporting, listening, and customer care. | Teams need tweet search, follower exports, post tweets, media uploads, DMs, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Social media management, publishing, engagement, analytics, listening, advocacy, influencer, and customer-care suite. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Sprout's official pages describe Smart Inbox, Brand Keywords for X, multi-profile publishing, approval workflows, analytics reports, listening, Premium Analytics, Advocacy, Influencer Marketing, Enterprise options, CRM integrations, and chatbots. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | Check seats, social profiles, approval workflow needs, Premium Analytics, Listening, Advocacy, Influencer Marketing, Professional Services, and Enterprise requirements. | Xquik starts at USD 20/month with 140,000 included credits. Many read calls cost 1 credit per result or call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Plan for suite setup, social profiles, inbox routing, approval workflows, report templates, listening topics, add-ons, and an owner for exported data. | Use a dashboard tool first, then call the same X task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | Sprout Social covers cross-channel publishing, Smart Inbox engagement, analytics, listening, customer care, advocacy, and enterprise reporting. | Xquik handles X records, account actions, monitors, API access, signed webhooks, and export files. | | Suite scope | Cross-channel social management, care, listening, analytics, advocacy, and influencer workflows. | Tweet search, follower exports, post actions, media uploads, DMs, monitors, SDKs, MCP, and webhooks. | | Procurement | Per-seat plans with add-ons and an enterprise tier. | Self-serve plans with API access. | | Developer fit | Built for social, support, and reporting teams. | Built for developers and operators. | ## Operating model Compare Sprout Social and Xquik by output, cost, and handoff. Sprout Social covers cross-channel publishing, Smart Inbox engagement, analytics, and listening. It also covers customer care, advocacy, and enterprise reporting. Xquik handles X records, account actions, monitors, API access, signed webhooks, and export files. > [card] Procurement > > Sprout Social sells per-seat plans with add-ons and an enterprise tier. Xquik sells self-serve plans with API access. > [card] Setup & API > > Sprout Social covers social profiles, inbox routing, approval workflows, reports, listening topics, and add-ons. Xquik covers API keys, webhooks, SDKs, exports, and MCP. > [card] Output > > Sprout Social covers reports, inbox work, social listening topics, and customer-care views. Xquik covers tweet JSON, follower CSV & XLSX, monitor events, and webhook payloads. ## What to test in Xquik For social media management comparisons, list the X tasks you need. Test each one. Search tweets, export followers, post tweets, and upload media. Also send DMs, monitor keywords, and deliver signed webhooks. Choose Xquik when the X workflow must produce API responses, files, or signed events. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run one social care or reporting job** Use a real task. Route inbox messages, schedule a campaign post, or search tweets for a product term. Or export followers, upload media, or send a DM. Or monitor an account or deliver a webhook. **2. Inspect the output** Compare ownership, approvals, inbox routing, analytics exports, tweet IDs, and author IDs. Also compare timestamps, post results, CSV, JSON & XLSX exports, webhook signatures, and error handling. **3. Price the handoff** Compare Sprout seats, social profiles, Premium Analytics, Listening, Advocacy, Influencer Marketing, and Enterprise scope. Compare them with Xquik credits, active monitor billing, top-ups, and engineering time. ## Migration path Sprout Social covers publishing, Smart Inbox, approvals, analytics, listening, care, advocacy, and influencer workflows. Keep it for them if your team already works that way. Move one X-only task when it needs tweet results, follower files, or signed webhooks. Move it too when it needs MCP tool results. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Use Xquik for X work that needs tweet search, follower export, or post actions. Use it for X work that needs media uploads, DMs, or tweet monitoring. Use it too when the work needs webhook delivery, SDK calls, or MCP. Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official Sprout Social features](https://sproutsocial.com/features/) > > Verify current publishing, Smart Inbox, reporting, X keyword report, and approval workflow features. > [card] [Official Sprout Social pricing](https://sproutsocial.com/pricing/) > > Verify current plans, add-ons, Premium Analytics, Listening, Advocacy, and Influencer Marketing. > [card] [Sprout Social publishing](https://sproutsocial.com/features/social-media-publishing/) > > Verify current calendar, approval, Optimal Send Times, asset, URL tracking, and campaign planning features. > [card] [Sprout Social analytics](https://sproutsocial.com/features/social-media-analytics/) > > Verify current reports, network coverage, competitor reporting, and Premium Analytics features. # Syften alternative for 1-second X (Twitter) alerts Source: https://docs.xquik.com/alternatives/syften Xquik beats Syften per useful result. Syften bills USD 40 a month for 1,000 X posts, even rejected ones. Xquik bills USD 0.00015 a tweet & checks every second. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over Syften Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. Syften publishes none. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [Syften's documentation](https://syften.com/documentation) sells X (Twitter) monitoring as a USD 40 monthly add-on. It covers 1,000 tweets. AI-rejected posts still count toward that allowance. So each X post costs USD 0.04 there, kept or rejected. On Xquik, a kept tweet costs USD 0.00015. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where Syften fits Syften calls itself an AI-filtered keyword monitoring tool for the public web. X is a paid add-on. Its X (Twitter) alerts can arrive up to 15 minutes late. This guide compares Syften & Xquik on X (Twitter) keyword alerts. It covers alert speed, billing, delivery, writes & agent connections. > [!NOTE] > > Facts on this page come from Syften's official pages, read on 2026-10-15. Verify current pricing & terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. Its X monitors check every second. It adds writes, exports & 8 SDKs. > [card] When Syften may fit > > You mostly watch Reddit & developer forums, with X on the side. ## Source-backed Syften scope * Syften watches Reddit, GitHub, forums, Bluesky, Mastodon & more. * Plans cost USD 29.95, USD 49.95 & USD 119.95 a month. * X (Twitter) monitoring is a USD 40 monthly add-on for Standard & PRO. * The X add-on allows up to 65 filters & 1,000 tweets a month. * Extra tweets cost USD 0.04 each. AI-rejected posts still count toward the allowance. * X (Twitter) alerts arrive with a delay of up to 15 minutes. * Turning on X (Twitter) monitoring requires signing in with an X account. * Alerts go to email, Slack, RSS feeds & the API. Webhooks & MCP need PRO. * The MCP server has 4 tools & cannot publish posts. * Every plan starts with a 14-day free trial & no card. ## Comparison | Area | Syften | Xquik | | - | - | - | | X price | USD 40 a month for 1,000 tweets, on top of a plan. | 1 credit per returned tweet, USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Plan needed | Standard at USD 49.95 or PRO at USD 119.95 a month. | No plan needed. Pay-as-you-go credits work for every call. | | Filtered rows | AI-rejected X posts still count toward the allowance. | Billed only for delivered, unique, filter-matching rows. | | Alert speed | X (Twitter) alerts arrive up to 15 minutes late. | Account & keyword monitors check every second. | | Monitor price | Part of the add-on, within 1,000 tweets a month. | 30 credits an hour, USD 3.24 for 30 days, events & webhooks included. | | Delivery | Email, Slack, RSS & API. Webhooks need PRO. | Signed webhooks or Telegram, plus stored events you can poll. | | Write actions | None listed. Its MCP server cannot publish posts. | 24 write actions from connected accounts. Posting a tweet costs 30 credits. | | Agent tooling | MCP server with 4 tools on PRO. | Remote MCP server with OAuth or API key. | | SDKs | REST API with a bearer token. | TypeScript, Python, Go, Java, Kotlin, PHP, Ruby & C#. Also a CLI & Terraform provider. | | Exports | RSS, Atom & JSON feeds. | CSV, XLSX, JSON & Markdown exports. | ## What to test in Xquik Run your Syften X filters as Xquik keyword monitors for 1 week. Count alerts, delay & cost. Xquik bills only the tweets you keep, & its monitors check every second. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Copy each Syften X filter into an Xquik keyword monitor. Point the monitor at your webhook or Telegram. Keep Syften for Reddit & forums if you still need them. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Keyword monitors API](/api-reference/monitors/create-keyword) > > Create keyword monitors & receive signed webhook events. > [card] [Official Syften pricing](https://syften.com/pricing) > > Verify current prices before making a final decision. # Tweepy alternative with a Python X (Twitter) SDK Source: https://docs.xquik.com/alternatives/tweepy Xquik beats the X API behind Tweepy per result. X (Twitter) lists USD 0.005 per post read. Xquik's Python SDK reads tweets at USD 0.00015 each & adds monitors. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over Tweepy Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. Tweepy publishes none. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. Tweepy is free, but every call it makes bills through the X API. [X's pricing](https://docs.x.com/x-api/getting-started/pricing) lists USD 0.005 per post read & USD 0.010 per user read. Reading 1,000 posts costs USD 5 there & USD 0.15 on Xquik. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where Tweepy fits Tweepy is an open-source Python library for the official X API. It wraps X's v2 & v1.1 endpoints. You bring your own X app credentials & pay X's rates. This guide compares Tweepy on the X API with Xquik's Python SDK. It covers reads, followers, posting, real-time alerts & cost. > [!NOTE] > > Facts on this page come from Tweepy's docs & repository, read on 2026-10-15. X's rates come from its pricing page, read the same day. X says its prices may change. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. 1 API key covers reads, writes, monitors & exports. > [card] When Tweepy may fit > > Your app must call X's official API with its own developer credentials. ## Source-backed Tweepy scope * Tweepy uses the MIT license. Version 4.17.0 shipped on 2026-07-02. * Install it with `pip install tweepy`. * `Client` covers X API v2. `API` covers v1.1. * `StreamingClient` reads X's filtered & sample streams with a bearer token. * Recent search returns 10 to 100 posts per request. Full-archive search allows up to 500. * Follower pages return 1 to 1,000 users. * `wait_on_rate_limit` makes the client wait when X's rate limit hits. * Every call needs your own X bearer token or OAuth 1.0a keys. ## X API rates behind Tweepy * X bills USD 0.005 per post read & USD 0.010 per user read. * Followers & following cost USD 0.010 per user returned. * Creating a post costs USD 0.015. * Pay-per-use plans cap at 3,000,000 post reads a month. * X says its prices may change. ## Comparison | Area | Tweepy on the X API | Xquik | | - | - | - | | Read a post | USD 0.005 per post. | 1 credit, USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Read a profile | USD 0.010 per user. | 1 credit, USD 0.00015 with pay-as-you-go credits. | | Followers | USD 0.010 per follower. | 1 credit per follower, USD 0.00015 with pay-as-you-go credits. | | Post a tweet | USD 0.015 per post. | 30 credits, USD 0.0045 with pay-as-you-go credits. | | Real time | `StreamingClient` on X's filtered stream. | Account & keyword monitors that check every second, with signed webhooks. | | Credentials | Your own X app keys & tokens. | 1 Xquik API key. Writes run from connected accounts. | | Agent tooling | None listed. | Remote MCP server with OAuth or API key. | | SDKs | Python. | TypeScript, Python, Go, Java, Kotlin, PHP, Ruby & C#. Also a CLI & Terraform provider. | | Exports | Python objects or JSON responses. | CSV, XLSX, JSON & Markdown exports. | ## What to test in Xquik Run your Tweepy search in Xquik's Python SDK. Compare rows, fields & cost for 1 week of queries. Xquik bills only the tweets you keep. A recent search in Tweepy looks like this. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import tweepy client = tweepy.Client(bearer_token="YOUR_X_BEARER_TOKEN") response = client.search_recent_tweets(query="xquik", max_results=10) for tweet in response.data or []: print(tweet.id, tweet.text) ``` The same search in Xquik's Python SDK reads `X_TWITTER_SCRAPER_API_KEY`. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from x_twitter_scraper import XTwitterScraper client = XTwitterScraper() page = client.x.tweets.search(q="xquik", limit=10) for tweet in page.tweets: print(tweet.id, tweet.text) ``` The Xquik call needs no X developer app, no X account and no cookies. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Install `x_twitter_scraper` beside Tweepy. Move 1 read job first, then compare rows & cost. Move writes & streams once the receiving code accepts Xquik's output. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Python SDK](/sdks/python) > > Install the SDK, authenticate & search tweets from Python. > [card] [Official Tweepy docs](https://docs.tweepy.org/en/stable/) > > Verify the current Tweepy release before making a final decision. > [card] [Official X API pricing](https://docs.x.com/x-api/getting-started/pricing) > > Verify X's current rates before making a final decision. # Tweet Binder alternative for hashtag analytics Source: https://docs.xquik.com/alternatives/tweet-binder Tweet Binder PRO now opens only by request, on 1 annual plan. Xquik's Hashtag Tracker counts posts, reach and top accounts. Each post read costs 1 credit. > For the complete documentation index, see [llms.txt](/llms.txt). Tweet Binder is an X (Twitter) hashtag analytics tool. Its terms name it Tweet Binder by Audiense. This page shows how Tweet Binder sells access today. It then maps each Tweet Binder job to Xquik. > [!NOTE] > > Check [Tweet Binder](https://www.tweetbinder.com/) for its current plans before you compare. ## Tweet Binder today On 2026-11-20, Tweet Binder's home page offered a free hashtag report. It covers up to 200 posts from the last 7 days. Its pricing link opens a PRO access form. PRO is now by request only, set up by 1 of its agents. It comes as a single annual plan. The old plans are no longer sold. The page says an agent replies within 24 hours. Tweet Binder also sells Twitter walls for events and API access. ## Twitter hashtag analytics in 1 report The [Hashtag Tracker](https://xquik.com/en/twitter-hashtag-tracker) reads any hashtag, keyword or account. Pick the last day, week, month or any time. Then pick how many posts to read. The report counts posts by type. It sums views, likes, reposts, replies, quotes and bookmarks. It ranks accounts 12 ways, such as most posts and most followers. It also lists the top posts, hashtags, mentioned accounts and languages. A timeline counts posts per hour or day. Potential reach adds each author's followers once. Potential impressions add them once for each post. Each post read costs 1 credit. The default 500 post report costs 500 credits, or USD 0.075 with pay-as-you-go credits. You need no X account, only an Xquik sign-in. ## Track a hashtag live A [keyword monitor](/api-reference/monitors/create-keyword) watches a hashtag around the clock. It checks every second and sends each new post where you pick. * A Telegram chat, through @XquikBot. * A Discord channel webhook or a Slack incoming webhook. * Your own HTTPS endpoint, as a signed webhook. Each active monitor costs 30 credits per hour, or 720 credits per day. The USD 20 plan includes 140,000 credits a month. That keeps 6 monitors on all month. ## Tweet Binder jobs and their Xquik tools | Tweet Binder job | Xquik tool | | - | - | | Impact report on a hashtag or keyword | [Hashtag Tracker](https://xquik.com/en/twitter-hashtag-tracker) | | Real time hashtag monitoring | [Keyword monitor](/api-reference/monitors/create-keyword) | | Twitter historical data | [Advanced Search](https://xquik.com/en/twitter-advanced-search) | | Follower evolution | [Follower Tracker](https://xquik.com/en/twitter-follower-tracker) | | Find influencers | [User Search](https://xquik.com/en/twitter-user-search) | | API access to statistical data | [Search tweets](/api-reference/x/search-tweets) | The keyword monitor costs 30 credits per hour. Every other row costs 1 credit per result. This call reads the posts behind a hashtag report. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/search?q=%23AI&sinceDate=2026-11-13" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Each returned post costs 1 credit. Continue with `next_cursor` to read the next page. ## Tweet Binder vs Xquik | Area | Tweet Binder | Xquik | | - | - | - | | Access | PRO by request, set up by an agent. | Sign up yourself and pay per post read. | | Plan | 1 annual PRO plan. | USD 20 a month for 140,000 credits, or pay-as-you-go credits. | | Report size | The free report covers 200 posts from 7 days. | As many posts as you pick, from any period. | | Live tracking | Real time hashtag monitoring. | Keyword monitors check every second. | | Event walls | Twitter walls for events. | Xquik has no event wall. | | Code access | API access and an AI MCP. | A REST API, SDKs and MCP. | ## Move a Tweet Binder report to Xquik **1. Run the report** Open the Hashtag Tracker. Enter the hashtag, pick a period and the posts to read. **2. Read the results** Check the totals, the timeline, the top accounts and the top posts. **3. Keep tracking live** Add a keyword monitor for the hashtag on the [monitors page](https://dashboard.xquik.com/en/monitors). Pick Telegram, Discord, Slack or a webhook. > [card] [Hashtag Tracker](https://xquik.com/en/twitter-hashtag-tracker) > > Count posts and see reach, top accounts and top posts for any hashtag. > [card] [Keyword monitors](/api-reference/monitors/create-keyword) > > Check a hashtag every second and send new posts to a chat or webhook. > [card] [Search tweets](/api-reference/x/search-tweets) > > Read the posts behind a hashtag by date through the API. > [card] [Billing guide](/guides/billing) > > See credit prices for reads, analysis and monitors. # Tweet Hunter alternative for scheduling & analytics Source: https://docs.xquik.com/alternatives/tweet-hunter Compare Tweet Hunter AI writing, scheduling, analytics, Auto-DMs, and creator CRM with Xquik tweet search, follower exports, monitors, webhooks, SDKs, and MCP. > For the complete documentation index, see [llms.txt](/llms.txt). ## Where Tweet Hunter fits Tweet Hunter is a creator tool for AI writing, scheduling, Auto-DMs, analytics, and CRM. Read this comparison when your output stays inside a creator dashboard. This guide compares Tweet Hunter and Xquik on specific X tasks. It covers tweet search, follower exports, and account or keyword monitors. It also covers publishing, webhooks, and app or agent connections. > [!NOTE] > > This guide uses the public Tweet Hunter pricing page as the competitor source. Re-check it before buying because offers, account limits, and Auto-DM limits can change. ## Quick answer > [card] Choose Tweet Hunter when > > You need a creator dashboard for tweet ideas, AI writing, and scheduling. It must also cover X (Twitter) analytics, Auto-DMs, and creator CRM work. > [card] Choose Xquik when > > You need tweet search, follower exports, media uploads, DMs, and 1-second monitors. You also need signed webhooks, SDKs, MCP, and per-call pricing. ## Source-backed Tweet Hunter scope Tweet Hunter's official pricing page describes it as an all-in-one AI X tool. The page says it is for growing an audience and brand on X. The visible offer lists Discover, Grow, and Enterprise plans with a 7-day trial. The visible offer lists Discover at USD 29/month with 1 X account. It includes a 12M+ tweet library, custom inspirations, scheduling, and evergreen tweets. It also includes 3,000 Auto-DMs/month, auto-plug, auto-retweet, and X (Twitter) analytics. The visible offer lists Grow at USD 49/month with 5 X accounts. Grow includes everything in Discover. It adds 7,500 Auto-DMs/month, partnership labels, daily AI-written tweets, and rewrites. It also adds writing help, thread ideas, and X CRM lists. Grow also includes interaction imports and list engagement. The visible offer lists Enterprise at roughly USD 199/month with everything in Grow. It adds 15,000 Auto-DMs/month, ghostwriting, priority support, custom-trained AI, and AI reply generation. Tweet Hunter's official Advanced Options help page covers Auto-DM. It says Auto-DM can send a Direct Message based on likes, replies, or retweets. It also says Auto-DM works for the first 72 hours of a tweet. It says Auto-DM checks new engagements every minute during the first 24 hours. It says Auto-DM has a 500 DMs/tweet cap. The page says Auto-DM also requires transparent wording. That wording tells people they will receive a DM when they interact. ## Comparison | Area | Tweet Hunter | Xquik | | - | - | - | | Use when | Creators need tweet ideas, AI writing, scheduling, analytics, Auto-DMs, and simple X CRM. | Teams need tweet search, follower exports, write actions, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Creator growth tool. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Public pricing lists a 12M+ viral tweet library, custom inspirations, scheduling, evergreen tweets, analytics, Auto-DMs, auto-plug, auto-retweet, AI writer, and CRM features by plan. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | The public pricing page lists Discover at USD 29/month for 1 X account, Grow at USD 49/month for 5 X accounts, and Enterprise around USD 199/month under its displayed offer. Verify the live page before buying because the page presents the offer as limited-time. | Xquik starts at USD 20/month with 140,000 included credits. Many read calls cost 1 credit per result or call. Top-ups cost USD 0.00015/credit. Webhook and stored-event management are free. | | Integration effort | Use it when the output stays inside the creator workflow, such as drafts, schedules, analytics, Auto-DMs, or creator contacts. | Use a dashboard tool first, then move the same task to REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | Tweet Hunter fits content creation and audience growth inside its dashboard. | Xquik fits tweet search, follower exports, media posts, account monitors, alerts, write actions, and API handoff. | | Content support | Tweet ideas, AI-written tweets, rewrites, hooks, scheduling, evergreen tweets, and analytics. | Free compose, refine, and score steps, then metered create-tweet and media-upload actions for connected accounts. | | Monitoring | Analytics, engagement lists, Auto-DM triggers, and creator growth tracking. | Account and keyword monitors check every 1 second and can deliver signed webhooks. | | Developer fit | A creator dashboard. Public pricing lists no API for exports, SDKs, or MCP. | Dashboard, REST API, signed webhooks, SDKs, MCP, and CSV, JSON, XLSX & Markdown exports. | ## Operating model Compare Tweet Hunter and Xquik by output, cost, and handoff. Tweet Hunter produces creator output, such as ideas, writing, scheduling, analytics, Auto-DMs, and CRM. Xquik returns X records, such as tweets, users, followers, media, and DMs. Other examples are monitor events, webhook payloads, exports, SDK calls, and MCP tool calls. > [card] Main job > > Tweet Hunter lets teams create and schedule content. Xquik lets teams search tweets, export followers and replies, and run writes. It also lets them monitor accounts and notify other systems. > [card] Setup & API > > Tweet Hunter covers creator account setup. Xquik covers the API key and a connected X account for writes. It also covers an optional webhook endpoint and SDK or MCP setup. > [card] Output > > Tweet Hunter covers scheduled posts and creator analytics. Xquik covers API responses, exports, stored monitor events, signed webhooks, and agent tools. ## Cost checkpoints | Task | Tweet Hunter pricing unit | Xquik pricing unit | | - | - | - | | Draft and schedule tweets | Subscription plan. The public page shows Discover at USD 29/month and Grow at USD 49/month. | Compose, refine, and score are free. A text-only tweet or reply costs 30 credits. | | Upload media for posts or DMs | Included where the plan lists it. Verify limits on the live page. | Upload media costs 10 credits and returns `mediaUrl` or `mediaId` for the next action. | | Run Auto-DM campaigns | Discover lists 3,000 Auto-DMs/month, Grow lists 7,500 Auto-DMs/month, and Enterprise lists 15,000 Auto-DMs/month. The help page says each Auto-DM tweet works for 72 hours and has a 500 DMs/tweet cap. | Send DM costs 10 credits/call. Use Xquik when the same workflow needs media upload, follower export, webhook delivery, SDK calls, or event storage. | | Search tweets or export followers | Tweet Hunter's public pricing does not list this task. Validate export needs during trial. | Search tweets and follower exports cost 1 credit/result, with CSV, JSON, XLSX, Markdown, API, SDK, and MCP handoff options. | | Monitor accounts or keywords | Analytics and growth tracking in the creator dashboard. | Active monitors cost 30 credits per hour, check every 1 second, and include stored events plus webhook delivery. | | Connect agents and backend jobs | A dashboard workflow. Verify any automation handoff before buying. | REST API, signed webhooks, SDKs, MCP, and CSV, JSON, XLSX & Markdown exports. | ## What to test in Xquik For publishing comparisons, test the steps before and after the post. Find source tweets, upload media, send DMs, and export replies. Also monitor keywords and notify other tools. Choose Xquik when publishing must include tweet, reply, follower, or monitor outputs. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Try a keyword search, follower export, media upload, DM, account monitor, or webhook delivery. Compare outputs, not feature labels. **2. Inspect the output** Confirm draft flow, media handling, scheduling needs, export formats, and API access. Also confirm whether tweet search, follower exports, or monitoring matter after publishing. Then compare seats, included volume, top-ups, and engineering time. **3. Check the next integration** Decide where the result goes next. Pick CSV, JSON, webhook, SDK call, MCP tool, dashboard review, or another API. ## Migration path Start with one task that has a measurable output. Good tests are a 1,000-result tweet search, a follower export, or a media-backed post. A DM send or a keyword monitor that sends signed webhooks also works. Test Xquik for tweet search, follower exports, and automation. Keep the content calendar stable while you do. Switch work that needs replies, profile records, alerts, API calls, or lower per-result cost. Check Tweet Hunter public pricing next to Xquik credits for current totals. Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official Tweet Hunter pricing](https://tweethunter.io/pricing) > > Verify current plans, account limits, Auto-DM limits, and AI features. Do this before making a final decision. # TweetAPI alternative that bills only kept tweets Source: https://docs.xquik.com/alternatives/tweetapi Xquik beats TweetAPI per useful result. TweetAPI bills every call, even empty pages & retries. Xquik bills USD 0.00015 per kept tweet, so empty searches cost 0. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over TweetAPI Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. TweetAPI publishes none. Its own Apify Actor, tweetapi/twitter-x-search-scraper, ran in Xquik's benchmark. It cost USD 0.000374 per useful tweet at 2.6 per second. See its [public run](https://console.apify.com/view/runs/mxkP8EDAUVtCZdobb). Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [TweetAPI's docs](https://www.tweetapi.com/docs/getting-started/overview) charge units per call, not per tweet returned. Empty results, pagination, retries & repeated requests each use units. Pay-as-you-go units cost USD 0.0005 each. A search that keeps 3 tweets costs USD 0.0005 there. On Xquik, it costs USD 0.00045. An empty search costs 0 on Xquik. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where TweetAPI fits TweetAPI calls itself an independent third-party API for developers & researchers. It lists 82 endpoints & sells units by plan or pack. This guide compares TweetAPI & Xquik on specific X tasks. It covers search billing, monitors, writes, SDKs & agent connections. > [!NOTE] > > Facts on this page come from TweetAPI's site & Apify listing, read on 2026-10-15. Verify current pricing & terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. It adds 1-second monitors, signed webhooks, exports & 8 SDKs. > [card] When TweetAPI may fit > > Your app sends X Chat messages through an API. ## Source-backed TweetAPI scope * TweetAPI lists 82 documented endpoints. * Pro costs USD 17 a month for 100,000 units. * Ultra costs USD 57 for 500,000 units. Mega costs USD 197 for 2,000,000. * Pay-as-you-go packs cost USD 5 per 10,000 units, USD 0.0005 each. * Pay-as-you-go units expire after 365 days. * Units are charged per call, not per tweet returned. * Most calls cost 1 unit. An X Chat send costs 10. A login costs 500. * Empty results, pagination, retries & repeated requests each use units. * Rate limits run from 10 to 180 requests a minute. * Writes need account authorization fields beyond the API key. * SDKs cover Python & Node.js. * The hosted MCP server uses OAuth & is read-only. * Its monitoring guide fetches posts when your app sends a request. * Its Apify Actor bills USD 0.00025 per tweet, plus USD 0.001 per run. * New accounts get 100 free units with no card. ## Comparison | Area | TweetAPI | Xquik | | - | - | - | | Billing unit | Units per call, from USD 17 a month or USD 5 per 10,000. | 1 credit per returned tweet, USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Empty search | 1 unit, like any call. | Billed only for returned rows, so 0 rows cost nothing. | | Sparse search | 3 tweets cost 1 call, USD 0.0005 on pay-as-you-go. | 3 tweets cost USD 0.00045. | | Retries | Each retry & repeated request uses units. | Failed requests & retries cost nothing. | | Monitoring | Fetches posts when your app sends a request. | Account & keyword monitors that check every second, with signed webhooks. | | Write actions | Posts, likes, follows & DMs with account authorization. | 24 write actions from connected accounts. Posting a tweet costs 30 credits. | | Agent tooling | Read-only hosted MCP server with OAuth. | Remote MCP server with OAuth or API key. | | SDKs | Python & Node.js. | TypeScript, Python, Go, Java, Kotlin, PHP, Ruby & C#. Also a CLI & Terraform provider. | | Exports | JSON API responses. | CSV, XLSX, JSON & Markdown exports. | | Apify Actor | Not in the October Apify benchmark. | USD 0.000155 per useful tweet, 172.4 per second & 67 fields in the October benchmark. | ## What to test in Xquik Price the whole task with your real queries. Count empty calls, sparse pages, retries & monitors. Xquik bills only the tweets you keep. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Run the same queries in both products. Compare kept tweets, empty calls, fields & cost. Move the task once the systems that read the data accept Xquik's output. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Keyword monitors API](/api-reference/monitors/create-keyword) > > Create keyword monitors & receive signed webhook events. > [card] [Official TweetAPI pricing](https://www.tweetapi.com/pricing) > > Verify current prices before making a final decision. # TweetDeck alternative for tweet monitoring Source: https://docs.xquik.com/alternatives/tweetdeck Compare TweetDeck/X Pro with Xquik for live columns, advanced search, scheduled posts, tweet search, follower exports, monitor tweets, webhooks, API, and MCP. > For the complete documentation index, see [llms.txt](/llms.txt). This guide compares TweetDeck, now X Pro, and Xquik on common X jobs. It covers live columns, X (Twitter) search, composing or scheduling posts, and follower exports. It also covers tweet search, signed webhooks, and handing records to apps and agents. > [!NOTE] > > Before buying, verify current X Pro access rules. Check them in the official [X Pro help page](https://help.x.com/en/using-x/x-pro) and [X Premium page](https://help.x.com/en/using-x/x-premium). ## Quick answer > [card] Choose TweetDeck when > > Your team needs the official X multi-column interface in a browser. It must also have advanced search, post composer, scheduled posts, Decks, and account switching. > [card] Choose Xquik when > > You need tweet search, follower exports, post tweets, or media uploads from one product. Or you need DMs, 1-second monitors, signed webhooks, SDKs, or MCP from it. ## Source-backed TweetDeck/X Pro scope X's official X Pro help describes X Pro as the global replacement for TweetDeck. It has a multi-column workspace that includes more of X.com. The page lists a full post composer, scheduled posts, and advanced search. It also lists top or latest post order and Decks. It lists a column creator with Search X, video docking, and account switching too. The official X Pro usage guide describes X Pro as a browser workspace. The workspace is for viewing multiple timelines in one interface. The guide covers connecting multiple X (Twitter) accounts and creating posts with media. It also covers adding or reordering columns. Column types include home, notifications, search, lists, and communities. Other types are explore, bookmarks, profiles, messages, and scheduled posts. The official X Premium help page describes X Premium as an optional subscription. It has Basic, Premium, and Premium+ tiers, each with a price. The page says Premium features can change. It says new subscriptions require a verified phone number. It also says X shows regional price information on web and in-app. X Pro's official FAQ says teams can delegate account access without sharing sign-in credentials. It also says X Pro does not support scheduled Direct Messages. ## Comparison | Area | TweetDeck | Xquik | | - | - | - | | Use when | Operators want multiple configurable timelines, advanced search, column groups, account switching, and scheduled posts in the official X dashboard. | Teams need tweet search, follower exports, post tweets, media uploads, DMs, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Official X multi-column dashboard, formerly TweetDeck. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | X Pro help lists a full post composer, scheduled posts, advanced search, top or latest post order, Decks, a column creator, video docking, and account switching. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | Verify the required X Premium tier, regional price, account eligibility, and product availability. X says Premium features can change. | Xquik starts at USD 20/month with 140,000 included credits. Many read calls cost 1 credit per result or call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Plan for browser-based columns, saved searches, lists, profile columns, account switching, and manual review. | Use a dashboard tool first, then call the same task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | TweetDeck/X Pro is a live X workspace for columns, search, scheduled posts, and manual monitoring. | Xquik runs automation, exports, monitors, webhooks, and API calls. | | Interface | Browser columns, Decks, advanced search, and post composer. | Tools dashboard plus API calls. | | Data movement | Manual monitoring, saved columns, X account data download, and dashboard review. | Exports, monitors, API responses, and webhook events. | | Automation | Manual work in the X dashboard. | Automated extraction, write actions, and monitoring. | ## Operating model Compare TweetDeck/X Pro and Xquik by output, cost, and handoff. TweetDeck/X Pro is a live X workspace for columns, search, and scheduled posts. It also covers manual monitoring. Xquik runs automation, exports, monitors, webhooks, and API calls. > [card] Interface > > TweetDeck offers browser columns, Decks, advanced search, and a post composer. Xquik offers a tools dashboard and API calls. > [card] Data movement > > TweetDeck covers manual monitoring, saved columns, and dashboard review. Xquik covers exports, monitors, API responses, and webhook events. > [card] Automation > > TweetDeck needs manual work in the X dashboard. Xquik automates extraction, write actions, and monitoring. ## What to test in Xquik For TweetDeck/X Pro comparisons, test the handoff with one API key. Search tweets, fetch users, export followers, and post tweets. Also upload media, send DMs, monitor keywords, and receive a webhook event. Choose Xquik when one API key must handle all 8 tasks. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run one live-monitoring job** Use a real task. Monitor a brand account, search a keyword, export followers, or upload media. Or send a DM, post a tweet, or deliver a webhook. Compare outputs, not feature labels. **2. Inspect the output** Compare columns, saved searches, tweet IDs, author IDs, timestamps, and post results. Also compare export formats, webhook payloads, and the handoff to your production system. **3. Price active monitoring** Compare the X Pro subscription requirement with Xquik credits. Active Xquik monitors cost 30 credits per hour while enabled. Webhook plus stored-event delivery is included. ## Migration path Start with one repeated task. Validate that Xquik can run the data collection, account action, export, or webhook handoff. Do that before moving more dashboard work. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Switch only when the Xquik output matches the required records. It must also reduce integration work or cost. X sets X Pro availability and pricing in its subscription terms. X's public Premium docs list X Pro as a Premium+ feature. They also say features may change. Verify the current tier before your team depends on it. Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official X Pro help](https://help.x.com/en/using-x/x-pro) > > Verify current X Pro features, columns, Decks, composer, search, and account-switching details. > [card] [Official X Premium terms](https://help.x.com/en/using-x/x-premium) > > Verify current subscription tier, regional pricing, and feature availability before making a final decision. # X (Twitter) API Pro alternative, USD 0.00015 a tweet Source: https://docs.xquik.com/alternatives/twitter-api-pro X (Twitter) API Pro is a legacy name. X lists USD 0.005 per post read, Xquik USD 0.00015 per tweet. Compare search, follower exports, monitors, and webhooks. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik bills USD 0.00015 per tweet, profile, or follower with pay-as-you-go credits. X's current pay-per-use API lists USD 0.005 per post read. It also lists USD 0.010 per user read. Its pricing page showed these rates on 2026-10-15. See [Xquik pricing](https://xquik.com/en) for plans and credits. ## Cost per 1,000 tweets | Task | X API pay-per-use | Xquik | | - | - | - | | Read 1,000 tweets | USD 5.00 | USD 0.15 | | Read 1,000 followers | USD 10.00 | USD 0.15 | | Publish 100 text posts | USD 1.50 | USD 0.45 | X's rates come from its pricing page on 2026-10-15. Xquik's rates come from [Xquik pricing](https://xquik.com/en) at USD 0.00015 per credit. Xquik bills only delivered, unique, filter-matching results. So an empty search costs nothing. ## Where X (Twitter) API Pro fits "Twitter API Pro" is a legacy name. This page covers direct official API access, credentials, pagination, and usage billing. Read the [X API page](/alternatives/x-api) for current official pricing. This guide compares X (Twitter) API Pro and Xquik on specific X tasks. It covers tweet search, follower exports, and account or keyword monitors. It also covers publishing, webhooks, and app or agent connections. > [!NOTE] > > "Twitter API Pro" is a legacy comparison term. Verify current X API pricing, access rules, and product terms before buying. Check them on the [official pricing page](https://docs.x.com/x-api/getting-started/pricing). ## Quick answer > [card] Choose Twitter API Pro when > > You already have approved developer access, and platform terms match the project. Your team also wants direct control over endpoint design. > [card] Choose Xquik when > > You want ready endpoints for tweet search, user lookup, followers, and writes. You also want ready exports, monitors, and signed webhooks. You don't want to build exports, retries, and alerts yourself. ## Source-backed X (Twitter) API Pro scope The current official X docs recommend X API v2 for new projects. Treat "Twitter API Pro" as a legacy comparison term. Before buying or migrating, compare the workload against current X API pay-per-use docs. The official X API overview covers API access and v2 highlights. It describes programmatic access for reading posts, publishing content, managing users, and sending DMs. It also covers analyzing metrics and trends, managing lists, and working with Spaces. Its v2 highlights are fields, expansions, annotations, and conversation tracking. Edit history and pay-per-usage pricing are v2 highlights too. The official Getting Access docs describe the setup path. You create a developer account, create an app, and save credentials. They describe Bearer Token access for reading public data. They also describe OAuth user-context access for posting, liking, following, and accessing DMs. The official Search Posts docs list recent search and full-archive search. Recent search at `GET /2/tweets/search/recent` covers the last 7 days. Full-archive search at `GET /2/tweets/search/all` covers the complete archive. Recent search supports up to 100 posts per request. Full-archive search supports up to 500 posts per request for pay-per-use and Enterprise customers. The official pricing docs describe credits purchased upfront. They point to the Developer Console for current rates. X charges reads per resource and writes per request. The docs list Owned Reads at USD 0.001 per resource for eligible app-owned data. They also list 24-hour UTC deduplication for billable resources. The official pagination docs describe the integration loop for large exports. Request `max_results` and read the next-page cursor from response metadata. Send that cursor on the next request, and repeat until no cursor remains. ## Comparison | Area | Twitter API Pro | Xquik | | - | - | - | | Use when | Teams compare higher-tier official API access with hosted X tools. | Teams need tweet search, follower exports, write actions, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Official X API access. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Usually covers one area, such as raw API access, stream delivery, publishing calls, or self-hosted collection code. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | Current X API docs list pay-per-usage pricing. Official docs list post reads at USD 0.005/resource, follower reads at USD 0.010/resource, and content creates at USD 0.015/request. Check the Developer Console for current rates. | Xquik starts at USD 20/month with 140,000 included credits. Tweet search and follower exports cost 1 credit/result. Top-up credits cost USD 0.00015 each. Direct MPP covers 7 operations at USD 0.00015 to USD 0.00075 per call. | | Integration effort | Plan for auth, pagination, retries, storage, exports, alerts, and monitoring. | Use a dashboard tool first, then call the same task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | Twitter API Pro is a legacy name for higher-tier official X API access. | Xquik sells tweet search, profile lookup, follower and reply exports, timelines, account actions, and monitors as plans, dashboard tools, and API calls. | | How you buy | Official developer account and usage credits. | Self-serve SaaS subscription and API keys. | | User experience | You build everything on the API. | Dashboard tools, plus an API and MCP. | | Direct access | Teams that require direct official API access. | Teams that want ready endpoints and portable exports. | ## Operating model Compare X (Twitter) API Pro and Xquik by output, cost, and handoff. X (Twitter) API Pro is a legacy name for higher-tier official X API access. Xquik sells plans, dashboard tools, and API calls for tweet search and profile lookup. They also cover follower and reply exports, timelines, account actions, and monitors. > [card] How you buy > > The X API needs an official developer account and usage credits. Xquik needs a self-serve subscription and an API key. > [card] User experience > > With the X API, you build everything on the API. Xquik gives you dashboard tools, plus an API and MCP. > [card] Direct access > > X (Twitter) API Pro suits teams that require direct official API access. Xquik suits teams that want ready endpoints and portable exports. ## Current cost checkpoint Compare older X (Twitter) API Pro notes against the current pay-per-usage X API model. Price the exact unit you need before estimating migration cost. | Task | Current X API unit to price | Xquik unit to price | | - | - | - | | Search 1,000 posts | Posts read costs USD 0.005 per resource in the official pricing docs. | Search tweets costs 1 credit per tweet. Top-up credits cost USD 0.00015 each. Included subscription credits can lower the effective per-credit rate. | | Export 1,000 followers | Following or follower read costs USD 0.010 per resource in the official pricing docs. | The followers endpoint costs 1 credit per user. Top-up credits cost USD 0.00015 each. Xquik returns CSV, JSON, XLSX, Markdown, and API output. | | Publish 100 posts | Content create costs USD 0.015 per request, or USD 0.200 per request with URL, in the official pricing docs. | A text-only tweet or reply costs 30 credits per call. A separate media upload costs 10 credits per call. | | Monitor accounts | Price stream or polling access, storage, retries, alerting, and webhook delivery. | Active monitors check every 1 second and cost 30 credits per monitor-hour. Stored events and webhook delivery management are included. | Use the X API when you require direct platform access. Use Xquik when you need an export file, webhook, or SDK call. Use it too when you need an MCP tool or dashboard tool. ## What to test in Xquik For API comparisons, price the whole task. Include endpoint access, pagination, retries, storage, exports, alerts, webhooks, SDKs, and maintenance. Choose Xquik when you need all of them from one product. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Try a keyword search, follower export, media upload, DM, account monitor, or webhook delivery. Compare outputs, not feature labels. **2. Inspect the output** Confirm returned data, pagination, retry behavior, webhook payloads, and export formats. Also confirm how much code each call needs. Then compare total cost for the same task. Count access, included volume, top-ups, and engineering time. **3. Check the next integration** Decide where the result goes next. Pick CSV, JSON, webhook, SDK call, MCP tool, dashboard review, or another API. ## Migration path Start with one API-backed task. Keep the current integration running. Meanwhile, compare output shape, latency, pagination, retries, exports, and alert delivery in Xquik. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Switch only when the Xquik output matches the required records. It must also reduce integration work or cost. Verify official X API pricing directly because terms can change without notice. Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. On X API, use the official per-resource and per-request prices in the Developer Console. Then add any engineering time for storage, exports, retries, dashboards, SDKs, and webhooks. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, operations that cost no credits, and active monitor billing. > [card] [Official X API pricing](https://docs.x.com/x-api/getting-started/pricing) > > Verify current X API pay-per-usage rates before making a final decision. # Twitter MCP & X MCP servers compared for AI agents Source: https://docs.xquik.com/alternatives/twitter-mcp-servers Compare Twitter MCP servers for X (Twitter) data. Xquik is a hosted X MCP server that needs no X developer keys. Public reads cost USD 0.00015 per result. > For the complete documentation index, see [llms.txt](/llms.txt). X (Twitter) has several MCP servers. Xquik hosts one at `https://xquik.com/mcp`. X hosts xmcp at `https://api.x.com/mcp` for its own API. Community servers on GitHub wrap the X API with your own keys. This page compares where each runs, the keys it needs & its read price. > [!NOTE] > > Facts about other servers come from each project's official page, read on 2026-11-20. Check each page before you choose. ## Quick answer > [card] [Pick Xquik](/mcp/overview) > > Add 1 URL in Claude, ChatGPT or Cursor, then sign in. You need no X developer app. Public reads cost USD 0.00015 per result. > [card] [When xmcp may fit](https://docs.x.com/tools/mcp) > > You already pay for the X API. You want X's own operations & have an X developer app. ## X (Twitter) MCP servers side by side | Server | Where it runs | Keys you need | Search & post | Price of 1 post read | | - | - | - | - | - | | Xquik | Hosted at `https://xquik.com/mcp` | An Xquik sign-in or API key | Both | USD 0.00015 | | [X's hosted xmcp](https://docs.x.com/tools/mcp) | `https://api.x.com/mcp`, through `xurl` or a Bearer token | Your own X developer app | Reads & Articles, with no post creation listed | USD 0.005, X API pay-per-use | | [xmcp on GitHub](https://github.com/xdevplatform/xmcp) | Your machine, port 8000 | X developer app key, secret & bearer token | Both | USD 0.005, X API pay-per-use | | [x-twitter-mcp-server](https://github.com/rafaljanicki/x-twitter-mcp-server) | Your machine, Docker or Smithery | X API key, secret, access tokens & bearer token | Both | USD 0.005, X API pay-per-use | | [x-mcp-server](https://github.com/DataWhisker/x-mcp-server) | Your machine, Node.js | X OAuth 1.0a keys & access tokens | Both | USD 0.005, or USD 0.00015 for searches through Xquik | | [twitter-mcp](https://github.com/EnesCinr/twitter-mcp) | Your machine, through `npx` | X API keys & access tokens | Both | USD 0.005, X API pay-per-use | X's [pricing page](https://docs.x.com/x-api/getting-started/pricing) lists USD 0.005 per post read & USD 0.015 per created post. The other servers call the X API with your own app's keys. So each read runs on your own X API account at X's prices. The DataWhisker x-mcp-server can also send tweet searches to Xquik. Posting through Xquik needs a connected X account. So do private reads such as DMs & bookmarks. Public reads need none. ## Why Xquik is the Twitter MCP server to pick **It's hosted.** Claude & ChatGPT connect to its public HTTPS URL. X's hosted server needs your own X developer app. Its docs connect through the `xurl` bridge, or a Bearer token for reads. The xmcp README says remote clients of a local copy need a tunnel. **It needs no X developer app.** You sign in to Xquik when your app asks. Reads run on Xquik's infrastructure. **It's the cheapest per read.** 1,000 public tweets cost USD 0.15 through Xquik. The same 1,000 post reads cost USD 5 on X's pay-per-use API. **It bills only what you get.** Xquik bills only delivered, unique, filter-matching results. Empty or failed reads cost nothing. **Its speed & price are public.** Dated speed & price runs against named rivals are on the [benchmark page](https://xquik.com/en/benchmarks). > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Add the Xquik MCP server | App | URL | | - | - | | Claude | `https://xquik.com/mcp?app=claude` | | ChatGPT | `https://xquik.com/mcp?app=chatgpt` | | Cursor & other MCP clients | `https://xquik.com/mcp` | Add the URL to your app, then sign in when it asks. The [MCP overview](/mcp/overview) covers sign-in & tool modes. [Coding agents](/mcp/coding-agents) covers Claude Code, Codex, Cursor & Zed. ## Questions about X MCP servers ### Is there an MCP server for X (Twitter)? Yes. Xquik hosts a remote X MCP server at `https://xquik.com/mcp`. X hosts xmcp for its own API. GitHub lists more community servers. ### What is the best Twitter MCP server for Claude? Xquik fits Claude best of the servers on this page. Add `https://xquik.com/mcp?app=claude` as a custom connector & sign in. Claude can then search tweets & read replies, profiles & followers. It posts from a connected X account. The other servers need your own X developer keys. ### Which X MCP server can search tweets and post? Xquik, xmcp on GitHub, x-twitter-mcp-server, x-mcp-server & twitter-mcp all search & post. Of these, only Xquik runs hosted with no X developer keys. X's hosted xmcp lists reads & Article publishing, with no post creation listed. ### Do I need an X developer account for an X MCP server? You need one for xmcp & every community server on this page. They call the X API with your app's keys. Xquik needs none. You connect an X account only to post or to read private data. ### How much does an X (Twitter) MCP server cost? The servers on GitHub are free to download. The X API reads behind them aren't. X lists USD 0.005 per post read. Xquik charges USD 0.00015 per public result, so 1,000 tweets cost USD 0.15. ### Does X have an official MCP server? Yes. X hosts xmcp at `https://api.x.com/mcp`, & it needs your own X developer app. [X's MCP docs](https://docs.x.com/tools/mcp) connect through the `xurl` bridge, or a Bearer token for reads. The [xmcp code on GitHub](https://github.com/xdevplatform/xmcp) runs on your machine. It turns about 119 X API operations into tools. ## Next steps > [card] [MCP server overview](/mcp/overview) > > Install URLs, sign-in & what each read costs. > [card] [MCP tools](/mcp/tools) > > Every tool the Xquik MCP server exposes. > [card] [Official X API vs Xquik](/alternatives/x-api) > > Compare Xquik with X's own API on price & reads. > [card] [Official X API pricing](https://docs.x.com/x-api/getting-started/pricing) > > Verify X's current prices before you decide. # TwitterAPI.io alternative that bills no empty calls Source: https://docs.xquik.com/alternatives/twitterapi-io Xquik beats TwitterAPI.io per useful result. Both list USD 0.00015 per tweet, but TwitterAPI.io bills every call, even empty ones. Xquik adds SDKs & remote MCP. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over TwitterAPI.io Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xquik publishes reproducible benchmarks with run IDs. TwitterAPI.io publishes none. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [TwitterAPI.io's pricing](https://twitterapi.io/pricing) charges at least USD 0.00015 per call. The minimum also applies when a call returns no data. Both list USD 0.00015 per tweet, so empty & sparse calls decide the bill. An empty search costs 0 on Xquik. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where TwitterAPI.io fits TwitterAPI.io calls itself a public social data API for developers & AI agents. Its pay-as-you-go tweet price matches Xquik's at USD 0.00015 per tweet. The 2 differ on empty results, subscriptions, writes, streams & agent tooling. This guide compares TwitterAPI.io and Xquik on specific X tasks. It covers tweet search, follower exports, monitors, publishing, webhooks & agent connections. > [!NOTE] > > Facts on this page come from TwitterAPI.io's official pages, read on 2026-11-05. Verify current pricing and terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. It also adds file exports, SDKs in 8 languages, 1-second monitors & remote MCP. ## Source-backed TwitterAPI.io scope * Tweets cost 15 credits each, which is USD 0.00015 per returned tweet. USD 1 buys 100,000 credits. * Every call costs at least 15 credits, USD 0.00015, even with no data. * A profile costs USD 0.00018, alone or in batches under 100. Batches of 100 or more cost USD 0.00001 each. * Followers & followings cost USD 0.03 per 1,000 at 1 to 99 per call. At 100 to 199 they cost USD 0.02 per 1,000. At 200 they cost USD 0.01. * Follower IDs cost USD 0.02 per 1,000 at 50 to 199 per call. At 200 to 3,999 they cost USD 0.01 per 1,000. At 4,000 to 5,000 they cost USD 0.0045. * Since October 2026, posting, liking, following & other v2 writes cost USD 0.0006 per call. * Logging in an X account costs USD 0.10. Article content costs USD 0.001 per call. * The account stream starts at USD 29 a month for 6 accounts. It falls to USD 1 per account at 500. Median delivery is under 500 ms. * Keyword filter rules push tweets by webhook or WebSocket, at USD 0.00015 per tweet. * Requests use 1 `x-api-key` header. Its MCP server has 12 read-only tools, hosted or run locally. * Never-paid accounts get 0.2 requests per second. Paid accounts get 20, Scale 50 & Business 500. * New accounts get USD 1 in free credits, valid for 31 days. Paid credits never expire. * The Business plan buys 1.9 times the credits per dollar while subscribed. ## Comparison | Area | TwitterAPI.io | Xquik | | - | - | - | | Tweet price | USD 0.00015 per tweet, & at least USD 0.00015 per call. | 1 credit per tweet, USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Empty search | At least USD 0.00015 per call, also when 0 tweets return. | Billed only for returned rows, so 0 rows cost nothing. | | Profile lookup | USD 0.00018 each below 100 per call. USD 0.00001 each at 100 or more. | 1 credit per profile, USD 0.00015 with pay-as-you-go credits. | | Post a tweet | USD 0.0006 per call. | 30 credits, USD 0.0045 with pay-as-you-go credits. | | Like, follow & other writes | USD 0.0006 per call. | 10 credits, USD 0.0015 with pay-as-you-go credits. | | Read an X article | USD 0.001 per call. | 5 credits, USD 0.00075 with pay-as-you-go credits. | | Monitoring | Account stream from USD 29 a month for 6. Keyword filter rules bill per tweet. | Account & keyword monitors that check every second, at 30 credits an hour each. | | Agent tooling | Hosted or local MCP server with 12 read-only tools. | Remote MCP server with OAuth or API key, plus REST, SDKs & signed webhooks. | | Exports | JSON API responses. | CSV, XLSX, JSON & Markdown exports. | ## What to test in Xquik Price the whole task. Count empty & sparse calls, write steps, exports & monitors. Xquik never bills a search that returns nothing. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Run the same query in both products. Compare rows, empty pages, fields & cost. Move the task once the systems that read the data accept Xquik's output. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Search tweets API](/api-reference/x/search-tweets) > > Query parameters, filters, cursors, and response fields. > [card] [Official TwitterAPI.io pricing](https://twitterapi.io/pricing) > > Verify current prices before making a final decision. # twscrape alternative for tweet scraping by API Source: https://docs.xquik.com/alternatives/twscrape Compare twscrape with Xquik for tweet scraping, follower exports, replies, profiles, timelines, monitors, signed webhooks, REST APIs, and MCP. Includes pricing. > For the complete documentation index, see [llms.txt](/llms.txt). This guide compares twscrape and Xquik on specific X tasks. It covers tweet search, follower exports, and account or keyword monitors. It also covers publishing, webhooks, and app or agent connections. > [!NOTE] > > Verify the current twscrape license, features, and limits before you build on it. Check them in the official repository. ## Quick answer > [card] Choose twscrape when > > You want a Python library or CLI. You can supply authorized X/Twitter accounts. You can also maintain sessions, rate limits, storage, and exports yourself. > [card] Choose Xquik when > > You need tweet search, follower exports, or write actions from one product. Or you need 1-second monitors, signed webhooks, SDKs, or MCP from that product. ## Source-backed twscrape scope twscrape's official GitHub README describes it as a Twitter GraphQL API implementation. Per the README, it uses SNScrape data models. Installation uses `pip install twscrape`, and development installs can point at the GitHub repository. The README lists search, async/await functions, and a login flow with email verification. It also lists raw X (Twitter) API responses and SNScrape models. The README says twscrape requires authorized X/Twitter accounts to work with the API. It documents adding accounts with cookies or login credentials. It also documents login and relogin CLI commands and account status inspection. The README also covers account database selection and optional manual email verification. The usage examples cover search tabs for Top, Latest, and Media. They cover tweet details, retweeters, tweet replies, and user lookup by login or ID. Others cover following, followers, verified followers, subscriptions, user tweets, user replies, and user media. More examples show list timelines, trends, and raw responses. They also show converting Tweet and User models to dict or JSON. The CLI docs cover search, tweet details, replies, retweeters, and user lookup. They cover user media, following, followers, verified followers, subscriptions, user timelines, and trends. They also cover one-document-per-line stdout output, raw output, desired `limit`, and per-endpoint pagination behavior. The README limitations say request limits reset every 15 minutes per endpoint. They add that each account has separate limits by operation. They also say `user_tweets` and `user_tweets_and_replies` can return about 3,200 tweets maximum. They also note that rate limits may vary by account age and status. ## Scrape Twitter in Python with no X account twscrape runs on X accounts you add with cookies or passwords. Xquik runs each request on Xquik's infrastructure. You add no X account and no cookies. So no account of yours can get banned. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from x_twitter_scraper import XTwitterScraper client = XTwitterScraper() page = client.x.tweets.search(q="xquik", limit=10) for tweet in page.tweets: print(tweet.id, tweet.text) ``` The SDK reads `X_TWITTER_SCRAPER_API_KEY`. Each returned tweet costs 1 credit. ## Comparison | Area | twscrape | Xquik | | - | - | - | | Use when | Developers want to maintain their own scraping code. | Teams need tweet search, follower exports, write actions, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Open-source library. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | twscrape README covers search, tweet, user, list & trend calls with raw or SNScrape-shaped responses, using X accounts you add. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | The package is open source and free to install. You supply authorized accounts and handle sessions, rate limits, output files, and job runs. | Xquik starts at USD 20/month with 140,000 included credits. Many read calls cost 1 credit per result or call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Plan for Python setup, adding your own X accounts, CLI output, pagination behavior, retries, storage, exports, alerts, and monitoring. | Use a dashboard tool first, then call the same task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | twscrape is an open-source library. Developers use it to build and maintain their own X (Twitter) data pipeline. | Xquik gives teams hosted API keys, exports, monitoring, support, and billing. | | Hosting | A library you host and maintain. | Hosted product with dashboard and API. | | Operational work | You handle retries, storage, exports, and uptime. | Xquik handles exports, uptime, and support. | | Ownership fit | Teams that want full code ownership. | Teams that want hosted endpoints without building them first. | ## Operating model Compare twscrape and Xquik by output, cost, and handoff. The twscrape project is an open-source library. It targets developers who build and maintain their own X (Twitter) data pipeline. Xquik gives teams hosted API keys, exports, monitoring, support, and billing. > [card] Hosting > > twscrape requires a self-hosted library and ongoing maintenance. Xquik provides a hosted API and dashboard. > [card] Operational work > > With twscrape, teams handle retries, storage, exports, and uptime. Xquik handles exports, uptime, and support. > [card] Ownership fit > > Choose twscrape for full code ownership. Choose Xquik for hosted endpoints without building them first. ## What to test in Xquik For API comparisons, price the whole task. Include endpoint access, pagination, retries, storage, exports, alerts, webhooks, SDKs, and maintenance. Choose Xquik when you need all of them from one product. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Try a keyword search, follower export, media upload, DM, account monitor, or webhook delivery. Compare outputs, not feature labels. **2. Inspect the output** Confirm returned data, pagination, retry behavior, webhook payloads, and export formats. Also confirm how much code each call needs. Then compare total cost for the same task. Count access, included volume, top-ups, and engineering time. **3. Check the next integration** Decide where the result goes next. Pick CSV, JSON, webhook, SDK call, MCP tool, dashboard review, or another API. ## Migration path Start with one API-backed task. Compare output shape, latency, pagination, retries, exports, and alert delivery in Xquik. Keep the current integration running during that comparison. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Switch only when the Xquik output matches the required records. It must also reduce integration work or cost. twscrape is free to use. You still run, maintain, and monitor it. Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official twscrape site](https://github.com/vladkens/twscrape) > > Verify current product details before making a final decision. # Typefully alternative for X (Twitter) threads by API Source: https://docs.xquik.com/alternatives/typefully Typefully pricing runs from a free plan to USD 18 a month per social set. Compare it with Xquik for thread posts, tweet search, follower exports & webhooks. > For the complete documentation index, see [llms.txt](/llms.txt). This guide compares Typefully and Xquik for a creator publishing workflow. Compare tasks such as writing X (Twitter) threads, scheduling posts, and cross-posting content. Other tasks are using AI writing help and inspecting analytics. Add tweet search, follower exports, and account or keyword monitors. Also add webhooks and app or agent connections. > [!NOTE] > > Before buying, check Typefully's official site. Verify current pricing, API access, MCP access, and supported platforms there. Also verify analytics, cross-posting, Auto-DM, and product terms. ## Quick answer > [card] Choose Typefully when > > You mainly need a creator workspace for drafting X (Twitter) threads and scheduling posts. It must also handle cross-posting to social platforms, collaborating on drafts, and reviewing analytics. > [card] Choose Xquik when > > You need the X part in code. Examples are tweet search, follower exports, post tweets, media uploads, and DMs. Other examples are 1-second monitors, signed webhooks, SDKs, and MCP. ## Source-backed Typefully scope Typefully's official X scheduling page describes AI writing help and a content calendar. It also describes X post and thread scheduling, natural-language scheduling, and predefined time slots. It supports cross-posting to LinkedIn, Threads, Bluesky, and other platforms. It also covers X (Twitter) analytics, multiple accounts, team collaboration, polls, and media. It covers long posts, realistic previews, auto-plugs, and automatic thread splitting too. Typefully's REST API creates, edits, schedules, publishes, and deletes drafts. It posts to X, LinkedIn, Threads, Bluesky, and Mastodon. Media uploads accept images, videos, GIFs, and PDFs. The API supports tags, social sets, draft comments, and webhooks. Webhooks cover created, published, scheduled, status-changed, tag-changed, and deleted drafts. Its MCP actions cover drafts, queues, published posts, media, tags, and connected accounts. Typefully's help pages describe saved slots and suggested X posting times. They also describe Natural Posting Times with up to 4 minutes of variation. They also cover calendar views, drag-and-drop changes, tags, and minimum gaps. X (Twitter) analytics include impressions, engagements, engagement rate, profile conversion rate, and CSV exports. Auto-DM can trigger on replies, retweets, or follows. The published limits allow 3 campaigns, 30 DMs/minute, and 100 DMs/hour. They also allow 500 DMs/day and 4 days per campaign. ## Typefully pricing [Typefully's pricing page](https://typefully.com/pricing), read on 2026-11-04, lists 3 plans. | Plan | Price | Posts a month | Limits | | - | - | - | - | | Free | USD 0 | 10 | 1 social set, 1 user, API & MCP access | | Creator | USD 99 a year, billed yearly only | 1,000 | 1 social set, 1 user, X (Twitter) analytics & AI writing | | Business | USD 18 a month per social set, billed yearly | 1,500 | Up to 50 social sets, unlimited users, higher API limits | Xquik has no posting plan. Each post costs credits from the same balance as tweet search and follower exports. ## Comparison | Area | Typefully | Xquik | | - | - | - | | Use when | Creator teams need one workspace for AI writing help, thread scheduling, cross-posting, draft review, and analytics. | Teams need tweet search, follower exports, post tweets, media uploads, DMs, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Creator publishing, X (Twitter) thread scheduling, social scheduling, analytics, API, and MCP platform. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Typefully's pages describe AI writing, X (Twitter) thread scheduling, content calendars, and saved slots. They list suggested times, cross-posting, X (Twitter) analytics, Auto-DMs, draft comments, and social sets. They add media uploads, a REST API, webhooks, MCP, and agent skills. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | Check plan limits for drafts, connected accounts, team collaboration, analytics, API access, MCP access, Auto-DMs, and cross-posting. | Xquik starts at USD 20/month with 140,000 included credits. Tweet search and follower exports cost 1 credit/result. Common X write calls cost 10 credits/call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Plan for Typefully social sets, draft IDs, media uploads, tags, draft comments, published-post webhooks, and AI assistant or MCP setup. | Use a dashboard tool first, then call the same X task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | Typefully helps creators write, schedule, cross-post, review, and measure social posts. | Xquik handles X records, account actions, monitors, API access, signed webhooks, and export files. | | Primary use | Creator publishing workspace for X (Twitter) threads and cross-posted content. | X platform for publishing, data, monitoring, exports, and API access. | | Developer tools | Typefully REST API, draft webhooks, and Typefully MCP for content workflows. | REST API, webhooks, dashboard tools, SDKs, and MCP server for X workflows. | | Data export | Content operations, queue, drafts, published posts, analytics, and webhook events. | CSV, JSON, XLSX, Markdown, webhook events, SDK responses, MCP results, and API responses. | ## Operating model Compare Typefully and Xquik by output, cost, and handoff. Typefully helps creators write, schedule, cross-post, review, and measure social posts. Xquik handles X records, account actions, monitors, API access, signed webhooks, and export files. > [card] Primary use > > Typefully covers X (Twitter) thread writing, queue scheduling, cross-posting, draft review, and analytics. Xquik covers tweet, profile, follower, and reply data plus account actions through an API. > [card] Setup & API > > Typefully covers social sets, drafts, media uploads, tags, draft comments, webhooks, and MCP. Xquik covers API keys, webhooks, SDKs, exports, and MCP. > [card] Output > > Typefully covers scheduled posts, draft workflows, analytics, published-post webhooks, and MCP content actions. Xquik covers tweet JSON, follower CSV & XLSX, monitor events, and webhook payloads. ## What to test in Xquik For creator publishing comparisons, test the steps before and after the post. Search source tweets, post tweets, upload media, and send DMs. Also export replies, monitor keywords, deliver signed webhooks, and pass records to other tools. Choose Xquik when publishing must include API records, export files, or monitor events. Choose it too when publishing must include signed webhooks. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Schedule an X (Twitter) thread, cross-post it, or create a draft through an API. Or upload media, search tweets for a campaign term, or export followers. Or send a DM, monitor an account, or deliver a webhook. **2. Inspect the output** Compare draft IDs, social sets, media IDs, queue state, and analytics fields. Also compare tweet IDs, author IDs, timestamps, post results, and CSV, JSON & XLSX exports. Compare webhook signatures and error handling too. **3. Price the handoff** List Typefully connected accounts, collaboration, analytics, API access, MCP access, Auto-DMs, and cross-posting. Compare that list with Xquik credits, active monitor billing, top-ups, and engineering time. ## Migration path Typefully covers writing, X (Twitter) thread scheduling, cross-posting, draft comments, analytics, Auto-DMs, and automation. If your team already works that way, keep it for those tasks. Move one X-only task when its output must become API data or files. Do the same when its output must become signed webhooks or MCP tool results. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Use Xquik for X work that needs tweet search, follower export, or post actions. It also fits media uploads, DMs, tweet monitoring, webhook delivery, SDK calls, or MCP. Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official Typefully X scheduling](https://typefully.com/x-twitter) > > Verify current X scheduling, AI writing, cross-posting, analytics, media, and thread features. > [card] [Official Typefully API](https://support.typefully.com/en/articles/8718287-typefully-api) > > Verify current REST API, draft, media upload, social set, comment, and webhook support. > [card] [Official Typefully MCP](https://support.typefully.com/en/articles/13128440-typefully-mcp-server) > > Verify current MCP, AI assistant, queue, draft, media upload, tag, and connected-account support. > [card] [Typefully scheduling help](https://support.typefully.com/en/articles/9210135-scheduling-and-calendar) > > Verify current schedule slots, suggested times, calendar, tag filters, and queue behavior. > [card] [Typefully analytics help](https://support.typefully.com/en/articles/8718148-analytics-page-metrics) > > Verify current X (Twitter) analytics metrics, refresh timing, and CSV export behavior. > [card] [Typefully Auto-DM help](https://support.typefully.com/en/articles/8718257-auto-dm-campaigns) > > Verify current Auto-DM triggers, limits, duration, and delivery statuses. # X (Twitter) API cost per post vs Xquik credits Source: https://docs.xquik.com/alternatives/x-api X API costs USD 0.005 per post read and USD 0.015 per post created. Xquik reads a tweet for USD 0.00015. Price a month of your workload in the calculator below. > For the complete documentation index, see [llms.txt](/llms.txt). This page compares the official X (Twitter) API with Xquik. Xquik bills USD 0.00015 per tweet, profile, or follower with pay-as-you-go credits. X's pricing page lists USD 0.005 per post read. It also lists USD 0.010 per user read and USD 0.015 per post created. That page showed these rates on 2026-10-15. Xquik charges only for delivered, unique, filter-matching results. See [X (Twitter) API pricing](/guides/billing) for Xquik plans and credits. See the [X (Twitter) API alternatives comparison](/twitter-api-alternatives) for more rivals ranked by price. Use this guide to compare real X tasks. Search tweets, export followers and replies, and retrieve profiles and timelines. Post tweets, send direct messages, and monitor accounts or keywords. Send webhooks and connect apps or agents. > [!NOTE] > > Verify current X API pricing, access rules, and product terms before buying. Check them on the [official pricing page](https://docs.x.com/x-api/getting-started/pricing). ## X (Twitter) API cost checkpoint X now prices the X API per use. Price the exact unit you need before building. The table below lists the billed unit for common X tasks. Official X API pricing also lists Owned Reads at USD 0.001 per resource. This rate applies when a developer app accesses its own data. That covers its posts, bookmarks, followers, likes, lists, and similar owned data. Price Owned Reads separately from general post reads, follower reads, writes, DMs, and monitoring. | Task | X API unit to price | Xquik unit to price | | - | - | - | | Search 1,000 posts | Posts read costs USD 0.005 per resource in the official pricing docs. | Search tweets costs 1 credit per tweet. Top-up credits cost USD 0.00015 each. Included subscription credits can lower the effective per-credit rate. | | Export 1,000 followers | Following or follower read costs USD 0.010 per resource in the official pricing docs. | The followers endpoint costs 1 credit per user. Top-up credits cost USD 0.00015 each. Xquik returns CSV, JSON, XLSX, Markdown, and API output. | | Publish 100 posts | Content create costs USD 0.015 per request, or USD 0.200 per request with URL, in the official pricing docs. | A text-only tweet or reply costs 30 credits per call. A separate media upload costs 10 credits per call. | | Monitor accounts | Price stream or polling access, storage, retries, alerting, and webhook delivery. | Active monitors check every 1 second and cost 30 credits per monitor-hour. Stored events and webhook delivery management are included. | | Work with your own account data | Owned Reads cost USD 0.001 per resource for eligible owned-data endpoints in the official pricing docs. | Use Xquik account, extraction, and export endpoints when the result must move to CSV, JSON, XLSX, webhook, SDK, MCP, or dashboard review. | ## X (Twitter) API cost calculator Multiply each daily count by 30, then by its rate. [X's pricing docs](https://docs.x.com/x-api/getting-started/pricing), read on 2026-11-04, list USD 0.005 per post read. They list USD 0.015 per post created, or USD 0.200 with a URL. Xquik bills 1 credit per tweet read and 30 credits per text post. Top-up credits cost USD 0.00015 each. | Daily workload | X API a month | Xquik a month | | - | - | - | | 1,000 post reads | USD 150 | USD 4.50 | | 10,000 post reads and 100 posts | USD 1,545 | USD 58.50 | | 100,000 post reads | USD 15,000 | USD 450 | | 100 text posts | USD 45 | USD 13.50 | The Xquik column uses top-up rates. Plan credits cost less per credit. Posts with a URL cost USD 0.200 each on X. A feed full of links costs more there. Use the official X API when you require direct platform access. Use Xquik when you need an export file, webhook, or SDK call. Use it too when you need an MCP tool or dashboard tool. ## Quick answer > [card] Choose X API when > > You already have approved developer access, and platform terms match the project. Your team also wants direct control over endpoint design. > [card] Choose Xquik when > > You want ready endpoints for tweet search, user lookup, followers, and writes. You also want ready exports, monitors, and signed webhooks. You don't want to build exports, retries, and alerts yourself. ## Is Xquik better than X API v2 for scraping? Not for every project. Choose X API v2 when you require direct platform access. Choose Xquik for ready tweet search, follower exports, and reply exports. It also adds pagination, files, monitors, webhooks, SDKs, and MCP. Compare the same task in both products. Measure returned fields, cursor behavior, retries, and export formats. Also measure delivery options and total cost to run. ## Source-backed X API scope X's official overview describes the X API as programmatic access to public conversation. Capabilities include reading posts, publishing content, managing users, and analyzing metrics and trends. They also include sending DMs, managing lists, and working with Spaces. The same overview recommends X API v2 for new projects. The official OAuth 2.0 overview covers app and user auth. It describes Bearer Token authentication tied to the developer App for reading public information. It also describes OAuth 2.0 Authorization Code Flow with PKCE for user-context access. Use that distinction when comparing tweet search with account actions. Account actions include posting, follows, DMs, and list management. The official Search Posts docs list `GET /2/tweets/search/recent` for last-7-day search. They list `GET /2/tweets/search/all` for full-archive search. All developers can use recent search, which returns up to 100 posts per request. Pay-per-use and Enterprise customers can use full-archive search. It returns up to 500 posts per request. The official Follows docs cover follower lookup and follow management. They list `GET /2/users/:id/followers`, `GET /2/users/:id/following`, `POST /2/users/:id/following`, and `DELETE /2/users/:source_user_id/following/:target_user_id`. The official pagination docs describe the standard loop. Request `max_results` and read the next-page cursor from `meta`. Send it on the following request, and repeat until the API returns no cursor. Use this when estimating engineering work for search, timeline, follower, and following exports. The official pricing docs describe credit-based pay-per-usage with per-resource reads and per-request writes. They also list Owned Reads at USD 0.001 per resource for eligible app-owned data. They list 24-hour UTC deduplication for billable resources. They cover Developer Console usage tracking, auto-recharge, and spending limits too. ## Official X API migration map Use this map to move one API-backed workflow at a time. Keep the old call live. Ship the matching Xquik call behind a feature flag. Then compare the record shape, pagination cursor, export path, and output owner before switching. > [card] Auth & base URL > > Official X API calls use `https://api.x.com/2` plus Bearer or OAuth > user-context auth. Xquik REST calls use `https://xquik.com/api/v1` plus > the `x-api-key` header. > [card] Search posts > > Replace `GET /2/tweets/search/recent` or `GET /2/tweets/search/all` with > `GET /api/v1/x/tweets/search?q={query}`. Keep supported X (Twitter) search operators > in `q`, then resume with `cursor`. > [card] Tweet lookup > > Replace `GET /2/tweets/:id` with `GET /api/v1/x/tweets/{id}`. Replace > `GET /2/tweets?ids=...` with `GET /api/v1/x/tweets?ids=...` for a batch. > A batch takes as many tweet IDs as the URL holds. > [card] User lookup > > Replace `GET /2/users/:id` and `GET /2/users/by/username/:username` with > `GET /api/v1/x/users/{id}`. Xquik accepts a username or numeric user ID. > Replace `GET /2/users?ids=...` with `GET /api/v1/x/users/batch?ids=...`. > [card] Timelines & mentions > > Replace user timeline and mention timeline calls with > `GET /api/v1/x/users/{id}/tweets` and > `GET /api/v1/x/users/{id}/mentions`. > [card] Followers & following > > Replace follower and following list reads with > `GET /api/v1/x/users/{id}/followers` and > `GET /api/v1/x/users/{id}/following`. > [card] Engagement rows > > Use `GET /api/v1/x/tweets/{id}/quotes`, > `GET /api/v1/x/tweets/{id}/retweeters`, > `GET /api/v1/x/tweets/{id}/favoriters`, and > `GET /api/v1/x/tweets/{id}/replies` for quote, repost, like, or reply > analysis. > [card] Pagination & exports > > Official X (Twitter) API pagination reads `meta.next_token` and sends it back as > `pagination_token`. Xquik list and search pages return `next_cursor` and > accept it as `cursor`. For CSV, JSON, XLSX, Markdown, PDF, or TXT files, > create an extraction job. Then call `GET /api/v1/extractions/{id}/export` > for those files. ## Migration checkpoint Store a small checkpoint per replaced workflow. It lets another engineer verify the endpoint pair and resume from the last page. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "migration": "official_x_api_to_xquik", "old_endpoint": "GET /2/users/:id/followers", "new_endpoint": "GET /api/v1/x/users/{id}/followers", "cursor_map": { "old_response": "meta.next_token", "old_request": "pagination_token", "new_response": "next_cursor", "new_request": "cursor" }, "handoff": { "export_path": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=csv", "owner": "crm-import-worker" } } ``` ## Comparison | Area | X API | Xquik | | - | - | - | | Use when | Teams have approved developer access and need to build directly on official X endpoints. | Teams need tweet search, follower exports, write actions, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Official API. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Usually covers one area, such as raw API access, stream delivery, publishing calls, or self-hosted collection code. | Tweet and profile reads, exports, X (Twitter) actions, monitors, webhooks, SDKs, MCP, and pay-per-use. | | Pricing & value | Pay-per-usage. Official docs list post reads at USD 0.005/resource, follower reads at USD 0.010/resource, and content creates at USD 0.015/request. Check the Developer Console for current rates. | Xquik starts at USD 20/month with 140,000 included credits. Tweet search and follower exports cost 1 credit/result. Top-up credits cost USD 0.00015 each. Direct MPP covers 7 operations at USD 0.00015 to USD 0.00075 per call. | | Integration effort | Plan for auth, pagination, retries, storage, exports, alerts, and monitoring. | Use a dashboard tool first, then call the same task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | The official X API gives approved developers direct platform access. | Xquik provides a ready dashboard, REST API, webhooks, exports, and MCP for common tasks. These include tweet search, user lookup, follower export, monitors, writes, and webhooks. | | Access model | Direct platform developer access. | API keys plus ready dashboard tools. | | Setup | Developer account, app setup, and platform approval flow. | Xquik account, API key, and ready-made tools. | | Scope | Raw API. | Tools, exports, signed webhooks, MCP, and monitors. | ## Operating model Compare X API and Xquik by output, cost, and handoff. The official X API gives approved developers direct platform access. Xquik provides a ready dashboard, REST API, webhooks, exports, and MCP for common tasks. These include tweet search, user lookup, follower export, monitors, writes, and webhooks. > [card] Access model > > The X API gives direct platform developer access. Xquik gives API keys plus ready dashboard tools. > [card] Setup > > The X API needs a developer account, app setup, and platform approval. Xquik needs an account and an API key. > [card] Scope > > X API provides raw platform access. Xquik adds tools, exports, signed webhooks, MCP, and monitors. ## What to test in Xquik For API comparisons, price the whole task. Include endpoint access, pagination, retries, storage, exports, alerts, webhooks, SDKs, and maintenance. Choose Xquik when you need all of them from one product. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Try a keyword search, follower export, media upload, DM, account monitor, or webhook delivery. Compare outputs, not feature labels. **2. Inspect the output** Confirm returned data, pagination, retry behavior, webhook payloads, and export formats. Also confirm how much code each call needs. Then compare total cost for the same task. Count access, included volume, top-ups, and engineering time. **3. Check the next integration** Decide where the result goes next. Pick CSV, JSON, webhook, SDK call, MCP tool, dashboard review, or another API. ## Migration path Start with one API-backed task. Keep the current integration running. Meanwhile, compare output shape, latency, pagination, retries, exports, and alert delivery in Xquik. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Switch only when the Xquik output matches the required records. It must also reduce integration work or cost. A coding agent can do the move with the [X API alternative Skill](https://github.com/Xquik-dev/x-api). It maps official X API v2 calls to Xquik endpoints. It names any call without one. It writes the client with API key auth, cursor pagination, and retries. The client also checks webhook signatures. It states the cost before a loop or a monitor runs. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npx skills add Xquik-dev/x-api ``` Price the real workload. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. On X API, use the official per-resource and per-request prices in the Developer Console. Then add any engineering time for storage, exports, retries, dashboards, SDKs, and webhooks. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, operations that cost no credits, and active monitor billing. > [card] [Official X API pricing](https://docs.x.com/x-api/getting-started/pricing) > > Verify current X API pay-per-usage rates before making a final decision. # Xanguard alternatives for crypto X (Twitter) alerts Source: https://docs.xquik.com/alternatives/xanguard Xanguard alternatives for crypto X (Twitter) alerts, led by Xquik. Get 1-second keyword & account monitors, signed webhooks, tweet search & follower exports. > For the complete documentation index, see [llms.txt](/llms.txt). This guide compares Xanguard and Xquik on specific X tasks. It covers tweet search, follower exports, and account or keyword monitors. It also covers publishing, webhooks, and app or agent connections. > [!NOTE] > > Before buying, check Xanguard's [official site](https://xanguard.tech/). Verify current pricing, tracked-account limits, delivery channels, and product terms there. ## Quick answer > [card] Choose Xanguard when > > Your team needs crypto-focused tweet alerts, Telegram delivery, or WebSocket events for watched accounts. Or the team needs follow alerts, profile change alerts, or community monitoring for them. > [card] Choose Xquik when > > You need tweet search, follower exports, media uploads, or DMs from one product. Or you need write actions, 1-second monitors, signed webhooks, SDKs, or MCP from it. ## Source-backed Xanguard scope Xanguard's official home page advertises sub-second Twitter/X alerts for crypto. It lists delivery through Telegram, REST API, and HMAC-signed webhooks. It also lists WebSocket streaming on B2B plans. The home page lists 14 REST API endpoints and 4 delivery channels. It also lists HMAC-SHA256 webhook signatures, 8 products, and a free tier. It lists plans from USD 19/month paid in SOL. Xanguard's public workflow describes adding accounts and detecting new tweets. It also describes applying keyword filters, mute rules, and reply and repost exclusions. It covers contract detection and alert delivery too. Alerts go through Telegram, webhooks, REST clients, or B2B WebSocket. The official B2B page describes 4 real-time modules in one connection. They cover tweets, follows, profile changes, and community monitoring. The page says tweet events include replies, quotes, and retweets. They include full untruncated text, media URLs, quoted tweet content, and contract address extraction. B2B setup starts with Telegram bot or REST API target creation. Next comes a WebSocket connection at `wss://api.xanguard.tech/v1/dt/realtime/ws`. That connection uses API-key login through an opcode protocol. B2B pricing lists RT 25 at USD 49/month for 25 tracked accounts. It lists RT 100 at USD 149/month for 100 tracked accounts. It also lists RT 500 at USD 499/month for 500 tracked accounts. Enterprise has custom pricing above 500 accounts. The B2B plan cards include RT 25, RT 100, and RT 500. Each of those cards lists WebSocket, REST API, webhook delivery, and Telegram delivery. Each also lists all 4 real-time modules. RT 100 adds priority support. The page also says you pay with SOL or Telegram Stars. Per the page, Xanguard activates the plan after confirming payment. ## Comparison | Area | Xanguard | Xquik | | - | - | - | | Use when | Crypto teams need sub-second tweet alerts, contract detection, community activity, or WebSocket events for trading bots. | Teams need tweet search, follower exports, media uploads, DMs, write actions, 1-second monitors, signed webhooks, SDKs, and MCP together. | | Product type | Crypto monitoring API. | Platform for tweet search, follower exports, account actions, monitors, webhooks & files. | | Coverage | Tweet alerts, community watch, convergence tracking, trending alerts, REST API, Telegram, WebSocket on B2B plans, and HMAC-SHA256 signed webhooks. B2B includes tweets, follows, profile changes, and community activity in one WebSocket. | Tweet and profile reads, exports, X actions, monitors, webhooks, SDKs, MCP, and pay-per-use reads. | | Pricing & value | Xanguard says consumer plans start at USD 19/month paid in SOL. B2B plans list RT 25 at USD 49/month, RT 100 at USD 149/month, RT 500 at USD 499/month, and custom pricing above 500 accounts. | Xquik starts at USD 20/month with 140,000 included credits. Tweet search and follower exports cost 1 credit/result. A text-only post costs 30 credits, and other X write calls cost 10 credits/call. Top-ups cost USD 0.00015/credit, and webhook plus stored-event management is free. | | Integration effort | Use Telegram setup, Bearer-auth REST calls, HMAC webhooks, or a persistent WebSocket with a login opcode on B2B plans. | Use a dashboard tool first, then call the same X task through REST, webhook, SDK, export, or MCP when it needs automation. | | Summary | Xanguard sends crypto alerts for watched Twitter and X accounts. | Xquik fits teams that need more X coverage, such as REST endpoints, extractions, follower data, account actions, monitors, webhooks, SDKs, MCP, and dashboard tools. | | Primary use case | Crypto-focused X alerts and monitoring. | Tweet, follower, reply, and profile data, posting, monitors, and exports. | | Delivery model | Real-time alerting and monitoring channels. | Dashboard tools, REST API, exports, and signed webhooks. | | Audience | Trading teams watching fast crypto signals. | Builders and operators automating many X tasks. | ## Operating model Compare Xanguard and Xquik by output, cost, and handoff. Xanguard sends fast Twitter and X alerts to crypto watchlists and trading systems. Xquik fits teams that need more X coverage. Examples are REST endpoints, extractions, follower data, account actions, and monitors. Other examples are webhooks, SDKs, MCP, and dashboard tools. > [card] Primary use case > > Xanguard covers crypto-focused X alerts and monitoring. Xquik covers tweet, follower, reply, and profile data, posting, monitors, and exports. > [card] Delivery model > > Xanguard covers real-time alerting and monitoring channels. Xquik covers dashboard tools, REST API, exports, and signed webhooks. > [card] Audience > > Xanguard suits trading teams watching fast crypto signals. Xquik suits builders and operators automating many X tasks. ## Current cost checkpoint Use Xanguard when the job is crypto alert delivery for tracked accounts. Use Xquik when the same project also needs searchable tweet and profile records. Use it too when that project needs follower exports, monitor events, or webhooks. Use it too when that project needs write actions, SDKs, MCP, or dashboard review. | Task | Xanguard unit to price | Xquik unit to price | | - | - | - | | Track 25 accounts for trading alerts | B2B RT 25 lists 25 tracked accounts at USD 49/month, with tweets, follows, profile changes, community activity, WebSocket, REST API, webhooks, and Telegram. | 25 active monitors use 750 credits/hour. At top-up pricing, 24/7 monitoring for 30 days is about USD 81.00 before included monthly credits. | | Track 100 accounts | B2B RT 100 lists 100 tracked accounts at USD 149/month with all 4 B2B modules and priority support. | 100 active monitors use 3,000 credits/hour. Use Xquik when the same account list also needs stored events, REST reads, exports, webhooks, SDKs, or MCP. | | Search old tweets or export followers | Xanguard covers live alerts for watched accounts. | Search tweets and follower exports cost 1 credit/result, with CSV, JSON, XLSX, Markdown, API, SDK, and MCP handoff options. | | Publish, upload media, or send DMs | Xanguard does not list this task. | A text-only post costs 30 credits. Uploading media and other X write calls cost 10 credits/call. | Choose Xanguard for crypto alert speed and watched-account WebSocket feeds. Choose Xquik when the same X account or keyword work must produce data exports. Choose it too when that work must produce dashboards, signed webhooks, or API calls. The same goes for SDK jobs, MCP tools, or connected-account actions. ## What to test in Xquik For API comparisons, price the whole task. Include endpoint access, pagination, retries, storage, exports, alerts, webhooks, SDKs, and maintenance. Choose Xquik when you need all of them from one product. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## What to verify in a trial **1. Run the real task** Use a real task. Try a keyword search, follower export, media upload, DM, account monitor, or webhook delivery. Compare outputs, not feature labels. **2. Inspect the output** Confirm returned data, pagination, retry behavior, webhook payloads, and export formats. Also confirm how much code each call needs. Then compare total cost for the same task. Count access, included volume, top-ups, and engineering time. **3. Check the next integration** Decide where the result goes next. Pick CSV, JSON, webhook, SDK call, MCP tool, dashboard review, or another API. ## Other Xanguard alternatives The [X (Twitter) API alternatives comparison](/twitter-api-alternatives) lists more alert & monitoring tools. Compare [Syften](/alternatives/syften), [TweetDeck](/alternatives/tweetdeck) & [Sorsa](/alternatives/sorsa) too. ## Migration path Start with one API-backed task. Keep the current integration running. Meanwhile, compare output shape, latency, pagination, retries, exports, and alert delivery in Xquik. Keep the test small. Use 1 task, 1 output, 1 cost model, and 1 owner for the output. Switch only when the Xquik output matches the required X records. It must also reduce integration work or cost. Compare Xanguard and Xquik by alert latency, tracked-account limits, and delivery channels. Also compare REST endpoint count, export needs, write actions, and agent handoff. Price the real workload. On Xanguard, price watched accounts, required modules, delivery channel, and SOL payment flow. On Xquik, Starter is USD 20/month with 140,000 credits. Top-ups are USD 0.00015/credit. Webhook and stored-event management cost no credits. Active monitors bill only while enabled. > [card] [Xquik API overview](/api-reference/overview) > > Review REST API authentication, endpoint groups, and response patterns. > [card] [Integration guide](/guides/workflows) > > Map dashboard tools to REST calls, signed webhooks, exports, and MCP tools. > [card] [Pricing & billing](/guides/billing) > > Check included credits, top-ups, free operations, and active monitor billing. > [card] [Official Xanguard site](https://xanguard.tech/) > > Verify current consumer alert products, REST API endpoints, delivery channels, and payment options. > [card] [Official Xanguard B2B pricing](https://xanguard.tech/b2b/) > > Verify current tracked-account limits, modules, and delivery channels before making a final decision. # Xpoz alternative for X writes, monitors & webhooks Source: https://docs.xquik.com/alternatives/xpoz Xquik beats Xpoz per useful result on X. Xpoz bills credits per search & per page, whatever returns. Xquik bills USD 0.00015 per row & adds writes & monitors. > For the complete documentation index, see [llms.txt](/llms.txt). ## Why Xquik wins over Xpoz Xquik is the fastest X (Twitter) data service, & the cheapest per useful result. Public Apify benchmarks ran on 2026-10-15. Xquik's X Tweet Scraper delivered 172.4 useful tweets per second, the fastest. It cost USD 0.000155 per useful tweet, the lowest of 5 Actors. Every run is public on the [benchmark page](https://xquik.com/en/benchmarks#benchmark-x-tweet-scraper). Xpoz publishes price comparisons, but no reproducible benchmark runs. Xquik publishes every benchmark run with its run ID. Xquik bills only delivered, unique, filter-matching results. Empty pages, failed requests, retries, duplicates & filtered rows cost nothing. [Xpoz's pricing](https://www.xpoz.ai/pricing) bills 2 credits per X (Twitter) search & bills each later page too. At the Pro extra-credit rate, a search costs USD 0.006, even with 3 results. Those 3 results cost USD 0.00045 on Xquik. That makes Xquik the cheapest per useful result. Xquik also covers more of X in 1 product. It offers 23 extraction tools, 24 write actions & 1-second monitors with signed webhooks. Agents connect through a remote MCP server, & developers use SDKs in 8 languages. ## Where Xpoz fits Xpoz calls itself the social data API for AI agents. It covers Twitter/X, Instagram, TikTok & Reddit. It bills credits per search, not per result. This guide compares Xpoz and Xquik on specific X tasks. It covers tweet search, tracking, writes, webhooks, exports & agent connections. > [!NOTE] > > Facts on this page come from Xpoz's official pages, read on 2026-10-15. Verify current pricing and terms on the official site before buying. ## Quick answer > [card] Pick Xquik > > Xquik is faster & cheaper per useful result. It also adds X writes, 1-second monitors, signed webhooks & XLSX exports. > [card] When Xpoz may fit > > You also need Instagram, TikTok or Reddit in the same API. ## Source-backed Xpoz scope * A Twitter/X search costs 2 credits. It returns up to 300 results at no extra charge. * Each tool call bills, including later pages of a paged result. * Free gives 500 one-time credits. Pro costs USD 20 a month for 7,500 credits. * Max costs USD 200 a month for 120,000 credits. * Extra credits cost USD 0.003 each on Pro and USD 0.002 on Max. A search then costs USD 0.006 or USD 0.004. * Tracked keywords & users make later searches more complete and fresher. Free has 1 slot, Pro 3 & Max 10. * The hosted MCP server has 48 tools, 13 of them for Twitter/X. Every tool is read-only, except tracking tools. * SDKs cover TypeScript & Python, plus a CLI. CSV exports reach 500K rows, metered against a row allowance. * Authentication uses an access key, Google sign-in or a bearer token. ## Comparison | Area | Xpoz | Xquik | | - | - | - | | Billing unit | 2 credits per Twitter/X search, up to 300 results. | 1 credit per returned row, USD 0.00015 with pay-as-you-go credits. Plans cost up to 20% less. | | Searches | 2 credits per search, plus each later page, whatever returns. | USD 0.00015 per row with pay-as-you-go credits. | | Empty search | 2 credits, however many results return. | Billed only for returned rows, so 0 rows cost nothing. | | Write actions | MCP tools are read-only. | 24 write actions from connected accounts. Posting a tweet costs 30 credits. | | Monitoring | Tracked keywords & users refresh data for later searches. | Account & keyword monitors check every second and send signed webhooks. Each costs 30 credits an hour. | | Agent tooling | Hosted MCP server with 48 tools, using OAuth or a bearer key. | Remote MCP server with OAuth or API key. | | SDKs | TypeScript & Python, plus a CLI. | TypeScript, Python, Go, Java, Kotlin, PHP, Ruby & C#, plus a CLI & a Terraform provider. | | Exports | CSV up to 500K rows, metered by a row allowance. | CSV, XLSX, JSON & Markdown exports. | ## What to test in Xquik Count the searches & pages each job runs. Xpoz bills every search & page, & Xquik bills only the rows you keep. Small & empty searches show the gap fastest. > [card] Tweets, followers & exports > > 23 extraction tools cover tweets, replies, quotes, reposts, and likes. They also cover followers, following, verified followers, communities, lists, Spaces, articles, and search. Export results to CSV, JSON, XLSX, Markdown, or API responses. > [card] Automation & writes > > 18 X write actions run from connected accounts. They cover tweets, media uploads, likes, retweets, follows, DMs, profile updates, and community actions. > [card] Monitoring & delivery > > Account and keyword monitors check active streams every 1 second. Store events, poll them, or deliver them through signed webhooks. > [card] Developer tools > > Choose REST, an SDK, MCP, or pay-per-use reads. Credit records show each request's cost. ## Migration path Run the same X query in both products. Compare results per search, fields, freshness & cost. Move the task once the systems that read the data accept Xquik's output. > [card] [Xquik pricing](https://xquik.com/en) > > Plans, top-ups and credits. > [card] [Search tweets API](/api-reference/x/search-tweets) > > Query parameters, filters, cursors, and response fields. > [card] [Official Xpoz pricing](https://www.xpoz.ai/pricing) > > Verify current prices before making a final decision. # Account details & subscription, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/account/get Retrieve an Xquik account's subscription state, API credits, monitor usage, and billing. It also returns top-up settings and the connected X (Twitter) username. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/account` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/account \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/account", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const account = await response.json(); process.stdout.write(`${JSON.stringify(account, null, 2)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/account", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) account = response.json() print(account) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "log" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/account", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(string(body)) } ``` ## Run an API account preflight Call `GET /account` before a long tweet search, follower export, scheduled write, or monitor rollout. The response separates subscription access, available credits, and active monitor cost. It also separates automatic top-up settings and the linked X (Twitter) username. | Preflight question | Response field | Integration decision | | - | - | - | | Is the subscription active? | `plan` | Report subscription state. Check `creditInfo.balance` before metered work. | | How many credits remain? | `creditInfo.balance` | Compare the Bigint string with the estimated tweet, follower, or extraction cost. | | How many monitors are active? | `monitorsUsed` | Reconcile account and keyword monitors before enabling another one. | | What is the current hourly monitor charge? | `monitorBilling.activeHourlyBurn` | Include active monitors in the hourly credit budget. | | What is the estimated daily monitor charge? | `monitorBilling.activeDailyEstimate` | Add the estimate to your daily credit forecast. | | Is automatic top-up enabled? | `creditInfo.autoTopupEnabled` | Confirm the account can buy credits without a manual checkout. | | Which X identity is linked? | `xUsername` | Compare the username with the intended tweet, reply, or follower workflow. | Use `plan` to report subscription state. Do not use it to decide whether credits remain. Funded pay-as-you-go requests can continue while `plan` is `inactive`. Treat missing `creditInfo` as no recorded balance, not numeric zero. Do not use `monitorsAllowed` as a capacity limit. The field is deprecated and always reports the maximum safe integer. Use `monitorsUsed` and the monitor billing fields for cost checks. ## Store an account billing snapshot Store a timestamped account snapshot before a worker starts billable work. Never convert credit strings to an unsafe JavaScript number. | Stored value | Source | Use | | - | - | - | | Subscription state | `plan` | Explain why a job started or stopped. | | Credit balance | `creditInfo.balance` | Reconcile credits before and after tweet, follower, write, or extraction work. | | Purchased credits | `creditInfo.lifetimePurchased` | Compare account funding with cumulative usage. | | Used credits | `creditInfo.lifetimeUsed` | Track total credits the account has used. | | Active monitors | `monitorsUsed` | Match the snapshot against your account and keyword monitor lists. | | Hourly monitor charge | `monitorBilling.activeHourlyBurn` | Detect an unexpected monitor-cost increase. | | Daily monitor estimate | `monitorBilling.activeDailyEstimate` | Forecast the next 24 hours of active monitor usage. | | Automatic top-up state | `creditInfo.autoTopupEnabled` | Send low-balance alerts to a person or let automatic top-up handle them. | | Linked X username | `xUsername` | Confirm which X account write actions will use. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Generate one from the [API Keys page](https://dashboard.xquik.com/en/api-keys). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `plan` | `string` | Subscription status. `"active"` or `"inactive"`. | | `subscription` | `object` | Subscription state, without billing provider IDs. | | `subscription.status` | `string` | `none`, `active`, `past_due`, `canceling` or `incomplete`. | | `subscription.tier` | `string` | `starter`, `pro` or `business`. Omitted without a subscription. | | `subscription.currentPeriodStart` | `string` | Start of the current billing period, ISO 8601. | | `subscription.currentPeriodEnd` | `string` | Renewal date, or the end date when canceling. ISO 8601. | | `monitorsAllowed` | `number` | Deprecated. Monitor slots are unlimited, so this is always `9007199254740991`. | | `monitorsUsed` | `number` | Number of active account monitors and keyword monitors. | | `monitorBilling` | `object` | Active monitor billing details. | | `monitorBilling.activeDailyEstimate` | `string` | Estimated daily credits for active monitors. | | `monitorBilling.activeHourlyBurn` | `string` | Credits charged each hour for active monitors. | | `monitorBilling.creditsPerActiveMonitorDay` | `string` | Daily credit estimate for 1 active monitor. | | `monitorBilling.creditsPerActiveMonitorHour` | `string` | Hourly credits charged for 1 active monitor. | | `monitorBilling.eventsIncluded` | `boolean` | Whether monitor billing includes webhook and event deliveries. | | `monitorBilling.instantCheckIntervalSeconds` | `number` | Active monitor check interval in seconds. | | `monitorBilling.unlimitedSlots` | `boolean` | Whether monitor slot count is unlimited. | | `creditInfo` | `object` | Credit balance details. Omitted if no credit balance row exists yet. | | `creditInfo.balance` | `string` | Current credit balance (Bigint string to preserve precision above Number.MAX_SAFE_INTEGER). | | `creditInfo.lifetimePurchased` | `string` | Total credits purchased across all time (Bigint string). | | `creditInfo.lifetimeUsed` | `string` | Total credits consumed across all time (Bigint string). | | `creditInfo.autoTopupEnabled` | `boolean` | Whether automatic credit top-up is enabled. | | `creditInfo.autoTopupStopped` | `boolean` | Whether declined charges stopped automatic top-up while it is enabled. It stops after 3 declines in a row on one card. A paid top-up or a paid plan renewal clears it. So does the next automatic top-up on a new card. | | `creditInfo.autoTopupAmountDollars` | `number` | Dollar amount charged when automatic top-up runs. | | `creditInfo.autoTopupThreshold` | `string` | Credit balance threshold that triggers automatic top-up when enabled (Bigint string). | | `xUsername` | `string` | Linked X (Twitter) username. Omitted when no X account is connected. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "plan": "active", "subscription": { "status": "active", "tier": "pro", "currentPeriodStart": "2026-09-01T00:00:00.000Z", "currentPeriodEnd": "2026-10-01T00:00:00.000Z" }, "monitorsAllowed": 9007199254740991, "monitorsUsed": 3, "monitorBilling": { "activeDailyEstimate": "2160", "activeHourlyBurn": "90", "creditsPerActiveMonitorDay": "720", "creditsPerActiveMonitorHour": "30", "eventsIncluded": true, "instantCheckIntervalSeconds": 1, "unlimitedSlots": true }, "creditInfo": { "balance": "50000", "lifetimePurchased": "140000", "lifetimeUsed": "90000", "autoTopupEnabled": false, "autoTopupStopped": false, "autoTopupAmountDollars": 10, "autoTopupThreshold": "50000" }, "xUsername": "elonmusk" } ``` ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. ## Credit balance Every subscriber gets a monthly credit allowance. Metered reads bill per result or call. Writes bill per action. Active monitors bill 30 credits per hour. `monitorsUsed`, `monitorBilling.activeHourlyBurn`, and `monitorBilling.activeDailyEstimate` include active account monitors and active keyword monitors. The daily estimate is 24 hours of the hourly burn. At 0 credits, metered calls return `402`. > [!NOTE] > > **Related.** [Authentication](/api-reference/authentication) · [Billing & Usage](/guides/billing) ## Response examples * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Subscription checkout page, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/account/subscription-checkout Create a confirmed Xquik API subscription checkout, or get the dashboard billing page. Route new, active & payment-issue accounts without charging the account. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/subscribe` **Free.** This endpoint does not consume credits. > [!NOTE] > > Returns a checkout URL for new subscribers. An existing subscriber gets the > dashboard billing page. The user signs in there to manage billing. An API key > never opens a billing portal session. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/subscribe \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/subscribe", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const data = await response.json(); // Redirect user to data.url ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/subscribe", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) data = response.json() # Redirect user to data["url"] ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" ) func main() { req, err := http.NewRequest("POST", "https://xquik.com/api/v1/subscribe", nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Create an X API subscription checkout Call `POST /subscribe` after an authenticated user confirms a billing action. The request creates a hosted URL. It never completes payment automatically. Use this route for 3 account states. | Account state | Response status | Returned destination | | - | - | - | | No active subscription | `checkout_created` | Hosted subscription checkout | | Active or trialing subscription | `already_subscribed` | Dashboard billing page, after sign-in | | Past-due or incomplete subscription | `payment_issue` | Dashboard billing page, to fix the payment | Always route by `status`. Do not infer the destination from the URL hostname. Use only the URL returned by the current response. This endpoint does not quote current X (Twitter) API pricing or X API pricing. Review the [live Xquik pricing](https://xquik.com/en) before checkout. The home page lists the current tiers and credits. ## Choose a subscription tier Send `tier` only when the user selected a specific Xquik plan. | Tier value | Checkout behavior | | - | - | | `starter` | Pre-select Starter. | | `pro` | Pre-select Pro. | | `business` | Pre-select Business. | | Omitted | Let the user choose on the hosted checkout. | The field pre-selects a tier. It does not activate that tier by itself. Send only the documented enum values. ## Pay in the user's currency Send `currency` to charge in the user's currency. The default is `USD`. Xquik accepts `USD`, `EUR`, `GBP`, `TRY`, `JPY`, `CNY`, `KRW`, `CAD`, `AUD`, and `MXN`. Lowercase codes work too. An unknown code returns `400`. Xquik converts the USD plan price at the latest daily ECB rate. Each renewal charges the same amount before tax. An account that already pays in USD gets a USD checkout. With rates over 3 ECB working days old, the checkout charges USD. Read `chargedCurrency` to see the currency the checkout charges. ## Complete a safe billing handoff 1. Show the current plan and credit terms before confirmation. 2. Call this endpoint once for the confirmed action. 3. Check the HTTP status before reading `url`. 4. Send the user to the returned hosted URL. 5. Keep the billing URL out of logs and analytics. 6. Recheck [`GET /account`](/api-reference/account/get) after the user returns. Read `plan` to confirm subscription state. Read `creditInfo.balance` before tweet search, follower exports, writes, or monitor work. Subscriptions are not the only funding path. A funded pay-as-you-go account can continue eligible work while `plan` is `inactive`. ## Handle checkout retries The service can reuse a matching open checkout. Use the latest returned URL. A different tier or currency can replace an older open checkout. Do not call this endpoint from a timer or an automatic retry loop. For `429`, wait for `Retry-After`. For `401`, replace the credential first. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `tier` | `string` | No | Pre-select `starter`, `pro`, or `business`. Omit the body when the user should choose on the hosted checkout. | | `currency` | `string` | No | Currency to pay in, such as `EUR`. Lowercase codes work too. Default `USD`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `url` | `string` | Checkout URL for new subscribers, or the dashboard billing page for existing subscribers. Send the user to this URL. | | `message` | `string` | Human-readable message describing the action taken. | | `status` | `string` | The status is `already_subscribed`, `checkout_created`, or `payment_issue`. | | `chargedCurrency` | `string` | Currency the checkout charges. Only a `checkout_created` answer has it. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "chargedCurrency": "EUR", "url": "https://xquik.com/billing/checkout/session", "message": "Complete checkout at the URL below to start your subscription.", "status": "checkout_created" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "currency must be 1 of USD, EUR, GBP, TRY, JPY, CNY, KRW, CAD, AUD, MXN" }` Send a listed currency code, or omit `currency` to pay in USD. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Get Account](/api-reference/account/get) to check current subscription status and usage. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Update account locale, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/account/update Set the Xquik dashboard locale to English, Turkish, or Spanish. Send a locale code, receive a success confirmation, and handle validation or rate-limit errors. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/account` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/account \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "locale": "tr" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/account", { method: "PATCH", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ locale: "tr" }), }); const data = await response.json(); console.log(data); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.patch( "https://xquik.com/api/v1/account", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={"locale": "tr"}, ) data = response.json() print(data) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]string{ "locale": "tr", }) req, err := http.NewRequest("PATCH", "https://xquik.com/api/v1/account", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Change the Xquik dashboard language Send one locale code to change the language of supported Xquik screens. The account locale controls dashboard labels, notices, and supported messages. It does not translate tweets, replies, profiles, or media from X. | Dashboard language | `locale` value | Example body | | - | - | - | | English | `en` | `{ "locale": "en" }` | | Turkish | `tr` | `{ "locale": "tr" }` | | Spanish | `es` | `{ "locale": "es" }` | Send exactly one supported value. Locale codes are lowercase and case-sensitive. Values such as `EN`, `en-US`, or `de` fail validation. > [!WARNING] > > This endpoint changes only the Xquik account locale. It leaves connected X > accounts and profile settings unchanged. It does not alter tweet language or > X API content. ## Confirm an account locale update A successful request returns `{ "success": true }`. This response confirms the accepted update. It does not echo the locale or return an account object. Keep the locale from your request when the client needs an audit record. [Get Account](/api-reference/account/get) reports subscription, credits, monitor billing, and the connected X (Twitter) username. It does not return the saved locale. | Client check | Expected result | Next action | | - | - | - | | HTTP status is `200` | The API accepted the locale update | Store the requested locale when needed. | | `success` is `true` | The response matches the success contract | Continue without parsing an account object. | | Response is `400` | Locale is missing or unsupported | Send `en`, `tr`, or `es`. | | Response is `401` | Authentication failed | Replace the missing or invalid credential. | | Response is `429` | The request exceeded the rate limit | Wait for `Retry-After`, then retry once. | ## Handle locale validation errors Validate the code before sending the request. Do not retry a `400` response with the same body. Correct the locale first. For `401`, provide a valid API key or bearer token. Browser sessions may use the supported session cookie. Never place credentials in query parameters. For `429`, pause the locale update. Read the `Retry-After` header and retry after that interval. Do not run parallel retries for one account setting. ### How do I change Xquik to Turkish or Spanish? Send `{ "locale": "tr" }` for Turkish. Send `{ "locale": "es" }` for Spanish. Use `{ "locale": "en" }` to return to English. ### Does this change the language of tweets or replies? No. Xquik stores the account interface preference. Tweet text, reply text, profile bios, timelines, and media remain unchanged. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `locale` | `string` | Yes | Locale preference for the account. Must be one of `en`, `tr`, or `es`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `success` | `boolean` | Always `true` on successful update. | | `ignoredFields` | `string[]` | Fields the request sent that this route does not read, in the order sent. They changed nothing. Omitted when the request sent only `locale`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": true } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Set locale to en, es, or tr." }` The `locale` field is missing or unsupported. Send `en`, `tr`, or `es`. ### 401 Unauthenticated Missing or invalid API key. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Get Account](/api-reference/account/get) for subscription, credits, monitor billing, and the connected X (Twitter) username · [Authentication](/api-reference/authentication) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Set your X identity handle, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/account/x-identity Store your lowercase X or Twitter handle for own-account tweet style analysis. Validate username format, replace a handle, and recover from 400, 401 or 429. > For the complete documentation index, see [llms.txt](/llms.txt). `PUT https://xquik.com/api/v1/account/x-identity` ## Store your X or Twitter handle Store one X (Twitter) username on your authenticated Xquik account. Send the handle without its leading `@`. Xquik validates the syntax and stores lowercase text. This identity helps [Analyze Style](/api-reference/styles/analyze) recognize when the requested username matches your stored username. That match supports own-account tweet style analysis. This route does not look up an X profile. It does not verify username availability, account existence, or ownership. It also does not connect an X account. It does not authorize tweet, reply, like, follow, or Direct Message actions. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail-with-body \ --request PUT https://xquik.com/api/v1/account/x-identity \ --header "x-api-key: xq_YOUR_KEY_HERE" \ --header "Content-Type: application/json" \ --data '{"username":"elonmusk"}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/account/x-identity", { method: "PUT", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ username: "elonmusk" }), }); const result = await response.json(); if (!response.ok) { throw new Error(`${response.status} ${result.error}: ${result.message}`); } console.log(result.xUsername); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.put( "https://xquik.com/api/v1/account/x-identity", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={"username": "elonmusk"}, ) result = response.json() if response.status_code != 200: raise RuntimeError( f'{response.status_code} {result["error"]}: {result["message"]}' ) print(result["xUsername"]) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, err := json.Marshal(map[string]string{ "username": "elonmusk", }) if err != nil { panic(err) } req, err := http.NewRequest("PUT", "https://xquik.com/api/v1/account/x-identity", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var result map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { panic(err) } if resp.StatusCode != http.StatusOK { panic(fmt.Sprintf("%d %v: %v", resp.StatusCode, result["error"], result["message"])) } fmt.Println(result["xUsername"]) } ``` ## Format the X (Twitter) username Send one `username` string. Remove the `@` prefix first. The Xquik route accepts 1 to 15 characters. Every character must be a letter, number, or underscore. The route rejects spaces, periods, hyphens, emoji, and `@`. | Input | Result | Reason | | - | - | - | | `XDevelopers` | Stored as `xdevelopers` | Xquik lowercases uppercase letters. | | `xquik_api` | Stored as `xquik_api` | The route accepts letters and underscores. | | `@NASA` | `400 invalid_username` | Remove the leading `@`. | | `xquik-api` | `400 invalid_username` | The route rejects hyphens. | | `xquik api` | `400 invalid_username` | The route rejects spaces. | | Empty string | `400 invalid_input` | A username is required. | Xquik does not trim whitespace. Remove surrounding spaces before sending the body. Store the lowercase response value as your canonical Xquik copy. [X's username guidance](https://help.x.com/en/managing-your-account/change-x-handle) describes a handle as the unique name shown after `@`. Native X rules and availability checks can be stricter than this route's syntax validation. Passing the Xquik pattern does not prove that X currently allows the handle. It also does not prove that the handle belongs to you. ## Understand handle, display name, and user ID An X (Twitter) username is also called a Twitter handle or X (Twitter) handle. It appears after `@` and inside the profile URL. This endpoint stores that username only. | Identifier | Example | Stored here? | Can it change? | | - | - | - | - | | X or Twitter handle | `@NASA` | Yes, without `@` | Yes, the X account can rename it. | | Display name | `NASA` | No | Yes | | Numeric X (Twitter) user ID | `123456789` | No | No. X keeps the ID when the handle changes. | Send no numeric Twitter user ID unless it is the account's username text. This route does not convert an X (Twitter) ID to a username. Use [Twitter Profile Lookup](/api-reference/x/twitter-profile-lookup) for profile fields from a known username or user ID. Use [Search Users](/api-reference/x/search-users) when you need username search. ## Apply the identity to tweet style analysis Set the handle before analyzing your own posting style. The style route compares its requested username with this stored lowercase value. Use this workflow. 1. Find the exact current X (Twitter) username. 2. Remove the leading `@` symbol. 3. Send the username through this route. 4. Save the returned lowercase `xUsername`. 5. Call Analyze Style for that same username. 6. Review the style result for the intended account. 7. Update this identity after an X (Twitter) username change. Case does not affect the stored match. `XDevelopers` becomes `xdevelopers`. Sending the same normalized username again keeps the same stored value. Sending another valid username replaces the previous one. The response returns the new stored value. No username history appears in this response. This route provides no delete or clear operation. Replace the value with another valid username when your account identity changes. ## Keep identity storage separate from X connection This endpoint changes one Xquik account field. It does not create an authenticated connection to X. | Action | Performed here? | Correct workflow | | - | - | - | | Store a username for style matching | Yes | Call this route. | | Verify that an X profile exists | No | Call Twitter Profile Lookup. | | Search for a Twitter username | No | Call Search Users. | | Connect an X account for write actions | No | Use the X account connection flow. | | Rename the account on X | No | Change the username through X. | | Convert a Twitter user ID to username | No | Use a profile lookup endpoint. | | Read followers, replies, or tweets | No | Use the matching X (Twitter) read endpoint. | Use [List Connected X Accounts](/api-reference/x-accounts/list) to inspect login-backed X connections. A stored style identity and a connected X account serve different purposes. ## Recover from X identity errors | Status | Error | Cause | Fix | | - | - | - | - | | `200` | Success object | Xquik stored the lowercase username | Save `xUsername`. | | `400` | `invalid_input` | The body is non-object or `username` is missing, empty, or non-string | Send a non-empty string. | | `400` | `invalid_username` | The string breaks the 1-to-15-character pattern | Remove `@`, spaces, and unsupported symbols. | | `401` | `unauthenticated` | The credential is missing or invalid | Replace the API key or bearer token. | | `429` | `rate_limit_exceeded` | Too many requests reached the route | Wait for `Retry-After`, then retry once. | Never retry either `400` response without changing the body. Never retry `401` without replacing the credential. After `429`, keep the exact intended handle. Retry after the server's delay, then confirm the stored value through [Get Account](/api-reference/account/get). ## X (Twitter) username questions ### What is a Twitter handle? A Twitter handle is the unique username displayed after `@`. X now calls it an X (Twitter) username or handle. It differs from the display name. ### How can I find my Twitter username? Open your X profile or account settings. Copy the handle shown after `@`, then send it here without that symbol. ### Does this endpoint perform a Twitter username lookup? No. It stores supplied text after syntax validation. It does not fetch profile details or confirm that the username exists. ### Does it verify that I own the X account? No. The route does not perform an ownership challenge. Use the separate X account connection workflow for authenticated actions. ### Is a Twitter user ID the same as a username? No. A username is the changeable handle. A user ID identifies the profile with a separate numeric value. ### What happens if my X (Twitter) handle changes? Call this route again with the new handle. The valid lowercase username replaces the previous value. ### Does setting an X identity consume credits? No. This authenticated account update is free. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | An OAuth bearer token formatted as `Bearer YOUR_TOKEN`. Send this header or `x-api-key`, not both. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | X username without `@`. Send 1 to 15 letters, numbers, or underscores. The stored value becomes lowercase. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `success` | `boolean` | Always `true` after a successful update. | | `xUsername` | `string` | Stored lowercase X (Twitter) username without `@`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": true, "xUsername": "elonmusk" } ``` ### 400 Invalid input The body lacks a non-empty string `username`. `{ "error": "invalid_username", "message": "Invalid username format." }` The username breaks the 1-to-15-character letter, number, and underscore pattern. ### 401 Unauthenticated Authentication is missing or invalid. Replace the credential before retrying. ### 429 Rate limited Too many requests reached the route. Wait for `Retry-After` before retrying. > [!NOTE] > > **Related.** > > * [Get Account](/api-reference/account/get) to confirm the stored handle. > * [Analyze Style](/api-reference/styles/analyze) to process tweet style. > * [List Connected X Accounts](/api-reference/x-accounts/list) to inspect authenticated X connections. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **409** `{ "error": "x_username_taken", "message": "Another Xquik account already linked this X username." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Get one activity record, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/activity/get Retrieve any Xquik activity, from a write to a webhook delivery, with its request, API key, OAuth app, charge, related activity & UTC times to the millisecond. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/activity/{id}` **Free.** This endpoint does not consume credits. Every activity keeps a full record you can fetch. Take the ID from the activity page URL in the dashboard. Or take it from a row of [List activity](/api-reference/activity/list). Copy as cURL on that page gives the same call. An API key's own record answers only a signed-in dashboard session. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/activity/naF3xqHLWDTs \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/activity/naF3xqHLWDTs", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const activity = await response.json(); process.stdout.write(`${JSON.stringify(activity, null, 2)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/activity/naF3xqHLWDTs", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) activity = response.json() print(activity) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "log" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/activity/naF3xqHLWDTs", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(string(body)) } ``` ## Debug an activity | Question | Field | | - | - | | Which call made this change? | `request.method`, `request.path` | | Did the call succeed? | `request.httpStatus` | | How long did the call take? | `request.durationMs` | | Which key or app made it? | `caller.apiKey`, `caller.oauthClient` | | How many credits did it use? | `charge.credits` | | What happened to the same subject? | `related` | Send the record to your support ticket or AI assistant as is. It never holds an API key value. An OAuth app gets it without your IP address and user agent. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key with full access. Generate one from the [API Keys page](https://dashboard.xquik.com/en/api-keys). | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Activity ID from the activity page URL or an Activity log row. An example is `naF3xqHLWDTs`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `object` | `string` | Always `activity`. | | `id` | `string` | Activity ID. | | `kind` | `string` | `write_action`, `extraction`, `monitor_change`, `api_key`, `billing`, `giveaway_draw`, `monitor_event`, `media_download`, `media_share`, `support_ticket`, `webhook_delivery`, `webhook_endpoint` or `x_account_connection`. | | `type` | `string` | Type within the kind, the same as its Activity log row, such as `pause`. | | `status` | `string` | `completed`, `running`, `failed` or `canceled`. | | `url` | `string` | Dashboard page of this activity. | | `requestId` | `string \| null` | ID of the API request behind this activity. | | `timestamps` | `object` | Every time of this activity, ISO 8601 in UTC to the millisecond. `createdAt` is always present. Other times appear when the activity has them. Examples are `updatedAt`, `completedAt`, `confirmedAt`, `expiresAt`, `occurredAt`, `discoveredAt`, `deliveredAt`, `nextRetryAt` or `lastUsedAt`. | | `request` | `object \| null` | The API request behind this activity. It holds `method`, `path`, `httpStatus`, `durationMs`, `ipAddress`, `userAgent` and `at`. Null for activity from before Oct 30, 2026. Also null for activity no API request made. Examples are a monitor event or a webhook delivery. | | `caller` | `object` | Who made the change. `authMethod` is `api_key`, `oauth` or `session`. `apiKey` holds the key's `name` and `prefix`. `oauthClient` holds the app's `id` and `name`. | | `charge` | `object \| null` | Credits charged, with `credits`, `balanceAfter` and `at`. Null when the activity charged nothing. | | `details` | `object` | Fields of this kind of activity. They can hold the target, the search query or the monitor. They can also hold the event data or the webhook payload. | | `related` | `object[]` | Up to 5 other activities on the same subject within 7 days, newest first. Each has `id`, `type`, `status`, `createdAt` and `url`. | ### 400 Invalid input The activity ID has the wrong format. Copy it from the activity page URL. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 403 Forbidden A read-only or scoped key cannot read activity. Use a key with full access. ### 404 Not found No activity exists with this ID, or it belongs to a different account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Get account](/api-reference/account/get) · [List > events](/api-reference/events/list) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "activity", "id": "naF3xqHLWDTs", "kind": "monitor_change", "type": "pause", "status": "completed", "url": "https://dashboard.xquik.com/activity/naF3xqHLWDTs", "requestId": "9f2c1d7e4b8a4c55a1e0d3b2c6f7a8e9", "timestamps": { "createdAt": "2026-10-28T20:22:13.481Z" }, "request": { "method": "PATCH", "path": "/api/v1/monitors/42", "httpStatus": 200, "durationMs": 37, "ipAddress": "203.0.113.9" }, "caller": { "authMethod": "api_key", "apiKey": { "name": "Production", "prefix": "xq_ab12" }, "oauthClient": null } } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List & export the activity log, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/activity/list List the account's activity log, newest first, with the Activity page's filters. Get JSON, or the same rows as a CSV, Excel, Markdown, PDF or text file. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/activity` **Free.** This endpoint does not consume credits. The rows match the dashboard's Activity log. Copy as cURL on that page gives this call with its filters. A cut list ends with a `notice` row that says where it stopped. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/activity?category=monitors&status=failed&limit=50" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch( "https://xquik.com/api/v1/activity?category=monitors&status=failed&limit=50", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" } }, ); const rows = await response.json(); process.stdout.write(`${JSON.stringify(rows, null, 2)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/activity", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"category": "monitors", "status": "failed", "limit": 50}, ) rows = response.json() print(rows) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "log" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/activity?category=monitors&status=failed&limit=50", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(string(body)) } ``` ## Download the log as a file Add `format` to get a file. The file comes in the same formats as every other Xquik export. | `format` | File | | - | - | | `json` | JSON array, the default | | `csv` | CSV | | `xlsx` | Excel workbook | | `md` | Markdown table | | `md-document` | Markdown document | | `pdf` | PDF or ZIP of PDFs | | `txt` | Plain text | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key with full access. Generate one from the [API Keys page](https://dashboard.xquik.com/en/api-keys). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `format` | `string` | No | Answer format. `json`, `csv`, `xlsx`, `md`, `md-document`, `pdf` or `txt`. | | `limit` | `number` | No | Most rows to return, with no upper limit. A PDF above 10,000 rows comes as a ZIP of PDF parts. Default `100`. | | `category` | `string` | No | `all`, `actions`, `extractions`, `monitors`, `webhooks` or `billing`. | | `status` | `string` | No | Comma-separated statuses, such as `failed,running`. | | `q` | `string` | No | Search text, up to 200 characters. | | `since` | `string` | No | Oldest time, ISO 8601. | | `until` | `string` | No | Newest time, ISO 8601. | ## Response ### 200 OK An array of rows, newest first. Each row has these fields. | Field | Type | Description | | - | - | - | | `time` | `string` | ISO 8601 time in UTC to the millisecond. Empty on the notice row. | | `category` | `string` | Kind of activity, such as `write_action`, `monitor_event` or `webhook_delivery`. | | `type` | `string` | Type within the category, such as `like` or `pause`. | | `activity` | `string` | The row's title, as the Activity log shows it. | | `status` | `string` | `completed`, `running`, `failed` or `canceled`. | | `source` | `string` | The account, monitor or key the activity came from. | | `target` | `string` | The post or account it acted on. | | `results` | `number \| string` | Results, for extractions and giveaways. | | `credits` | `number \| string` | Credits charged, or added for billing rows. | | `details` | `string` | Extra detail, such as a result ID or an HTTP status. | | `id` | `string` | Activity ID. Pass it to [Get activity](/api-reference/activity/get) for the full record. | | `link` | `string` | Link to the post or profile on X. | ### 400 Invalid input A query parameter has the wrong format. Check the values above. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 403 Forbidden A read-only or scoped key cannot read activity. Use a key with full access. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Get activity](/api-reference/activity/get) · [List > events](/api-reference/events/list) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} [ { "time": "2026-10-28T20:22:13.481Z", "category": "monitor_change", "type": "pause", "activity": "Account monitor for @elonmusk paused", "status": "completed" } ] ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Pause or resume many API keys, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/api-keys/bulk-pause Pause or resume up to 10,000 Xquik API keys in 1 request. You get back each key it changed. It skips revoked, expired & unknown keys, so retries are safe. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/api-keys` Stop a runaway agent's keys in 1 request, then resume them later. Xquik pauses or resumes each listed key that belongs to your account. It skips revoked, expired & unknown keys. It also skips other accounts' keys, so a retry is safe. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://dashboard.xquik.com/api/v1/api-keys \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" \ -H "Content-Type: application/json" \ -d '{"ids": ["42", "43"], "paused": true}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://dashboard.xquik.com/api/v1/api-keys", { method: "PATCH", headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE", Origin: "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin", "Content-Type": "application/json", }, body: JSON.stringify({ ids: ["42", "43"], paused: true }), }); const { keys } = await response.json(); console.log(keys); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.patch( "https://dashboard.xquik.com/api/v1/api-keys", cookies={"__Host-xquik_session": "YOUR_SESSION_COOKIE"}, headers={"Origin": "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin"}, json={"ids": ["42", "43"], "paused": True}, ) print(response.json()["keys"]) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "fmt" "io" "log" "net/http" ) func main() { body := bytes.NewBufferString(`{"ids": ["42", "43"], "paused": true}`) req, err := http.NewRequest("PATCH", "https://dashboard.xquik.com/api/v1/api-keys", body) if err != nil { log.Fatal(err) } req.Header.Set("Content-Type", "application/json") req.Header.Set("Origin", "https://dashboard.xquik.com") req.Header.Set("Sec-Fetch-Site", "same-origin") req.AddCookie(&http.Cookie{Name: "__Host-xquik_session", Value: "YOUR_SESSION_COOKIE"}) resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() answer, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(string(answer)) } ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `Cookie` | `string` | Yes | Your signed-in dashboard session cookie, `__Host-xquik_session`. API keys and OAuth tokens get `403 session_required`. | | `Origin` | `string` | Yes | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | IDs of the keys to pause or resume, from 1 to 10,000. Get them from [List API keys](/api-reference/api-keys/list). | | `paused` | `boolean` | Yes | `true` pauses each key, so its calls get `403 api_key_paused`. `false` resumes it. Its next call goes through. Pausing a paused key keeps its first `pausedAt`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `keys` | `array` | Your listed keys in their new state, newest first. Each has the fields of [List API keys](/api-reference/api-keys/list). A paused key has `pausedAt`. Unknown IDs never appear. Revoked keys, expired keys & other accounts' keys never appear either. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "keys": [ { "id": "43", "name": "Staging", "prefix": "xq_c3d4", "scope": "paid_reads", "isActive": true, "createdAt": "2026-02-20T09:00:00.000Z", "pausedAt": "2026-02-25T08:00:00.000Z" }, { "id": "42", "name": "Production", "prefix": "xq_a1b2", "scope": "full", "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "pausedAt": "2026-02-25T08:00:00.000Z" } ] } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Send ids as a list of 1 to 10000 API key IDs. Set paused to true or false." }` `ids` was missing, empty, or longer than 100. Or it held a value that is not a numeric ID. `paused` was missing or not `true` or `false`. Xquik changes nothing. ### 401 Unauthenticated Missing, expired, or invalid dashboard session cookie. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > Pausing keeps each key & its settings. To stop a key for good, use > [Revoke API keys](/api-reference/api-keys/bulk-revoke) instead. > > **Related.** [Update API Key](/api-reference/api-keys/update) · [List API Keys](/api-reference/api-keys/list) · [Revoke API Keys](/api-reference/api-keys/bulk-revoke) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "session_required", "message": "API keys & OAuth tokens cannot use this route. Sign in at dashboard.xquik.com/account instead." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Revoke many API keys at once, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/api-keys/bulk-revoke Revoke up to 10,000 Xquik API keys in 1 request & get back the IDs it revoked. Unknown IDs are skipped, so a retry is safe. Revocation is immediate & free. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/api-keys/bulk-revoke` Clean up old or leaked keys in 1 request. Xquik revokes each listed key that belongs to your account. It answers with the IDs it revoked. It skips IDs of unknown keys and of other accounts' keys. So a retry is safe. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://dashboard.xquik.com/api/v1/api-keys/bulk-revoke \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" \ -H "Content-Type: application/json" \ -d '{"ids": ["42", "43"]}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://dashboard.xquik.com/api/v1/api-keys/bulk-revoke", { method: "POST", headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE", Origin: "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin", "Content-Type": "application/json", }, body: JSON.stringify({ ids: ["42", "43"] }), }); const { revoked } = await response.json(); console.log(revoked); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://dashboard.xquik.com/api/v1/api-keys/bulk-revoke", cookies={"__Host-xquik_session": "YOUR_SESSION_COOKIE"}, headers={"Origin": "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin"}, json={"ids": ["42", "43"]}, ) print(response.json()["revoked"]) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "fmt" "io" "log" "net/http" ) func main() { body := bytes.NewBufferString(`{"ids": ["42", "43"]}`) req, err := http.NewRequest("POST", "https://dashboard.xquik.com/api/v1/api-keys/bulk-revoke", body) if err != nil { log.Fatal(err) } req.Header.Set("Content-Type", "application/json") req.Header.Set("Origin", "https://dashboard.xquik.com") req.Header.Set("Sec-Fetch-Site", "same-origin") req.AddCookie(&http.Cookie{Name: "__Host-xquik_session", Value: "YOUR_SESSION_COOKIE"}) resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() answer, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(string(answer)) } ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `Cookie` | `string` | Yes | Your signed-in dashboard session cookie, `__Host-xquik_session`. API keys and OAuth tokens get `403 session_required`. | | `Origin` | `string` | Yes | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `ids` | `string[]` | Yes | IDs of the keys to revoke, from 1 to 10,000. Get them from [List API keys](/api-reference/api-keys/list). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `revoked` | `string[]` | IDs of your keys that are now revoked, newest first. A key you had already revoked still appears. Unknown IDs and other accounts' keys never do. A repeated ID appears once. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "revoked": ["42", "43"] } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Send ids as a list of 1 to 10000 API key IDs." }` `ids` was missing, empty, or longer than 100. Or it held a value that is not a numeric ID. Xquik revokes nothing. ### 401 Unauthenticated Missing, expired, or invalid dashboard session cookie. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!WARNING] > > Revocation is **immediate and permanent**. Every request with a revoked key returns > `401 Unauthenticated`. Create a new key if you need one. To stop keys for a while, pause them on > the [API keys page](https://dashboard.xquik.com/en/api-keys) instead. > [!NOTE] > > API key revocation requires a same-origin dashboard session. API keys and OAuth bearer tokens cannot > revoke account keys. > > **Related.** [Revoke API Key](/api-reference/api-keys/revoke) · [List API Keys](/api-reference/api-keys/list) · [Create API Key](/api-reference/api-keys/create) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "session_required", "message": "API keys & OAuth tokens cannot use this route. Sign in at dashboard.xquik.com/account instead." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Create an X (Twitter) API key for Xquik requests Source: https://docs.xquik.com/api-reference/api-keys/create Create an X (Twitter) API key for tweet, follower, profile, monitor, webhook, and export requests. Xquik shows the secret once, so store it in a vault. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/api-keys` ## When to create a key Use this route only when creating a new credential. `fullKey` appears at creation, so store it immediately in a secret manager. List operations return inventory data and never replace this storage step. Give each workload only the `scopes` it needs. A key that only reads X (Twitter) data needs `["read"]`. Set `expiresInDays` so a forgotten key stops working on its own. Set `allowedIps` so only your servers can use the key. Calls from other IPs get `403 ip_not_allowed`. Set `monthlyBudgetCredits` to cap what the key spends each UTC calendar month. **Free.** This endpoint does not consume credits. Store `fullKey` immediately and log only `id` and `prefix`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} response=$(curl -sS -X POST https://dashboard.xquik.com/api/v1/api-keys \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" \ -H "Content-Type: application/json" \ -d '{"name": "Production"}') full_key=$(jq -r '.fullKey' <<<"$response") key_id=$(jq -r '.id' <<<"$response") key_prefix=$(jq -r '.prefix' <<<"$response") # Store $full_key in your secret manager; do not print it in logs. printf 'Created API key %s (%s)\n' "$key_id" "$key_prefix" ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://dashboard.xquik.com/api/v1/api-keys", { method: "POST", headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE", Origin: "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin", "Content-Type": "application/json", }, body: JSON.stringify({ name: "Production" }), }); const key = await response.json(); const apiKey = key.fullKey; // Store apiKey in your secret manager; do not print it in logs. process.stdout.write(`Created API key ${key.id} (${key.prefix})\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://dashboard.xquik.com/api/v1/api-keys", cookies={"__Host-xquik_session": "YOUR_SESSION_COOKIE"}, headers={"Origin": "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin"}, json={"name": "Production"}, ) key = response.json() api_key = key["fullKey"] # Store api_key in your secret manager; do not print it in logs. print(f"Created API key {key['id']} ({key['prefix']})") ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" ) func main() { body, err := json.Marshal(map[string]string{"name": "Production"}) if err != nil { log.Fatal(err) } req, err := http.NewRequest("POST", "https://dashboard.xquik.com/api/v1/api-keys", bytes.NewReader(body)) if err != nil { log.Fatal(err) } req.Header.Set("Content-Type", "application/json") req.Header.Set("Origin", "https://dashboard.xquik.com") req.Header.Set("Sec-Fetch-Site", "same-origin") req.AddCookie(&http.Cookie{Name: "__Host-xquik_session", Value: "YOUR_SESSION_COOKIE"}) resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var key map[string]string if err := json.NewDecoder(resp.Body).Decode(&key); err != nil { log.Fatal(err) } apiKey := key["fullKey"] // Store apiKey in your secret manager; do not print it in logs. _ = apiKey fmt.Printf("Created API key %s (%s)\n", key["id"], key["prefix"]) } ``` | API key receipt column | Response source | Storage rule | | - | - | - | | Key ID | `id` | Use this ID for later revocation. | | Full API key | `fullKey` | Store it once in an approved secret manager. | | Safe prefix | `prefix` | Use this value in logs and key inventories. | | Key label | `name` | Identify the workload or environment. | | Access scope | `scope` | Confirm the key can call only what it needs. | | Scopes held | `scopes` | Confirm the list matches the workload. | | IP allowlist | `allowedIps` | Confirm only your servers' IPs are listed. | | Creation time | `createdAt` | Record when credential access began. | | Expiry time | `expiresAt` | Plan the replacement before this time. | | Active-key limit | `403 api_key_limit_reached` | Revoke an unused key before retrying. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `Cookie` | `string` | Yes | Your signed-in dashboard session cookie, `__Host-xquik_session`. API keys and OAuth tokens get `403 session_required`. | | `Origin` | `string` | Yes | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | Display name for the key. Defaults to `"Default"` if omitted. | | `scope` | `string` | No | What the key can call. Scope `full` calls every route an API key can use. Scope `paid_reads` calls paid X (Twitter) read routes only, like tweet search and profiles. Other routes answer it with `403 insufficient_scope`. Missing or `null` saves `full`. Change it later with [Update API key](/api-reference/api-keys/update). | | `scopes` | `string[]` | No | The scopes the key holds. Pick from `full`, `read`, `write`, `monitors`, `exports` & `billing`. Every key holds `read`. A list with `full` saves Full access. `scopes` wins over `scope`. Calls outside the list get `403 insufficient_scope`. [Authentication](/api-reference/authentication#limit-what-a-key-can-call) lists what each scope covers. | | `connectsXAccounts` | `boolean` | No | Lets this key connect, reconnect & disconnect X accounts. It starts off. Only a dashboard session can set it. | | `expiresInDays` | `integer` | No | Days until the key stops working, from 1 to 365. Missing or `null` keeps it working until you revoke it. You cannot change the expiry later. Create a new key instead. | | `allowedIps` | `string[]` | No | Up to 20 IPv4 or IPv6 addresses or CIDR ranges may use the key. Use entries like `203.0.113.4`, `198.51.100.0/24` or `2001:db8::/32`. Calls from other IPs get `403 ip_not_allowed`. Missing or `[]` allows any IP. Change the list later with [Update API key](/api-reference/api-keys/update). | | `monthlyBudgetCredits` | `integer` | No | Credits the key can spend each UTC calendar month, from 1 to 1,000,000,000,000. Missing or `null` sets no budget. New calls that don't fit the budget get `403 api_key_budget_reached`. Change or remove it later with [Update API key](/api-reference/api-keys/update). | ## Response ### 201 Created | Field | Type | Description | | - | - | - | | `id` | `string` | Unique identifier for the API key. | | `fullKey` | `string` | The complete API key including the `xq_` prefix. | | `prefix` | `string` | First 8 characters of the key including the `xq_` prefix (for example `"xq_a1b2"`). | | `name` | `string` | Display name of the key. | | `scope` | `string` | `full` or `paid_reads`. | | `scopes` | `string[]` | The scopes the key holds. A Full access key holds `full`. | | `connectsXAccounts` | `boolean` | Whether this key can connect, reconnect & disconnect X accounts. | | `allowedIps` | `string[]` | IPs & CIDR ranges that may use the key. An empty list allows any IP. | | `isActive` | `boolean` | Always `true` for a new key. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `expiresAt` | `string` | ISO 8601 time the key stops working. Omitted when the key never expires. | | `monthlyBudgetCredits` | `integer` | Credits the key can spend each UTC calendar month. Omitted when the key has no budget. | | `monthlySpentCredits` | `integer` | Credits charged for calls with the key this UTC calendar month. Always `0` for a new key. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "42", "fullKey": "xq_YOUR_KEY_HERE", "prefix": "xq_a1b2", "name": "Production", "scope": "full", "scopes": ["full"], "allowedIps": [], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "monthlySpentCredits": 0 } ``` > [!WARNING] > > Xquik returns `fullKey` once. Store it in a secret manager. You cannot retrieve it again. ### 400 Invalid input `{ "error": "invalid_input", "message": "Set expiresInDays to a whole number from 1 to 365." }` `scope` is not `full` or `paid_reads`, or a `scopes` entry is not a scope. An `expiresInDays` outside 1 to 365 fails too. So does a `name` longer than 100 characters. An `allowedIps` entry that isn't an IP or CIDR range fails too. So does a list over 20 entries. So does a `monthlyBudgetCredits` that isn't a whole number from 1 to 1,000,000,000,000. The message names the field to fix. Xquik creates no key. ### 401 Unauthenticated Missing, expired, or invalid dashboard session cookie. ### 403 Key limit reached `{ "error": "api_key_limit_reached", "limit": 10000, "message": "API key limit reached. Delete an existing key first." }` You have reached the maximum number of active API keys (10,000). Revoke an active key before creating a new one. Revoked keys do not count toward the active limit. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > API key creation requires a same-origin dashboard session. API keys and OAuth > bearer tokens cannot create more keys. > > **Related.** > > * [List API Keys](/api-reference/api-keys/list) > * [Update API Key](/api-reference/api-keys/update) > * [Revoke API Key](/api-reference/api-keys/revoke) > * [Revoke API Keys](/api-reference/api-keys/bulk-revoke) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_limit_reached", "message": "API key limit reached. Delete an existing key first." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List active API keys, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/api-keys/list List Xquik API keys for X API authentication. Review each key ID, name, safe prefix, active state, creation time & last use before rotation or revocation. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/api-keys` ## Audit Xquik API keys before X (Twitter) automation List every Xquik key registered to the signed-in account. Review keys before running tweet searches, follower exports, webhooks, monitors, or X writes. This endpoint returns key inventory metadata. It never returns a complete API key. Use `id` for revocation and `prefix` for safe identification. The key list answers 6 operational questions. * Which named Xquik keys exist on this account? * Which keys are active or revoked? * What can each key call, and when does it expire? * How many credits did each key spend this month, against which budget? * When did each key last authenticate a request? * Which key ID should a rotation workflow revoke? **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://dashboard.xquik.com/api/v1/api-keys \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://dashboard.xquik.com/api/v1/api-keys", { headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE" }, }); const result = await response.json(); if (!response.ok) throw new Error(JSON.stringify(result)); const keyInventory = result.keys.map((key) => ({ id: key.id, name: key.name, safePrefix: key.prefix, active: key.isActive, scope: key.scope, createdAt: key.createdAt, expiresAt: key.expiresAt ?? null, lastUsedAt: key.lastUsedAt ?? null, monthlyBudgetCredits: key.monthlyBudgetCredits ?? null, monthlySpentCredits: key.monthlySpentCredits, })); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://dashboard.xquik.com/api/v1/api-keys", cookies={"__Host-xquik_session": "YOUR_SESSION_COOKIE"}, ) result = response.json() response.raise_for_status() key_inventory = [ { "id": key["id"], "name": key["name"], "safe_prefix": key["prefix"], "active": key["isActive"], "scope": key["scope"], "created_at": key["createdAt"], "expires_at": key.get("expiresAt"), "last_used_at": key.get("lastUsedAt"), "monthly_budget_credits": key.get("monthlyBudgetCredits"), "monthly_spent_credits": key["monthlySpentCredits"], } for key in result["keys"] ] ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "log" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://dashboard.xquik.com/api/v1/api-keys", nil) if err != nil { log.Fatal(err) } req.AddCookie(&http.Cookie{Name: "__Host-xquik_session", Value: "YOUR_SESSION_COOKIE"}) resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(string(body)) } ``` ## Read the API key inventory Treat the response as an account credential inventory. Never treat it as a secret recovery endpoint. | Inventory check | Response field | Management decision | | - | - | - | | Stable key record | `id` | Pass this ID to the revoke endpoint. | | Workload label | `name` | Match the key to its service or environment. | | Safe identifier | `prefix` | Compare deployments without exposing the full key. | | Current state | `isActive` | Accept requests only when this value is `true`. | | Access scope | `scope` | Give each workload the smallest scope it needs. | | Scopes held | `scopes` | Check each key holds only what its workload calls. | | IP allowlist | `allowedIps` | List your servers' IPs. An empty list allows any IP. | | Credential age | `createdAt` | Review old keys against your rotation policy. | | Planned end | `expiresAt` | Replace the key before this time. Missing means it never ends. | | Monthly budget | `monthlyBudgetCredits` | Raise it before the key runs out. Missing means no budget. | | Monthly spend | `monthlySpentCredits` | Compare it with the budget & spot unexpected usage. | | Last authentication | `lastUsedAt` | Investigate stale keys and keys active without a known workload. | `lastUsedAt` is optional. Its absence means Xquik recorded no authenticated use. Xquik refreshes it at most once a minute. As a result, it can trail the latest call by up to 60 seconds. It does not prove that a deployment no longer needs the key. `monthlySpentCredits` counts the credits charged for calls with the key this UTC month. It starts again at 0 each month. New calls that don't fit the budget get `403 api_key_budget_reached`. Raise or remove the budget with [Update API key](/api-reference/api-keys/update) to unblock the key sooner. Check scheduled jobs before revoking a quiet key. A monthly follower export can remain valid without recent requests. Confirm the owner and workload first. ## Distinguish Xquik keys from official X credentials An Xquik API key starts with `xq_`. It authenticates requests to Xquik routes. It is not an official X (Twitter) API key or X developer bearer token. | Credential | Purpose | Where to manage it | | - | - | - | | Xquik API key | Authenticate Xquik tweet, follower, monitor, webhook, and write routes. | Xquik API key pages. | | Official X API key | Identify an application on the X developer platform. | X developer console. | | Xquik dashboard session | Authorize Xquik API key management. | Signed-in Xquik dashboard. | Official X documentation separates application keys from bearer tokens. Read its [authentication overview](https://docs.x.com/fundamentals/authentication/oauth-1-0a/api-key-and-secret) when integrating directly with the X developer platform. Use [Xquik authentication](/api-reference/authentication) for Xquik request headers. Use this list endpoint only for Xquik credential inventory. ## Rotate an Xquik API key Create the replacement before revoking the current key. This overlap prevents failed tweet, follower, webhook, and monitor requests. 1. List keys and record the current `id`, `name`, and `prefix`. 2. [Create a replacement key](/api-reference/api-keys/create) with a clear name. 3. Store the returned `fullKey` in an approved secret manager. 4. Update one deployment without logging the replacement value. 5. Send a planned Xquik request from that deployment. 6. List keys and verify the replacement `lastUsedAt` value. 7. [Revoke the old key](/api-reference/api-keys/revoke) by its exact `id`. 8. List keys again and confirm the old key is inactive. OWASP treats creation, rotation, revocation, and expiration as a secret lifecycle. Review its [secrets management guidance](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) when defining your organization policy. A key works only while `isActive` is `true` and `expiresAt` is missing or ahead. Set `expiresInDays` when you [create a key](/api-reference/api-keys/create) so a forgotten key expires. Give a workload that only reads X (Twitter) data a `paid_reads` key. ## Common X API key questions ### Can I recover my full Xquik API key? No. `GET /api-keys` returns only a safe prefix. The creation response returns `fullKey` once. Create a replacement when the stored secret is unavailable. ### Can an API key list other Xquik keys? No. This management endpoint requires a same-origin dashboard session. An `x-api-key` header or OAuth bearer token cannot authorize the request. ### How do I check which Xquik key is active? Match the deployed key prefix with `prefix`. Then check `isActive`. Never print the complete deployed key during this comparison. ### What does a missing last-used time mean? The key has no recorded authenticated request. It may be new or unused. Check the intended workload before revocation. ### Does this endpoint list official X (Twitter) API keys? No. It lists Xquik keys for Xquik endpoints. Manage official X developer credentials in the X developer console. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `Cookie` | `string` | Yes | Your signed-in dashboard session cookie, `__Host-xquik_session`. API keys and OAuth tokens get `403 session_required`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Maximum items per page, from 1 to 10,000. Default 200. | | `cursor` | `string` | No | `nextCursor` from the previous page. The `after` alias also works. Offset pagination is not supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `keys` | `array` | Array of API key objects. | | `keys[].id` | `string` | Unique identifier for the API key. | | `keys[].name` | `string` | Display name of the key. | | `keys[].prefix` | `string` | First 8 characters of the key including the `xq_` prefix (for example `"xq_a1b2"`). | | `keys[].isActive` | `boolean` | Whether the key is active. A revoked key is `false`. An expired key stays `true`, so check `expiresAt` too. | | `keys[].scope` | `string` | Scope `full` calls every route an API key can use. Scope `paid_reads` calls paid X (Twitter) read routes only. Other routes answer it with `403 insufficient_scope`. | | `keys[].scopes` | `string[]` | The scopes the key holds, such as `["read", "monitors"]`. A Full access key holds `full`. | | `keys[].connectsXAccounts` | `boolean` | Whether this key can connect, reconnect & disconnect X accounts. | | `keys[].allowedIps` | `string[]` | IPs & CIDR ranges that may use the key. An empty list allows any IP. | | `keys[].createdAt` | `string` | ISO 8601 creation timestamp. | | `keys[].expiresAt` | `string` | ISO 8601 time the key stops working. Omitted when the key never expires. | | `keys[].lastUsedAt` | `string` | ISO 8601 timestamp of the last API call made with this key. Xquik refreshes it at most once a minute. Omitted if never used. | | `keys[].pausedAt` | `string` | ISO 8601 time you paused the key. Omitted while the key works. A paused key gets `403 api_key_paused`. | | `keys[].monthlyBudgetCredits` | `integer` | Credits the key can spend each UTC calendar month. Omitted when the key has no budget. | | `keys[].monthlySpentCredits` | `integer` | Credits charged for calls with the key this UTC calendar month. `0` when it has no calls yet. | | `hasMore` | `boolean` | Whether more rows follow this page. | | `nextCursor` | `string` | Pass it as `cursor` for the next page. Present when `hasMore` is `true`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "keys": [ { "id": "42", "name": "Production", "prefix": "xq_a1b2", "scope": "full", "scopes": ["full"], "allowedIps": ["203.0.113.4", "198.51.100.0/24"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "lastUsedAt": "2026-02-24T18:45:12.000Z", "monthlyBudgetCredits": 50000, "monthlySpentCredits": 1200 }, { "id": "43", "name": "Staging", "prefix": "xq_c3d4", "scope": "paid_reads", "scopes": ["read"], "allowedIps": [], "isActive": true, "createdAt": "2026-02-20T09:00:00.000Z", "expiresAt": "2026-03-22T09:00:00.000Z", "monthlySpentCredits": 0, "pausedAt": "2026-02-25T08:00:00.000Z" } ], "hasMore": false } ``` ### 400 Invalid cursor `{ "error": "invalid_input", "message": "Cursor invalid. Use nextCursor from the previous page, or omit it to start over." }` The `cursor` is not one this list returned. Send the `nextCursor` of the previous page, or omit it. ### 401 Unauthenticated Missing, expired, or invalid dashboard session cookie. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > API key listing requires a same-origin dashboard session. API keys and OAuth > bearer tokens cannot list account keys. > > **Related.** [Create API Key](/api-reference/api-keys/create) · [Update API Key](/api-reference/api-keys/update) · [Revoke API Key](/api-reference/api-keys/revoke) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "session_required", "message": "API keys & OAuth tokens cannot use this route. Sign in at dashboard.xquik.com/account instead." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Revoke an API key by ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/api-keys/revoke Permanently revoke an API key used for tweet, follower, profile, monitor, webhook, export, or account-action requests. Revocation is immediate and free. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/api-keys/{id}` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://dashboard.xquik.com/api/v1/api-keys/42 \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://dashboard.xquik.com/api/v1/api-keys/42", { method: "DELETE", headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE", Origin: "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin", }, }); const result = await response.json(); console.log(result); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.delete( "https://dashboard.xquik.com/api/v1/api-keys/42", cookies={"__Host-xquik_session": "YOUR_SESSION_COOKIE"}, headers={"Origin": "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin"}, ) result = response.json() print(result) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "log" "net/http" ) func main() { req, err := http.NewRequest("DELETE", "https://dashboard.xquik.com/api/v1/api-keys/42", nil) if err != nil { log.Fatal(err) } req.Header.Set("Origin", "https://dashboard.xquik.com") req.Header.Set("Sec-Fetch-Site", "same-origin") req.AddCookie(&http.Cookie{Name: "__Host-xquik_session", Value: "YOUR_SESSION_COOKIE"}) resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(string(body)) } ``` ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique identifier of the API key to revoke. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `Cookie` | `string` | Yes | Your signed-in dashboard session cookie, `__Host-xquik_session`. API keys and OAuth tokens get `403 session_required`. | | `Origin` | `string` | Yes | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `success` | `boolean` | Always `true` when Xquik revokes the key. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": true } ``` ### 400 Invalid ID `{ "error": "invalid_id" }` The path parameter is not a valid ID. IDs are numeric strings. ### 401 Unauthenticated Missing, expired, or invalid dashboard session cookie. ### 404 Not found No API key with this ID exists on your account. Revoking a key you already revoked returns `200` again. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!WARNING] > > Revocation is **immediate and permanent**. Every request with the revoked key returns `401 Unauthenticated`. You cannot undo it. Create a new key if you need one. To stop a key for a while, pause it instead. The revoke dialog on the [API keys page](https://dashboard.xquik.com/en/api-keys) offers **Pause instead**. > [!NOTE] > > API key revocation requires a same-origin dashboard session. API keys and > OAuth bearer tokens cannot revoke account keys. > > **Related.** [Create API Key](/api-reference/api-keys/create) · [List API Keys](/api-reference/api-keys/list) · [Revoke API Keys](/api-reference/api-keys/bulk-revoke) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "session_required", "message": "API keys & OAuth tokens cannot use this route. Sign in at dashboard.xquik.com/account instead." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Update API key name & budget, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/api-keys/update Rename an active Xquik API key, change its scope or set its monthly credit budget. It keeps its secret & expiry, and its next request uses the change. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/api-keys/{id}` Rename a key so its owner is clear. Narrow a key that only reads to `paid_reads`. Pause a key to stop it for a while, then resume it. Limit a key to your servers with `allowedIps`. Cap what a key spends each month with `monthlyBudgetCredits`. Send 1 or more of `name`, `scope`, `paused`, `allowedIps` & `monthlyBudgetCredits`. The key keeps its secret, prefix and expiry. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://dashboard.xquik.com/api/v1/api-keys/42 \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" \ -H "Content-Type: application/json" \ -d '{"name": "Analytics notebook", "scope": "paid_reads", "monthlyBudgetCredits": 50000}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://dashboard.xquik.com/api/v1/api-keys/42", { method: "PATCH", headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE", Origin: "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin", "Content-Type": "application/json", }, body: JSON.stringify({ name: "Analytics notebook", scope: "paid_reads", monthlyBudgetCredits: 50000, }), }); const key = await response.json(); console.log(key); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.patch( "https://dashboard.xquik.com/api/v1/api-keys/42", cookies={"__Host-xquik_session": "YOUR_SESSION_COOKIE"}, headers={"Origin": "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin"}, json={"name": "Analytics notebook", "scope": "paid_reads", "monthlyBudgetCredits": 50000}, ) key = response.json() print(key) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "fmt" "io" "log" "net/http" ) func main() { body := bytes.NewBufferString(`{"name": "Analytics notebook", "scope": "paid_reads", "monthlyBudgetCredits": 50000}`) req, err := http.NewRequest("PATCH", "https://dashboard.xquik.com/api/v1/api-keys/42", body) if err != nil { log.Fatal(err) } req.Header.Set("Content-Type", "application/json") req.Header.Set("Origin", "https://dashboard.xquik.com") req.Header.Set("Sec-Fetch-Site", "same-origin") req.AddCookie(&http.Cookie{Name: "__Host-xquik_session", Value: "YOUR_SESSION_COOKIE"}) resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() answer, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(string(answer)) } ``` ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique identifier of the API key to update. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `Cookie` | `string` | Yes | Your signed-in dashboard session cookie, `__Host-xquik_session`. API keys and OAuth tokens get `403 session_required`. | | `Origin` | `string` | Yes | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body Send at least 1 field. | Body parameter | Type | Required | Description | | - | - | - | - | | `name` | `string` | No | New display name, up to 100 characters. An empty name saves `"Default"`. | | `scope` | `string` | No | Scope `full` calls every route an API key can use. Scope `paid_reads` calls paid X (Twitter) read routes only. Other routes answer it with `403 insufficient_scope`. The key's next request uses the new scope. | | `scopes` | `string[]` | No | The scopes the key holds, from `full`, `read`, `write`, `monitors`, `exports` & `billing`. Every key holds `read`. `scopes` wins over `scope`. Missing keeps the key's scopes. The key's next request uses the new list. | | `connectsXAccounts` | `boolean` | No | Lets this key connect, reconnect & disconnect X accounts. Only a dashboard session can change it. | | `paused` | `boolean` | No | `true` pauses the key, and `false` resumes it. A paused key gets `403 api_key_paused` on every request. Its next request after you resume goes through. Sending the current state again changes nothing. While paused, the key has `pausedAt`, the time you paused it. A revoked key answers `409 api_key_revoked`. An expired key answers `409 api_key_expired`. | | `allowedIps` | `string[]` | No | Up to 20 IPv4 or IPv6 addresses or CIDR ranges may use the key. The list replaces the saved one. Send `[]` to allow any IP again. Calls from other IPs get `403 ip_not_allowed`. The key's next request uses the new list. | | `monthlyBudgetCredits` | `integer` | No | Credits the key can spend each UTC calendar month, from 1 to 1,000,000,000,000. `null` removes the budget, and a missing field keeps it. Raise or remove the budget, & the key's next call works again. | ## Response ### 200 OK Returns the saved key with the same fields as [List API keys](/api-reference/api-keys/list). ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "42", "name": "Analytics notebook", "prefix": "xq_a1b2", "scope": "paid_reads", "scopes": ["read"], "allowedIps": [], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "lastUsedAt": "2026-02-24T18:45:12.000Z", "monthlyBudgetCredits": 50000, "monthlySpentCredits": 1200 } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Send name, scopes, paused, allowedIps or monthlyBudgetCredits to change." }` The body had no field to change, or `scope` was not `full` or `paid_reads`. A `scopes` entry that was not a scope fails too. So does a `name` longer than 100 characters. An `allowedIps` entry that isn't an IP or CIDR range fails too. So does a list over 20 entries. `monthlyBudgetCredits` must be `null` or a whole number from 1 to 1,000,000,000,000. Xquik changes nothing. ### 401 Unauthenticated Missing, expired, or invalid dashboard session cookie. ### 404 Not found No active API key with this ID exists on your account. A revoked key cannot change. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > API key changes require a same-origin dashboard session. API keys and OAuth bearer tokens cannot > change account keys. > > **Related.** [Create API Key](/api-reference/api-keys/create) · [List API Keys](/api-reference/api-keys/list) · [Revoke API Key](/api-reference/api-keys/revoke) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "session_required", "message": "API keys & OAuth tokens cannot use this route. Sign in at dashboard.xquik.com/account instead." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "api_key_revoked", "message": "This API key is revoked. Create a new key at dashboard.xquik.com/api-keys." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # API key authentication, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/authentication Authenticate tweets, follower exports, monitors, webhooks, and X writes with Xquik API keys, guest keys, OAuth 2.1, sessions, or MPP. Lists methods per route. > For the complete documentation index, see [llms.txt](/llms.txt). Authenticate tweet, follower, monitor, webhook, and write requests with an Xquik API key. This REST API authentication guide also covers guest keys, OAuth 2.1, sessions, and MPP. Xquik keys authenticate Xquik endpoints only. They are not an official Twitter API key or X API token. Choose the narrowest method that covers the route. ## API key format Account and guest keys follow this format. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} xq_your_api_key_here ``` * **Prefix.** `xq_` * **Body.** 64 hexadecimal characters * **Storage.** Keep each REST API key in a secret manager. Never log or commit it. ## Using your API key Send account API requests with the `x-api-key` request header. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/account \ -H "x-api-key: xq_your_api_key_here" ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/account", { headers: { "x-api-key": "xq_your_api_key_here" }, }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/account", headers={"x-api-key": "xq_your_api_key_here"}, ) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "net/http" ) func main() { req, _ := http.NewRequest("GET", "https://xquik.com/api/v1/account", nil) req.Header.Set("x-api-key", "xq_your_api_key_here") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) } ``` For Bearer tokens, send the same key in the authorization header. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Authorization: Bearer xq_your_api_key_here ``` Use Bearer authentication for guest keys. An `xq_` value remains an Xquik API key. OAuth 2.1 access tokens omit the `xq_` prefix. In Postman, paste the key into the Xquik collection's `apiKey` variable. Every request then sends it as `x-api-key`. See [Run in Postman](/api-reference/overview#run-in-postman). ## Auth methods by endpoint The cards below list the auth method each endpoint accepts. Most routes accept an API key or dashboard session cookie. Routes that manage API keys or charge saved cards accept only dashboard sessions. X account sign-in routes also take a key with the Connect X accounts permission. > [card] API key only > > `GET /account` accepts `x-api-key`. Use it to check plan, credit balance, and monitor billing from server-side integrations. > [card] Session cookie only > > `POST /api-keys`, `GET /api-keys`, `PATCH /api-keys`, `PATCH /api-keys/{id}`, `DELETE /api-keys/{id}`, `POST /api-keys/bulk-revoke`, and `POST /credits/quick-topup` require a dashboard session cookie. > > An API key or OAuth token gets `403 session_required` on these routes. > [card] X account sign-in > > These take a dashboard session or a key with the Connect X accounts permission. They are `POST /x/accounts`, `GET /x/account-connection-attempts/{id}`, `POST /x/account-connection-challenges/{id}/submit`, `POST /x/accounts/{id}/reauth`, `POST /x/accounts/bulk-retry`, and `DELETE /x/accounts/{id}`. > > The permission starts off, and only a dashboard session can turn it on. Full access doesn't include it. A key without it gets `403 x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`, so X passwords never reach a model. See [Connect your users' X accounts](/guides/connect-x-accounts-for-your-users). > [card] Account and billing > > `PATCH /account`, `PUT /account/x-identity`, `GET /credits`, `POST /credits/topup`, and `POST /subscribe` accept either `x-api-key` or a dashboard session cookie. For an account with a plan, `POST /subscribe` returns the dashboard billing page. The user signs in there. > [card] Events and webhooks > > `* /monitors/*`, `GET /events/*`, `* /webhooks/*`, and `GET /webhooks/{id}/deliveries` accept either auth method. > [card] Tweets, exports, and X actions > > `* /draws/*`, `* /extractions/*`, `* /x/*`, `POST /x/media/download`, `GET /x/accounts`, `GET /x/accounts/{id}`, and `* /x-write/*` accept either auth method. > [card] Content tools and support > > `GET /trends`, `GET /radar`, `* /styles/*`, `* /drafts/*`, `POST /compose`, and `* /support/*` accept either auth method. > [card] Guest paid reads > > A guest key has scope `paid_reads`. It authenticates only the prepaid paid-read routes plus guest status and top-up. It never grants account, write, automation, account credential, or OAuth access. > [!NOTE] > > Some actions require a same-origin dashboard session. They are API key > management, saved-card top-ups, and X account sign-in and removal. API keys and > OAuth bearer tokens get `403 session_required` there. A leaked key reads and > acts on its account's data. But it never reaches credentials, saved cards, or X > passwords. > [!NOTE] > > The MCP server also supports OAuth 2.1 with PKCE for browser-based clients. > See [OAuth 2.1](/oauth/overview) for current client compatibility and setup. ## Accountless guest keys After the user confirms USD 10 to 250, `POST /api/v1/guest-wallets` makes no charge. It returns a one-use hosted checkout, a guest key, and a status URL. The guest key stays inactive for paid reads until Xquik verifies payment. It can authenticate `GET /api/v1/guest-wallets/status` while pending. Once active, it can call exactly the [eligible paid-read routes](/guides/guest-wallets#eligible-paid-read-routes). > [!WARNING] > > Never create a guest wallet or top-up automatically after a `401` or `402`. Ask the user to choose an amount and confirm it. The user must open and complete the hosted checkout. Guest credential routes are direct REST only. The API MCP server never exposes wallet creation, status, or top-up as executable operations. See [Accountless guest wallets](/guides/guest-wallets) for the complete flow. ## Machine Payments Protocol Direct [MPP](/mpp/machine-payments-protocol) payments also cover 7 fixed-price reads. This replaces API key authentication for those reads. Without credentials, the API server returns a 402 payment challenge. ### Challenge header ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} WWW-Authenticate: Payment id="challenge_id_here", realm="xquik.com", method="tempo", intent="charge", request="payment_request_here" ``` | Parameter | Description | | - | - | | `id` | Unique challenge identifier | | `realm` | Protection space (`xquik.com`) | | `method` | Payment method (`tempo`) | | `intent` | Payment intent (`charge`) | | `request` | Base64url-encoded JSON with amount, currency, and recipient | ### Credential header After completing the payment, retry the request with a payment credential. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Authorization: Payment ``` The credential contains the original challenge parameters and a method-specific payload proving payment. ### Receipt header Settled responses include a receipt. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Payment-Receipt: ``` The receipt confirms settlement with a reference ID and timestamp. Every response after accepted payment includes this header, including non-2xx responses. Check the HTTP status and response body. Confirm application success before processing the result. ### Eligible endpoints See the [MPP overview](/mpp/machine-payments-protocol#eligible-endpoints) for every direct MPP operation and fixed prices. > [!NOTE] > > The non-MPP paid reads return `401` with `WWW-Authenticate: Bearer` and the optional guest wallet action. The direct MPP operations return `402` with `WWW-Authenticate: Payment` and the same guest action. A failed read never creates checkout. ## Key management ### Create a key Generate keys from the **API Keys** page in your dashboard or via the API. The API route accepts session auth only. ```bash Create API Key theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://dashboard.xquik.com/api/v1/api-keys \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" \ -H "Content-Type: application/json" \ -d '{"name": "Production"}' ``` The creation response returns the full key (`fullKey`) once. Store it in a secret manager. ### Limit what a key can call Give each key only the scopes its workload needs. Pick them in the key's settings on the [API keys page](https://dashboard.xquik.com/en/api-keys). The API takes them as `scopes` when you create or update a key. | Scope | What the key can call | | - | - | | `read` | Paid X reads, like tweet search, profiles & tweets. Every key holds it. | | `write` | Posts, likes, reposts, follows, DMs, media, profile edits & communities. | | `monitors` | Monitors, keyword & post monitors, webhooks & events. | | `exports` | Extractions, draws & their exports. | | `billing` | Your credit balance & top-up status. Read only. | | `full` | Every route an API key can use, including the routes no other scope covers. | A key without `full` holds `read` plus any of `write`, `monitors`, `exports` & `billing`. `scope` still works. `paid_reads` saves a read only key, and `full` saves Full access. Set `expiresInDays` from 1 to 365 so the key stops working on its own. [Update API key](/api-reference/api-keys/update) changes the name or scopes later. ### Restrict a key to your IPs Give a key an IP allowlist so only your servers can use it. List up to 20 IPs or CIDR ranges, like `203.0.113.4` or `198.51.100.0/24`. Both IPv4 & IPv6 work. Edit the list in the key's settings on the [API keys page](https://dashboard.xquik.com/en/api-keys). The API takes it as `allowedIps` when you create or update a key. Calls from any other IP get `403 ip_not_allowed`. An empty list allows any IP, so keys without a list work as before. Xquik saves each range in its standard form, so `198.51.100.7/24` becomes `198.51.100.0/24`. The API keys page shows the IP that last called each key. Search an IP there to find the keys that list it. The search also finds keys that IP used in the last 30 days. ### Pause a key Pause a key on the [API keys page](https://dashboard.xquik.com/en/api-keys) to stop it for a while. Select several keys to pause or resume them together. Pausing never deletes the key. The key keeps its settings. Resume works at once, so the next request goes through. You can't pause or resume a revoked or expired key. [Update API key](/api-reference/api-keys/update) pauses or resumes 1 key with `paused`. [Pause API keys](/api-reference/api-keys/bulk-pause) pauses or resumes up to 10,000 keys in 1 request. ### Cap a key's monthly credits Set `monthlyBudgetCredits` when you create or update a key. It caps what calls with the key spend each UTC calendar month. A key without a budget can spend your whole balance. * At 80%, Xquik sends the account owner 1 warning email per key each month. * Calls running at once can't take the key past its budget. * A call that doesn't fit what's left gets `403 api_key_budget_reached` and costs nothing. * A refused call never runs. * A read with a `limit` needs that many results' price left. * A media download needs the price of every post it names. * A read without a `limit` returns only what fits. An extraction, a draw and a style refresh do the same. * A write needs its price plus 20 credits left. It charges only what it uses. * A started call bills what it delivered, even past a lowered budget. * The budget applies to REST, MCP and Apify Actor calls that use the key. * The key works again when the next UTC month starts. * Raise or remove the budget to unblock the key sooner. The budget never changes what a call costs. `monthlySpentCredits` on each key shows its spend this month. ### Revoke a key ```bash Revoke API Key theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://dashboard.xquik.com/api/v1/api-keys/123 \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" ``` Xquik deactivates revoked keys immediately. You cannot reactivate them. To stop a key for a while, pause it instead. [Revoke API keys](/api-reference/api-keys/bulk-revoke) revokes up to 10,000 keys in 1 request. ## Error response An invalid or missing API key returns this error. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "unauthenticated" } ``` **Status.** `401 Unauthorized` Replace the credential before retrying. A paused key returns this error. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." } ``` **Status.** `403 Forbidden` REST routes, webhook management routes & the MCP server all send it. Resume the key, then retry. Keys you never pause work as before. A call outside the key's scopes returns this error. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "insufficient_scope", "message": "This API key lacks the monitors scope. Add it at dashboard.xquik.com/api-keys.", "requiredScope": "monitors" } ``` **Status.** `403 Forbidden` `requiredScope` names the scope to add. It is `write`, `monitors`, `exports`, `billing` or `full`. Add it on the [API keys page](https://dashboard.xquik.com/en/api-keys), then retry. REST & MCP refuse the same calls. Full access keys work as before. A call from an IP outside the key's allowlist returns this error. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "ip_not_allowed", "message": "This API key only accepts calls from its IP allowlist, and 198.51.100.7 is not on it. Add 198.51.100.7 to the key at dashboard.xquik.com/api-keys, or call from a listed IP." } ``` **Status.** `403 Forbidden` The message names the IP that made the call. Add that IP to the key's allowlist, or call from a listed IP. Every call with the key checks the list, REST & MCP included. ## Security best practices Apply these API security controls to every environment. > [accordion] Store keys in environment variables > > Never hardcode API keys in your source code. Use environment variables to keep keys separate from your codebase. > > ```bash .env theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > XQUIK_API_KEY=xq_your_api_key_here > ``` > > Access the key in your application. > > ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > const apiKey = process.env.XQUIK_API_KEY; > ``` > > ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > import os > > api_key = os.environ["XQUIK_API_KEY"] > ``` > > ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > apiKey := os.Getenv("XQUIK_API_KEY") > ``` > [accordion] Never commit keys to version control > > Add `.env` to your `.gitignore` to prevent accidental commits. > > ```bash .gitignore theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > # Environment variables > .env > .env.local > .env.production > ``` > > If you commit a key by accident, revoke it immediately from your dashboard. Then generate a new one. Treat the exposed key as compromised. A force-push that removes it from history doesn't change that. > [accordion] Rotate keys on a schedule > > Rotate API keys on a schedule to limit the damage from a leak. > > 1. Create a new key from the dashboard > 2. Update the key in all your environments > 3. Verify all services work with the new key > 4. Revoke the old key > > Xquik supports multiple active keys, so you can rotate without downtime. > [accordion] Use separate keys for development & production > > Create distinct API keys for each environment. A leaked development key then cannot reach production. Each key also records usage for its environment. > > ```bash .env.local theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > # Development > XQUIK_API_KEY=xq_dev_key_here > ``` > > ```bash .env.production theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > # Production > XQUIK_API_KEY=xq_prod_key_here > ``` > > Give each key a descriptive name, such as "Production Backend", "Staging", or "Local Dev". The name identifies the key in the dashboard. > [!NOTE] > > **Next steps.** [Quickstart](/x-api-quickstart) for a complete setup walkthrough, or [OAuth Overview](/oauth/overview) for OAuth 2.1 integration. # Plan & check a tweet draft, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/compose/create Plan, refine, and validate one X post with source-backed guidance from the public X recommendation algorithm, deterministic checks, examples, and intent URLs. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/compose` **Free.** This endpoint does not consume credits. Use this guided Tweet composer to plan, refine, and validate one post draft. Its source is `xai-org/x-algorithm`. It never returns finished Tweet text. It never publishes a post. It never predicts likes, replies, reposts, bookmarks, profile visits, or follower growth. Use 3 Compose calls for one complete writing cycle. ## Workflow 1. Call `compose` with a topic. 2. Answer its 4 questions. 3. Call `refine` with the topic, goal, and tone. 4. Write the draft. Call `score` with its full text. The guidance maps public source facts to the requested goal. Ranking stays viewer-specific. Published defaults may differ from production experiments. ## Choose the correct tweet writing step | Step | Required input | Returned writing help | Not returned | | - | - | - | - | | `compose` | `topic` | 10 source facts and 4 questions | Finished Tweet text | | `refine` | `topic`, `goal`, `tone` | Source guidance and request context | Finished Tweet text | | `score` | `draft` | One input check and pass status | Predicted reach | Each call returns only its step-specific shape. Do not deserialize every result into one generic response type. ## Match the goal to your tweet intent The `goal` selects one question and matching source guidance. | Goal | Compose question | Refine emphasis | | - | - | - | | `engagement` | What call to action should readers take? | One useful point and concrete example | | `followers` | Why should readers follow this account? | Niche expertise and future value | | `authority` | What expertise or insight supports the post? | Evidence, reasoning, and useful frameworks | | `conversation` | What replies should the post invite? | Context, one open question, and readable paragraphs | `compose` defaults to `engagement` when you omit `goal`. Send a documented goal when later steps depend on it. ## Requests > [tab] 1. Compose > > Returns 10 source facts and 4 follow-up questions. > > ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > curl https://xquik.com/api/v1/compose \ > -X POST \ > -H "x-api-key: xq_YOUR_KEY_HERE" \ > -H "Content-Type: application/json" \ > -d '{ > "step": "compose", > "topic": "PostgreSQL query planning", > "goal": "authority" > }' > ``` > > `step` and `topic` are required. > > These fields are optional. > > * `goal` takes `engagement`, `followers`, `authority`, or `conversation`. > Defaults to `engagement`. > * `styleUsername` names an analyzed X (Twitter) username or saved custom style label. > [tab] 2. Refine > > Returns goal, tone, media, and editorial guidance. > > ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > curl https://xquik.com/api/v1/compose \ > -X POST \ > -H "x-api-key: xq_YOUR_KEY_HERE" \ > -H "Content-Type: application/json" \ > -d '{ > "step": "refine", > "topic": "PostgreSQL query planning", > "goal": "authority", > "tone": "professional", > "mediaType": "none" > }' > ``` > > `step`, `topic`, `goal`, and `tone` are required. > > These fields are optional. > > * `mediaType` takes `photo`, `video`, or `none`. > * `callToAction` names the action the draft should request. > * `additionalContext` adds audience, constraints, or source context. > [tab] 3. Score > > Runs one deterministic input check. > > ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > curl https://xquik.com/api/v1/compose \ > -X POST \ > -H "x-api-key: xq_YOUR_KEY_HERE" \ > -H "Content-Type: application/json" \ > -d '{ > "step": "score", > "draft": "PostgreSQL 18 reduced query latency by 30%. Test the JIT compiler on analytical workloads. Which result changed your rollout plan?", > "hasLink": false > }' > ``` > > `step` and `draft` are required. > > `hasLink` and the deprecated `hasMedia` field remain accepted. Validation > ignores both fields. ## Refine request context The `tone` field accepts any non-empty string. The response keeps the requested tone, topic, goal, media, action, and additional context. It then adds source-backed viewer-action guidance. It does not invent style rules. ## Headers Send `x-api-key` with an Xquik API key. OAuth clients can send a bearer token through the `Authorization` header instead. | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | OAuth bearer token using `Bearer YOUR_TOKEN`. | | `Content-Type` | `string` | Yes | Use `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `step` | `string` | Yes | Use exactly `compose`, `refine`, or `score`. | | `topic` | `string` | No | Non-empty subject. Required for `compose` and `refine`. | | `goal` | `string` | No | Use `engagement`, `followers`, `authority`, or `conversation`. Required for `refine`. Optional for `compose`. | | `styleUsername` | `string` | No | Account-scoped analyzed username or custom label. Only used by `compose`. Xquik lowercases the lookup value. | | `tone` | `string` | No | Non-empty voice description. Required for `refine`. | | `mediaType` | `string` | No | Optional `photo`, `video`, or `none` value for `refine`. | | `callToAction` | `string` | No | Optional requested action for `refine`. | | `additionalContext` | `string` | No | Optional audience, constraint, or verified source context for `refine`. Include selected Radar facts only when current context helps. | | `draft` | `string` | No | Non-empty full post text. Required for `score`. | | `hasLink` | `boolean` | No | Set true when a separate link card is attached during `score`. | | `hasMedia` | `boolean` | No | Deprecated compatibility field. Text checks ignore it. | The API ignores unknown body fields. Send only the fields for the selected step. ## Response ### 200 OK The response shape matches the requested workflow step. ## Compose response | Field | Type | Required | Description | | - | - | - | - | | `contentRules` | `object[]` | Yes | 10 source facts from the public X recommendation code. | | `contentRules[].rule` | `string` | Yes | One concrete editorial rule for the requested goal. | | `followUpQuestions` | `string[]` | Yes | 4 questions for the next writing step. | | `radarRecommendations` | `object[]` | Yes | Deprecated compatibility field. Always empty. | | `engagementMultipliers` | `object[]` | Yes | 26 published signal names. Every `multiplier` states that X does not publish the production weight. | | `engagementMultipliers[].action` | `string` | Yes | Human-readable public signal name. | | `engagementMultipliers[].multiplier` | `string` | Yes | States that X does not publish the production multiplier. | | `scorerWeights` | `object[]` | Yes | 26 published signal names. Every `weight` is `null`. | | `scorerWeights[].signal` | `string` | Yes | Signal name from X's public ranking repository. | | `scorerWeights[].context` | `string` | Yes | Signal direction and the limit of public evidence. | | `scorerWeights[].weight` | `null` | Yes | Always `null` because X does not publish production weights. | | `engagementVelocity` | `string` | Yes | States that X publishes no universal engagement window or decay rate. | | `topPenalties` | `string[]` | Yes | 5 negative predictions named by X's public model. Xquik claims no severity order. | | `source` | `string` | Yes | Signal source and evidence limits. | | `intentUrl` | `string` | Yes | X post intent seeded with the topic. | | `nextStep` | `string` | Yes | Exact fields required for `refine`. | | `savedStyles` | `object[]` | No | Saved styles. Present when saved styles exist and `styleUsername` is omitted. | | `savedStyles[].username` | `string` | No | Saved analyzed username or custom style label. | | `savedStyles[].tweetCount` | `integer` | No | Cached post count for the style. | | `styleTweets` | `string[]` | No | Cached examples. Present when `styleUsername` matches a cached style. | | `styleNote` | `string` | No | Fallback instruction when the requested style is unavailable. | ### Match a saved Twitter writing style `styleUsername` searches only styles owned by the authenticated account. Xquik lowercases the lookup value before searching. | Style lookup | Result | | - | - | | Matching analyzed username or custom label | 200 response with `styleTweets` | | Omitted value with saved styles | 200 response with `savedStyles` | | Missing style without available credits | 200 response with `styleNote` | | Missing style with available credits | 400 `invalid_input` with analysis instructions | The 200 fallback still returns the complete Compose response. The 400 branch returns only the documented error object. Analyze the username first when the account can run a new style analysis. ## Refine response | Field | Type | Required | Description | | - | - | - | - | | `compositionGuidance` | `string[]` | Yes | Goal, tone, media, and editorial guidance. | | `examplePatterns` | `object[]` | Yes | Deprecated compatibility field. Always empty. | | `intentUrl` | `string` | Yes | X post intent seeded with the topic. | | `nextStep` | `string` | Yes | Exact fields required for the `score` call. | ## Score response This step runs one deterministic input check. It checks that the draft contains text. It does not score quality or predict ranking. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "checklist": [{ "factor": "Draft contains text", "passed": true }], "intentUrl": "https://x.com/intent/tweet?text=...", "nextStep": "Draft accepted. Publish through POST /api/v1/x/tweets or use intentUrl.", "passed": true, "passedCount": 1, "topSuggestion": "No deterministic ranking score exists. Ranking uses per-viewer predictions.", "totalChecks": 1 } ``` `intentUrl` appears only when the draft contains text. | Field | Type | Required | Description | | - | - | - | - | | `checklist` | `object[]` | Yes | One deterministic input check. | | `checklist[].factor` | `string` | Yes | Stable name for the evaluated rule. | | `checklist[].passed` | `boolean` | Yes | Whether the draft satisfies this rule. | | `checklist[].suggestion` | `string` | No | `Add the post text.` when the draft is blank. | | `passed` | `boolean` | Yes | True when the draft contains text. | | `passedCount` | `integer` | Yes | `1` for text. `0` for a blank draft. | | `totalChecks` | `integer` | Yes | Always `1` for the current contract. | | `topSuggestion` | `string` | Yes | The missing-text fix or the source limit on deterministic ranking scores. | | `intentUrl` | `string` | No | X post intent containing the draft. Present only when every check passes. | | `nextStep` | `string` | Yes | Publishing instructions after success. Revision instructions after failure. | ## Errors | Status | Cause | Fix | | - | - | - | | `400` | Invalid `step` or non-object JSON body | Send `compose`, `refine`, or `score` | | `400` | Missing `topic` for `compose` | Send a non-empty topic | | `400` | Missing `goal`, `tone`, or `topic` for `refine` | Send every required Refine field | | `400` | Missing `draft` for `score` | Send the complete post text | | `400` | Account with credits requested an uncached style | Analyze the username with `POST /api/v1/styles` | | `401` | Missing or invalid API credentials | Send an API key or OAuth bearer token | | `429` | Request rate exceeded | Wait for `Retry-After` before retrying | > [tab] 400 Invalid input > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "error": "invalid_input", > "message": "step is required. Must be \"compose\", \"refine\", or \"score\"." > } > ``` > > Missing step-specific fields also return `invalid_input`. > [tab] 401 Unauthenticated > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "unauthenticated" } > ``` > [tab] 429 Rate limited > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "error": "rate_limit_exceeded", > "message": "Too many requests. Try again later.", > "retryAfter": 60 > } > ``` > > Wait for `Retry-After` before retrying. ## Tweet composer questions ### What does the tweet composer generate? It returns source facts, 4 questions, request context, and one input check. You write the draft between `refine` and `score`. ### Is this endpoint a tweet generator? No. A Tweet generator usually writes final post text from one prompt. This endpoint guides a 3-step writing workflow. It helps plan, refine, and check one draft without publishing it. ### How does it help write a good tweet? Choose a goal before drafting. Answer the 4 questions. Add verified context when needed. Treat source signals as viewer-specific, not universal advice. ### Can it supply current Twitter post ideas? No. `radarRecommendations` remains an empty compatibility field. Supply verified facts through `additionalContext` during Refine. ### Can it match a saved Twitter writing style? Yes. Send an analyzed username or custom style label in `styleUsername`. A successful match returns cached `styleTweets`. Use those samples to study sentence length, vocabulary, openings, and calls to action. The endpoint does not rewrite the draft. It also doesn't verify that one style belongs to a public X (Twitter) username. ### What happens when a draft check fails? `passed` becomes false for a blank draft. The checklist suggests adding text. `intentUrl` stays absent until the draft contains text. ### Does the score predict likes, replies, or reposts? No. It never predicts likes, replies, reposts, bookmarks, profile visits, or follower growth. Ranking stays viewer-specific. ### Can the endpoint publish the draft? No. Use [Create Tweet](/api-reference/x-write/create-tweet) after review. You can also open `intentUrl` after the input check passes. > [!NOTE] > > Research current context with [Radar](/api-reference/radar/list). Save accepted > text with [Create Draft](/api-reference/drafts/create). Analyze a reference > voice with [Analyze Style](/api-reference/styles/analyze). ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "checklist": [ { "factor": "Draft contains text", "passed": true } ], "nextStep": "Draft accepted. Publish through POST /api/v1/x/tweets or use intentUrl.\n", "passed": true, "passedCount": 1, "topSuggestion": "No deterministic ranking score exists. Ranking uses per-viewer predictions.", "totalChecks": 1, "intentUrl": "https://x.com/intent/tweet?text=PostgreSQL%2018%20reduced%20query%20latency" } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Credit balance & API usage, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/credits/get Retrieve the available API credit balance, lifetime purchased and used totals, and automatic top-up settings for an Xquik account. The call is free to run. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/credits` ## When to read credits This route is read-only. It returns current balance, lifetime totals, and automatic top-up settings. Use purchase and status routes only after deciding to add credits. ## Check credits before tweets, followers, or monitors Read the balance before starting a large tweet search, follower export, or reply export. Also read it before starting an active monitor or X write. Compare the balance with the route's documented credit cost. Reduce the requested result count when the available balance cannot cover the full job. Keep `balance`, `lifetime_purchased`, and `lifetime_used` as strings. These values can exceed JavaScript's safe integer range. Convert them with a bigint library only when the client supports exact arithmetic. Review automatic top-up fields separately. `auto_topup_enabled` reports whether automatic funding is active. The threshold and dollar amount describe when and how much the account adds. `auto_topup_stopped` is `true` when declined charges stopped it. Ask the user to update the card in the dashboard to restart it. This endpoint never charges a payment method. Use standard top-up for a hosted checkout. Use quick top-up only after the account has a saved payment method. Poll standard checkout status with the checkout session ID. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/credits \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/credits", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const data = await response.json(); console.log(data); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/credits", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) data = response.json() print(data) ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `auto_topup_amount_dollars` | `number` | Dollar amount charged when automatic top-up runs. | | `auto_topup_enabled` | `boolean` | Whether automatic top-up is enabled. | | `auto_topup_stopped` | `boolean` | Whether declined charges stopped automatic top-up while it is enabled. It stops after 3 declines in a row on one card. A paid top-up or a paid plan renewal clears it. So does the next automatic top-up on a new card. | | `auto_topup_threshold` | `string` | Credit balance threshold that triggers automatic top-up when enabled (Bigint string). | | `balance` | `string` | Current credit balance (Bigint string to preserve precision above Number.MAX_SAFE_INTEGER). | | `lifetime_purchased` | `string` | Total credits purchased (Bigint string). | | `lifetime_used` | `string` | Total credits consumed (Bigint string). | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "auto_topup_amount_dollars": 10, "auto_topup_enabled": false, "auto_topup_stopped": false, "auto_topup_threshold": "50000", "balance": "450", "lifetime_purchased": "1000", "lifetime_used": "550" } ``` ### 401 Unauthenticated Missing or invalid API key. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Top Up Credits](/api-reference/credits/topup) · [Get Top-Up Status](/api-reference/credits/topup-status) · [Quick Top-Up](/api-reference/credits/quick-topup) · [Billing Guide](/guides/billing) ## Response examples * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Quick top-up by saved payment, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/credits/quick-topup Charge a saved method for USD 10-500 in the Xquik dashboard. Handle authentication, declines, and checkout fallback without double billing or server errors. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/credits/quick-topup` Add API credits from the Xquik dashboard with a saved payment method. ## Add API credits with a saved payment method Use quick top-up after the dashboard confirms an amount from USD 10 through 500. This route requires a same-origin Xquik session. External integrations must use the [hosted top-up endpoint](/api-reference/credits/topup). Read `outcome` before handling any other response field. `charged` means the credits and new balance are ready. `requires_action` means the client must complete payment authentication. `declined` means the saved method failed. `no_payment_method` means the account has no reusable payment method. Never print or store `clientSecret`. Pass it directly to the payment confirmation flow. Log only the outcome, added credits, and resulting balance after a successful charge. Quick top-up differs from standard checkout status. The status route polls a hosted checkout session by `session_id`. This route returns its own immediate payment outcome for the saved payment method. **Free.** This endpoint does not consume credits. ```javascript Dashboard browser theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("/api/v1/credits/quick-topup", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ dollars: 25 }), }); const result = await response.json(); if (result.outcome === "charged") { window.location.reload(); } else if (result.outcome === "requires_action") { await confirmSavedPayment(result.clientSecret); } else { window.location.assign("/account/subscription"); } ``` | Credit top-up outcome | Response fields | Next action | | - | - | - | | Immediate charge | `outcome: "charged"` | Store `credits` and the updated `balance`. | | Payment authentication | `outcome: "requires_action"` | Complete the billing confirmation flow. | | Missing payment method | `outcome: "no_payment_method"` | Create a checkout top-up instead. | | Declined payment method | `outcome: "declined"` | Ask for another payment method. | | Added credits | `credits` | Treat the bigint value as a string. | | Updated balance | `balance` | Check it before the next tweet, follower, or monitor job. | | Confirmation secret | `clientSecret` | Send it only to the billing confirmation flow. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `dollars` | `number` | Yes | Top-up amount in US dollars, which sets the credits. Minimum USD 10, maximum USD 500. | | `currency` | `string` | No | Currency the saved card pays in. Xquik converts the dollar amount at the latest daily ECB rate. The credits always match the dollar amount. Use 1 of `USD`, `EUR`, `GBP`, `TRY`, `JPY`, `CNY`, `KRW`, `CAD`, `AUD` or `MXN`. Lowercase codes work too. With rates over 3 ECB working days old, Xquik charges nothing in other currencies. It answers 409 `price_changed` with the USD charge instead. | | `chargedMinorUnits` | `integer` | No | The charge you showed the payer, in the currency's smallest unit. Send `2231` for EUR 22.31 or `1580` for JPY 1,580. If the charge differs, Xquik charges nothing. It answers 409 `price_changed` with the new charge. Leave it out to pay the current charge. | At USD 0.00015 per credit, a USD 25 quick top-up adds 166,666 credits. Xquik rounds down to whole credits. Only `charged` grants credits. Complete `requires_action` with `clientSecret`. Use hosted checkout for `declined` or `no_payment_method`. ## Response ### 200 Charged The payment succeeded. Xquik added the credits to your balance. | Field | Type | Description | | - | - | - | | `outcome` | `string` | Always `"charged"`. | | `balance` | `string` | Updated credit balance after top-up (Bigint string). | | `credits` | `string` | Number of credits added (Bigint string). | | `chargedCurrency` | `string` | Currency the saved card paid in, such as `EUR`. | | `chargedMinorUnits` | `integer` | Amount charged in the currency's smallest unit. JPY and KRW have no decimals. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "outcome": "charged", "balance": "466666", "credits": "166666", "chargedCurrency": "EUR", "chargedMinorUnits": 2231 } ``` ### 200 Requires action Payment requires more authentication, such as 3D Secure. Use the returned client secret with the billing confirmation flow to complete the payment. | Field | Type | Description | | - | - | - | | `outcome` | `string` | Always `"requires_action"`. | | `clientSecret` | `string` | Payment client secret for completing the payment. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "outcome": "requires_action", "clientSecret": "pi_3abc...secret_xyz" } ``` ### 200 No payment method The account has no saved payment method. Redirect the user to add one in the billing portal. Or use the standard [top-up endpoint](/api-reference/credits/topup) instead. | Field | Type | Description | | - | - | - | | `outcome` | `string` | Always `"no_payment_method"`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "outcome": "no_payment_method" } ``` ### 200 Declined The saved method failed. Open hosted checkout so the user can choose another. | Field | Type | Description | | - | - | - | | `outcome` | `string` | Always `"declined"`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "outcome": "declined" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Maximum quick top-up is $500" }` Xquik charges nothing. The `message` names the field to fix. * `dollars` is missing, below USD 10, above USD 500 or has over 2 decimals. * `currency` is not 1 of the 10 codes. * `chargedMinorUnits` is not a positive whole number. ### 401 Unauthenticated Missing or expired dashboard session. This route does not accept API keys. ### 409 Conflict Xquik charged nothing for this request. `{ "error": "price_changed", "message": "The price changed. Resend with this chargedCurrency & chargedMinorUnits to pay.", "chargedCurrency": "USD", "chargedMinorUnits": 2500 }` `price_changed` means the charge differs from the one you sent. Show the payer the new charge. To pay it, resend with `currency` set to `chargedCurrency` and the new `chargedMinorUnits`. | Field | Type | Description | | - | - | - | | `chargedCurrency` | `string` | Currency Xquik would charge now, such as `USD`. | | `chargedMinorUnits` | `integer` | Amount Xquik would charge now, in the currency's smallest unit. | `idempotency_conflict` means an `Idempotency-Key` came back with another amount or currency. Send a new key to buy again. `topup_in_progress` means another top-up for this account is still running. Check your balance before you try again. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Top Up Credits](/api-reference/credits/topup) · [Get Top-Up Status](/api-reference/credits/topup-status) · [Get Credits](/api-reference/credits/get) · [Billing Guide](/guides/billing) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "session_required", "message": "API keys & OAuth tokens cannot use this route. Sign in at dashboard.xquik.com/account instead." }` * **409** `{ "error": "price_changed", "message": "The price changed. Resend with this chargedCurrency & chargedMinorUnits to pay." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Buy credits for reads & writes, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/credits/topup Create a hosted checkout for at least USD 10 of tweet, profile, follower, monitor, webhook, export, and X write API credits. Returns one redirect URL. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/credits/topup` ## When to use hosted checkout Use this route when the buyer needs a hosted checkout. Use quick top-up for a saved payment method. Use top-up status only to poll an existing checkout session. Store the `session_id` from the returned URL before redirecting the user. The status route needs it. **Free.** This endpoint does not consume credits. Ask the user to confirm the dollar amount before calling this endpoint. The response returns a hosted checkout URL. The call does not complete payment or add credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/credits/topup \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"dollars": 10}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/credits/topup", { method: "POST", headers: { "x-api-key": "xq_your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ dollars: 10 }), }); const data = await response.json(); process.stdout.write(`${JSON.stringify(data, null, 2)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/credits/topup", headers={"x-api-key": "xq_your_api_key_here"}, json={"dollars": 10}, ) data = response.json() print(data) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "dollars": 10, }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/credits/topup", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_your_api_key_here") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `dollars` | `number` | Yes | Amount in US dollars to top up. Minimum \$10. | | `currency` | `string` | No | Currency to pay in. Xquik converts the dollar amount at the latest daily ECB rate. The credits always match the dollar amount. Use 1 of `USD`, `EUR`, `GBP`, `TRY`, `JPY`, `CNY`, `KRW`, `CAD`, `AUD` or `MXN`. Lowercase codes work too. With rates over 3 ECB working days old, Checkout charges USD instead. It shows the USD charge before payment, and `chargedCurrency` says `USD`. | | `locale` | `string` | No | Optional checkout locale. Defaults to `en`. | | `returnPath` | `string` | No | Optional Xquik tool page to return to after Checkout, such as `/en/x-article-reader`. Without it, Checkout returns to the billing page. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `url` | `string` | Stable Xquik redirect URL for the active hosted checkout session. Open it in a browser. `GET /credits/topup/redirect` redirects with `303`. The target is the payment page, or the account page after checkout ends. | | `redirect_url` | `string` | Same stable redirect URL in snake_case. | | `chargedCurrency` | `string` | Currency the checkout charges, such as `EUR`. | | `chargedMinorUnits` | `integer` | Amount the checkout charges before tax, in the currency's smallest unit. JPY and KRW have no decimals, so 1580 JPY is ¥1,580. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "url": "https://xquik.com/api/v1/credits/topup/redirect?session_id=checkout_session_id", "redirect_url": "https://xquik.com/api/v1/credits/topup/redirect?session_id=checkout_session_id", "chargedCurrency": "EUR", "chargedMinorUnits": 892 } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Minimum top-up is $10" }` Xquik opens no checkout. The `message` names the field to fix. * `dollars` is missing, below USD 10 or not a whole number. * `currency` is not 1 of the 10 codes. * `returnPath` is not an Xquik tool page. ### 401 Unauthenticated Missing or invalid API key. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Get Credits](/api-reference/credits/get) · [Get Top-Up Status](/api-reference/credits/topup-status) · [Quick Top-Up](/api-reference/credits/quick-topup) · [Billing Guide](/guides/billing) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Credit top-up payment status, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/credits/topup-status Poll a credit checkout session for processing, paid, expired, or failed status before starting tweet, follower, monitor, or write requests. Polling is free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/credits/topup/status` **Free.** This endpoint does not consume credits. Use this endpoint after creating a standard [top-up checkout](/api-reference/credits/topup). Pass the checkout session ID for that top-up to check whether payment is complete. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/credits/topup/status?session_id=checkout_session_id" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const sessionId = "checkout_session_id"; const response = await fetch( `https://xquik.com/api/v1/credits/topup/status?session_id=${encodeURIComponent(sessionId)}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" } }, ); const data = await response.json(); console.log(data); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/credits/topup/status", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"session_id": "checkout_session_id"}, ) data = response.json() print(data) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" "net/url" ) func main() { endpoint, err := url.Parse("https://xquik.com/api/v1/credits/topup/status") if err != nil { panic(err) } query := endpoint.Query() query.Set("session_id", "checkout_session_id") endpoint.RawQuery = query.Encode() req, err := http.NewRequest("GET", endpoint.String(), nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Hold queued API work until checkout is paid Store the checkout session ID when creating a standard top-up. Associate it with the intended tweet, follower, reply, monitor, or write workload. Never substitute a session from another account or purchase. Poll this endpoint before you start work that needs the credits. Act on the returned status. * `processing` keeps the workload paused. * `paid` allows a fresh credit-balance check. * `failed` requires a new checkout. * `expired` requires a new checkout. Do not start work from `amount_dollars` or `credits` alone. Only `paid` confirms that Xquik granted credits. Then call [Get Credits](/api-reference/credits/get). Compare the balance with the planned request cost. Limit polls while the status is `processing`. Wait between requests and honor `Retry-After` after rate limiting. Faster polling does not speed up payment. Store the last observed status and check time with the session ID. This lets another worker resume polling without creating a second purchase. `failed` and `expired` are final. Stop polling that session. Create a new checkout only after the user or approved billing workflow requests it. When `paid` appears, start only the workload tied to that checkout. Keep unrelated queues behind their own credit and approval checks. One top-up then cannot start unrelated work. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `session_id` | `string` | Yes | Checkout session ID for the top-up checkout. | ## Response ### 200 Paid Payment succeeded. Xquik added credits to the account. | Field | Type | Description | | - | - | - | | `status` | `string` | Always `"paid"`. | | `amount_dollars` | `integer` | Dollar amount requested for the top-up. | | `credits` | `string` | Credit amount granted as a Bigint string. | | `chargedCurrency` | `string` | Currency the checkout charged, such as `EUR`. | | `chargedMinorUnits` | `integer` | Amount the checkout charged before tax, in the currency's smallest unit. JPY and KRW have no decimals. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "amount_dollars": 25, "chargedCurrency": "EUR", "chargedMinorUnits": 2231, "credits": "166666", "status": "paid" } ``` ### 200 Processing Payment has not reached a final state yet. Poll again later. | Field | Type | Description | | - | - | - | | `status` | `string` | Always `"processing"`. | | `amount_dollars` | `integer` | Dollar amount requested for the top-up, when available. | | `credits` | `string` | Pending credit amount as a Bigint string, when available. | | `chargedCurrency` | `string` | Currency the checkout charges, such as `EUR`, when available. | | `chargedMinorUnits` | `integer` | Amount the checkout charges before tax, in the currency's smallest unit, when available. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "amount_dollars": 25, "chargedCurrency": "EUR", "chargedMinorUnits": 2231, "credits": "166666", "status": "processing" } ``` ### 200 Failed Payment failed. Create a new top-up checkout before retrying payment. | Field | Type | Description | | - | - | - | | `status` | `string` | Always `"failed"`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "status": "failed" } ``` ### 200 Expired The checkout session expired before payment completed. | Field | Type | Description | | - | - | - | | `status` | `string` | Always `"expired"`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "status": "expired" } ``` ### 400 Invalid input The `session_id` query parameter is missing. ### 401 Unauthenticated Missing or invalid API key. ### 404 Not found No top-up checkout exists for that session ID on this account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Top Up Credits](/api-reference/credits/topup) · [Quick Top-Up](/api-reference/credits/quick-topup) · [Get Credits](/api-reference/credits/get) · [Billing Guide](/guides/billing) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Create a tweet draft, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/drafts/create Save one Xquik tweet draft with text, optional topic and goal, 25,000-character validation, API authentication, and clear 400, 401 or 429 recovery steps. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/drafts` ## Save a tweet draft before publishing Create one private tweet draft inside your authenticated Xquik account. Supply the proposed text and optional composition context. The response returns a stable Xquik draft ID for review or deletion. This request does not publish a tweet. It sends nothing to followers. It creates no replies, reposts, likes, impressions, or public tweet ID. Xquik drafts are separate from [X's native Unsent posts](https://help.x.com/en/using-x/how-to-post). Creating a record here does not add anything to the X (Twitter) compose interface. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail-with-body \ --request POST https://xquik.com/api/v1/drafts \ --header "x-api-key: xq_YOUR_KEY_HERE" \ --header "Content-Type: application/json" \ --data '{ "text": "Just shipped dark mode. What feature should we build next?", "topic": "product update", "goal": "conversation" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/drafts", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ text: "Just shipped dark mode. What feature should we build next?", topic: "product update", goal: "conversation", }), }); const draft = await response.json(); if (!response.ok) { throw new Error(`${response.status} ${draft.error}: ${draft.message}`); } console.log(draft.id, draft.text, draft.createdAt); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/drafts", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "text": "Just shipped dark mode. What feature should we build next?", "topic": "product update", "goal": "conversation", }, ) draft = response.json() if response.status_code != 201: raise RuntimeError( f'{response.status_code} {draft["error"]}: {draft["message"]}' ) print(draft["id"], draft["text"], draft["createdAt"]) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, err := json.Marshal(map[string]interface{}{ "text": "Just shipped dark mode. What feature should we build next?", "topic": "product update", "goal": "conversation", }) if err != nil { panic(err) } req, err := http.NewRequest("POST", "https://xquik.com/api/v1/drafts", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var draft map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&draft); err != nil { panic(err) } if resp.StatusCode != http.StatusCreated { panic(fmt.Sprintf("%d %v: %v", resp.StatusCode, draft["error"], draft["message"])) } fmt.Println(draft["id"], draft["text"], draft["createdAt"]) } ``` ## Choose the tweet draft fields Send a JSON object with 1 required field and 2 optional fields. | Field | Requirement | Draft use | | - | - | - | | `text` | Required string with 1 to 25,000 characters | Store the exact proposed tweet text. | | `topic` | Optional string, stored up to 500 characters | Record the intended subject. | | `goal` | Optional supported enum value | Record the intended composition outcome. | The supported `goal` values are `engagement`, `followers`, `authority`, and `conversation`. Match the lowercase value exactly. The API silently omits an unsupported `goal`. It also omits a non-string goal. Validate this field before sending the request. The API silently truncates a topic longer than 500 characters. It omits a non-string topic. Trim and validate the topic inside your client. The `text` field behaves differently. Missing, empty, non-string, or oversized text returns `400 invalid_input`. Xquik never silently truncates draft text. The 25,000-character storage limit is not a publishing guarantee. Confirm the connected account's X posting rules before a separate write request. ## Read the created draft A successful request returns `201 Created` and one draft object. | Field | Meaning | Next action | | - | - | - | | `id` | Stable Xquik draft ID | Store it for retrieval or deletion. | | `text` | Exact accepted text | Compare it with the submitted copy. | | `topic` | Accepted optional topic | Confirm any truncation was acceptable. | | `goal` | Accepted optional goal | Confirm the requested value was supported. | | `createdAt` | ISO 8601 creation timestamp | Record when review began. | | `updatedAt` | ISO 8601 update timestamp | Compare later retrieval with this response. | The API omits optional `topic` and `goal` fields when unset or invalid. Do not expect those keys to contain `null`. The response contains no thread order, media attachment, reply target, or schedule. It also contains no publishing status or public tweet ID. ## Build a tweet draft review workflow Create a draft when a person or agent must approve text before publishing. 1. Prepare one exact tweet text string. 2. Add a short topic when reviewers need context. 3. Choose one supported composition goal. 4. Create the Xquik draft once. 5. Store the returned draft ID. 6. Retrieve that ID before final approval. 7. Compare text, context, and timestamps. 8. Publish approved text through a separate X write route. 9. Delete the saved draft after retention requirements allow it. This route provides no edit operation. Create a replacement draft when text must change. Keep the old ID until reviewers approve the replacement. This route also provides no idempotency key. Repeating the same successful request creates another draft record. Store every `201` response before creating again. After a lost response, list and reconcile drafts before retrying. Use [List Drafts](/api-reference/drafts/list) to reconcile duplicate records. Use [Get Draft](/api-reference/drafts/get) before publishing or deleting one. ## Keep Xquik and native X drafts separate Native X drafts appear under Unsent posts in the X (Twitter) compose interface. Native thread drafts can contain several connected posts. Native drafts can also carry photos, GIFs, or video. An Xquik draft stores one text string plus optional composition context. It does not mirror native draft features or publish automatically. | Draft capability | Xquik create draft | Native X draft | | - | - | - | | Store one text string through an API | Yes | No through this endpoint | | Store optional topic and goal | Yes | Not represented here | | Appear under X Unsent posts | No | Yes | | Keep a native thread sequence | No | Supported by native X workflows | | Keep native media attachments | No | Supported by native X workflows | | Publish during draft creation | No | No | Keep thread items, media IDs, reply targets, and scheduling instructions in your publishing workflow. Do not assume the draft response contains them. ## Recover from draft creation errors | Status | Error | Cause | Fix | | - | - | - | - | | `201` | Draft object | Xquik stored the draft | Save the returned ID. | | `400` | `invalid_input` | `text` is missing, empty, non-string, or oversized | Send 1 to 25,000 characters. | | `401` | `unauthenticated` | The credential is missing or invalid | Replace the API key or bearer token. | | `429` | `rate_limit_exceeded` | Too many requests reached the route | Wait for `Retry-After`, then retry once. | Never retry `400` without changing the body. Never retry `401` without replacing the credential. After `429`, keep the submitted text. Retry only after the server's delay. Reconcile the list when the original request may have succeeded. ## Tweet draft creation questions ### How can I save a tweet draft through an API? Send `POST /drafts` with a JSON `text` string. Authenticate with an Xquik API key or OAuth bearer token. ### Does creating a draft publish the tweet? No. The request stores private Xquik text only. Publish through a separate write route after approval. ### Does the draft appear in X unsent posts? No. Xquik draft records and native X drafts are separate collections. ### Can one draft store a Twitter thread? No. One draft stores one text string. Create and keep thread structure in your publishing workflow. ### Can I attach media or a reply target? No. Draft fields contain no media or reply target. Add those details during a separate publishing request. ### Can I update a saved tweet draft? No update route exists. Create a replacement, approve it, then delete the old record when safe. ### Does creating a tweet draft consume credits? No. This authenticated draft creation request is free. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | An OAuth bearer token formatted as `Bearer YOUR_TOKEN`. Send this header or `x-api-key`, not both. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `text` | `string` | Yes | Exact draft text. Send 1 to 25,000 characters. Oversized text returns `400`. | | `topic` | `string` | No | Optional composition topic. The API silently truncates values longer than 500 characters. | | `goal` | `string` | No | Optional. Use `engagement`, `followers`, `authority`, or `conversation`. Any other value returns `400` that names the 4 goals. | ## Response ### 201 Created | Field | Type | Description | | - | - | - | | `id` | `string` | Unique Xquik draft ID. | | `text` | `string` | Exact accepted tweet text. | | `topic` | `string` | Optional accepted topic. Omitted when unset. | | `goal` | `string` | Optional accepted goal. Omitted when unset. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `updatedAt` | `string` | ISO 8601 update timestamp. | | `ignoredFields` | `string[]` | Fields the request sent that this route does not read, in the order sent. They changed nothing. Omitted when the route read every field. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "42", "text": "Just shipped dark mode. What feature should we build next?", "topic": "product update", "goal": "conversation", "createdAt": "2026-02-24T10:30:00.000Z", "updatedAt": "2026-02-24T10:30:00.000Z" } ``` ### 400 Invalid input The `text` field is missing, empty, non-string, or longer than 25,000 characters. `{ "error": "invalid_input", "message": "Set goal to engagement, followers, authority, or conversation." }` The `goal` field holds a value outside the 4 goals. ### 401 Unauthenticated Authentication is missing or invalid. Replace the credential before retrying. ### 429 Rate limited Too many requests reached the route. Wait for `Retry-After` before retrying. > [!NOTE] > > **Next steps.** > > * [List Drafts](/api-reference/drafts/list) to list saved text. > * [Get Draft](/api-reference/drafts/get) to retrieve one record. > * [Delete Draft](/api-reference/drafts/delete) to remove it. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Delete a saved tweet draft, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/drafts/delete Delete one Xquik tweet draft by ID without deleting a published post or native X draft. Handle empty 204 responses and 400, 401, 404 & 429 API errors. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/drafts/{id}` ## Delete one saved tweet draft Delete one tweet draft from your Xquik account. The request removes its saved text, optional topic, optional goal, and timestamps. It does not publish the draft or call an X write route. This endpoint manages Xquik draft records only. It does not manage drafts under [X's native Unsent posts](https://help.x.com/en/using-x/how-to-post). It also does not delete published tweets, scheduled posts, or connected X accounts. Use the draft ID returned by [Create Draft](/api-reference/drafts/create) or [List Drafts](/api-reference/drafts/list). Fetch the draft before deletion when its text must receive human approval. > [!WARNING] > > Deletion is permanent. Xquik provides no restore endpoint for deleted tweet > drafts. Confirm the saved text and draft ID before sending this request. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --include --request DELETE \ https://xquik.com/api/v1/drafts/42 \ --header "x-api-key: xq_YOUR_KEY_HERE" ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const draftId = "42"; const response = await fetch(`https://xquik.com/api/v1/drafts/${draftId}`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); if (response.status !== 204) { const problem = await response.json(); throw new Error(`${response.status} ${problem.error}: ${problem.message}`); } console.log(`Deleted tweet draft ${draftId}`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests draft_id = "42" response = requests.delete( f"https://xquik.com/api/v1/drafts/{draft_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) if response.status_code != 204: problem = response.json() raise RuntimeError( f'{response.status_code} {problem["error"]}: {problem["message"]}' ) print(f"Deleted tweet draft {draft_id}") ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" ) func main() { draftID := "42" req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/drafts/"+draftID, nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() if resp.StatusCode != http.StatusNoContent { var problem struct { Error string `json:"error"` Message string `json:"message"` } if err := json.NewDecoder(resp.Body).Decode(&problem); err != nil { panic(err) } panic(fmt.Sprintf("%d %s: %s", resp.StatusCode, problem.Error, problem.Message)) } fmt.Printf("Deleted tweet draft %s\n", draftID) } ``` ## Handle 204 no content A successful tweet draft deletion returns `204 No Content`. The response has no JSON, text, or deletion object. Check the status before parsing the body. Calling `response.json()` after a successful deletion throws an end-of-input error. Parse JSON only for `400`, `401`, `404`, or `429` responses. The `204` status confirms that Xquik deleted the matching draft record. It does not return the deleted text. Fetch and store any needed review copy first. ## Confirm the correct tweet draft Use a read-before-delete flow for dashboards, agents, and scheduled cleanup jobs. 1. Fetch the draft through `GET /drafts/{id}`. 2. Compare its `id`, `text`, `topic`, `goal`, and timestamps. 3. Ask for confirmation when a person owns the draft. 4. Send `DELETE /drafts/{id}` once. 5. Accept only `204` as a successful deletion. 6. Remove the draft from your local queue. 7. List drafts again when reconciliation matters. Do not guess draft IDs. Use an ID returned to the authenticated account. A numeric ID owned by another account returns `404` without exposing ownership. ## Understand what deletion changes | Resource | Result | Reason | | - | - | - | | Matching Xquik draft | Deleted permanently | This route targets one stored draft ID. | | Draft text, topic, and goal | Deleted with the draft | These fields belong to that record. | | Native X or Twitter draft | Unchanged | Xquik cannot edit the X (Twitter) compose box. | | Published tweet or thread | Unchanged | Use a separate X write route for live posts. | | Scheduled post | Unchanged | Draft deletion does not cancel a schedule. | | Connected X account | Unchanged | The request changes no account connection. | A saved Xquik tweet draft is not a published tweet. It has an Xquik draft ID, not a public tweet ID. Deleting one cannot remove replies, reposts, likes, or media attached to a published post. ## Recover from draft deletion errors | Status | Error | Cause | Fix | | - | - | - | - | | `204` | No body | Xquik deleted the draft | Stop. Do not parse JSON. | | `400` | `invalid_id` | The path value is not a parseable draft ID | Copy an ID from Create Draft or List Drafts. | | `401` | `unauthenticated` | The credential is missing or invalid | Replace the API key or bearer token. | | `404` | `draft_not_found` | The draft is absent or belongs to another account | Verify the ID and authenticated account. | | `429` | `rate_limit_exceeded` | Too many requests reached the route | Wait for `Retry-After`, then retry once. | A second deletion of the same ID returns `404`. The first request already removed the record. Treat that result as success only when your workflow allows it. Never retry `400`, `401`, or `404` without changing the request. The same request fails the same way. It cannot restore a deleted draft. ## Tweet draft deletion questions ### Does this delete a published tweet? No. This route deletes one saved Xquik draft. Use the documented tweet deletion route for a live post the connected account owns. ### Does this delete my native X draft? No. Native X drafts appear under Unsent posts. Xquik draft IDs identify separate records stored for API composition workflows. ### Can I restore a deleted tweet draft? No restore route exists. Save an approved copy before deletion when retention rules require one. ### Can I delete every draft in one request? No bulk deletion route exists. List drafts, confirm each target, and delete each ID separately. Apply your own concurrency and rate-limit controls. ### Why does a successful delete return no JSON? HTTP `204` means the deletion succeeded without response content. Check the status code instead of parsing a body. ### Why does a retry return 404? The first successful request removed the draft. Later requests cannot find the same account-owned record. ### Does deleting a draft consume credits? No. This authenticated route is free and consumes no Xquik credits. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique Xquik draft ID. Copy it from [Create Draft](/api-reference/drafts/create) or [List Drafts](/api-reference/drafts/list). | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | An OAuth bearer token formatted as `Bearer YOUR_TOKEN`. Send this header or `x-api-key`, not both. | ## Response > [tab] 204 No content > > Xquik deleted the draft. Do not parse a response body. > [tab] 400 Invalid ID > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "invalid_id", "message": "Invalid ID format." } > ``` > > The provided draft ID is not a valid format. > [tab] 401 Unauthenticated > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." } > ``` > > Missing or invalid API key. > [tab] 404 Not found > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "draft_not_found", "message": "Draft not found." } > ``` > > No draft exists with this ID, or it belongs to a different account. > [tab] 429 Rate limited > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 } > ``` > > Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** > > * [List Drafts](/api-reference/drafts/list) to verify the draft was removed. > * [Create Draft](/api-reference/drafts/create) to save a new one. ## Response examples * **204** `No response body.` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Get a tweet draft by ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/drafts/get Retrieve one Xquik tweet draft by ID with saved text, optional topic, optional goal, creation time & update time. Handle 400, 401, 404 & 429 API errors. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/drafts/{id}` ## Retrieve one tweet draft by ID Retrieve one saved tweet draft from your Xquik account. The response contains its ID, text, optional topic, optional goal, and timestamps. It does not return thread order, media attachments, reply targets, or publishing results. Use the ID returned by [Create Draft](/api-reference/drafts/create) or [List Drafts](/api-reference/drafts/list). This route reads that record without creating, changing, publishing, or deleting it. Xquik drafts are separate from [X's native Unsent posts](https://help.x.com/en/using-x/how-to-post). This endpoint cannot retrieve drafts stored inside the X (Twitter) compose interface. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail-with-body \ https://xquik.com/api/v1/drafts/42 \ --header "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const draftId = "42"; const response = await fetch(`https://xquik.com/api/v1/drafts/${draftId}`, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const draft = await response.json(); if (!response.ok) { throw new Error(`${response.status} ${draft.error}: ${draft.message}`); } console.log(draft.id, draft.text, draft.updatedAt); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests draft_id = "42" response = requests.get( f"https://xquik.com/api/v1/drafts/{draft_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) draft = response.json() if response.status_code != 200: raise RuntimeError( f'{response.status_code} {draft["error"]}: {draft["message"]}' ) print(draft["id"], draft["text"], draft["updatedAt"]) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" ) func main() { draftID := "42" req, err := http.NewRequest("GET", "https://xquik.com/api/v1/drafts/"+draftID, nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var draft map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&draft); err != nil { panic(err) } if resp.StatusCode != http.StatusOK { panic(fmt.Sprintf("%d %v: %v", resp.StatusCode, draft["error"], draft["message"])) } fmt.Println(draft["id"], draft["text"], draft["updatedAt"]) } ``` ## Read the tweet draft fields The API returns one draft object. It omits optional fields that you did not supply during creation. | Field | Meaning | Review use | | - | - | - | | `id` | Stable Xquik draft ID | Keep it for later retrieval or deletion. | | `text` | Exact saved tweet text | Review this copy before publishing. | | `topic` | Optional composition topic | Keep the intended subject. | | `goal` | Optional composition goal | Check engagement, followers, authority, or conversation intent. | | `createdAt` | ISO 8601 creation timestamp | Record when someone created the draft. | | `updatedAt` | ISO 8601 update timestamp | Compare the returned record with a cached review copy. | The `text` field contains one saved string. It can contain up to 25,000 characters. The `topic` field can contain up to 500 characters. The `goal` value can be `engagement`, `followers`, `authority`, or `conversation`. This response contains no public tweet ID. A draft remains private until a separate X write request publishes approved text. ## Keep Xquik and native X drafts separate Native X drafts appear inside the X (Twitter) compose interface. Native thread drafts can contain several connected posts. Native posts can also include photos, GIFs, or video. An Xquik draft stores one text value plus optional composition context. It has no thread sequence, media collection, reply target, or native X draft ID. | Draft source | Retrieve it here? | Retrieval method | | - | - | - | | Xquik Create Draft API | Yes | Call `GET /drafts/{id}`. | | Xquik List Drafts API | Yes | Copy an ID, then call this route. | | X Unsent posts | No | Open the native X (Twitter) compose interface. | | Published tweet or thread | No | Use an X tweet read endpoint. | Do not send a public tweet ID to this route. Tweet IDs and Xquik draft IDs identify different resources. ## Build a tweet draft review workflow 1. Save tweet text through `POST /drafts`. 2. Store the returned Xquik draft ID. 3. Retrieve the draft before human or agent review. 4. Compare its text, topic, goal, and timestamps. 5. Approve or reject the exact returned text. 6. Publish approved text through a separate X write route. 7. Delete the saved draft when retention rules allow it. This route provides no edit operation. Create a new draft when approved text must change. Keep the old ID until reviewers accept the replacement. Use [Create Tweet](/api-reference/x-write/create-tweet) only after approval. Reading a draft never sends text to followers or creates likes and replies. ## Recover from tweet draft lookup errors | Status | Error | Cause | Fix | | - | - | - | - | | `200` | Draft object | The account owns the requested draft | Read the returned fields. | | `400` | `invalid_id` | The path value is not a parseable draft ID | Copy an ID from Create Draft or List Drafts. | | `401` | `unauthenticated` | The credential is missing or invalid | Replace the API key or bearer token. | | `404` | `draft_not_found` | The draft is absent or belongs to another account | Verify the ID and authenticated account. | | `429` | `rate_limit_exceeded` | Too many requests reached the route | Wait for `Retry-After`, then retry once. | The route returns the same `404` for missing drafts and other-account IDs. Clients cannot use it to discover another account's draft IDs. Never retry `400`, `401`, or `404` without changing the request. Retry `429` only after the server's delay. ## Tweet draft retrieval questions ### Where can I find an Xquik tweet draft? Call List Drafts first. Copy the returned `id`, then request this endpoint. ### Can this API retrieve my native X drafts? No. Native X drafts remain under Unsent posts. This route reads Xquik records created through the draft API. ### Does one draft include a Twitter thread? No. The response contains one text string. It includes no thread order or connected-post collection. ### Does the response include media or reply targets? No. The draft object contains no media, reply target, or tweet ID. ### Can this route publish or update the draft? No. This route only reads the saved record. Create replacement text or publish through separate endpoints. ### Can I retrieve a deleted draft? No. A deleted draft returns `404`. Xquik provides no restore endpoint. ### Does retrieving a draft consume credits? No. This authenticated lookup is free and consumes no Xquik credits. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique Xquik draft ID. Copy it from [Create Draft](/api-reference/drafts/create) or [List Drafts](/api-reference/drafts/list). | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | An OAuth bearer token formatted as `Bearer YOUR_TOKEN`. Send this header or `x-api-key`, not both. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | Unique draft ID. | | `text` | `string` | The draft tweet text. | | `topic` | `string` | Topic the tweet is about. Omitted if not set. | | `goal` | `string` | Optimization goal. Omitted if not set. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `updatedAt` | `string` | ISO 8601 last update timestamp. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "42", "text": "Just shipped dark mode. What feature should we build next?", "topic": "product update", "goal": "conversation", "createdAt": "2026-02-24T10:30:00.000Z", "updatedAt": "2026-02-24T10:30:00.000Z" } ``` ### 400 Invalid ID `{ "error": "invalid_id", "message": "Invalid ID format." }` The provided draft ID is not a valid format. ### 401 Unauthenticated Missing or invalid API key. ### 404 Not found `{ "error": "draft_not_found", "message": "Draft not found." }` No draft exists with this ID, or it belongs to a different account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** > > * [List Drafts](/api-reference/drafts/list) to see all your drafts. > * [Create Draft](/api-reference/drafts/create) to save a new one. > * [Delete Draft](/api-reference/drafts/delete) to remove this draft. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List tweet drafts with cursors, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/drafts/list List Xquik tweet drafts with exact text, optional topic and goal, timestamps, stable cursor pagination, authentication, and clear 400, 401, or 429 recovery. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/drafts` ## List saved tweet drafts List tweet drafts stored in your authenticated Xquik account. Each result contains saved text, an optional topic, an optional goal, and timestamps. Use this route to build a draft inventory or review queue. It returns drafts newest first and supports cursor pagination. The route never publishes draft text or sends it to followers. Xquik drafts are separate from [X's native Unsent posts](https://help.x.com/en/using-x/how-to-post). This API cannot list drafts saved inside the X (Twitter) compose interface. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail-with-body \ "https://xquik.com/api/v1/drafts?limit=20" \ --header "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/drafts?limit=20", { headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const page = await response.json(); if (!response.ok) { throw new Error(`${response.status} ${page.error}: ${page.message}`); } for (const draft of page.drafts) { console.log(draft.id, draft.text, draft.createdAt); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/drafts", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"limit": 20}, ) page = response.json() if response.status_code != 200: raise RuntimeError( f'{response.status_code} {page["error"]}: {page["message"]}' ) for draft in page["drafts"]: print(draft["id"], draft["text"], draft["createdAt"]) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/drafts?limit=20", nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var page map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&page); err != nil { panic(err) } if resp.StatusCode != http.StatusOK { panic(fmt.Sprintf("%d %v: %v", resp.StatusCode, page["error"], page["message"])) } fmt.Println(page["drafts"], page["hasMore"]) } ``` ## Understand the tweet draft list The response contains one `drafts` array and pagination fields. An empty array is a successful result. It means the account has no saved drafts. Drafts use descending creation order. A newer `createdAt` value appears first. The draft ID breaks ties between equal creation times. This order does not change while clients follow returned cursors. The list contains Xquik draft records only. It excludes published tweets, scheduled posts, native X drafts, and another account's drafts. Each draft contains one saved text string. It contains no thread order, media attachment, reply target, or public tweet ID. ## Paginate through every draft Request up to 10,000 drafts per page. The default `limit` is 50. A smaller value helps clients process short review batches. Follow this cursor workflow. 1. Request the first page without `afterCursor`. 2. Process every draft in the returned order. 3. Check `hasMore` after processing the page. 4. Copy `nextCursor` when `hasMore` is `true`. 5. Send that value as the next `afterCursor`. 6. Stop when `hasMore` becomes `false`. Treat `nextCursor` as an opaque value. Never decode, edit, or construct it. Keep only the latest cursor after a page succeeds. The final page omits `nextCursor`. Do not expect an empty string or `null`. Use `hasMore` as the loop condition. This route exposes no topic, goal, text, date, or status filter. Filter the returned draft objects inside your client for a smaller review set. Do not paginate with timestamps or guessed draft IDs. Those values cannot replace the returned cursor. A cursor from another account also cannot select that account's drafts. ## Read the draft inventory fields The API omits optional fields that you did not supply during draft creation. Check for `topic` and `goal` before reading them. | Field | Meaning | Inventory use | | - | - | - | | `drafts[].id` | Stable Xquik draft ID | Retrieve or delete the exact draft. | | `drafts[].text` | Exact saved tweet text | Review the proposed post copy. | | `drafts[].topic` | Optional composition topic | Group drafts by intended subject. | | `drafts[].goal` | Optional composition goal | Review engagement, followers, authority, or conversation intent. | | `drafts[].createdAt` | ISO 8601 creation timestamp | Sort or record intake time. | | `drafts[].updatedAt` | ISO 8601 update timestamp | Compare a result with a cached copy. | | `hasMore` | Whether another page exists | Continue or stop pagination. | | `nextCursor` | Opaque cursor for the next page | Pass it through unchanged. | The `text` field can contain up to 25,000 characters. The optional `topic` field can contain up to 500 characters. A `goal` can be `engagement`, `followers`, `authority`, or `conversation`. ## Build a tweet draft review queue Use list pagination before retrieval, publishing, or cleanup. 1. List the newest Xquik tweet drafts. 2. Store each returned draft ID once. 3. Review its text, topic, goal, and timestamps. 4. Retrieve one draft again before final approval. 5. Publish approved text through a separate X write route. 6. Delete obsolete drafts after required review. 7. Continue until `hasMore` is `false`. Listing a draft does not reserve, approve, publish, or delete it. Your client must record those workflow states separately. The list response provides no draft count across every page. Count processed IDs locally when an inventory total matters. Deduplicate by `id` during long runs where other clients create or delete drafts. Use [Get Draft](/api-reference/drafts/get) before you delete drafts. Use [Create Tweet](/api-reference/x-write/create-tweet) only after content approval. ## Keep native X drafts separate Native X drafts appear under Unsent posts inside the compose interface. Native thread drafts may contain several connected posts. Native drafts may also contain photos, GIFs, or video. An Xquik draft stores one text value and optional composition context. It does not mirror the native X draft collection. | Draft source | Listed here? | Correct action | | - | - | - | | Xquik Create Draft API | Yes | Paginate this endpoint. | | Xquik Get Draft API | Yes | Match the same Xquik draft ID. | | X Unsent posts | No | Open the native X (Twitter) compose interface. | | Published tweet or thread | No | Use an X tweet read endpoint. | | Scheduled post | No | Use the matching scheduling workflow. | Do not send a public tweet ID as `afterCursor`. Public tweet IDs and draft cursors identify different resources. ## Recover from draft list errors | Status | Error | Cause | Fix | | - | - | - | - | | `200` | Draft page | The authenticated request succeeded | Process `drafts`, then inspect `hasMore`. | | `400` | `invalid_input` | `afterCursor` is edited or unknown | Resend the last `nextCursor`, or omit it. | | `401` | `unauthenticated` | The credential is missing or invalid | Replace the API key or bearer token. | | `429` | `rate_limit_exceeded` | Too many requests reached the route | Wait for `Retry-After`, then retry once. | An empty `drafts` array is not a `404`. It is a valid `200` response. Never retry `401` without replacing the credential. Retry `429` only after the server's delay. Keep the last successful cursor before retrying a page. ## Tweet draft list questions ### How can I list my saved tweet drafts? Call `GET /drafts` with an API key or OAuth bearer token. The response lists drafts owned by that authenticated Xquik account. ### Does this API list native Twitter or X drafts? No. Native drafts remain under Unsent posts. This route lists records created through the Xquik draft API. ### How many tweet drafts can one page return? One page returns at most 10,000 drafts. Use `nextCursor` when `hasMore` is `true`. ### Can I search draft text or filter by topic? No server-side search or filter parameter exists. Paginate, then filter fields inside your client. ### Does one draft include a thread or media? No. One result contains a text string and optional composition context. It contains no thread sequence, media collection, or reply target. ### Are deleted drafts included? No. Deleted drafts are absent. Xquik provides no deleted-draft restore route. ### Does listing tweet drafts consume credits? No. This authenticated list request is free and consumes no Xquik credits. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Results per page. Default `50`, maximum `10000`. | | `afterCursor` | `string` | No | Opaque cursor from `nextCursor`. Pass it unchanged to fetch the next page. An edited or unknown cursor returns `400`. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | An OAuth bearer token formatted as `Bearer YOUR_TOKEN`. Send this header or `x-api-key`, not both. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `drafts` | `object[]` | Draft objects ordered by creation time, newest first. | | `drafts[].id` | `string` | Unique Xquik draft ID. | | `drafts[].text` | `string` | Exact saved tweet text. | | `drafts[].topic` | `string` | Optional draft topic. Omitted when unset. | | `drafts[].goal` | `string` | Optional composition goal. Omitted when unset. | | `drafts[].createdAt` | `string` | ISO 8601 creation timestamp. | | `drafts[].updatedAt` | `string` | ISO 8601 update timestamp. | | `hasMore` | `boolean` | Whether another page exists. | | `nextCursor` | `string` | Opaque next-page cursor. Present only when `hasMore` is `true`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "drafts": [ { "id": "42", "text": "Just shipped dark mode. What feature should we build next?", "topic": "product update", "goal": "conversation", "createdAt": "2026-02-24T10:30:00.000Z", "updatedAt": "2026-02-24T10:30:00.000Z" }, { "id": "38", "text": "Three lessons from building a real-time API.", "goal": "authority", "createdAt": "2026-02-23T16:15:00.000Z", "updatedAt": "2026-02-23T16:15:00.000Z" } ], "hasMore": true, "nextCursor": "MjAyNi0wMi0yM1QxNjoxNTowMC4wMDBafDM4" } ``` ### 400 Invalid cursor `{ "error": "invalid_input", "message": "Cursor invalid. Use nextCursor from the previous page, or omit it to start over." }` The `afterCursor` value is not a `nextCursor` from this route. Send the last `nextCursor` received, or omit `afterCursor` to start from the first page. ### 401 Unauthenticated Authentication is missing or invalid. Replace the credential before retrying. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests reached the route. Wait for `Retry-After` before retrying. > [!NOTE] > > **Related.** > > * [Create Draft](/api-reference/drafts/create) to save tweet text. > * [Get Draft](/api-reference/drafts/get) to retrieve one record. > * [Delete Draft](/api-reference/drafts/delete) to remove it. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Giveaway picker & winner draw, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/draws/create Select random giveaway winners from a tweet's replies. Filter by repost, follow, keyword, hashtag, mention, language, and account age. Returns backup winners. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/draws` Use this Twitter giveaway picker API to select primary and backup winners. Filter replies by reposts, follows, keywords, hashtags, mentions, or language. Add account-age, follower-count, or unique-author rules. **Metered draw execution** · source lookup, replies, optional retweeters, and optional follow checks consume credits > [!NOTE] > > Xquik reads every direct reply and retweeter X shows. It stops at what your remaining credits cover. `totalEntries` and `validEntries` count the inspected direct replies. X hides some replies, so the post can report more. A draw on a busy post takes about 1 minute. To allow for that, keep the request open for 100 seconds. Xquik runs & charges follow checks only for authors who pass your other filters. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/draws \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "tweetUrl": "https://x.com/NASA/status/2102882545427714266", "winnerCount": 3, "backupCount": 2, "mustRetweet": true, "filterMinFollowers": 10, "requiredKeywords": ["giveaway"] }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/draws", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json", }, body: JSON.stringify({ tweetUrl: "https://x.com/NASA/status/2102882545427714266", winnerCount: 3, backupCount: 2, mustRetweet: true, filterMinFollowers: 10, requiredKeywords: ["giveaway"], }), }); const data = await response.json(); console.log(data); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests from uuid import uuid4 response = requests.post( "https://xquik.com/api/v1/draws", headers={"x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": str(uuid4())}, json={ "tweetUrl": "https://x.com/NASA/status/2102882545427714266", "winnerCount": 3, "backupCount": 2, "mustRetweet": True, "filterMinFollowers": 10, "requiredKeywords": ["giveaway"], }, ) data = response.json() print(data) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "crypto/rand" "encoding/json" "fmt" "io" "log" "net/http" ) func main() { payload := map[string]interface{}{ "tweetUrl": "https://x.com/NASA/status/2102882545427714266", "winnerCount": 3, "backupCount": 2, "mustRetweet": true, "filterMinFollowers": 10, "requiredKeywords": []string{"giveaway"}, } body, err := json.Marshal(payload) if err != nil { log.Fatal(err) } req, err := http.NewRequest("POST", "https://xquik.com/api/v1/draws", bytes.NewReader(body)) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", rand.Text()) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() respBody, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(string(respBody)) } ``` | Giveaway draw column | Request or response source | Audit rule | | - | - | - | | Draw ID | Response `id` | Use this public ID for review and export. | | Source tweet | Response `tweetId` | Keep the giveaway tweet identifier. | | Inspected entries | Response `totalEntries` | Record how many replies Xquik inspected. | | Eligible entries | Response `validEntries` | Compare this count with every filter. | | Winner order | `winners[].position` | Keep the original selection order. | | Winner username | `winners[].authorUsername` | Store the selected X account. | | Winning reply | `winners[].tweetId` | Retain the qualifying reply identifier. | | Backup state | `winners[].isBackup` | Separate primary and backup winners. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | | `Content-Type` | `string` | Yes | Must be `application/json`. | | `Idempotency-Key` | `string` | No | Use 1-255 visible ASCII characters. Generate one unique value for each draw. Reuse it only for an exact retry. A retry returns the original draw and charges nothing. A retry while the first request runs returns `409 idempotency_in_progress`. A draw that fails frees its key for a retry. If the first request stops, the key frees after 10 minutes. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `tweetUrl` | `string` | Yes | Full tweet URL to run the draw on. Accepts `x.com` and `twitter.com` formats (for example `https://x.com/user/status/1893456789012345678`). | | `winnerCount` | `number` | No | Number of winners to draw. Defaults to `1` if omitted. | | `backupCount` | `number` | No | Number of backup winners to draw. Xquik selects backup winners in case you disqualify primary winners. | | `uniqueAuthorsOnly` | `boolean` | No | When `true`, each author can win once, however many replies they posted. | | `mustRetweet` | `boolean` | No | When `true`, only entries from users who retweeted the original tweet are eligible. | | `mustFollowUsername` | `string` | No | X (Twitter) username that entrants must follow to be eligible. That account's numeric user ID also works. Xquik strips the `@` prefix if included. A number is a user ID, up to 19 digits. | | `filterMinFollowers` | `number` | No | Minimum follower count required for eligible entries. | | `filterAccountAgeDays` | `number` | No | Minimum account age in days. The draw excludes accounts younger than this. | | `filterLanguage` | `string` | No | Filter entries by tweet language code (for example `en`, `tr`, `es`). | | `requiredKeywords` | `string[]` | No | Array of keywords that must appear in the reply text. The draw excludes entries missing any keyword. | | `requiredHashtags` | `string[]` | No | Array of hashtags that must appear in the reply text. Include the `#` prefix. | | `requiredMentions` | `string[]` | No | Array of usernames that the reply text must mention. Include the `@` prefix. | ## Response ### 201 Created An exact retry returns the original draw with `Idempotency-Replayed: true`. | Field | Type | Description | | - | - | - | | `id` | `string` | Draw public ID returned by Xquik. | | `tweetId` | `string` | X tweet ID extracted from the URL. | | `totalEntries` | `number` | Entries inspected after the credit cap, which can be fewer than the post's replies. | | `validEntries` | `number` | Inspected entries that passed every filter. A credit cap can leave valid replies uninspected. | | `winners` | `array` | Selected winners and backup winners. | | `winners[].position` | `number` | Winner position (1-indexed). | | `winners[].authorUsername` | `string` | X (Twitter) username of the winner. | | `winners[].tweetId` | `string` | Tweet ID of the winning reply. | | `winners[].isBackup` | `boolean` | `true` if this is a backup winner. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345", "tweetId": "2102882545427714266", "totalEntries": 847, "validEntries": 312, "winners": [ { "position": 1, "authorUsername": "alice_web3", "tweetId": "1893456789012345700", "isBackup": false }, { "position": 2, "authorUsername": "bob_dev", "tweetId": "1893456789012345701", "isBackup": false }, { "position": 3, "authorUsername": "charlie_nft", "tweetId": "1893456789012345702", "isBackup": false }, { "position": 4, "authorUsername": "diana_crypto", "tweetId": "1893456789012345703", "isBackup": true }, { "position": 5, "authorUsername": "eve_trades", "tweetId": "1893456789012345704", "isBackup": true } ] } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Missing or malformed request body" }` Missing or malformed request body. Send `tweetUrl` as a string. ### 400 Invalid tweet URL `{ "error": "invalid_tweet_url", "message": "Invalid tweet URL format" }` Xquik could not parse the `tweetUrl`. Must be a valid `x.com` or `twitter.com` status URL. ### 400 Invalid idempotency key `{ "error": "invalid_idempotency_key", "message": "Idempotency-Key invalid. Use 1-255 visible ASCII characters." }` The `Idempotency-Key` header is empty, longer than 255 characters, or not visible ASCII. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key / session cookie. ### 402 Insufficient credits `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` The available balance cannot cover the minimum draw cost. A later final deduction failure also returns `insufficient_credits`. Xquik stores no draw result and charges nothing after that failure. Check your [credit balance](/api-reference/account/get). ### 404 Not found `{ "error": "tweet_not_found", "message": "Tweet not found" }` The target tweet does not exist, was deleted, or the ID is invalid. ### 409 Idempotency conflict Reuse a key only for the same request. Exact retries return the original draw. Xquik reads nothing and charges nothing for this request. ### 409 Idempotency in progress `{ "error": "idempotency_in_progress", "message": "Idempotency-Key belongs to a running request. Retry later." }` The first request with this key is still running. Retry with the same key after it finishes. Xquik charges nothing for this request. ### 424 Short read `{ "error": "draw_too_large", "message": "The post has more replies than 1 draw reads. Contact support." }` X failed or stopped early. Retry after `replies_incomplete` or `retweeters_incomplete`. `draw_too_large` means the post has more entries than 1 draw reads. Contact support. Xquik saves & charges nothing. ### 424 X API dependency failed `{ "error": { "type": "dependency_error", "code": "x_api_unavailable", "message": "X data source temporarily unavailable" } }` Send `xquik-api-contract: 2026-04-29` to receive this status for dependency failures that return `502` by default. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. ### 502 X API unavailable `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable" }` The read service returned an error. Retry after a short delay. > [!NOTE] > > **Next steps.** > > * [Get Draw](/api-reference/draws/get) to retrieve full draw details including tweet metadata. > * [Export Draw](/api-reference/draws/export) to download results as CSV, XLSX or Markdown. > * [List Draws](/api-reference/draws/twitter-giveaway-history) to see your draw history. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits" }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key belongs to another request. Use a new key." }` * **424** `{ "error": "replies_incomplete", "message": "X stopped before every reply loaded. Retry the draw later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` # Export giveaway winners as CSV, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/draws/export Export selected Twitter giveaway winners or inspected reply entries as CSV, XLSX, JSON, Markdown, PDF, or text. Keep all columns, order, and filenames. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/draws/{id}/export` Download a Twitter giveaway winner list or inspected reply entries. Choose CSV, XLSX, JSON, Markdown, PDF, or plain text. Keep the returned filename and exact row order for every handoff. Use `type=winners` for selected primary and backup winners. Use `type=entries` for every stored reply inspected during the draw. Entry exports include passing and failing replies. ## Export Twitter giveaway winners or entries Choose the export type before choosing its file format. The 2 export types contain different columns and answer different review questions. **Free.** This endpoint does not consume credits. > [card] Winner list > > Set `type=winners`. Export ordered primary and backup winners with their > selected reply text. > [card] Inspected entries > > Set `type=entries`. Export stored replies with filter results and detected > languages. > [card] Spreadsheet review > > Choose CSV or XLSX for sorting, filtering, sponsor review, and fulfillment. > [card] Audit archive > > Choose JSON, Markdown, PDF, or text for scripts and review records. The export does not include source tweet metadata or create-time filter rules. Join the file with [Get Draw](/api-reference/draws/get) using the draw ID. Keep the original create request when reviewers need eligibility rules. ## Download a giveaway winner CSV ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail-with-body \ "https://xquik.com/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345/export?format=csv&type=winners" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ --output twitter-giveaway-winners.csv ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { writeFile } from "node:fs/promises"; const drawId = "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345"; const response = await fetch( `https://xquik.com/api/v1/draws/${drawId}/export?format=csv&type=winners`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }, ); if (!response.ok) { const problem = await response.json(); throw new Error(problem.message || "Giveaway winner export failed."); } const bytes = Buffer.from(await response.arrayBuffer()); await writeFile("twitter-giveaway-winners.csv", bytes); process.stdout.write(`${response.headers.get("content-disposition") || "download saved"}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests draw_id = "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345" response = requests.get( f"https://xquik.com/api/v1/draws/{draw_id}/export", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"format": "csv", "type": "winners"}, timeout=30, ) response.raise_for_status() with open("twitter-giveaway-winners.csv", "wb") as export_file: export_file.write(response.content) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "log" "net/http" "os" ) func main() { drawID := "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345" req, err := http.NewRequest("GET", "https://xquik.com/api/v1/draws/"+drawID+"/export?format=csv&type=winners", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 300 { body, readErr := io.ReadAll(resp.Body) if readErr != nil { log.Fatal(readErr) } log.Fatalf("giveaway export failed with %d: %s", resp.StatusCode, string(body)) } file, err := os.Create("twitter-giveaway-winners.csv") if err != nil { log.Fatal(err) } defer file.Close() if _, err := io.Copy(file, resp.Body); err != nil { log.Fatal(err) } fmt.Println(resp.Header.Get("Content-Disposition")) } ``` Never parse a successful export as JSON. The `200` body contains file bytes. Parse JSON only after a non-success status. ## Choose a Twitter giveaway export format Every format contains the same rows. Only the file encoding and filename extension change. `type` alone decides the columns. > [card] CSV for Google Sheets > > Use `format=csv` for spreadsheets and imports. Xquik neutralizes > formula-like reply text before download. > [card] XLSX for Excel > > Use `format=xlsx` for a native workbook with a bold header row. > [card] JSON for automation > > Use `format=json` for scripts, databases, and structured giveaway archives. > [card] Markdown table > > Use `format=md` for a compact table in repositories or review tickets. > [card] Markdown document > > Use `format=md-document` for one titled section per winner or entry. > [card] PDF for review > > Use `format=pdf` for a readable handoff. A PDF above 10,000 rows comes as a ZIP of PDF parts. > [card] Plain text > > Use `format=txt` for line-oriented review without spreadsheet software. Entry exports include every row. Winner exports contain selected winners. ## Understand winner export columns The export orders winner rows by their 1-indexed draw position. Do not sort them by username before publication. > [card] Position > > `Position` keeps the original winner order. Keep it in every handoff. > [card] Username > > `Username` identifies the selected X account at draw time. > [card] Text > > `Text` contains the selected reply text stored for the draw. > [card] Backup > > `Backup` is `true` for a backup winner. Keep backup rows separate. The winner export does not include the winning reply ID. Retrieve draw detail when verification needs each winner's `tweetId`. ## Understand giveaway entry export columns Entry rows keep stored insertion order. They include passing and failing replies that Xquik inspected. > [card] Username > > `Username` identifies the reply author stored during draw processing. > [card] Text > > `Text` contains the stored reply used during eligibility checks. > [card] Passed filter > > `Passed Filter` reports whether that reply passed every configured filter. > [card] Language > > `Language` contains the stored language code. It can be empty. Do not call every exported entry eligible. Check `Passed Filter` first. The entry file cannot explain which individual rule rejected a reply. ## Build a giveaway audit handoff Keep both exports with the draw detail. Reviewers can then check winners against every inspected reply. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "draw_id": "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345", "draw_detail_path": "/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345", "winner_export_path": "/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345/export?format=csv&type=winners", "entry_export_path": "/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345/export?format=csv&type=entries", "create_request_stored": true } ``` Store the original create request separately. It contains hashtags, keywords, mentions, language, follower rules, and other eligibility settings. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The public draw ID. Retrieve it from [Giveaway History](/api-reference/draws/twitter-giveaway-history) or draw creation. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Send your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `format` | `string` | Yes | Choose `csv`, `json`, `md`, `md-document`, `pdf`, `txt`, or `xlsx`. | | `type` | `string` | No | Choose `winners` or `entries`. The default is `winners`. | ## Response ### 200 File download Returns a file download. The response includes a `Content-Disposition` header with the filename. > [card] CSV > > `format=csv` returns `text/csv; charset=utf-8` with filenames like > `draw-winners-*.csv`. > [card] JSON > > `format=json` returns `application/json; charset=utf-8` with filenames > like `draw-winners-*.json`. > [card] Markdown > > `format=md` returns `text/markdown; charset=utf-8` with filenames like > `draw-winners-*.md`. > [card] Markdown document > > `format=md-document` returns `text/markdown; charset=utf-8` with > filenames like `draw-winners-*.md`. > [card] PDF > > `format=pdf` returns `application/pdf` with filenames like > `draw-winners-*.pdf`. > [card] TXT > > `format=txt` returns `text/plain; charset=utf-8` with filenames like > `draw-winners-*.txt`. > [card] XLSX > > `format=xlsx` returns > `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` with > filenames like `draw-winners-*.xlsx`. Entry exports use the same suffix pattern with `draw-entries-*` filenames. **Winner export columns.** Position, Username, Text, Backup **Entry export columns.** Username, Text, Passed Filter, Language Entry exports include every row. A PDF above 10,000 rows comes as a ZIP of PDF parts. ### 400 Invalid parameters The `format` value is missing or unsupported. The `type` value can also be invalid. Fix both values before retrying. ### 401 Unauthenticated The API key or OAuth bearer token is missing or invalid. Replace it first. ### 404 Draw not found No accessible draw matches that ID. Check the ID and authenticated account. ### 429 Rate limited Honor `Retry-After`, then retry the identical export request. ## Handle giveaway export responses > [card] 200 File ready > > Save the binary body. Keep the `Content-Disposition` filename when > your storage policy allows it. > [card] 400 Parameters > > Supply one supported format. Use only `winners` or `entries` for type. > [card] 401 Authentication > > Replace the API key or OAuth bearer token before retrying. > [card] 404 Draw missing > > Confirm the public draw ID and the account owning that draw. > [card] 429 Rate limit > > Wait for `Retry-After`. Reuse the same draw ID, format, and type. ## Twitter giveaway export questions ### How do I download X (Twitter) giveaway winners as CSV? Call this endpoint with `format=csv&type=winners`. Save the binary response as a CSV file. Check the HTTP status before opening it. ### Can I export every inspected giveaway entry? Yes. Set `type=entries`. The file contains the stored replies that Xquik inspected. It does not fetch new replies. ### Does an entry export contain only eligible replies? No. It contains passing and failing stored replies. Use `Passed Filter` to separate them. ### Which giveaway export opens in Excel? Choose `format=xlsx` for a native workbook. Choose CSV for Excel, Google Sheets, imports, or simple scripts. ### How do I identify backup winners? Export winners and read `Backup`. A `true` value marks a backup winner. Keep the original `Position` value. ### Can I export more than 100,000 giveaway entries? Yes. Entry exports include every stored row. A PDF above 10,000 rows comes as a ZIP of PDF parts. The endpoint has no cursor. ### Does the export include giveaway eligibility rules? No. Keep the original draw request separately. The entry export reports only the combined pass result. ### Does the export include source tweet metrics? No. Call [Get Draw](/api-reference/draws/get) for source tweet metrics, candidate counts, status, and timestamps. ### What happens when a winner export has no rows? The file can contain headers or an empty collection. Treat that as an empty result, not a transport failure. ### Can I use the file for sponsor proof? Yes, but include draw detail and the stored create request. The export alone cannot reconstruct eligibility rules. ### Does a giveaway export consume credits? No. Exporting an existing draw is free. Creating a new draw can consume credits. > [!NOTE] > > **Related.** [Get Draw](/api-reference/draws/get) verifies winners. > [Giveaway History](/api-reference/draws/twitter-giveaway-history) finds draw > IDs. [Create Draw](/api-reference/draws/create) starts a new selection. ## Response examples * **200** `` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Giveaway draw & winner details, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/draws/get Retrieve one Twitter giveaway draw by ID. Verify source tweet metrics, entry counts, ordered primary and backup winners, timestamps, and result status. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/draws/{id}` Retrieve one Twitter giveaway result with its draw ID. Inspect the source tweet snapshot, candidate counts, timestamps, and ordered winner rows. Separate primary winners from backup winners before publishing results. This endpoint does not return create-time eligibility rules or exclusion reasons. Keep the original `POST /draws` request when an audit needs those rules. ## Verify one Twitter giveaway draw Use this route to review one completed or pending draw. Keep its draw ID with winner announcements, support records, and exports. **Free.** This endpoint does not consume credits. > [card] Source tweet snapshot > > Read the tweet ID, URL, text, author, and engagement counts captured for > the draw. > [card] Candidate counts > > Compare `totalEntries` with `validEntries`. Neither value reports the > number of winners. > [card] Ordered winners > > Keep `position`, `authorUsername`, `tweetId`, and `isBackup` for every > selected account. > [card] Draw timing > > Store `createdAt` for creation. Store `drawnAt` when winner selection has > finished. Use [Giveaway History](/api-reference/draws/twitter-giveaway-history) to find a draw ID. Use [Export Draw](/api-reference/draws/export) for winner or entry files. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail-with-body https://xquik.com/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const drawId = "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345"; const response = await fetch(`https://xquik.com/api/v1/draws/${drawId}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const result = await response.json(); if (!response.ok) { throw new Error(result.message || "Giveaway draw request failed."); } const verification = { draw_id: result.draw.id, tweet_id: result.draw.tweetId, tweet_url: result.draw.tweetUrl, status: result.draw.status, total_entries: result.draw.totalEntries, valid_entries: result.draw.validEntries, created_at: result.draw.createdAt, drawn_at: result.draw.drawnAt || null, primary_winners: result.winners.filter((winner) => !winner.isBackup), backup_winners: result.winners.filter((winner) => winner.isBackup), }; process.stdout.write(`${JSON.stringify(verification)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests draw_id = "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345" response = requests.get( f"https://xquik.com/api/v1/draws/{draw_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) response.raise_for_status() result = response.json() verification = { "draw_id": result["draw"]["id"], "tweet_id": result["draw"]["tweetId"], "tweet_url": result["draw"]["tweetUrl"], "status": result["draw"]["status"], "primary_winners": [ winner for winner in result["winners"] if not winner["isBackup"] ], "backup_winners": [ winner for winner in result["winners"] if winner["isBackup"] ], } print(verification) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "log" "net/http" ) func main() { drawID := "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345" req, err := http.NewRequest("GET", "https://xquik.com/api/v1/draws/"+drawID, nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } if resp.StatusCode < 200 || resp.StatusCode >= 300 { log.Fatalf("giveaway draw failed with %d: %s", resp.StatusCode, string(body)) } fmt.Println(string(body)) } ``` ## Interpret Twitter giveaway winner rows Winner order is part of the result. Keep each 1-indexed `position`. Do not sort by username or tweet ID. > [card] Primary winner > > `isBackup` is `false`. Use the original `position` in announcements and > fulfillment records. > [card] Backup winner > > `isBackup` is `true`. Keep the row separate until someone approves > the replacement. > [card] Winning reply > > `tweetId` identifies the selected reply. Store it beside the winner's X (Twitter) > username. > [card] Winner account > > `authorUsername` identifies the selected X account at draw time. Join > records on the tweet ID, which does not change. Do not promote a backup winner by changing the existing row. Record the replacement decision separately. This keeps the original draw result. ## Keep eligibility rules separately `GET /draws/{id}` returns the draw snapshot and winners. It does not repeat the eligibility filters sent to `POST /draws`. Store the original create request when reviews need these settings. * required repost and followed-account rules * required keywords, hashtags, mentions, or language * minimum account age and follower count * primary, backup, and unique-author settings Use an entry export when the review needs candidate rows. The export can show whether an entry passed the filters. It does not reconstruct a missing create request. ## Build a giveaway verification handoff Join the draw summary, winner rows, and export location with one draw ID. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "draw_id": "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345", "tweet_id": "2102882545427714266", "tweet_url": "https://x.com/NASA/status/2102882545427714266", "status": "completed", "total_entries": 847, "valid_entries": 312, "created_at": "2026-02-24T10:00:00.000Z", "drawn_at": "2026-02-24T10:05:00.000Z", "primary_winner_count": 3, "backup_winner_count": 0, "winner_export_path": "/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345/export?format=csv&type=winners", "entry_export_path": "/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345/export?format=csv&type=entries" } ``` Store winner rows separately from this summary. Keep `position` and `isBackup` on every row. Never infer filter rules from entry counts. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The draw public ID. Returned when you [create a draw](/api-reference/draws/create) or [list draws](/api-reference/draws/twitter-giveaway-history). | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Send your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `draw` | `object` | Draw details including tweet metadata. | | `draw.id` | `string` | Draw public ID returned by Xquik. | | `draw.tweetId` | `string` | X tweet ID. | | `draw.tweetUrl` | `string` | Original tweet URL. | | `draw.tweetText` | `string` | Full text content of the tweet. | | `draw.tweetAuthorUsername` | `string` | Username of the tweet author. | | `draw.tweetLikeCount` | `number` | Like count at time of draw. | | `draw.tweetRetweetCount` | `number` | Retweet count at time of draw. | | `draw.tweetReplyCount` | `number` | Reply count at time of draw. | | `draw.tweetQuoteCount` | `number` | Quote tweet count at time of draw. | | `draw.status` | `string` | Draw status (for example `completed`). | | `draw.totalEntries` | `number` | Inspected candidate entries. | | `draw.validEntries` | `number` | Entries that passed all filters. | | `draw.createdAt` | `string` | ISO 8601 creation timestamp. | | `draw.drawnAt` | `string` | ISO 8601 timestamp of when Xquik selected winners. Present only for completed draws. | | `winners` | `array` | Selected winners and backup winners ordered by position. | | `winners[].position` | `number` | Winner position (1-indexed). | | `winners[].authorUsername` | `string` | X (Twitter) username of the winner. | | `winners[].tweetId` | `string` | Tweet ID of the winning reply. | | `winners[].isBackup` | `boolean` | `true` if this is a backup winner. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "draw": { "id": "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345", "tweetId": "2102882545427714266", "tweetUrl": "https://x.com/NASA/status/2102882545427714266", "tweetText": "Today, Croatia became the 74th nation that has committed to a peaceful and prosperous exploration of space.", "tweetAuthorUsername": "NASA", "tweetLikeCount": 2450, "tweetRetweetCount": 1820, "tweetReplyCount": 847, "tweetQuoteCount": 95, "status": "completed", "totalEntries": 847, "validEntries": 312, "createdAt": "2026-02-24T10:00:00.000Z", "drawnAt": "2026-02-24T10:05:00.000Z" }, "winners": [ { "position": 1, "authorUsername": "alice_web3", "tweetId": "1893456789012345700", "isBackup": false }, { "position": 2, "authorUsername": "bob_dev", "tweetId": "1893456789012345701", "isBackup": false }, { "position": 3, "authorUsername": "charlie_nft", "tweetId": "1893456789012345702", "isBackup": false } ] } ``` ### 401 Unauthenticated The API key or OAuth bearer token is missing or invalid. Replace it before retrying. ### 404 Not found No draw exists with this ID, or it belongs to a different account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. ## Handle giveaway draw responses > [card] 200 Draw result > > Read `draw` and `winners`. Split primary and backup winners before handoff. > [card] 401 Authentication > > Authentication failed. Replace the API key or OAuth bearer token first. > [card] 404 Draw missing > > No accessible draw matches that ID. Check its account and exact value. > [card] 429 Rate limit > > Too many requests. Honor `Retry-After`, then retry the same draw ID. ## Twitter giveaway winner verification questions ### How do I verify a past Twitter giveaway winner? Get the draw ID from giveaway history. Request `GET /draws/{id}`. Keep the ordered winner rows and source tweet snapshot. ### Does the draw detail include eligibility rules? No. Store the original create request separately. Use entry exports when a review needs candidate pass or fail values. ### How do I identify backup winners? Read `isBackup` on every winner row. A primary winner has `false`. A backup winner has `true`. ### Can I download the giveaway result? Yes. Call `GET /draws/{id}/export`. Choose winners or entries and a supported file format. ### What if the giveaway draw ID returns 404? Check the exact draw ID and authenticated account. The current credential cannot read another account's draw. ### Does winner verification consume credits? No. Retrieving an existing draw is free. Running a new draw can consume credits. > [!NOTE] > > **Related.** [Export Draw](/api-reference/draws/export) downloads results. > [Giveaway History](/api-reference/draws/twitter-giveaway-history) lists past > draws. [Create Draw](/api-reference/draws/create) runs a new selection. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Giveaway history & past draws, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/draws/twitter-giveaway-history List past Twitter giveaway draws with tweet URLs, statuses, entry counts, timestamps, and opaque cursors. Then retrieve winners or export audit records. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/draws` List every Twitter giveaway draw owned by the authenticated Xquik account. Review source tweets, draw statuses, entry counts, and completion times. Continue through older results with an opaque cursor. This endpoint returns draw summaries. It does not return winner objects or eligibility rules. Retrieve one draw when winner verification needs those details. **Free.** This endpoint does not consume credits. ## List past Twitter giveaway draws Use `GET /draws` for a Twitter giveaway history page or audit queue. The API orders results by `createdAt` and draw ID, newest first. Each row identifies its source tweet and inspected candidate counts. > [card] List draw history > > Call `GET /draws` for draw IDs, tweet URLs, statuses, entry counts, and > timestamps. Follow `nextCursor` when `hasMore` is true. > [card] Review past winners > > Call `GET /draws/{id}` for source tweet metrics and ordered winner rows. > Keep primary and backup winners separate. > [card] Export audit records > > Call `GET /draws/{id}/export` for winners or entries. Choose CSV, JSON, > Markdown, PDF, text, or XLSX. > [card] Run another draw > > Call `POST /draws` with the source tweet and eligibility rules. Do not reuse > an old draw ID for a new selection. Use list results to find draws. Use detail results to verify winners. Use exports for review, customer support, or campaign archives. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail-with-body "https://xquik.com/api/v1/draws?limit=10" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/draws?limit=10", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const page = await response.json(); if (!response.ok) { throw new Error(page.message || "Giveaway history request failed."); } const drawRows = page.draws.map((draw) => ({ draw_id: draw.id, tweet_url: draw.tweetUrl, status: draw.status, total_entries: draw.totalEntries, valid_entries: draw.validEntries, created_at: draw.createdAt, drawn_at: draw.drawnAt || null, })); process.stdout.write( `${JSON.stringify({ drawRows, hasMore: page.hasMore, nextCursor: page.nextCursor || null })}\n`, ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/draws", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"limit": 10}, ) response.raise_for_status() page = response.json() draw_rows = [ { "draw_id": draw["id"], "tweet_url": draw["tweetUrl"], "status": draw["status"], "total_entries": draw["totalEntries"], "valid_entries": draw["validEntries"], "created_at": draw["createdAt"], "drawn_at": draw.get("drawnAt"), } for draw in page["draws"] ] print({"draws": draw_rows, "next_cursor": page.get("nextCursor")}) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "log" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/draws?limit=10", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } if resp.StatusCode < 200 || resp.StatusCode >= 300 { log.Fatalf("giveaway history failed with %d: %s", resp.StatusCode, string(body)) } fmt.Println(string(body)) } ``` ## Choose the correct giveaway result The list route answers which draws exist. It also shows when each draw ran. It cannot answer who won or which reply qualified. Use this handoff for each returned row. > [card] Find past draws > > Call `GET /draws`. Keep `id`, `tweetUrl`, `status`, and `createdAt`. > [card] Compare entry counts > > Read `totalEntries` and `validEntries` from each list summary. > [card] Verify winners > > Call `GET /draws/{id}`. Keep position, username, tweet ID, and backup > state. > [card] Review the source tweet > > Read the tweet ID, text, author, and engagement counts from draw detail. > [card] Download results > > Call `GET /draws/{id}/export`. Select `winners` or `entries` and one format. Do not label `validEntries` as a winner count. It counts inspected entries that passed the configured filters. Winner rows exist only in the detail response. ## Build a Twitter giveaway audit handoff Store one summary row per draw. Keep the public draw ID as the join key. Store the source tweet URL. Usernames can change. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "draw_id": "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345", "tweet_url": "https://x.com/NASA/status/2102882545427714266", "status": "completed", "total_entries": 847, "valid_entries": 312, "created_at": "2026-02-24T10:00:00.000Z", "drawn_at": "2026-02-24T10:05:00.000Z", "detail_path": "/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345", "winner_export_path": "/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345/export?format=csv&type=winners" } ``` Fetch detail rows before publishing past giveaway winners. Keep winner position and `isBackup`. Dashboards and announcements then cannot show a backup winner as a primary winner. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Results per page. Default `50`, max `10000`. | | `cursor` | `string` | No | Cursor for pagination. Pass the `nextCursor` value from a previous response to fetch the next page. An edited or unknown cursor returns `400`. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Send your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `draws` | `array` | List of draw objects ordered by creation date (newest first). | | `draws[].id` | `string` | Draw public ID returned by Xquik. | | `draws[].tweetUrl` | `string` | Original tweet URL used for the draw. | | `draws[].status` | `string` | Draw status (for example `completed`). | | `draws[].totalEntries` | `number` | Candidate entries inspected for the draw. | | `draws[].validEntries` | `number` | Entries that passed all filters. | | `draws[].createdAt` | `string` | ISO 8601 creation timestamp. | | `draws[].drawnAt` | `string` | ISO 8601 timestamp of when Xquik selected winners. Present only for completed draws. | | `hasMore` | `boolean` | `true` if more pages exist beyond this result set. | | `nextCursor` | `string` | Pagination cursor. Pass it as `cursor` for the next page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "draws": [ { "id": "f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345", "tweetUrl": "https://x.com/NASA/status/2102882545427714266", "status": "completed", "totalEntries": 847, "validEntries": 312, "createdAt": "2026-02-24T10:00:00.000Z", "drawnAt": "2026-02-24T10:05:00.000Z" }, { "id": "9a78ce15-2f3d-4f90-a86b-1049c7a26e92", "tweetUrl": "https://x.com/NASA/status/2102761519985332442", "status": "completed", "totalEntries": 1240, "validEntries": 980, "createdAt": "2026-02-23T16:30:00.000Z", "drawnAt": "2026-02-23T16:35:00.000Z" } ], "hasMore": true, "nextCursor": "MjAyNi0wMi0yM1QxNjozMDowMC4wMDBafDY2NjY1" } ``` ### 400 Invalid cursor `{ "error": "invalid_input", "message": "Cursor invalid. Use nextCursor from the previous page, or omit it to start over." }` The `cursor` value is not a `nextCursor` from this route. Send the last `nextCursor` received, or omit `cursor` to start from the first page. ### 401 Unauthenticated Missing or invalid API key / session cookie. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. ## Paginate Twitter giveaway history Draws use cursor pagination. Pass `nextCursor` as the next `cursor` value. ```bash First page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail-with-body "https://xquik.com/api/v1/draws?limit=10" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```bash Next page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail-with-body "https://xquik.com/api/v1/draws?limit=10&cursor=MjAyNi0wMi0yM1QxNjozMDowMC4wMDBafDY2NjY1" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Continue fetching pages until `hasMore` is `false`. Cursors are opaque strings. Do not parse or build them. Use this loop to export the complete history. ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const seenCursors = new Set(); const draws = []; let cursor; do { const url = new URL("https://xquik.com/api/v1/draws"); url.searchParams.set("limit", "100"); if (cursor) url.searchParams.set("cursor", cursor); const response = await fetch(url, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const page = await response.json(); if (!response.ok) { throw new Error(page.message || "Giveaway history page failed."); } draws.push(...page.draws); const next = page.nextCursor; if (page.hasMore && (!next || seenCursors.has(next))) { throw new Error("Giveaway history cursor did not advance."); } if (next) seenCursors.add(next); cursor = page.hasMore ? next : undefined; } while (cursor); process.stdout.write(`${JSON.stringify(draws)}\n`); ``` Save the last accepted cursor after you store each batch. Restart from that cursor after a worker failure. Never build a cursor from timestamps or draw IDs. ## Handle giveaway history responses > [card] 200 Draw page > > Read `draws` and `hasMore`. Read `nextCursor` only when another page exists. > [card] 400 Invalid cursor > > The cursor is not one this route returned. Resend the last `nextCursor`. > [card] 401 Authentication > > Authentication failed. Replace the API key or OAuth bearer token first. > [card] 429 Rate limit > > Too many requests. Honor `Retry-After`, then resume with the same cursor. Do not advance the cursor after a failed request. A retry must request the same page. Append results only after the response succeeds. ## Twitter giveaway history questions ### How do I view past Twitter giveaway draws? Call `GET /draws` with your Xquik API key. The newest draw summaries appear first. Follow `nextCursor` for older results. ### Does giveaway history include past winners? The list response does not include winners. Pass its `id` to `GET /draws/{id}` for primary and backup winner rows. ### Can I download previous Twitter giveaway winners? Yes. Fetch the draw ID first. Then export `type=winners` in CSV, JSON, Markdown, PDF, text, or XLSX. ### What do total and valid entries mean? `totalEntries` counts inspected candidate entries. `validEntries` counts entries that passed the draw filters. Neither field reports the winner count. ### How do I audit a Twitter giveaway result? Store the list summary and draw ID. Fetch draw details and keep winner order. Export entries when the review needs every inspected reply. ### Does listing giveaway draws consume credits? No. Listing draw history is free. Running a new draw can consume credits. > [!NOTE] > > **Related.** [Get Draw](/api-reference/draws/get) retrieves one result. Use > [Create Draw](/api-reference/draws/create) for a new winner selection. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Get a webhook event payload, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/events/get Retrieve one monitor event by ID with tweet text, author fields, engagement metrics, event type, timestamps, and monitor identifiers. The call is free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/events/{id}` **Free.** This endpoint does not consume credits. Account events include the current `username` and permanent `xUserId`. Use `xUserId` to match an account after its username changes. `monitorName` is your monitor label when Xquik created the event. A rename leaves past events unchanged. MCP returns `x_user_id`, `monitor_name`, and prefixed `monitor_id` values. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/events/9001 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '{ event_id: .id, event_type: .type, monitor_type: .monitorType, monitor_id: .monitorId, monitor_name: (.monitorName // null), x_user_id: (.xUserId // null), keyword_monitor_id: (.keywordMonitorId // null), username: (.username // null), query: (.query // null), occurred_at: .occurredAt, x_event_id: (.xEventId // null), tweet_id: (.xEventId // .data.id // null), tweet_text: (.data.text // null), author_username: (.data.author.username // .data.author.userName // null), event_detail_endpoint: ("/api/v1/events/" + .id), delivery_join_key: .id }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/events/9001", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const event = await response.json(); const eventRow = { event_id: event.id, event_type: event.type, monitor_type: event.monitorType, monitor_id: event.monitorId, monitor_name: event.monitorName ?? null, x_user_id: event.xUserId ?? null, keyword_monitor_id: event.keywordMonitorId ?? null, username: event.username ?? null, query: event.query ?? null, occurred_at: event.occurredAt, x_event_id: event.xEventId ?? null, tweet_id: event.xEventId ?? event.data?.id ?? null, tweet_text: event.data?.text ?? null, author_username: event.data?.author?.username ?? event.data?.author?.userName ?? null, event_detail_endpoint: `/api/v1/events/${event.id}`, delivery_join_key: event.id, }; process.stdout.write(`${JSON.stringify(eventRow)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/events/9001", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) event = response.json() tweet = event.get("data") if isinstance(event.get("data"), dict) else {} author = tweet.get("author") if isinstance(tweet.get("author"), dict) else {} event_row = { "event_id": event["id"], "event_type": event["type"], "monitor_type": event["monitorType"], "monitor_id": event["monitorId"], "monitor_name": event.get("monitorName"), "x_user_id": event.get("xUserId"), "keyword_monitor_id": event.get("keywordMonitorId"), "username": event.get("username"), "query": event.get("query"), "occurred_at": event["occurredAt"], "x_event_id": event.get("xEventId"), "tweet_id": event.get("xEventId") or tweet.get("id"), "tweet_text": tweet.get("text"), "author_username": author.get("username") or author.get("userName"), "event_detail_endpoint": f"/api/v1/events/{event['id']}", "delivery_join_key": event["id"], } print(json.dumps(event_row)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" "os" ) type EventAuthor struct { Username *string `json:"username"` } type EventPayload struct { ID *string `json:"id"` Text *string `json:"text"` Author *EventAuthor `json:"author"` } type Event struct { ID string `json:"id"` Type string `json:"type"` MonitorType string `json:"monitorType"` MonitorID string `json:"monitorId"` MonitorName *string `json:"monitorName"` XUserID *string `json:"xUserId"` KeywordMonitorID *string `json:"keywordMonitorId"` Username *string `json:"username"` Query *string `json:"query"` OccurredAt string `json:"occurredAt"` Data EventPayload `json:"data"` XEventID *string `json:"xEventId"` } type EventRow struct { DeliveryJoinKey string `json:"delivery_join_key"` EventDetailEndpoint string `json:"event_detail_endpoint"` EventID string `json:"event_id"` EventType string `json:"event_type"` MonitorType string `json:"monitor_type"` MonitorID string `json:"monitor_id"` MonitorName *string `json:"monitor_name"` XUserID *string `json:"x_user_id"` KeywordMonitorID *string `json:"keyword_monitor_id"` Username *string `json:"username"` Query *string `json:"query"` OccurredAt string `json:"occurred_at"` XEventID *string `json:"x_event_id"` TweetID *string `json:"tweet_id"` TweetText *string `json:"tweet_text"` AuthorUsername *string `json:"author_username"` } func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/events/9001", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var event Event if err := json.NewDecoder(resp.Body).Decode(&event); err != nil { log.Fatal(err) } tweetID := event.XEventID if tweetID == nil { tweetID = event.Data.ID } var authorUsername *string if event.Data.Author != nil { authorUsername = event.Data.Author.Username } row := EventRow{ DeliveryJoinKey: event.ID, EventDetailEndpoint: "/api/v1/events/" + event.ID, EventID: event.ID, EventType: event.Type, MonitorType: event.MonitorType, MonitorID: event.MonitorID, MonitorName: event.MonitorName, XUserID: event.XUserID, KeywordMonitorID: event.KeywordMonitorID, Username: event.Username, Query: event.Query, OccurredAt: event.OccurredAt, XEventID: event.XEventID, TweetID: tweetID, TweetText: event.Data.Text, AuthorUsername: authorUsername, } if err := json.NewEncoder(os.Stdout).Encode(row); err != nil { log.Fatal(err) } } ``` The Node.js, Python, and Go examples convert one event into an audit row. Store `event_id`, `monitor_type`, `monitor_id`, `event_type`, `occurred_at`, `x_event_id`, tweet fields from `data`, `event_detail_endpoint`, and `delivery_join_key`. Keyword monitor events use `keyword_monitor_id` and `query` instead of `username`. ## Event detail handoff Use this endpoint after list or delivery workflows find an event. Use it for full tweet data, author context, or a support or audit review. | Event detail column | Response source | Handoff rule | | - | - | - | | Event ID | `id` | Use this ID for event detail and delivery joins. | | Event type | `type` | Route tweet, reply, quote, or repost processing. | | Monitor source | `monitorType` | Separate account and keyword monitor events. | | Account monitor | `monitorId` and `username` | Join the event to its tracked X account. | | Keyword monitor | `keywordMonitorId` and `query` | Join the event to its tracked X (Twitter) search. | | Tweet ID | `xEventId` | Store the X tweet identifier separately. | | Occurred at | `occurredAt` | Keep the original event timestamp. | | Tweet payload | `data` | Extract tweet text, author, and engagement fields. | > [card] Detail row > > Store `event_id`, `event_type`, `occurred_at`, `event_detail_endpoint`, and > `delivery_join_key`. Keep `event_id` as the Xquik event identifier. > [card] Delivery join > > Match `delivery_join_key` to webhook delivery `streamEventId` from > [List Deliveries](/api-reference/webhooks/deliveries). Do not use > `x_event_id` for delivery joins. > [card] Monitor source > > Store `monitor_type`, `monitor_id`, `keyword_monitor_id`, `username`, and > `query`. That keeps account and keyword monitor audits separate. > [card] Tweet payload > > Store `x_event_id`, `tweet_id`, `tweet_text`, and `author_username` from > `data` when the event contains tweet content. > [card] Delivery status > > Join deliveries first. Then attach `status`, `attempts`, > `lastStatusCode`, `lastError`, `createdAt`, and `deliveredAt` to the event > detail row. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The event ID to retrieve. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | Unique event identifier. | | `type` | `string` | Event type (for example `tweet.new`, `tweet.reply`, `tweet.quote`, `tweet.retweet`). | | `monitorId` | `string` | Account monitor ID for account events. Keyword monitor ID for keyword events. Post monitor ID for post events. | | `monitorType` | `string` | The source type is `account`, `keyword` or `post`. | | `keywordMonitorId` | `string` | Keyword monitor ID. Present only for keyword monitor events. | | `username` | `string` | X (Twitter) username that triggered the event. Present only for account monitor events. | | `query` | `string` | Keyword query that matched the event. Present only for keyword monitor events. | | `occurredAt` | `string` | ISO 8601 timestamp. It holds X's time of the event when X gives one. This applies to a post, a live video & a Space. Else it holds the time Xquik saw the event. This applies to a deleted post, a profile change & a follow list change. | | `data` | `object` | Post or profile-change data. Post fields match REST responses. See [Webhooks Overview](/webhooks/overview). | | `xEventId` | `string` | X platform tweet ID associated with this event. Present only for tweet events. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "9001", "type": "tweet.new", "monitorId": "7", "monitorType": "account", "username": "elonmusk", "occurredAt": "2026-02-24T14:22:00.000Z", "data": { "id": "1893456789012345678", "text": "The future is now.", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk" }, "isRetweet": false, "isReply": false, "isQuote": false, "createdAt": "2026-02-24T14:22:00.000Z" }, "xEventId": "1893456789012345678" } ``` ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 400 Invalid ID `{ "error": "invalid_id", "message": "Invalid ID format." }` The provided event ID is not a valid format. ### 404 Not found No event exists with this ID, or it belongs to a different account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [List Events](/api-reference/events/list) · [List Deliveries](/api-reference/webhooks/deliveries) · [Get Monitor](/api-reference/monitors/twitter-account-monitor-status) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List webhook & monitor events, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/events/list Query stored events from account, keyword & post monitors, follower changes included. Filter by monitor or event type & paginate with a cursor. Listing is free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/events` **Free.** This endpoint does not consume credits. Account events include the current `username` and permanent `xUserId`. Use `xUserId` to match an account after its username changes. `monitorName` is your monitor label when Xquik created the event. A rename leaves past events unchanged. MCP returns `x_user_id`, `monitor_name`, and prefixed `monitor_id` values. > [!NOTE] > > Active monitor billing includes event and webhook deliveries. Stored monitor events expire 30 days after Xquik creates them. Export every page before older records expire. The dashboard has no CSV export for monitor events. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/events?limit=10&monitorId=7" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '. as $page | .events[] | { event_id: .id, event_type: .type, monitor_type: .monitorType, monitor_id: .monitorId, monitor_name: (.monitorName // null), x_user_id: (.xUserId // null), keyword_monitor_id: (.keywordMonitorId // null), username: (.username // null), query: (.query // null), occurred_at: .occurredAt, tweet_id: (.data.id // null), tweet_text: (.data.text // null), author_username: (.data.author.username // .data.author.userName // null), event_detail_endpoint: ("/api/v1/events/" + .id), delivery_join_key: .id, has_more: $page.hasMore, next_cursor: ($page.nextCursor // null) }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/events?limit=10&monitorId=7", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const data = await response.json(); const eventRows = data.events.map((event) => ({ event_id: event.id, event_type: event.type, monitor_type: event.monitorType, monitor_id: event.monitorId, monitor_name: event.monitorName ?? null, x_user_id: event.xUserId ?? null, keyword_monitor_id: event.keywordMonitorId ?? null, username: event.username ?? null, query: event.query ?? null, occurred_at: event.occurredAt, tweet_id: event.data?.id ?? null, tweet_text: event.data?.text ?? null, author_username: event.data?.author?.username ?? event.data?.author?.userName ?? null, event_detail_endpoint: `/api/v1/events/${event.id}`, delivery_join_key: event.id, has_more: data.hasMore, next_cursor: data.nextCursor ?? null, })); for (const row of eventRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/events", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"limit": 10, "monitorId": "7"}, ) data = response.json() event_rows = [] for event in data["events"]: tweet = event.get("data") if isinstance(event.get("data"), dict) else {} author = tweet.get("author") if isinstance(tweet.get("author"), dict) else {} event_rows.append( { "event_id": event["id"], "event_type": event["type"], "monitor_type": event["monitorType"], "monitor_id": event["monitorId"], "monitor_name": event.get("monitorName"), "x_user_id": event.get("xUserId"), "keyword_monitor_id": event.get("keywordMonitorId"), "username": event.get("username"), "query": event.get("query"), "occurred_at": event["occurredAt"], "tweet_id": tweet.get("id"), "tweet_text": tweet.get("text"), "author_username": author.get("username") or author.get("userName"), "event_detail_endpoint": f"/api/v1/events/{event['id']}", "delivery_join_key": event["id"], "has_more": data["hasMore"], "next_cursor": data.get("nextCursor"), } ) for row in event_rows: print(json.dumps(row)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" "os" ) type EventAuthor struct { Username *string `json:"username"` } type EventPayload struct { ID *string `json:"id"` Text *string `json:"text"` Author *EventAuthor `json:"author"` } type Event struct { ID string `json:"id"` Type string `json:"type"` MonitorType string `json:"monitorType"` MonitorID string `json:"monitorId"` MonitorName *string `json:"monitorName"` XUserID *string `json:"xUserId"` KeywordMonitorID *string `json:"keywordMonitorId"` Username *string `json:"username"` Query *string `json:"query"` OccurredAt string `json:"occurredAt"` Data EventPayload `json:"data"` } type EventResponse struct { Events []Event `json:"events"` HasMore bool `json:"hasMore"` NextCursor *string `json:"nextCursor"` } type EventRow struct { DeliveryJoinKey string `json:"delivery_join_key"` EventDetailEndpoint string `json:"event_detail_endpoint"` EventID string `json:"event_id"` EventType string `json:"event_type"` MonitorType string `json:"monitor_type"` MonitorID string `json:"monitor_id"` MonitorName *string `json:"monitor_name"` XUserID *string `json:"x_user_id"` KeywordMonitorID *string `json:"keyword_monitor_id"` Username *string `json:"username"` Query *string `json:"query"` OccurredAt string `json:"occurred_at"` TweetID *string `json:"tweet_id"` TweetText *string `json:"tweet_text"` AuthorUsername *string `json:"author_username"` HasMore bool `json:"has_more"` NextCursor *string `json:"next_cursor"` } func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/events?limit=10&monitorId=7", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var data EventResponse if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { log.Fatal(err) } encoder := json.NewEncoder(os.Stdout) for _, event := range data.Events { var authorUsername *string if event.Data.Author != nil { authorUsername = event.Data.Author.Username } row := EventRow{ DeliveryJoinKey: event.ID, EventDetailEndpoint: "/api/v1/events/" + event.ID, EventID: event.ID, EventType: event.Type, MonitorType: event.MonitorType, MonitorID: event.MonitorID, MonitorName: event.MonitorName, XUserID: event.XUserID, KeywordMonitorID: event.KeywordMonitorID, Username: event.Username, Query: event.Query, OccurredAt: event.OccurredAt, TweetID: event.Data.ID, TweetText: event.Data.Text, AuthorUsername: authorUsername, HasMore: data.HasMore, NextCursor: data.NextCursor, } if err := encoder.Encode(row); err != nil { log.Fatal(err) } } } ``` These examples emit one stored event row per line. Store `event_id`, `monitor_type`, `monitor_id`, `event_type`, `occurred_at`, tweet fields from `data`, `event_detail_endpoint`, `delivery_join_key`, and `next_cursor`. Pass `nextCursor` as `cursor` until `hasMore` is `false`. ## Source filter examples Use `monitorId` for account monitor events and `keywordMonitorId` for keyword monitor events. Do not pass a keyword monitor ID as `monitorId`. That filter matches account monitor events only. Use `postMonitorId` for post monitor events. Post events carry `postId`, `postUrl` & `authorUsername`. ```bash Account monitor events theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/events?limit=50&monitorId=7" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '{events: [.events[] | {id, type, monitorId, username}], hasMore, nextCursor}' ``` ```bash Keyword monitor events theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/events?limit=50&keywordMonitorId=21" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '{events: [.events[] | {id, type, keywordMonitorId, query}], hasMore, nextCursor}' ``` ```bash Post monitor events theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/events?limit=50&postMonitorId=31" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '{events: [.events[] | {id, type, monitorId, postId, data}], hasMore, nextCursor}' ``` ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Results per page. Default `50`, max `10000`. Large events can make a page shorter. Keep reading while `hasMore` is true. | | `monitorId` | `string` | No | Filter account-monitor events by account monitor ID. Use `keywordMonitorId` for keyword-monitor events. Omit both filters to return events from all monitors. | | `keywordMonitorId` | `string` | No | Filter keyword-monitor events by keyword monitor ID. Use the `id` returned by keyword monitor endpoints. | | `postMonitorId` | `string` | No | Filter post-monitor events by post monitor ID. Use the `id` returned by [post monitor endpoints](/api-reference/monitors/list-posts). The `post_monitor_id` alias also works. | | `eventType` | `string` | No | Filter by event type. Valid types are `tweet.new`, `tweet.quote`, `tweet.reply`, `tweet.retweet`, `tweet.media`, `tweet.link`, `tweet.poll`, `tweet.mention`, `tweet.hashtag`, `tweet.longform`. Valid types are also `profile.avatar.changed`, `profile.banner.changed`, `profile.name.changed`, `profile.username.changed`, `profile.bio.changed`, `profile.location.changed`, `profile.url.changed`, `profile.verified.changed`, `profile.protected.changed`, `profile.pinned_tweet.changed`. Valid types are also `profile.unavailable.changed`, `tweet.deleted`, `broadcast.started`, `space.started`, `following.added`, `following.removed`, `follower.added`, `follower.removed`, `profile.followers.changed`, `profile.following.changed`. Omit to return all types. Post monitor types are `post.reply.new`, `post.quote.new`, `post.likes.changed`, `post.retweets.changed`, `post.replies.changed`, `post.quotes.changed`, `post.bookmarks.changed`, `post.views.changed`, `post.edited` & `post.deleted`. | | `cursor` | `string` | No | Cursor for pagination. Pass the `nextCursor` value from a previous response to fetch the next page. An edited or unknown cursor returns `400`. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `events` | `array` | List of event objects matching the query. | | `events[].id` | `string` | Unique event identifier. | | `events[].type` | `string` | Event type from the monitor event type list. | | `events[].monitorId` | `string` | Account monitor ID for account events. Keyword monitor ID for keyword events. Post monitor ID for post events. | | `events[].monitorType` | `string` | The source type is `account`, `keyword` or `post`. | | `events[].keywordMonitorId` | `string` | Keyword monitor ID. Present only for keyword monitor events. | | `events[].username` | `string` | X (Twitter) username that triggered the event. Present only for account monitor events. | | `events[].query` | `string` | Keyword query that matched the event. Present only for keyword monitor events. | | `events[].postId` | `string` | ID of the monitored post. Present only for post monitor events. | | `events[].postUrl` | `string` | Link to the monitored post. Present only for post monitor events. | | `events[].authorId` | `string` | Permanent X (Twitter) user ID of the post's author. Present only for post monitor events. | | `events[].authorUsername` | `string` | Username of the post's author. Present only for post monitor events. | | `events[].occurredAt` | `string` | ISO 8601 timestamp. It holds X's time of the event when X gives one. This applies to a post, a live video & a Space. Else it holds the time Xquik saw the event. This applies to a deleted post, a profile change & a follow list change. | | `events[].data` | `object` | Post or profile-change data. Post fields match REST responses. Post profiles use `username` and `verified`. Legacy fields remain available. See [Webhooks Overview](/webhooks/overview) for each event type. | | `hasMore` | `boolean` | `true` if more pages exist beyond this result set. | | `nextCursor` | `string` | Pagination cursor. Pass it as `cursor` for the next page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "events": [ { "id": "9001", "type": "tweet.new", "monitorId": "7", "monitorType": "account", "username": "elonmusk", "occurredAt": "2026-02-24T14:22:00.000Z", "data": { "id": "1893456789012345678", "text": "The future is now.", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk" }, "isRetweet": false, "isReply": false, "isQuote": false, "createdAt": "2026-02-24T14:22:00.000Z" } }, { "id": "9002", "type": "tweet.reply", "monitorId": "7", "monitorType": "account", "username": "elonmusk", "occurredAt": "2026-02-24T15:05:30.000Z", "data": { "id": "1893456789012345999", "text": "Absolutely. Shipping next week.", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk" }, "isRetweet": false, "isReply": true, "isQuote": false, "inReplyToId": "1893456789012345900", "createdAt": "2026-02-24T15:05:30.000Z" } } ], "hasMore": true, "nextCursor": "MjAyNi0wMi0yNFQxNTowNTozMC4wMDBafDkwMDI=" } ``` ### 400 Invalid cursor `{ "error": "invalid_input", "message": "Cursor invalid. Use nextCursor from the previous page, or omit it to start over." }` The `cursor` value is not a `nextCursor` from this route. Send the last `nextCursor` received, or omit `cursor` to start from the first page. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. ## Event inventory handoff This endpoint lists stored monitor events. Use it when an agent, dashboard, or support workflow needs that list. That caller uses it before looking up details or webhook delivery status. | Event inventory column | Response source | Pagination rule | | - | - | - | | Event ID | `events[].id` | Open one event or join a webhook delivery. | | Event type | `events[].type` | Route tweet, reply, quote, or repost records. | | Monitor source | `events[].monitorType` | Separate account and keyword monitor rows. | | Account source | `events[].monitorId` and `username` | Filter one tracked X account. | | Keyword source | `events[].keywordMonitorId` and `query` | Filter one tracked X (Twitter) search. | | Post source | `events[].monitorId` and `postId` | Filter one tracked X post. | | Tweet fields | `events[].data` | Export tweet text, author, and timestamps. | | More pages | `hasMore` | Continue only while this value is `true`. | | Next page | `nextCursor` | Pass this value as the next `cursor` parameter. | > [card] Event row > > Store `event_id`, `event_type`, `occurred_at`, and > `event_detail_endpoint`. Use [Get Event](/api-reference/events/get) when a > later step needs the full event payload. > [card] Monitor source > > Store `monitor_type`, `monitor_id`, `keyword_monitor_id`, `username`, and > `query`. That keeps account and keyword monitor events separate in exports. > Use `monitorId` for account-monitor filters and `keywordMonitorId` for > keyword-monitor filters. > [card] Tweet fields > > Store `tweet_id`, `tweet_text`, and `author_username` from `data` when the > event contains tweet content. Other event types can leave those fields > empty. > [card] Delivery join > > Store `delivery_join_key` as the event ID. In webhook delivery rows, match > it to `streamEventId` from > [List Deliveries](/api-reference/webhooks/deliveries). > [card] Delivery status > > Join deliveries first. Then store `status`, `attempts`, > `lastStatusCode`, `lastError`, `createdAt`, and `deliveredAt` with the event > row. > [card] Cursor checkpoint > > Store `next_cursor` only when `has_more` is `true`. Pass it as `cursor` for > the next page and stop when `has_more` is `false`. ## Pagination Events use cursor pagination. Pass `nextCursor` as the next `cursor` value. ```bash First page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/events?limit=10&monitorId=7" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '{event_ids: [.events[].id], has_more: .hasMore, next_cursor: (.nextCursor // null)}' ``` ```bash Next page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/events?limit=10&monitorId=7&cursor=MjAyNi0wMi0yNFQxNTowNTozMC4wMDBafDkwMDI=" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '{event_ids: [.events[].id], has_more: .hasMore, next_cursor: (.nextCursor // null)}' ``` Continue fetching pages until `hasMore` is `false`. Cursors are opaque strings. Do not parse or build them. An edited or unknown cursor returns `400 invalid_input`. An empty `cursor` returns the first page. > [!NOTE] > > **Related.** [Get Event](/api-reference/events/get) · [List Deliveries](/api-reference/webhooks/deliveries) · [List Monitors](/api-reference/monitors/list) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Stream monitor events live, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/events/stream Get each monitor event over 1 open HTTP connection as Xquik stores it. Reconnect with Last-Event-ID to replay what you missed. Streaming costs no credits. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/events/stream` **Free.** Streaming does not consume credits. Open 1 connection and read your monitor events as they arrive. You need no public endpoint and no signature check. Use it beside webhooks or instead of them. ## How the stream works * Each event arrives as a server-sent event. `event` is its type, and `id` is its event ID. `data` is the event object [List events](/api-reference/events/list) returns. * A new connection gets each event stored after it opens. * To catch up after a drop, reconnect with `Last-Event-ID`. The stream first sends every event after that ID, oldest first. It then sends the new ones. * Events expire 30 days after Xquik creates them. So a replay reaches back 30 days at most. An ID Xquik no longer keeps replays every event it still keeps. * The first frame is `retry: 3000`, so a client waits 3 s before it reconnects. * An idle stream sends a `: keep-alive` comment every 15 s. * A connection ends after 30 minutes. Reconnect with the last ID you got. SSE libraries do this for you. * Keep up to 200 streams open per account. Xquik may answer `429` with `too_many_streams` to a 201st. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -N "https://xquik.com/api/v1/events/stream" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Last-Event-ID: 42" ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} let lastEventId; async function readStream() { const response = await fetch("https://xquik.com/api/v1/events/stream", { headers: { "x-api-key": "xq_YOUR_KEY_HERE", ...(lastEventId === undefined ? {} : { "Last-Event-ID": lastEventId }), }, }); if (!response.ok) throw new Error(`Stream refused: ${response.status}`); const decoder = new TextDecoder(); let buffer = ""; for await (const chunk of response.body) { buffer += decoder.decode(chunk, { stream: true }); const frames = buffer.split("\n\n"); buffer = frames.pop() ?? ""; for (const frame of frames) { const fields = Object.fromEntries( frame .split("\n") .filter((line) => line !== "" && !line.startsWith(":")) .map((line) => [line.slice(0, line.indexOf(":")), line.slice(line.indexOf(":") + 2)]), ); if (fields.data === undefined) continue; lastEventId = fields.id; const event = JSON.parse(fields.data); process.stdout.write(`${JSON.stringify({ id: event.id, type: event.type })}\n`); } } } // The stream ends after 30 minutes. Reconnect with the last ID. for (;;) { await readStream().catch((error) => console.error(error.message)); await new Promise((resolve) => setTimeout(resolve, 3000)); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import time import requests last_event_id = None def read_stream(): global last_event_id headers = {"x-api-key": "xq_YOUR_KEY_HERE"} if last_event_id is not None: headers["Last-Event-ID"] = last_event_id with requests.get( "https://xquik.com/api/v1/events/stream", headers=headers, stream=True, timeout=(10, 60), ) as response: response.raise_for_status() fields = {} for line in response.iter_lines(decode_unicode=True): if line == "": if "data" in fields: last_event_id = fields.get("id") event = json.loads(fields["data"]) print(json.dumps({"id": event["id"], "type": event["type"]})) fields = {} elif not line.startswith(":"): name, _, value = line.partition(": ") fields[name] = value # The stream ends after 30 minutes. Reconnect with the last ID. while True: try: read_stream() except requests.RequestException as error: print(error) time.sleep(3) ``` These examples print 1 line per event. They keep the last event ID for the next connection. Store that ID if your process restarts. With it, the first connection after a restart replays what it missed. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. | | `Last-Event-ID` | `string` | No | The last event ID your client got. The stream first sends every event after it. SSE libraries send it on their own when they reconnect. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `include` | `string` | No | Set to `post_metrics` to also get each post monitor's saved numbers as they change. Any other value is refused. | | `lookBack` | `boolean` | No | Set to `true` to resume 30 seconds before `Last-Event-ID`. Events saved late then still arrive. Events you already have can arrive again, so skip IDs you've seen. An ID the stream can't find starts 5 minutes back, not 30 days. Default `false`. | ## Response ### 200 OK ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} retry: 3000 id: 42 event: tweet.new data: {"id":"42","type":"tweet.new","monitorId":"7","monitorType":"account","occurredAt":"2025-01-15T12:00:00.000Z","data":{}} : keep-alive ``` A `text/event-stream` body. Each event's `data` line holds the event object that [List events](/api-reference/events/list) documents. It is 1 line of JSON. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 429 Too many streams or requests `too_many_streams` means the account has 200 streams open. Close 1, then connect again. `rate_limit_exceeded` means too many requests. Wait for the `Retry-After` header before you retry. > [!NOTE] > > **Related.** [List Events](/api-reference/events/list) · [Get Event](/api-reference/events/get) · [Webhooks overview](/webhooks/overview) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "too_many_streams", "message": "Close a stream first. Keep up to 200 open per account." }` # Cancel an extraction job, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/extractions/cancel Cancel an active Xquik extraction job by its ID. The job stops, saves no rows & uses no credits. Handle the 200, 401, 403, 404, 409 & 429 API responses. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/extractions/{id}` ## Cancel one extraction job Send `DELETE /extractions/{id}` to stop a `pending` or `running` job. The job ends as `canceled`. It saves no rows & uses no credits. A repeat request on a canceled job answers `200`, so a retry is safe. Use the job ID from [Create Extraction](/api-reference/extractions/create) or [List Extractions](/api-reference/extractions/twitter-scraping-job-history). An API key needs the exports scope for this route. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --request DELETE \ https://xquik.com/api/v1/extractions/aB3dE6gH9jK2 \ --header "x-api-key: xq_YOUR_KEY_HERE" ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const jobId = "aB3dE6gH9jK2"; const response = await fetch(`https://xquik.com/api/v1/extractions/${jobId}`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const body = await response.json(); if (!response.ok) { throw new Error(`${response.status} ${body.error}: ${body.message}`); } console.log(`${body.id} is ${body.status}`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests job_id = "aB3dE6gH9jK2" response = requests.delete( f"https://xquik.com/api/v1/extractions/{job_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) body = response.json() if not response.ok: raise RuntimeError(f'{response.status_code} {body["error"]}: {body["message"]}') print(f'{body["id"]} is {body["status"]}') ``` ## Know when a job can stop Only a `pending` or `running` job can stop. A finished job answers `409` with its `status`. Its rows stay as they were. To keep the rows a job already found, let it finish. Then read them through [Extraction results](/api-reference/extractions/twitter-extraction-results). ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | An OAuth bearer token formatted as `Bearer YOUR_TOKEN`. Send this header or `x-api-key`, not both. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Extraction job ID returned from [Create Extraction](/api-reference/extractions/create) or [List Extractions](/api-reference/extractions/twitter-scraping-job-history). | ## Response > [tab] 200 Canceled > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "id": "aB3dE6gH9jK2", "status": "canceled" } > ``` > > Xquik stopped the job. It saved no rows. > [tab] 401 Unauthenticated > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." } > ``` > > The API key or bearer token is missing or invalid. > [tab] 403 Forbidden > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "insufficient_scope", "message": "This API key lacks the exports scope. Add it at dashboard.xquik.com/api-keys.", "requiredScope": "exports" } > ``` > > The API key lacks the exports scope, or it is paused. > [tab] 404 Not found > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "not_found", "message": "Resource not found." } > ``` > > No job has this ID, or it belongs to another account. > [tab] 409 Already ended > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "extraction_terminal", "message": "Extraction already finished. Check its status.", "status": "completed" } > ``` > > The job already finished. `status` names how it ended. > [tab] 429 Rate limited > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 } > ``` > > Wait for the `Retry-After` header, then retry once. > [!NOTE] > > **Related.** [Create Extraction](/api-reference/extractions/create) starts a new job, and [List Extractions](/api-reference/extractions/twitter-scraping-job-history) shows each job's status. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "aB3dE6gH9jK2", "status": "canceled" } ``` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "extraction_terminal", "message": "Extraction already finished. Check its status.", "status": "completed" }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Create a bulk extraction job, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/extractions/create Start an export job for tweets, followers, following, replies, profiles, timelines, media, communities, or lists with one of 23 tools. 1 credit per result. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/extractions` **1 credit per result extracted** · [All plans](https://xquik.com/en) from \$0.00012/credit ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `dry_run` | `boolean` | No | Return a cost estimate without creating a job. Defaults to `false`. | ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500 }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/extractions", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json", }, body: JSON.stringify({ toolType: "reply_extractor", targetTweetId: "1893704267862470862", resultsLimit: 500, }), }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests from uuid import uuid4 response = requests.post( "https://xquik.com/api/v1/extractions", headers={"x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": str(uuid4())}, json={ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500, }, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "crypto/rand" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500, }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/extractions", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", rand.Text()) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | | `Content-Type` | `string` | Yes | Must be `application/json`. | | `Idempotency-Key` | `string` | No | Generate one unique value for each job. Reuse it only for an exact retry. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `toolType` | `string` | Yes | Extraction tool to run or estimate. See the endpoint's tool list. | Each tool reads its own target, collection, and filter fields. See [extraction parameters](/api-reference/extractions/parameters) for every field. ## Tool types Choose supported target fields. `resultsLimit` defaults to `10,000`. Send a positive integer to change it. > [card] Tweet target > > Use `targetTweetId` for tweet-centered jobs. > > * `article_extractor` extracts article content from a tweet. > * `favoriters` extracts visible users who liked a post. Liker identities can > be unavailable even when the post reports likes. The job reads through > your connected X account. Without one, the job fails with `errorMessage` > set to `errorXAccountRequired`. > * `quote_extractor` extracts users who quote-tweeted a tweet. > * `reply_extractor` extracts users who replied to a tweet. > * `repost_extractor` extracts users who retweeted a tweet. > * `thread_extractor` extracts all tweets in a thread. > [card] Username target > > Use `targetUsername` for account-centered jobs. > > * `follower_explorer` extracts followers of an account. > * `following_explorer` extracts accounts followed by a user. > * `mention_extractor` extracts tweets mentioning an account. > * `post_extractor` extracts posts from an account. > * `user_likes` extracts liked tweets that X makes visible. X shows likes only > to their owner. The job reads through your connected X account. Without > one, the job fails with `errorMessage` set to `errorXAccountRequired`. > * `user_affiliates` extracts the accounts an organization lists as its > affiliates. > * `user_media` extracts media posts from a user. > * `verified_follower_explorer` extracts verified followers of an account. > [card] Community target > > Use `targetCommunityId` for community jobs. > > * `community_extractor` extracts members of a community. > * `community_moderator_explorer` extracts moderators of a community. > * `community_post_extractor` extracts posts from a community. > * `community_search` searches matching posts within that community and also requires `searchQuery`. > [card] Search query > > Use `searchQuery` for keyword jobs. > > * `people_search` searches for users by keyword. > * `tweet_search_extractor` searches and extracts tweets by keyword or hashtag. > [card] List target > > Use `targetListId` for X List jobs. > > * `list_follower_explorer` extracts followers of a list. > * `list_member_extractor` extracts members of a list. > * `list_post_extractor` extracts posts from a list. > [card] Space target > > Use `targetSpaceId` for Space jobs. > > * `space_explorer` extracts participants of a Space. > > Store `targetSpaceId` beside the returned extraction `id`. Poll > [Get Extraction](/api-reference/extractions/twitter-extraction-results) or use > [Export Extraction](/api-reference/extractions/export) after completion to > read participant user rows. ## Collect attached media from mixed sources Use `tweet_search_extractor` when one job needs several Tweet sources. Set each source in `targets`. Use `mediaType: "media"` to keep rows with attachments. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "toolType": "tweet_search_extractor", "targets": [ { "kind": "tweet", "value": "1893704267862470862" }, { "kind": "replies", "value": "1893704267862470862" }, { "kind": "quotes", "value": "1893704267862470862" }, { "kind": "thread", "value": "1893704267862470862" }, { "kind": "profile_media", "value": "openai" } ], "mediaType": "media", "resultsLimit": 100 } ``` Full output stores attachments at `enrichmentData.tweet.media`. Add `outputPreset=flat` while retrieving results to return `media` at row level. Use `user_media` with `targetUsername` for one profile-only job. ## Response ### 202 Accepted | Field | Type | Description | | - | - | - | | `id` | `string` | Unique extraction job ID (UUID). | | `pollAfterMs` | `number` | Milliseconds to wait before polling. | | `statusUrl` | `string` | Relative URL for status and results. | | `waitUrl` | `string` | Relative polling URL. It waits 10 seconds and returns 1 compact row. | | `toolType` | `string` | Tool type used for this extraction. | | `status` | `string` | Current job status. | > [!NOTE] > > Prefer `waitUrl` while the job runs. Use `statusUrl` for immediate checks. New jobs include `Location` and `Retry-After`. Terminal replays return `pollAfterMs: 0` and omit `Retry-After`. ### 400 Invalid input The request body is missing or malformed. Send every required field. ### 400 Invalid tool type Use one of the 23 [tool types](#tool-types). ### 401 Unauthenticated Missing or invalid API key. ### 402 Insufficient credits The balance can't cover the extraction. The error is `no_subscription`, `subscription_inactive`, `no_credits` or `insufficient_credits`. ### 403 Protected account Post, media & follower tools refuse a protected `targetUsername`. Choose a public account. A multi-target job skips it & ends with `partial_failure`. ### 404 Not found The target tweet or user doesn't exist, was deleted, or is suspended. ### 409 Idempotency conflict The key was used for a different request. ### 424 X API dependency failed Send `xquik-api-contract: 2026-04-29` to get 424 instead of the default `502`. ### 429 Rate limited Wait `Retry-After` seconds, then retry. ### 502 X API unavailable The read service is unavailable. Retry with exponential backoff. > [!NOTE] > > **Next steps.** > > * [Get Extraction](/api-reference/extractions/twitter-extraction-results) to retrieve results with pagination. > * [Export Extraction](/api-reference/extractions/export) to download as CSV, XLSX or Markdown. > * [Estimate Extraction](/api-reference/extractions/twitter-scraping-cost-estimator) to check costs before running. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "allowed": true, "creditsAvailable": "50000", "creditsRequired": "500", "estimatedResults": 500, "source": "replyCount" } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "ext_123", "url": "https://dashboard.xquik.com/activity/a1b2c3d4e5f6", "pollAfterMs": 1000, "statusUrl": "/api/v1/extractions/a1b2c3d4", "waitUrl": "/api/v1/extractions/id?wait=10&limit=1&outputMode=compact", "toolType": "follower_explorer", "status": "running" } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_budget_reached", "message": "This API key reached its monthly credit budget. Raise or remove it at dashboard.xquik.com/api-keys, or wait for the next UTC month." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key belongs to another request. Use a new key." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` # Export extraction results, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/extractions/export Export tweet, follower, reply, profile, timeline, community, or list results in 7 formats, with documented CSV, XLSX, JSON, and PDF limits. Exports are free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/extractions/{id}/export` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail -X GET "https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=csv" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -o extraction-reply_extractor.csv ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { writeFile } from "node:fs/promises"; const extractionId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; const response = await fetch( `https://xquik.com/api/v1/extractions/${extractionId}/export?format=csv`, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }, ); if (!response.ok) { throw new Error(`Export failed with ${response.status}`); } const bytes = Buffer.from(await response.arrayBuffer()); await writeFile("extraction-reply_extractor.csv", bytes); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests extraction_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" response = requests.get( f"https://xquik.com/api/v1/extractions/{extraction_id}/export", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"format": "csv"}, ) response.raise_for_status() with open("extraction-reply_extractor.csv", "wb") as f: f.write(response.content) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "net/http" "os" ) func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=csv", nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 300 { panic(fmt.Sprintf("export failed with %d", resp.StatusCode)) } file, err := os.Create("extraction-reply_extractor.csv") if err != nil { panic(err) } defer file.Close() if _, err := io.Copy(file, resp.Body); err != nil { panic(err) } } ``` ## File handoff Treat the response body as file bytes. Save it first. Then pass the local path to the CRM import, warehouse load, queue, or agent. Do not print downloaded export bytes to shared logs. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "extraction_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "export_format": "csv", "export_file_path": "extraction-reply_extractor.csv", "content_type": "text/csv; charset=utf-8", "handoff_format": "file" } ``` The response `Content-Disposition` header contains the server filename. Store it when you need an audit trail. The trail connects the downloaded file to the extraction job. ### Format handoff map > [card] CRM CSV > > Use `format=csv` for CRM imports, spreadsheet checks, and follower or reply > upserts. Name reply jobs `xquik-replies.csv` and follower jobs > `xquik-followers.csv`. > [card] App JSON > > Use `format=json` for app ingestion, queue replay, or structured storage. > Each row keeps the nested `enrichmentData` of its result, with media and > entities. Store the extraction ID and server filename with the local path. > [card] Analyst XLSX > > Use `format=xlsx` for analyst review and account-management workbooks when > people need filters or formulas. > [card] Report formats > > Use `format=md`, `md-document`, `pdf`, or `txt` for human-readable reports. > A PDF above 10,000 rows comes as a ZIP of PDF parts. To process rows as they arrive, use [Extraction Workflow](/guides/extraction-data-handoff#durable-json-lines-handoff). With it, write JSON Lines from paginated `GET /extractions/{id}` results. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Extraction job ID returned from [Create Extraction](/api-reference/extractions/create) or [List Extractions](/api-reference/extractions/twitter-scraping-job-history). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `format` | `string` | Yes | Export file format. Use `csv`, `json`, `md`, `md-document`, `pdf`, `txt`, or `xlsx`. | ### Export filters | Query parameter | Type | Required | Description | | - | - | - | - | | `minFollowers` | `integer` | No | Minimum follower count. | | `maxFollowers` | `integer` | No | Maximum follower count. | | `minFollowing` | `integer` | No | Minimum following count. | | `maxFollowing` | `integer` | No | Maximum following count. | | `minPosts` | `integer` | No | Minimum post count. | | `maxPosts` | `integer` | No | Maximum post count. | | `minLikes` | `integer` | No | Minimum like count. | | `minReplies` | `integer` | No | Minimum reply count. | | `minRetweets` | `integer` | No | Minimum repost count. | | `minViews` | `integer` | No | Minimum view count. | | `hasDescription` | `boolean` | No | Require a non-empty description. | | `hasLocation` | `boolean` | No | Require a non-empty location. | | `compare` | `string` | No | ID of an earlier run that read the same account's whole list. The export then holds only the rows that differ. | | `change` | `string` | No | With `compare`, `added` keeps this run's new rows. `removed` keeps the earlier run's rows that this run lacks. The default is `added`. | | `hasWebsite` | `boolean` | No | Require a website on the profile. | | `joinedSince` | `string` | No | Keep accounts that joined X on this UTC day or later, as `YYYY-MM-DD`. | | `joinedUntil` | `string` | No | Keep accounts that joined X before this UTC day, as `YYYY-MM-DD`. | | `location` | `string` | No | Keep accounts whose location contains this text. | | `hideInactive` | `boolean` | No | Drop accounts at least 180 days old that average under 1 post a month. | | `hideFake` | `boolean` | No | Drop accounts with at least 3 of 4 signs. The signs are no posts, a default picture and an empty bio. The fourth is following at least 100 accounts and 10 times their followers. | | `hasEmail` | `boolean` | No | Require an email in the row's `Email` column. | | `businessEmailOnly` | `boolean` | No | Require an email outside free webmail, such as Gmail, in the `Email` column. | | `emailDomains` | `string` | No | Require the row's email at one of these comma-separated domains. An export filters on a profile's first email. A job filters on every email. | | `hasMedia` | `boolean` | No | Require media. | | `verified` | `boolean` | No | Match verified status. | | `lang` | `string` | No | Match a language code. | | `search` | `string` | No | Search exported result text. | | `sinceDate` | `string` | No | Include results on or after this date, from 00:00 UTC. An ISO 8601 time starts at that instant. Results without a post date are left out. An empty value sets no filter. | | `untilDate` | `string` | No | Include results on or before this date, inclusive, through 23:59:59 UTC. An ISO 8601 time ends at that instant. Results without a post date are left out. An empty value sets no filter. | ## Export columns The extraction tool type decides the columns. Default exports include 33 columns. `article_extractor` exports 11 article columns. JSON rows also keep each result's nested `enrichmentData`, as [Get Extraction](/api-reference/extractions/twitter-extraction-results) returns it. ### Default result columns All extraction tools except `article_extractor` use the default result column set. Some enrichment columns may be empty when the result does not include that data. > [card] User identity > > `User ID`, `Username`, `Display Name`, `Verified`, and `Profile Image`. > [card] Audience metrics > > `Followers`, `Following`, `Posts`, `Media Count`, and `Favorites`. > [card] Profile context > > `Description`, `Location`, `Email`, `Phones`, `Links`, and `Cover Picture`. > `Email` holds the first email the profile publishes. `Phones` & `Links` hold every number & > link it publishes, joined by a comma & a space. > [card] Tweet content > > `Tweet ID`, `Tweet URL`, `Tweet Text`, and `Tweet Created At`. > `Tweet URL` falls back to the status URL when the username is unavailable. > [card] Tweet engagement > > `Likes`, `Reposts`, `Replies`, `Quotes`, `Views`, and `Bookmarks`. > [card] Tweet metadata > > `Language`, `Source`, and `Conversation ID`. > [card] Article metadata > > `Article Title`, `Article Preview`, `Article Body`, and `Article Contents JSON`. ### Article extractor columns `article_extractor` uses a shorter column set for articles. > [card] Article identity > > `Article Title`, `Cover Image`, `Article Body`, and `Article Contents JSON`. > [card] Author identity > > `Author`, `Username`, and `Verified`. > [card] Author reach > > `Followers`. > [card] Article engagement > > `Views`, `Likes`, and `Quotes`. ## Response > [tab] 200 OK > > Returns a file download. The response includes a `Content-Disposition` header with the filename. > > > [card] CSV > > > > `format=csv` returns `text/csv; charset=utf-8` with filenames like > > `extraction-reply_extractor-*.csv`. > > > [card] JSON > > > > `format=json` returns `application/json; charset=utf-8` with filenames > > like `extraction-reply_extractor-*.json`. Each row adds the result's > > nested `enrichmentData` to its columns. > > > [card] Markdown > > > > `format=md` returns `text/markdown; charset=utf-8` with filenames like > > `extraction-reply_extractor-*.md`. > > > [card] Markdown document > > > > `format=md-document` returns `text/markdown; charset=utf-8` with > > filenames like `extraction-reply_extractor-*.md`. > > > [card] PDF > > > > `format=pdf` returns `application/pdf` with filenames like > > `extraction-reply_extractor-*.pdf`. > > > [card] TXT > > > > `format=txt` returns `text/plain; charset=utf-8` with filenames like > > `extraction-reply_extractor-*.txt`. > > > [card] XLSX > > > > `format=xlsx` returns > > `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` > > with filenames like `extraction-reply_extractor-*.xlsx`. > > Exports include every row, ordered by result ID. A PDF above 10,000 rows comes as a ZIP of PDF parts. > [tab] 400 Invalid format > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "error": "invalid_format", > "validFormats": ["csv", "json", "md", "md-document", "pdf", "txt", "xlsx"] > } > ``` > > The `format` query parameter is missing or not one of the supported values. > [tab] 401 Unauthenticated > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "unauthenticated" } > ``` > > Missing or invalid API key. > [tab] 404 Not found > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "not_found" } > ``` > > No extraction job exists with this ID, or it belongs to a different account. > [tab] 429 Rate limited > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 } > ``` > > Wait for the `Retry-After` value before requesting another export. > [!NOTE] > > **Next steps.** > > * [Get Extraction](/api-reference/extractions/twitter-extraction-results) to page through results with the API. > * [List Extractions](/api-reference/extractions/twitter-scraping-job-history) to find other extraction jobs to export. ## Response examples * **200** `` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Twitter scraper API extraction request parameters Source: https://docs.xquik.com/api-reference/extractions/parameters Every body parameter for Twitter extraction jobs and cost estimates, covering targets, collection limits, reply controls, tweet and profile filters, and search. > For the complete documentation index, see [llms.txt](/llms.txt). Create Extraction and the cost estimator accept the same body. Each tool reads the fields it needs and `toolType` picks the tool. ## Single targets | Body parameter | Type | Required | Description | | - | - | - | - | | `targetTweetId` | `string` | No | Tweet ID for a tweet-centered extraction. | | `targetUsername` | `string` | No | Username for an account-centered extraction. You may include `@`. | | `targetCommunityId` | `string` | No | Community ID for a community extraction. | | `targetListId` | `string` | No | List ID for a list extraction. | | `targetSpaceId` | `string` | No | Space ID for `space_explorer`. | | `searchQuery` | `string` | No | Query for `tweet_search_extractor`, `people_search` or `community_search`. `tweet_search_extractor` adds the structured search fields, such as `fromUser` and `minFaves`, to this query. X (Twitter) searches up to 512 characters. A longer tweet or people search answers 400, counted with the added fields. | ## Collection targets | Body parameter | Type | Required | Description | | - | - | - | - | | `targetTweetIds` | `string[]` | No | Process 1-10,000 Tweet IDs in one collection job. | | `targetUsernames` | `string[]` | No | Process 1-10,000 unique usernames in one job. `tweet_search_extractor` collects their posts. | | `targetCommunityIds` | `string[]` | No | Process 1-10,000 unique community IDs in one collection job. | | `targetListIds` | `string[]` | No | Process 1-10,000 unique List IDs in one collection job. | | `searchQueries` | `string[]` | No | Process 1-10,000 unique search queries in one collection job. Each follows the rules of `searchQuery`, its structured fields and 512-character limit included. | | `targets` | `array` | No | Process up to 10,000 mixed targets with automatic routing. | Each target accepts a supported string or `{ "kind": "...", "value": "..." }`. | Body parameter | Type | Required | Description | | - | - | - | - | | `relationTargets` | `array` | No | Process up to 10,000 profile relations in one collection job. | Each relation target uses `{ "relation": "...", "value": "..." }`. ## Collection controls | Body parameter | Type | Required | Description | | - | - | - | - | | `queryType` | `string` | No | Search ranking. Use `Latest`, `Top`, or `Both`. Defaults to `Latest`. | | `resultsLimit` | `integer` | No | Maximum unique results to emit. Defaults to `10,000`. Use any positive integer, such as `100000` or more. | | `topic` | `string` | No | Keep only posts about this topic, such as `the Rust programming language`. AI-powered analysis checks each post the job reads. Only posts scoring 0.5 or more are stored. Each stored post costs 2 credits instead of its read price. A dropped post costs nothing. `resultsLimit` caps the posts read & checked. Stored rows carry `enrichmentData.topicScore`, & the job's `topicFilter` states the cutoff & counts. Works with tools that return posts. Up to 200 characters. Send `topic` or `imageShows`, not both. | | `imageShows` | `string` | No | Keep only posts whose photos show this. Send `charts`, `screenshots`, `product_photos`, `memes` or `people`. You can also describe it in words, such as `a rocket`. Only photos X doesn't mark sensitive get checked, & each stored post costs 2 credits. Posts without such a photo stay out at no charge. Stored rows carry `enrichmentData.imageScore`, & the job's `imageFilter` states the cutoff & counts. Works with tools that return posts. Up to 200 characters. Send `topic` or `imageShows`, not both. | | `maxItemsPerTarget` | `integer` | No | Maximum results collected for each target. At least `1`. | | `maxPagesPerTarget` | `integer` | No | Reply pages collected per target. Accepts `1-1,000`. | | `startCursor` | `string` | No | Resume one reply target from this cursor. | | `dedupeAcrossTargets` | `boolean` | No | Merge duplicates across targets. Defaults to `true`. | | `dedupeMode` | `string` | No | Duplicate handling. Use `none`, `first`, or `merge`. | | `overlapMode` | `boolean` | No | Use `dedupeMode=merge`. Defaults to `false`. | | `includeSearchTerms` | `boolean` | No | Add matched search terms to collection metadata. Defaults to `false`. | | `includeTargetMetadata` | `boolean` | No | Add source target metadata to each result. Defaults to `true`. | | `enrichProfiles` | `boolean` | No | Add each user's full profile at `enrichmentData.profile`. Applies to `follower_explorer`, `following_explorer`, `verified_follower_explorer`, `people_search` & `repost_extractor`. Jobs take longer. Defaults to `false`. | ## Reply collection | Body parameter | Type | Required | Description | | - | - | - | - | | `collectionStrategy` | `string` | No | Collection strategy. Use `auto`, `complete`, `direct`, `search`, or `thread`. | | `scope` | `string` | No | Reply scope. Use `all`, `direct`, or `nested`. Defaults to `all`. | | `maxDepth` | `integer` | No | Maximum nested reply depth. At least `1`. | | `sort` | `string` | No | Sort order. Use `relevance`, `latest`, `oldest`, or `likes`. | | `excludeOriginalAuthor` | `boolean` | No | Exclude replies from the source author. Defaults to `false`. | | `includeOriginalPost` | `boolean` | No | Include the source post. Defaults to `false`. | | `hasMediaOnly` | `boolean` | No | Return only replies with media. Defaults to `false`. | | `sinceTime` | `string \| integer` | No | Reply start time as ISO 8601 or Unix seconds. | | `untilTime` | `string \| integer` | No | Reply end time as ISO 8601 or Unix seconds. | ## Tweet result filters | Body parameter | Type | Required | Description | | - | - | - | - | | `minViews` | `integer` | No | Minimum Tweet view count. | | `minBookmarks` | `integer` | No | Minimum Tweet bookmark count. | | `maxLikes` | `integer` | No | Maximum Tweet like count. | | `maxRetweets` | `integer` | No | Maximum Tweet repost count. | | `maxReplies` | `integer` | No | Maximum Tweet reply count. | | `maxQuotes` | `integer` | No | Maximum Tweet quote count. | | `textOnlyTerms` | `string` | No | Keep a post only when 1 of these words is in its text. Links, cards and quoted posts count as text. The author's name and username don't count. Quote a phrase to match it whole. | | `blueVerifiedOnly` | `boolean` | No | Return only Blue-verified Tweet authors. On a tool that returns users, return only profiles X marks as blue verified. Defaults to `false`. | | `cardName` | `string` | No | X search no longer supports `cardName`, so a search with it finds no Tweets. | | `source` | `string` | No | X search no longer supports `source`. An extraction with it answers 424 `search_unavailable` & charges nothing. | | `excludeSource` | `string` | No | X (Twitter) search ignores `excludeSource`, so an extraction with it returns unfiltered rows. Its answers carry `Deprecation` & `Sunset` headers. From 2027-01-15 an extraction with it answers 424 `search_unavailable` & charges nothing. | | `geocode` | `string` | No | X search no longer supports `geocode`. An extraction with it answers 424 `search_unavailable` & charges nothing. | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `near` | `string` | No | A place name. A country, such as United States, works like `placeCountry` & keeps Tweets tagged there. A city keeps Tweets about it. | | `within` | `string` | No | X search no longer supports `within`. An extraction with it answers 424 `search_unavailable` & charges nothing. Use `near` alone. | | `withinTime` | `string` | No | Match Tweets inside a recent time window. | | `nativeRetweets` | `boolean` | No | Return only native reposts. Defaults to `false`. | | `safe` | `boolean` | No | Enable safe search. Defaults to `false`. | | `news` | `boolean` | No | X search no longer supports `filter:news`. An extraction with `news` set to `true` answers 424 `search_unavailable` & charges nothing. | ## Profile result filters | Body parameter | Type | Required | Description | | - | - | - | - | | `minFollowers` | `integer` | No | Minimum profile follower count. | | `maxFollowers` | `integer` | No | Maximum profile follower count. | | `minFollowing` | `integer` | No | Minimum profile following count. | | `maxFollowing` | `integer` | No | Maximum profile following count. | | `minPosts` | `integer` | No | Minimum profile post count. | | `maxPosts` | `integer` | No | Maximum profile post count. | | `minAccountAgeDays` | `integer` | No | Minimum profile age in days. | | `verifiedType` | `string` | No | Match the exact profile verification type. | | `hasWebsite` | `boolean` | No | Require a profile website. Defaults to `false`. | | `hasLocation` | `boolean` | No | Require a profile location. Defaults to `false`. | | `hasEmail` | `boolean` | No | Require an email the profile publishes. Defaults to `false`. | | `businessEmailOnly` | `boolean` | No | Require an email outside free webmail, such as Gmail. Defaults to `false`. | | `emailDomains` | `string` | No | Require an email at one of these comma-separated domains. Subdomains match. | | `bioContains` | `string` | No | Match any bio term, ignoring case. Separate terms with commas or lines. | | `locationContains` | `string` | No | Require matching profile location text. | | `usernameContains` | `string` | No | Require matching username text. | ## Tweet search filters These fields apply to `tweet_search_extractor`. | Body parameter | Type | Required | Description | | - | - | - | - | | `fromUser` | `string` | No | Match an author username without `@`. | | `toUser` | `string` | No | Match replies sent to a username. | | `mentioning` | `string` | No | Match Tweets mentioning a username. | | `language` | `string` | No | Match a language code, such as `en`. | | `sinceDate` | `string` | No | Include Tweets on or after `YYYY-MM-DD`. | | `untilDate` | `string` | No | Include Tweets up to `YYYY-MM-DD`, a UTC day, inclusive, so its own Tweets count. | | `mediaType` | `string` | No | Media filter. Use `images`, `videos`, `gifs`, `media`, `links`, or `none`. | | `minFaves` | `integer` | No | Minimum like count. | | `minRetweets` | `integer` | No | Minimum repost count. | | `minReplies` | `integer` | No | Minimum reply count. | | `minQuotes` | `integer` | No | Minimum quote count. | | `verifiedOnly` | `boolean` | No | Return only verified authors. | | `replies` | `string` | No | Reply mode. Use `include`, `exclude`, or `only`. | | `retweets` | `string` | No | Repost mode. Use `include`, `exclude`, or `only`. | | `quotes` | `string` | No | Quote mode. Use `include`, `exclude`, or `only`. | | `exactPhrase` | `string` | No | Match one exact phrase. | | `excludeWords` | `string` | No | Exclude words or quoted phrases. | | `anyWords` | `string` | No | Match any listed word or quoted phrase. | | `hashtags` | `string` | No | Match hashtags separated by spaces, commas, or lines. | | `cashtags` | `string` | No | Match cashtags separated by spaces, commas, or lines. | | `url` | `string` | No | Match a URL substring or domain. | | `conversationId` | `string` | No | Match a conversation ID. | | `inReplyToTweetId` | `string` | No | Return only replies to this Tweet ID. | | `quotesOfTweetId` | `string` | No | Return only quotes of this Tweet ID. | | `retweetsOfTweetId` | `string` | No | Return only reposts of this Tweet ID. | | `listId` | `string` | No | Search within a List ID. | | `place` | `string` | No | Search within a place ID. | | `placeCountry` | `string` | No | Search within a country code. | | `pointRadius` | `string` | No | Set a geographic center and radius. | | `boundingBox` | `string` | No | Set a geographic bounding box. | | `advancedQuery` | `string` | No | Append raw advanced search syntax. | # Extraction status & results, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/extractions/twitter-extraction-results Inspect an extraction job's status, tool, progress, row count, and paginated tweet, follower, reply, profile, timeline, or list results. Polling is free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/extractions/{id}` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET "https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890?limit=100" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const extractionId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; const params = new URLSearchParams({ limit: "100" }); const response = await fetch(`https://xquik.com/api/v1/extractions/${extractionId}?${params}`, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests extraction_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" response = requests.get( f"https://xquik.com/api/v1/extractions/{extraction_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"limit": 100}, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890?limit=100", nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Extraction job ID returned from [Create Extraction](/api-reference/extractions/create) or [List Extractions](/api-reference/extractions/twitter-scraping-job-history). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Number of results to return per page. Defaults to `1000`, which is also the maximum. | | `cursor` | `string` | No | Pass the previous `nextCursor` unchanged. Do not send `offset`. It returns `400`. | | `wait` | `number` | No | Wait up to 10 seconds when the job is active. Defaults to `0`. | | `outputMode` | `string` | No | Use `compact` for core fields and tweet counts. Use `full` for nested enrichment. Use `raw` for a source copy. Defaults to `full`. | | `outputPreset` | `string` | No | Keep enrichment `nested` or merge it with `flat`. | | `fieldStyle` | `string` | No | Names fields in `source`, `camelCase`, or `snake_case` style. | | `includeRaw` | `boolean` | No | Deprecated. Use `outputMode=raw`. | | Extraction result page column | Response source | Export rule | | - | - | - | | Job ID | `job.id` | Keep this ID with every exported row. | | Extraction tool | `job.toolType` | Record which tool produced the rows. | | Job state | `job.status` | Export final rows only after completion. | | Total rows | `job.totalResults` | Compare this count with all saved pages. | | Result ID | `results[].id` | Use this ID for result-page deduplication. | | X user ID | `results[].xUserId` | Join profile records on this ID. It does not change. | | Tweet fields | `tweetId`, `tweetText`, and `tweetCreatedAt` | Store them only when returned. | | More pages | `hasMore` | Continue only while this value is `true`. | | Next page | `nextCursor` | Pass this value as the next `cursor` parameter. | ## Response ### 200 OK | Field | Type | Required | Description | | - | - | - | - | | `job` | `object` | No | Extraction job metadata. | | `job.id` | `string` | No | Unique extraction job ID. | | `job.toolType` | `string` | No | Tool type used for this extraction. | | `job.status` | `string` | No | The job status is `completed`, `failed`, or `running`. | | `job.totalResults` | `number` | No | Total number of extracted results. | | `job.targetTweetId` | `string` | No | Target tweet ID. Present for tweet-based tools. | | `job.targetUsername` | `string` | No | Target username. Present for user-based tools. | | `job.targetUserId` | `string` | No | Target X (Twitter) user ID. Present for user-based tools. | | `job.targetCommunityId` | `string` | No | Target community ID. Present for `community_extractor`, `community_moderator_explorer`, `community_post_extractor`, `community_search`. | | `job.searchQuery` | `string` | No | Search query. Present for `people_search`, `community_search`. | | `job.errorMessage` | `string` | No | Error description. Only present for failed jobs. `errorXAccountRequired` means the tool needs your connected X account. | | `job.createdAt` | `string` | No | ISO 8601 timestamp of when the job was created. | | `job.completedAt` | `string` | No | ISO 8601 timestamp of when the job finished. Only present for completed jobs. | | `results` | `object[]` | No | Array of extracted user/tweet records for the current page. Every result includes `id` and `xUserId`. The API omits all other fields when unavailable and never sets them to `null`. Check that a field is present before accessing it. | | `results[].id` | `string` | Yes | Unique result ID. | | `results[].xUserId` | `string` | Yes | X (Twitter) user ID. | | `results[].xUsername` | `string` | No | X (Twitter) username (handle). Omitted if unavailable. | | `results[].xDisplayName` | `string` | No | X display name. Omitted if unavailable. | | `results[].xFollowersCount` | `number` | No | Follower count at time of extraction. Omitted if unavailable. | | `results[].xVerified` | `boolean` | No | Whether the user has a verified badge. Omitted if unavailable. | | `results[].xProfileImageUrl` | `string` | No | URL to the user's profile image. Omitted if unavailable. | | `results[].tweetId` | `string` | No | Tweet ID. Omitted for non-tweet-based extractions. | | `results[].tweetUrl` | `string` | No | Canonical X post URL. Omitted for non-tweet-based extractions. | | `results[].tweetText` | `string` | No | Tweet text content. Omitted for non-tweet-based extractions. | | `results[].tweetCreatedAt` | `string` | No | ISO 8601 timestamp of the tweet. Omitted for non-tweet-based extractions. | | `results[].media` | `object[]` | No | Attached media with `outputPreset=flat`. Full nested output stores it at `enrichmentData.tweet.media`. | | `results[].likeCount` | `number` | No | Likes. Omitted when unavailable. | | `results[].retweetCount` | `number` | No | Reposts. Omitted when unavailable. | | `results[].replyCount` | `number` | No | Replies. Omitted when unavailable. | | `results[].quoteCount` | `number` | No | Quotes. Omitted when unavailable. | | `results[].viewCount` | `number` | No | Views. Omitted when unavailable. | | `results[].bookmarkCount` | `number` | No | Bookmarks. Omitted when unavailable. | | `results[].createdAt` | `string` | No | ISO 8601 timestamp of when the result was created. | | `results[].enrichmentData` | `object` | No | Additional profile, Tweet, media, and article metadata. Compact output omits this object. Full output keeps it nested. Flat output merges its fields into the result. | | `results[].enrichmentData.profile` | `object` | No | Full profile, as `GET /x/users/{id}` returns it. Present when the job sets `enrichProfiles` for `follower_explorer`, `following_explorer`, `verified_follower_explorer`, `people_search` or `repost_extractor`. Omitted when the profile read fails. Flat output keeps it as a nested `profile` object. | | `hasMore` | `boolean` | No | Whether more results exist beyond this page. | | `pollAfterMs` | `number` | No | Recommended delay before another immediate check. | | `waitUrl` | `string` | No | Relative polling URL. It waits 10 seconds and returns 1 compact row. | | `nextCursor` | `string` | No | Cursor for the next `cursor` parameter. Only present when `hasMore` is `true`. | With `outputMode=compact`, tweet results keep `tweetUrl`, `likeCount`, `retweetCount`, `replyCount`, `quoteCount`, `viewCount`, and `bookmarkCount`. Compact output omits `xProfileImageUrl` and `enrichmentData`. ### 401 Unauthenticated Missing or invalid API key. ### 404 Not found No extraction job exists with this ID, or it belongs to a different account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Wait for the `Retry-After` value before polling again. ## Paginating results The API orders results by ID ascending. Follow these steps to read every result of a large extraction. 1. Make the initial request without the `cursor` parameter. 2. Check `hasMore`. Pass `nextCursor` as the next `cursor` value. 3. Repeat until `hasMore` is `false`. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { appendFile } from "node:fs/promises"; const extractionId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; let cursor = undefined; let pageIndex = 0; do { const params = new URLSearchParams({ limit: "1000" }); if (cursor) params.set("cursor", cursor); const pageCursor = cursor ?? null; const response = await fetch(`https://xquik.com/api/v1/extractions/${extractionId}?${params}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const data = await response.json(); const rows = data.results.map((result) => ({ extraction_id: extractionId, row_id: result.id, x_user_id: result.xUserId, x_username: result.xUsername, tweet_id: result.tweetId, tweet_text: result.tweetText, page_index: pageIndex, page_cursor: pageCursor, next_cursor: data.nextCursor ?? null, has_more: data.hasMore, handoff_format: "jsonl", })); if (rows.length > 0) { await appendFile( "xquik-extraction-results.jsonl", `${rows.map((row) => JSON.stringify(row)).join("\n")}\n`, ); } cursor = data.hasMore ? data.nextCursor : undefined; pageIndex += 1; } while (cursor); ``` ## Cursor handoff Use `GET /extractions/{id}` when an integration needs structured JSON rows, incremental checkpoints, or extra rows. Extra rows are more than a file export can return. Treat `nextCursor` as an opaque checkpoint and pass it back as `cursor`. > [card] Page checkpoint > > Store `extraction_id`, `page_index`, `page_cursor`, `next_cursor`, > `has_more`, and `result_count` after each successful page. > [card] Row shape > > Store selected fields such as `row_id`, `x_user_id`, `x_username`, > `tweet_id`, and `tweet_text`. Do not write raw result arrays to shared logs. > [card] Large jobs > > Stream pages to `xquik-extraction-results.jsonl` when you need replayable > rows. > [card] File handoff > > Use [Export Extraction](/api-reference/extractions/export) when CSV, JSON, > XLSX, Markdown, PDF, or TXT files are enough. Store page checkpoints separately from row data. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "extraction_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "page_index": 3, "page_cursor": "990100", "next_cursor": "990200", "has_more": true, "result_count": 1000, "handoff_format": "jsonl" } ``` > [!NOTE] > > **Next steps.** > > * [Export Extraction](/api-reference/extractions/export) to download all results as CSV, XLSX, or Markdown. > * [List Extractions](/api-reference/extractions/twitter-scraping-job-history) to browse your job history. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "job": { "id": "a1b2c3d4e5f6", "url": "https://dashboard.xquik.com/activity/a1b2c3d4e5f6", "toolType": "follower_explorer", "status": "completed", "totalResults": 0 }, "results": [], "hasMore": false, "pollAfterMs": 0, "waitUrl": "/api/v1/extractions/ext_123?wait=10&limit=1&outputMode=compact" } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Scraping cost estimate & quote, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/extractions/twitter-scraping-cost-estimator Estimate API credits before exporting tweet searches, replies, followers, following, profiles, communities, or lists. The quote is free and starts no job. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/extractions/estimate` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions/estimate \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500 }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/extractions/estimate", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ toolType: "reply_extractor", targetTweetId: "1893704267862470862", resultsLimit: 500, }), }); const data = await response.json(); if (data.allowed) { // Safe to proceed with extraction } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/extractions/estimate", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500, }, ) data = response.json() if data.get("allowed"): # Safe to proceed with extraction pass ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500, }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/extractions/estimate", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Estimate X (Twitter) API scraping cost Request a free credit quote before starting any extraction. The response estimates results and required credits. It also checks your available credit balance. A quote never starts a scraping job. Use the same request fields for estimation and extraction. Keep `toolType`, target fields, filters, and `resultsLimit` unchanged. The quote then matches the job you run. ### Match each scraping task | Twitter scraping task | `toolType` | Required target | Estimated results | | - | - | - | - | | Search tweets with filters | `tweet_search_extractor` | `searchQuery` | Matching tweet search results | | Export tweet replies | `reply_extractor` | `targetTweetId` | Replies beneath one tweet | | Export followers | `follower_explorer` | `targetUsername` | Follower profiles | | Export following | `following_explorer` | `targetUsername` | Followed profiles | | Export profile tweets | `post_extractor` | `targetUsername` | Tweets from one profile | | Export community tweets | `community_post_extractor` | `targetCommunityId` | Tweets from one community | | Export list members | `list_member_extractor` | `targetListId` | Profiles inside one list | | Export list tweets | `list_post_extractor` | `targetListId` | Tweets from list members | Other supported tools estimate likes, media, mentions, quotes, reposts, threads, Spaces, and articles. Use their matching target fields below. ### Control the credit quote `resultsLimit` defaults to `10,000`. Set any positive integer for a different bound. The estimator adjusts `creditsRequired` for that projected count. Narrow tweet search estimates with dates, authors, languages, engagement thresholds, or media filters. Reuse those filters when creating the extraction. Changed filters can produce a different estimate. Post estimates use the 1,000-row cap. A protected profile returns 403 `x_account_protected`. ### Read the estimate When `allowed` is `false`, lower `resultsLimit`, narrow filters, or add credits. Then request another quote. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Must be `application/json`. | The estimator accepts the same fields as Create Extraction. ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `toolType` | `string` | Yes | Extraction tool to run or estimate. See the endpoint's tool list. | Each tool reads its own target, collection, and filter fields. See [extraction parameters](/api-reference/extractions/parameters) for every field. ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `allowed` | `boolean` | Whether the extraction can proceed given the current credit balance. | | `source` | `string` | Data source used for the estimate. It is `collection`, `followers`, `following`, `paginationCap`, `quoteCount`, `replyCount`, `resultsLimit`, `retweetCount`, or `unknown`. | | `estimatedResults` | `number` | Estimated number of results the extraction will return. | | `creditsRequired` | `string` | Credits this extraction will consume (stringified integer). | | `creditsAvailable` | `string` | Credits available in your balance (stringified integer). | | `resolvedXUserId` | `string` | Resolved X (Twitter) user ID from count-based profile estimates. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "allowed": true, "creditsRequired": "500", "creditsAvailable": "50000", "estimatedResults": 250, "source": "replyCount", "resolvedXUserId": "123456" } ``` When `allowed` is `false`, credits required exceed the available balance. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "allowed": false, "creditsRequired": "250000", "creditsAvailable": "18000", "estimatedResults": 250000, "source": "followers" } ``` ### 400 Invalid input The request body is missing or malformed. Send `toolType` and its matching target field. ### 400 Invalid tool type `{ "error": "invalid_tool_type" }` The `toolType` value is not one of the 23 supported tools. ### 401 Unauthenticated Missing or invalid API key. ### 402 Insufficient credits The available balance cannot cover the estimate. Possible error values include `no_subscription`, `subscription_inactive`, `no_credits`, and `insufficient_credits`. ### 404 Not found `{ "error": "tweet_not_found", "message": "Tweet not found" }` The target tweet does not exist, was deleted, or the ID is invalid. `{ "error": "user_not_found", "message": "X user not found" }` The target user does not exist or is suspended. ### 429 Rate limited Wait for the `Retry-After` value before requesting another estimate. ## Decision handoff A `200 OK` response is a quote. It starts no extraction. Store the estimate with the request you plan to run. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "checkpoint_type": "extraction_estimate", "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500, "estimatedResults": 500, "creditsRequired": "500", "creditsAvailable": "50000", "allowed": true, "source": "replyCount", "next_action": "create_extraction", "create_path": "/api/v1/extractions", "fallback_action": "lower_results_limit_or_add_credits" } ``` > [card] Allowed run > > When `allowed` is `true`, send the same `toolType`, target fields, filters, and `resultsLimit`. Send them to [Create Extraction](/api-reference/extractions/create). Store the returned job ID from that `202 Accepted` receipt. > [card] Blocked run > > When `allowed` is `false`, lower `resultsLimit`, narrow the target or filters, or add credits. Then call [Create Extraction](/api-reference/extractions/create). > [card] Source signal > > Store `source` so operators know whether the estimate came from `replyCount`, `followers`, or `resultsLimit`. `source` can also be `paginationCap` or another supported count. > [card] Audit fields > > Store `estimatedResults`, `creditsRequired`, `creditsAvailable`, `allowed`, and `source` with the planned extraction request. > [!NOTE] > > **Call this endpoint before every extraction.** It catches credit shortfalls before the job starts. If `allowed` is `false`, Create Extraction returns a `402` error. Check your current usage on the [dashboard](https://dashboard.xquik.com/en/account?tab=subscription). > [!NOTE] > > **Next steps.** [Create Extraction](/api-reference/extractions/create) to start an extraction, or [Extraction Workflow Guide](/guides/extraction-workflow) for the full flow. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_budget_reached", "message": "This API key reached its monthly credit budget. Raise or remove it at dashboard.xquik.com/api-keys, or wait for the next UTC month." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Scraping job history & status, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/extractions/twitter-scraping-job-history List tweet, follower, following, reply, profile, timeline, media, community, and list extraction jobs by tool, status, and cursor. Listing jobs is free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/extractions` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET "https://xquik.com/api/v1/extractions?limit=20&toolType=reply_extractor" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ limit: "20", toolType: "reply_extractor", }); const response = await fetch(`https://xquik.com/api/v1/extractions?${params}`, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/extractions", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={ "limit": 20, "toolType": "reply_extractor", }, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/extractions?limit=20&toolType=reply_extractor", nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `number` | No | Number of extractions to return per page. Defaults to `50`. Accepts up to `10000`. | | `toolType` | `string` | No | Filter by tool type. Use one of these values. - `article_extractor` - `community_extractor` - `community_moderator_explorer` - `community_post_extractor` - `community_search` - `favoriters` - `follower_explorer` - `following_explorer` - `list_follower_explorer` - `list_member_extractor` - `list_post_extractor` - `mention_extractor` - `people_search` - `post_extractor` - `quote_extractor` - `reply_extractor` - `repost_extractor` - `space_explorer` - `thread_extractor` - `tweet_search_extractor` - `user_affiliates` - `user_likes` - `user_media` - `verified_follower_explorer` | | `status` | `string` | No | Filter by job status. Use `completed`, `failed`, or `running`. | | `cursor` | `string` | No | Cursor for pagination. Use the `nextCursor` value from the previous response to fetch the next page. | | Scraping job inventory column | Response source | Reconciliation rule | | - | - | - | | Job ID | `extractions[].id` | Open the matching extraction result pages. | | Scraper tool | `extractions[].toolType` | Separate tweet, follower, reply, and profile jobs. | | Job state | `extractions[].status` | Handle completed, failed, and running jobs separately. | | Extracted rows | `extractions[].totalResults` | Compare this count with saved result pages. | | Started at | `extractions[].createdAt` | Keep the collection start time. | | Completed at | `extractions[].completedAt` | Measure completed-job duration. | | More jobs | `hasMore` | Continue only while this value is `true`. | | Next page | `nextCursor` | Pass this value as the next `cursor` parameter. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `extractions` | `object[]` | Array of extraction job summaries. | | `extractions[].id` | `string` | Unique extraction job ID. | | `extractions[].toolType` | `string` | Tool type used for this extraction. | | `extractions[].status` | `string` | The job status is `completed`, `failed`, or `running`. | | `extractions[].totalResults` | `number` | Total number of extracted results. | | `extractions[].createdAt` | `string` | ISO 8601 timestamp of when the job was created. | | `extractions[].completedAt` | `string` | ISO 8601 timestamp of when the job finished. Only present for completed jobs. | | `hasMore` | `boolean` | Whether more results exist beyond this page. | | `nextCursor` | `string` | Cursor for the next `cursor` parameter. Only present when `hasMore` is `true`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "extractions": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "toolType": "reply_extractor", "status": "completed", "totalResults": 150, "createdAt": "2026-02-24T10:00:00.000Z", "completedAt": "2026-02-24T10:00:12.000Z" }, { "id": "b2c3d4e5-f6a1-7890-abcd-ef2345678901", "toolType": "follower_explorer", "status": "completed", "totalResults": 4832, "createdAt": "2026-02-23T18:30:00.000Z", "completedAt": "2026-02-23T18:31:45.000Z" }, { "id": "c3d4e5f6-a1b2-7890-abcd-ef3456789012", "toolType": "repost_extractor", "status": "failed", "totalResults": 0, "createdAt": "2026-02-23T12:00:00.000Z" } ], "hasMore": true, "nextCursor": "eyJjIjoiMjAyNi0wMi0yM1QxMjowMDowMC4wMDBaIiwiaSI6Ijc3NzY4In0" } ``` ### 401 Unauthenticated Missing or invalid API key. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Wait for the `Retry-After` value before making another request. ## Pagination The API orders results by creation date, newest first. Follow these steps to read every extraction. 1. Make the initial request without the `cursor` parameter. 2. Check `hasMore`. Pass `nextCursor` as the next `cursor` value. 3. Repeat until `hasMore` is `false`. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { appendFile } from "node:fs/promises"; let cursor = undefined; let pageIndex = 0; do { const params = new URLSearchParams({ limit: "100", status: "completed", }); if (cursor) params.set("cursor", cursor); const pageCursor = cursor ?? null; const response = await fetch(`https://xquik.com/api/v1/extractions?${params}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const data = await response.json(); const rows = data.extractions.map((job) => ({ extraction_id: job.id, tool_type: job.toolType, status: job.status, total_results: job.totalResults, created_at: job.createdAt, completed_at: job.completedAt ?? null, detail_path: `/api/v1/extractions/${job.id}`, export_path: job.status === "completed" ? `/api/v1/extractions/${job.id}/export?format=csv` : null, page_index: pageIndex, page_cursor: pageCursor, next_cursor: data.nextCursor ?? null, has_more: data.hasMore, handoff_format: "jsonl", })); if (rows.length > 0) { await appendFile( "xquik-extraction-jobs.jsonl", `${rows.map((row) => JSON.stringify(row)).join("\n")}\n`, ); } cursor = data.hasMore ? data.nextCursor : undefined; pageIndex += 1; } while (cursor); ``` ## Job inventory handoff Use `GET /extractions` as the job inventory step before fetching details or exporting files. Treat `nextCursor` as opaque and pass it back as `cursor`. Do not write raw job lists to shared logs. > [card] Page checkpoint > > Store `page_index`, `page_cursor`, `next_cursor`, `has_more`, `limit`, > `tool_type_filter`, and `status_filter` after each successful page. > [card] Completed jobs > > Store these completed job fields for the next fetch or file export. They are > `id`, `toolType`, `totalResults`, `completedAt`, `detail_path`, and > `export_path`. > [card] Running or failed jobs > > Keep `status`, `createdAt`, and `id`. That lets dashboards retry failed jobs > or poll running jobs without rereading older pages. > [card] Next API step > > Use [Get Extraction](/api-reference/extractions/twitter-extraction-results) for paginated JSON > rows, or [Export Extraction](/api-reference/extractions/export) for files. Store page checkpoints separately from job rows. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "page_index": 2, "page_cursor": "eyJjIjoiMjAyNi0wMi0yM1QxODozMTo0NS4wMDBaIiwiaSI6Ijc3NzY4In0", "next_cursor": "eyJjIjoiMjAyNi0wMi0yM1QxMjowMDowMC4wMDBaIiwiaSI6Ijc3NzY0In0", "has_more": true, "limit": 100, "tool_type_filter": "reply_extractor", "status_filter": "completed", "handoff_format": "jsonl" } ``` > [!NOTE] > > **Next steps.** > > * [Get Extraction](/api-reference/extractions/twitter-extraction-results) to retrieve full results for a specific job. > * [Create Extraction](/api-reference/extractions/create) to run a new extraction. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # API features & result fields, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/features Every Xquik feature in 1 list. Complete searches, accurate rows, fresh data, speed, fair billing, reliability, agent tools, rich data & quality checks. > For the complete documentation index, see [llms.txt](/llms.txt). Each line below is something you get from Xquik. Each line applies to 1 or more parts of Xquik. Those are the REST API, MCP, Apify Actors & monitors. You pay only for delivered, unique, matching rows. ## Complete results * Searches return posts that X's own search tab leaves out. * Large date ranges come back whole & fast. * Searches return every match, whatever operators you combine. * Account searches include all of the account's posts & reposts. * Account history comes back complete, old posts included. * Threads include every post & the author's own replies. * Profile exports keep every post of the author's own threads. * Profile reads include the pinned post, flagged as pinned. * List timelines include posts that X's List page leaves out. * Follower & following exports return full lists. * Verified follower exports return full lists too. * Reply exports include replies that X's post page leaves out. * Reply exports work from any post ID or link. * Complete mode adds replies the author hid & explains empty threads. * Similar-account lists come back fuller. * Top tweet lists come back reliably. * Filtered pages come back full until the results run out. * Every page size returns the same complete results. * Timelines page all the way to the last post. * Batch post lookups miss fewer posts. * Account location labels fill in on more rows, at no extra charge. * Each answer holds the fullest data X has for it. ## Accurate rows * Search results hold every post that matches your query & nothing else. * Word & phrase matching works in every language & script. * Language filters work for every language X tags. * Language, date & engagement filters hold on every row you get. * A post is called missing only when it's gone. * "X can't run this search" appears only when it's true. * Protected accounts & private Lists get a clear answer, not an empty page. * Reposts carry the full original text. * Every ID in a row stays exact. * Mentions, links, hashtags & highlights line up with the text. * Counts X didn't send are listed in `unknownCounts`, never shown as 0. * Verified badges match what x.com shows. * Rows hold public data only. * Quote searches return every real quote & nothing else. * Reply exports hold only direct replies, in a proven order. * Reply pages count the replies a read hasn't reached yet. * Newest-first results come back in date order. * Messy queries still run instead of failing. * Place searches work with names in 6 languages. * Searches X can't run fail at once, with the fix. * A date means one thing in any common form. * Searches accept `since_id` & `max_id` bounds. * Ads & promoted entries never reach your rows. * Monitors report only real deletions, follows & unfollows. * Profile change alerts don't flap. ## Fresh data * Account monitors see changes within about a second. * Keyword monitors catch every matching post. * Monitors don't miss posts between checks. * A monitor that falls behind catches up on what it missed. * Live videos & Spaces raise an event when they start. * Post monitors report changes to likes, views & other counts. * Trends can be read for any past moment since the archive began. * Reads keep working when X ships changes. ## Speed * A slow X answer doesn't hold up your request. * Repeated lookups answer at once. * Searches stay fast on busy topics. * Each next page arrives fast. * Actors read many handles, posts & queries at once. * Reads finish the moment their rows arrive. * Stalled Actor calls recover on their own. * Webhooks arrive without connection setup delay. ## Fair billing * You pay only for the rows you get, after filters & duplicate removal. * Every answer states its charge in `X-Xquik-Credits-Charged`. * A retried page is free. * A low balance trims results instead of failing. * Bad input costs nothing, since it's refused before any read. * AI analysis bills only the posts it analyzed. * Monitors have 1 flat hourly price, events & webhooks included. * Monitor Actors bill only the hours a monitor watched. * Writes cost nothing until they land. * Saving the same media again is free. * Removed media isn't billed, & a single-post download with all its media removed returns `media_unavailable`. * Empty trend history steps are free. * You can price a bulk job before you run it. * A post ID listed twice in a batch is billed once. * Actors charge only for delivered, unique, matching rows. * A profile shared by several targets is billed once. * A restarted run never charges twice. * A spend cap becomes a row cap, & diagnostics still get written. * Tweet, reply & follower run reports estimate what the run cost. * Small runs end with a tip that cuts cost. * AI Actors don't bill failed or skipped analyses. * Each refund points at the exact charge it reverses. ## Reliability * A one-off X failure doesn't fail your request. * Paging stays consistent from one page to the next. * Paging never loops forever. * A deadline returns the rows already found, with diagnostics. * Overload is announced with 503, `Retry-After` & a reason. * Xquik answers 502 with `X-Xquik-Cause` & `Retry-After` when X fails the read. * Actors ride out short Xquik outages. * Actor runs survive restarts without repeats. * One bad row doesn't sink a batch. * Stopped runs keep their rows & their report. * A run that can't start still explains itself. * `stopCauses`, `failedSubtargets` & `unavailableTargets` spell out partial failures. * Bulk media downloads list each post they left out & why. * Webhooks are signed & replay-safe. * Webhook deliveries retry until they land, for up to 30 days. * New events don't queue behind old retries. * Webhooks never go to private or local hosts. * Missed events can be replayed from `Last-Event-ID`. * Chat alerts arrive in order without hitting rate limits. * A write reports success only once it's live on X. * Writes don't post twice. * Posting paces itself to protect your linked X accounts. * Replies land on the right post. * Retrying a write is safe with an idempotency key. * A long write answers 202 with a status link, then lands on X. * Problems on X's side are fixed before they reach your reads. * Asking again for a page in progress answers 409 with `Retry-After`. * Support can see exactly what a request or run returned. ## Built for agents * Agents reach the whole API through a few MCP tools. * Paid results are saved under a `result_id`, so failed scripts never pay twice. * Large answers fit the agent's context, capped at 24,000 characters. * A cut answer links to a CSV file of every row. * Each MCP tool states its credit price. * Clients can run reads without prompts & confirm writes. * 1 stable shape with snake_case, Unix seconds, `has_more` & `next_cursor`. * Sign-in works in modern MCP clients with OAuth 2.1 & PKCE. * `whoami` returns an account ID that never changes. * Agents can pay per call without an account. * Tool input errors say what to change. * MCP shows why a post or search failed. * Pick only the fields you need with `fields` & `omit`. * Actors accept input written for other Actors. * Output is ready for spreadsheets, with flat columns & engagement totals. * Scraper datasets describe every field. * Every run says why it ended & whether to retry. * Agents can find Xquik on their own through llms.txt & an agent card. * Linked X accounts can post, like, repost, follow, bookmark, block, mute & send DMs. * Give each agent an API key with only the scopes it needs. * Every activity keeps a full record you can fetch & export. * Rate limits & deprecations come as machine-readable headers. * Common names for cursor, limit, sort & type just work. * Pause a runaway agent's API key in 1 click, then resume it anytime. * Lock an API key to the IPs or CIDR ranges your servers call from. * Cap what an API key spends each month, with an email at 80%. * With an API key or OAuth, account timeline cursors fit in a URL. ## Rich data * Posts carry note text, edits, Community Notes, reach labels, reply controls & live events. * Rows carry source apps, media counts & professional account data. * Cashtag searches add X's ticker card in `searchContext`. * Media comes with variants, alt text, sizes & availability reasons. * Video subtitles come with timed cues. * You see when each account reposted a post. * You see if each account replied to, reposted or quoted a post. You also see if it follows the author or is in a Community. * Posts & bios can be translated into your language. * Short links resolve, & list rows can carry full profiles. * Profiles yield emails, phones & links tagged by network. * Account location comes with country code, accuracy note & username history. * Account checks say if each account is active, protected, suspended or missing. * Trends by place name, country or region ID, promoted trends marked. * Football games, plays, box scores, rosters, player props & game posts. * Community Notes contributors & notes, Space replays & job listings as Markdown. * AI answers carry probabilities, confidence & a question version. * AI analysis reads each post's images with its text, at no extra cost. * Changes across analysis runs don't flip on noise. * Sentiment analysis names each post's main emotion, such as joy or anger. * `viralAlgorithmScore` turns a post's public counts into 1 comparable number. * Each snapshot row holds every count's change since an earlier run. * Giveaway draws pick winners with cryptographic randomness. * Shadowban checks show if X search lists an account, with each post they read. ## Quality checks * Every field X shows is served, left out on purpose or proven absent. * Every read is checked live each hour. * Actor READMEs, schemas & real output name the same fields. * Xquik checks each API spec change against the docs before it ships. ## Next steps > [card] [Search tweets](/api-reference/x/search-tweets) > > Run your first search & read the rows. > [card] [Monitors](/api-reference/monitors/create) > > Watch X accounts & get signed webhook events. > [card] [MCP server](/mcp/overview) > > Give your agent every read & write. > [card] [Billing](/guides/billing) > > See the price per result & what costs nothing. # Create a guest wallet, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/guest-wallets/create Create a USD 10-250 hosted checkout and accountless API key for tweet, profile, follower, reply, timeline, community, and list reads. The call charges nothing. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/guest-wallets` Create a prepaid read wallet without an account, email address, or dashboard. This endpoint creates a one-use hosted checkout after the user confirms a USD amount. It does not charge the user. > [!WARNING] > > Ask the user to confirm the amount before calling this endpoint. Give the returned `checkout_url` to the user. Never open, submit, or complete the payment for them. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} idempotency_key=$(uuidgen | tr '[:upper:]' '[:lower:]') response=$(curl -sS -X POST https://xquik.com/api/v1/guest-wallets \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $idempotency_key" \ -d '{"amount_minor": 1000, "currency": "usd"}') api_key=$(jq -r '.api_key' <<<"$response") checkout_url=$(jq -r '.checkout_url' <<<"$response") wallet_id=$(jq -r '.wallet_id' <<<"$response") # Store $api_key and $idempotency_key in your secret manager. Do not print them. printf 'Created guest wallet %s. Open %s\n' "$wallet_id" "$checkout_url" ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { randomUUID } from "node:crypto"; const idempotencyKey = randomUUID(); const response = await fetch("https://xquik.com/api/v1/guest-wallets", { method: "POST", headers: { "Content-Type": "application/json", "Idempotency-Key": idempotencyKey, }, body: JSON.stringify({ amount_minor: 1000, currency: "usd" }), }); const wallet = await response.json(); const apiKey = wallet.api_key; // Store apiKey and idempotencyKey in your secret manager. Do not print them. process.stdout.write(String(wallet.checkout_url) + "\n"); ``` Store both `api_key` and the original `Idempotency-Key` as secrets. An exact replay can return the same response, including the key. No email recovery is available. Give only `checkout_url` to the user. After payment, poll `status_url` every `poll_after_seconds` with the guest key. Stop when `latest_purchase.status` is no longer `pending`. Do not call paid reads until `usable` is `true`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `Content-Type` | `string` | Yes | Must be `application/json`. | | `Idempotency-Key` | `string` | Yes | A cryptographically random UUID v4. Reuse it only for an exact retry of the same amount. Store it as a secret because it can recover the initial key. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `amount_minor` | `integer` | Yes | Confirmed USD amount in cents. Minimum `1000` and maximum `25000`. | | `currency` | `string` | Yes | Must be `usd`. | ## Response | Field | Type | Description | | - | - | - | | `account_required` | `boolean` | Always `false`. | | `amount` | `object` | Confirmed amount in minor units and `usd` currency. | | `checkout_url` | `string` | One-use hosted checkout URL for the user to open. | | `api_key` | `string` | Guest key returned on initial creation and exact idempotent replay. Store it as a secret. | | `authorization` | `object` | Required Bearer header and scheme. | | `credential_notice` | `string` | One-time credential storage guidance. | | `status_url` | `string` | API URL to poll with the guest key. | | `poll_after_seconds` | `integer` | Minimum polling delay. Always `2` for a pending purchase. | | `requires_user_interaction` | `boolean` | Always `true`. | | `instructions` | `string` | Required user interaction and polling guidance. | | `purchase_id` | `string` | Guest purchase ID. | | `status` | `string` | Initial purchase status. Normally `pending`. | | `expires_at` | `string` | Pending checkout expiry. New checkouts expire after 60 minutes. | | `credits` | `string` | Credits to grant after verified payment. | | `wallet_id` | `string` | Guest wallet ID. | > [tab] 201 Created > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "account_required": false, > "amount": { "amount_minor": 1000, "currency": "usd" }, > "api_key": "xq_example_returned_once", > "authorization": { "header": "Authorization", "scheme": "Bearer" }, > "checkout_url": "https://checkout.example/guest/example", > "credential_notice": "Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.", > "credits": "66666", > "expires_at": "2026-07-13T13:00:00.000Z", > "instructions": "Give checkout_url to the user. They must complete payment on the hosted checkout page. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", > "poll_after_seconds": 2, > "purchase_id": "gp_example", > "requires_user_interaction": true, > "status": "pending", > "status_url": "https://xquik.com/api/v1/guest-wallets/status", > "wallet_id": "gw_example" > } > ``` > [tab] 400 Invalid input > > Check the UUID v4 header, amount, currency, JSON, and request fields. > [tab] 409 Idempotency conflict > > You used the same `Idempotency-Key` with a different amount or request. Generate a new UUID v4 after the user confirms the new request. > [tab] 410 Checkout unavailable > > The pending checkout expired or no longer works. Ask the user to confirm before creating a new wallet. > [tab] 413 Request too large > > Reduce the request body, then retry with the same `Idempotency-Key`. > [tab] 415 Unsupported media type > > Send `Content-Type: application/json`. > [tab] 423 Wallet unavailable > > The wallet is unavailable. Do not retry payment automatically. > [tab] 429 Rate limited > > Wait for `Retry-After` before retrying the same request. > [tab] 503 Checkout unavailable > > Checkout is temporarily unavailable. Retry with the same `Idempotency-Key`. The response sends `Cache-Control: no-store, private`. An exact replay also sends `Idempotent-Replayed: true`. > [!NOTE] > > **Related.** [Guest wallet guide](/guides/guest-wallets) · [Get guest wallet status](/api-reference/guest-wallets/status) · [Top up guest wallet](/api-reference/guest-wallets/topup) ## Response examples ### 201 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "account_required": false, "amount": { "amount_minor": 1000, "currency": "usd" }, "api_key": "xq_example_returned_once", "authorization": { "header": "Authorization", "scheme": "Bearer" }, "checkout_url": "https://checkout.example/guest/example", "credential_notice": "Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.", "credits": "66666", "expires_at": "2026-07-13T13:00:00.000Z", "instructions": "Give checkout_url to the user. They must complete payment on the hosted checkout page. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", "poll_after_seconds": 2 } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **409** `{ "error": "idempotency_conflict", "message": "Reuse this Idempotency-Key only with the original request." }` * **410** `{ "error": "checkout_unavailable", "message": "Checkout unavailable. Retry with a new Idempotency-Key." }` * **413** `{ "error": "body_too_large", "message": "Request body is too large." }` * **415** `{ "error": "unsupported_media_type", "message": "Send a Content-Type header of application/json." }` * **423** `{ "error": "guest_wallet_unavailable", "message": "Guest wallet unavailable. Create a new wallet or contact support." }` * **429** `{ "error": "rate_limited", "message": "Try again later." }` * **503** `{ "error": "guest_wallets_unavailable", "message": "Guest wallet checkout is temporarily unavailable." }` # Guest wallet payment status, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/guest-wallets/status Check a guest API key's activation, credit balance, hosted payment status, and access to tweet, profile, follower, and reply reads. Status checks are free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/guest-wallets/status` Poll this endpoint after the user completes hosted checkout. While the wallet is pending, the guest key can authenticate this status route. It cannot call paid read routes until Xquik verifies payment. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/guest-wallets/status \ -H "Authorization: Bearer xq_your_guest_key_here" | jq ``` Wait at least `poll_after_seconds` before polling again. Continue while it is non-null, then stop. Use `usable` to decide whether paid reads can run. An active wallet can remain usable while a top-up is pending. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `Authorization` | `string` | Yes | Send the guest key as `Bearer xq_your_guest_key_here`. | ## Response | Field | Type | Description | | - | - | - | | `balance` | `string` | Available guest wallet credits. | | `scope` | `string` | Always `paid_reads`. | | `status` | `string` | Combined wallet and pending-checkout state. It is `active`, `pending`, `expired`, `failed`, `frozen`, or `closed`. A pending top-up can coexist with `usable: true`. | | `usable` | `boolean` | Whether the key can call eligible paid read routes. | | `poll_after_seconds` | `integer \| null` | `2` while payment is pending. Otherwise `null`. | | `latest_purchase` | `object \| null` | Latest amount, credits, expiry, purchase ID, checkout URL while pending, and purchase status. | | `top_up` | `object \| null` | Direct REST top-up action when the wallet is usable and has no pending checkout. | | `wallet_id` | `string` | Guest wallet ID. | ## Interpret the result Use these fields together. | Condition | Meaning | Action | | - | - | - | | `usable: true`, `status: active` | Paid reads can run. No checkout is pending. | Call eligible reads. Use `top_up` only after confirmation. | | `usable: true`, `status: pending` | Existing credits remain usable while a top-up is pending. | Continue affordable reads. Poll after the stated delay. | | `usable: false`, `status: pending` | The initial checkout still awaits verified payment. | Do not call paid reads. Poll after the stated delay. | | `usable: false`, `status: expired` or `failed` | The initial checkout ended without payment. | Stop polling. Get new confirmation before creating another wallet. | | `usable: false`, `status: frozen` or `closed` | Wallet access is unavailable. | Stop paid reads. Do not retry payment automatically. | `latest_purchase.status` describes only the latest purchase. Use the top-level `usable` field for paid-read access. > [tab] 200 OK > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "balance": "66666", > "latest_purchase": { > "amount": { "amount_minor": 1000, "currency": "usd" }, > "checkout_url": null, > "credits": "66666", > "expires_at": "2026-07-13T13:00:00.000Z", > "purchase_id": "gp_example", > "status": "paid" > }, > "poll_after_seconds": null, > "scope": "paid_reads", > "status": "active", > "top_up": { > "method": "POST", > "path": "/api/v1/guest-wallets/topups" > }, > "usable": true, > "wallet_id": "gw_example" > } > ``` > [tab] 401 Unauthenticated > > The guest key is missing or invalid. No email or account recovery is available. > [tab] 429 Rate limited > > Wait for `Retry-After` before polling again. Use `usable` to decide whether the key can call paid reads. The response sends `Cache-Control: no-store, private` and never returns the guest key. > [!NOTE] > > **Related.** [Guest wallet guide](/guides/guest-wallets) · [Create guest wallet](/api-reference/guest-wallets/create) · [Top up guest wallet](/api-reference/guest-wallets/topup) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "balance": "66666", "latest_purchase": { "amount": { "amount_minor": 1000, "currency": "usd" }, "checkout_url": null, "credits": "66666", "expires_at": "2026-07-13T13:00:00.000Z", "purchase_id": "gp_example" }, "poll_after_seconds": null, "scope": "paid_reads", "status": "active", "top_up": { "method": "POST", "path": "/api/v1/guest-wallets/topups" }, "usable": true, "wallet_id": "gw_example" } ``` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **429** `{ "error": "rate_limited", "message": "Try again later." }` # Top up a guest wallet, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/guest-wallets/topup Create a USD 10-250 hosted checkout to add tweet, profile, follower, reply, timeline, community, and list read credits to a guest key. It charges nothing. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/guest-wallets/topups` Add credits to an existing guest wallet. The wallet keeps the same `paid_reads` key. This endpoint creates a one-use hosted checkout only after the user confirms the amount. It does not charge the user. > [!WARNING] > > Never call this endpoint automatically after a `402`. Show the available option and amount, then wait for the user to confirm. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} idempotency_key=$(uuidgen | tr '[:upper:]' '[:lower:]') curl -X POST https://xquik.com/api/v1/guest-wallets/topups \ -H "Authorization: Bearer xq_your_guest_key_here" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $idempotency_key" \ -d '{"amount_minor": 2500, "currency": "usd"}' | jq ``` Keep the current guest key and store the new `Idempotency-Key` as a secret. Give only `checkout_url` to the user. After payment, poll `status_url` every `poll_after_seconds` with the same key. Stop when `latest_purchase.status` is no longer `pending`. Use `usable` to decide whether paid reads can run. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `Authorization` | `string` | Yes | Send the guest key as `Bearer xq_your_guest_key_here`. | | `Content-Type` | `string` | Yes | Must be `application/json`. | | `Idempotency-Key` | `string` | Yes | A new cryptographically random UUID v4. Reuse it only for an exact retry of this top-up request. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `amount_minor` | `integer` | Yes | Confirmed USD amount in cents. Minimum `1000` and maximum `25000`. | | `currency` | `string` | Yes | Must be `usd`. | ## Response | Field | Type | Description | | - | - | - | | `account_required` | `boolean` | Always `false`. | | `amount` | `object` | Confirmed amount in minor units and `usd` currency. | | `checkout_url` | `string` | One-use hosted checkout URL for the user to open. | | `credits` | `string` | Credits to grant after verified payment. | | `expires_at` | `string` | Pending checkout expiry. | | `instructions` | `string` | Required user interaction and polling guidance. | | `purchase_id` | `string` | Guest purchase ID. | | `status_url` | `string` | Guest wallet status URL. | | `poll_after_seconds` | `integer` | Minimum polling delay. Always `2` while pending. | | `requires_user_interaction` | `boolean` | Always `true`. | | `status` | `string` | Initial top-up status. Normally `pending`. | | `wallet_id` | `string` | Existing guest wallet ID. | > [tab] 201 Created > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "account_required": false, > "amount": { "amount_minor": 2500, "currency": "usd" }, > "checkout_url": "https://checkout.example/guest/example", > "credits": "166666", > "expires_at": "2026-07-13T13:00:00.000Z", > "instructions": "Give checkout_url to the user. They must complete payment on the hosted checkout page. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", > "poll_after_seconds": 2, > "purchase_id": "gp_example", > "requires_user_interaction": true, > "status": "pending", > "status_url": "https://xquik.com/api/v1/guest-wallets/status", > "wallet_id": "gw_example" > } > ``` > > This response never returns a new API key. > [tab] 400 Invalid input > > Check the UUID v4 header, amount, currency, JSON, and request fields. > [tab] 401 Unauthenticated > > The guest key is missing or invalid. > [tab] 409 Idempotency conflict > > You used the same `Idempotency-Key` for a different request. > [tab] 410 Checkout unavailable > > The checkout expired or no longer works. > [tab] 413 Request too large > > Reduce the request body, then retry with the same `Idempotency-Key`. > [tab] 415 Unsupported media type > > Send `Content-Type: application/json`. > [tab] 423 Wallet unavailable > > The wallet is unavailable. Check guest wallet status before taking another action. > [tab] 429 Rate limited > > Wait for `Retry-After` before retrying the same request. > [tab] 503 Checkout unavailable > > Checkout is temporarily unavailable. Retry with the same `Idempotency-Key`. The response sends `Cache-Control: no-store, private`. An exact replay also sends `Idempotent-Replayed: true`. > [!NOTE] > > **Related.** [Guest wallet guide](/guides/guest-wallets) · [Create guest wallet](/api-reference/guest-wallets/create) · [Get guest wallet status](/api-reference/guest-wallets/status) ## Response examples ### 201 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "account_required": false, "amount": { "amount_minor": 1000, "currency": "usd" }, "checkout_url": "https://checkout.example/guest/example", "credits": "66666", "expires_at": "2026-07-13T13:00:00.000Z", "instructions": "Give checkout_url to the user. They must complete payment on the hosted checkout page. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.", "poll_after_seconds": 2, "purchase_id": "gp_example", "requires_user_interaction": true, "status": "pending" } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **409** `{ "error": "idempotency_conflict", "message": "Reuse this Idempotency-Key only with the original request." }` * **410** `{ "error": "checkout_unavailable", "message": "Checkout unavailable. Retry with a new Idempotency-Key." }` * **413** `{ "error": "body_too_large", "message": "Request body is too large." }` * **415** `{ "error": "unsupported_media_type", "message": "Send a Content-Type header of application/json." }` * **423** `{ "error": "guest_wallet_unavailable", "message": "Guest wallet unavailable. Create a new wallet or contact support." }` * **429** `{ "error": "rate_limited", "message": "Try again later." }` * **503** `{ "error": "guest_wallets_unavailable", "message": "Guest wallet checkout is temporarily unavailable." }` # Create an account monitor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/create Monitor one X account every second. Track tweets, replies, mentions, profile changes, follows, and new or lost followers. Deliver signed webhook alerts. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/monitors` Create a Twitter account monitor for one known profile. Select tweet, profile, follow, or follower events. Store the monitor ID. Then connect signed webhooks. **Requires 30 available credits.** They pay for the first active monitor hour. The username lookup is free. > [!NOTE] > > Monitors are unlimited. Active monitors check every 1 second. Active monitor billing includes webhook and event deliveries. ## Create a Twitter monitor for one account Use this Twitter monitor API for continuous checks on one known profile. Send the username without `@`. Choose only the required event types. This API endpoint gives you one stable monitor ID. Use it to join events and webhook deliveries. Use `POST /monitors` for X (Twitter) API monitoring from one username. This tweet monitor covers selected posts, replies, quotes, reposts, and profile changes. It does not search posts from every public account. ## Choose the right Twitter monitoring option Choose one option for the required alert scope. | Monitoring need | Xquik option | Result | | - | - | - | | Continuous changes from one known account | `POST /monitors` | Selected post, profile, and follow events from that username. | | Specific keywords across many accounts | [Create Keyword Monitor](/api-reference/monitors/create-keyword) | Matching tweet events for one stored query. | | Historical or on-demand tweet results | [Search Tweets](/api-reference/x/search-tweets) | One paginated result set without continuous alerts. | Do not replace one option with another after collection starts. Store the chosen monitor type with every alert. ## How do I monitor a Twitter account with an API? Create one active monitor for each username requiring continuous checks. Send the username without `@` and choose exact event types. Xquik resolves the username to one stable X (Twitter) user ID. Store both the monitor ID and resolved user ID. Your application needs no open stream connection. The account monitor checks selected changes every second. Real-time Twitter alerts start after connecting a signed webhook. Stored events remain available for later inspection through the Events API. Use the monitor ID for updates, pauses, deletion, and event joins. Use the X (Twitter) user ID for stable account joins. Never use a display name as the account key. ## Which Twitter account activity can trigger alerts? Select `tweet.new` for original posts from the monitored account. Add `tweet.reply`, `tweet.quote`, or `tweet.retweet` for conversation activity. Use format events for media, links, polls, mentions, hashtags, and long posts. Each selected event type produces its own alerts. Profile events cover names, usernames, bios, locations, URLs, avatars, and banners. They also cover verification, protection, pinned posts, and account availability. Use `profile.unavailable.changed` when account availability affects a workflow. Keep previous and current profile values with the stored event. Account activity events cover deleted posts and lives the account posts. `tweet.deleted` fires when the account deletes a post the monitor saw. It usually arrives within a minute and holds the post as last seen. `broadcast.started` fires when the account posts its running live video. `space.started` fires when the account posts a live Space it hosts. A scheduled Space fires once it starts. Following events show whom the account follows and unfollows. New follows usually arrive within a minute, and unfollows within about 15 minutes. `following.added` holds the followed account's profile. `following.removed` fires when the account unfollows someone. For an account that follows over 5,000, older unfollows take up to 2 hours. Follower events show who follows the account and who leaves its followers. New followers usually arrive within a minute, and losses within about 15 minutes. `follower.added` holds the new follower's profile. `follower.removed` fires when a follower leaves. It also fires when X suspends or removes the follower's account. Lost followers are named for accounts with up to 100,000 followers. Above 5,000 followers, older losses take up to 2 hours. Above 100,000, losses are named among the newest 5,000 followers only. `following.added` and `follower.added` also hold `followedAt`, the time of the follow. Some follow times are exact. Others are the earliest time the follow can have. `followedAtExact` is true for an exact time and false for an earliest time. `followedAt` is missing when no follow time is known. The event's `occurredAt` stays the time Xquik saw the change. An added event holds `followKind` when the monitor reported that account removed. That covers removals from the last 30 days. `refollow` means it followed again. `return` means the old follow never ended. `following.removed` and `follower.removed` also hold `reason`, why the account left. `unavailable` means X no longer serves that account, as after a suspension or deletion. `unfollowed` means X confirms the follow ended. A removal event never fires for a follow that still stands. `reason` is missing when the cause is unknown. With `unavailable`, `unavailableReason` is `not_found` or `suspended`. Count events show when the account's follower or following count moves. `profile.followers.changed` and `profile.following.changed` hold `previous`, `current` and `change`. Count events report only real changes. Each count sends at most 1 event a minute. They work on protected accounts too. Choose only events that trigger an action. Extra event types create alerts that workers must still review. Update the monitor when the required event set changes. Do not infer unselected changes from tweet or profile counts. ## How do real-time Twitter alerts reach my application? Create the account monitor before registering its delivery endpoint. Then create an HTTPS webhook with the required event filters. Save the one-time webhook secret in a secret manager. Send a signed test before accepting production deliveries. Verify `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce` first. Compute the signature from the raw request body. Reject invalid signatures before parsing or queuing the payload. See [Webhook Verification](/webhooks/verification) for complete receiver examples. Use `deliveryId` for delivery-level idempotency. Use `streamEventId` for one-time monitor event processing. Store the queue row before returning a successful receiver response. Inspect [Webhook Deliveries](/api-reference/webhooks/deliveries) when alerts stop arriving. ## How do I monitor competitor Twitter account activity? Create one account monitor for each competitor username. Track new tweets, replies, quotes, reposts, links, and media. Add profile events for bio, username, avatar, banner, and pinned-post changes. Store each event type, timestamp, monitor ID, and X (Twitter) user ID. This workflow records account changes. It does not calculate sentiment, brand reputation, or share of voice. Use a keyword monitor for mentions across unrelated accounts. Use tweet search for a retrospective competitor query. Keep competitor alerts separate from your own account alerts. Route each monitor ID to its intended queue or workspace. A competitor event then cannot trigger unrelated jobs. ## How do I monitor multiple Twitter accounts? Create one monitor request per username. Monitors are unlimited, but each active monitor has hourly billing. Keep at least 30 credits before creating or restoring each monitor. Store every returned monitor ID before creating the next request. An active duplicate returns `409 monitor_already_exists`. Use [List Monitors](/api-reference/monitors/list) to recover its stored ID. Use [Update Monitor](/api-reference/monitors/update) to change events or active state. Pause a monitor when you can. Do not create a replacement. Store each resolved X (Twitter) user ID beside the current username. The user ID stays the same when a username-change event arrives. Review `nextBillingAt` before keeping large monitor sets active. ## What does an account monitor not track? Account monitors exclude likes, bookmarks, and direct-message activity. They do not return a complete historical timeline or follower list. They do not search specific keywords across every account. Use [Followers](/api-reference/x/followers) for the follower list as it stands now. Use [Following](/api-reference/x/following) for the current following list. Use [User Tweets](/api-reference/x/user-tweets) for timeline retrieval. Use [Create Keyword Monitor](/api-reference/monitors/create-keyword) for matching queries. Do not use aggregate counts in place of participant or relationship records. Choose the endpoint that returns the required tweets, profiles, or relationships. ## How do I recover from monitor and webhook failures? List account monitors before repeating an uncertain create request. Reuse the stored monitor when the first request succeeded. Retry the same username and event types only when no monitor exists. A webhook failure does not require a new monitor. Fix the receiver, verify its signature code, and send another signed test. Then inspect delivery attempts and join `streamEventId` to the stored event. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail-with-body -X POST https://xquik.com/api/v1/monitors \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "username": "elonmusk", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq -c '{ monitor_id: .id, username: .username, x_user_id: .xUserId, event_types: .eventTypes, is_active: .isActive, created_at: .createdAt, next_billing_at: .nextBillingAt }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/monitors", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ username: "elonmusk", eventTypes: ["tweet.new", "tweet.reply"], }), }); const monitor = await response.json(); if (!response.ok) { throw new Error(monitor.message || "Twitter monitor creation failed."); } const monitorState = { monitor_id: monitor.id, username: monitor.username, x_user_id: monitor.xUserId, event_types: monitor.eventTypes, is_active: monitor.isActive, created_at: monitor.createdAt, next_billing_at: monitor.nextBillingAt, }; process.stdout.write(`${JSON.stringify(monitorState)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.post( "https://xquik.com/api/v1/monitors", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "username": "elonmusk", "eventTypes": ["tweet.new", "tweet.reply"], }, ) monitor = response.json() if not response.ok: raise RuntimeError(monitor.get("message", "Twitter monitor creation failed.")) monitor_state = { "monitor_id": monitor["id"], "username": monitor["username"], "x_user_id": monitor["xUserId"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "created_at": monitor["createdAt"], "next_billing_at": monitor["nextBillingAt"], } print(json.dumps(monitor_state)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "io" "log" "net/http" "os" ) type Monitor struct { ID string `json:"id"` Username string `json:"username"` XUserID string `json:"xUserId"` EventTypes []string `json:"eventTypes"` IsActive bool `json:"isActive"` CreatedAt string `json:"createdAt"` NextBillingAt string `json:"nextBillingAt"` } type MonitorState struct { CreatedAt string `json:"created_at"` EventTypes []string `json:"event_types"` IsActive bool `json:"is_active"` MonitorID string `json:"monitor_id"` NextBillingAt string `json:"next_billing_at"` Username string `json:"username"` XUserID string `json:"x_user_id"` } func main() { body, _ := json.Marshal(map[string]interface{}{ "username": "elonmusk", "eventTypes": []string{"tweet.new", "tweet.reply"}, }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/monitors", bytes.NewReader(body)) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 300 { problem, readErr := io.ReadAll(resp.Body) if readErr != nil { log.Fatal(readErr) } log.Fatalf("Twitter monitor creation failed with %d: %s", resp.StatusCode, string(problem)) } var monitor Monitor if err := json.NewDecoder(resp.Body).Decode(&monitor); err != nil { log.Fatal(err) } state := MonitorState{ CreatedAt: monitor.CreatedAt, EventTypes: monitor.EventTypes, IsActive: monitor.IsActive, MonitorID: monitor.ID, NextBillingAt: monitor.NextBillingAt, Username: monitor.Username, XUserID: monitor.XUserID, } if err := json.NewEncoder(os.Stdout).Encode(state); err != nil { log.Fatal(err) } } ``` ## Account monitor handoff Use `POST /monitors` for one X account. Send alerts to a queue, CRM, warehouse, Slack, or an agent. It checks the selected events every second. Create the monitor first. Then create a signed webhook with [`POST /webhooks`](/api-reference/webhooks/create). Call [`POST /webhooks/{id}/test`](/api-reference/webhooks/test) before enabling production alerts. | Created monitor column | Response source | Setup rule | | - | - | - | | Monitor ID | `id` | Store this ID before configuring alerts. | | X username | `username` | Store the normalized username without `@`. | | X user ID | `xUserId` | Use this stable ID for account joins. | | Event filter | `eventTypes` | Align webhook subscriptions with these event types. | | Polling state | `isActive` | Run alert checks only for active monitors. | | Creation time | `createdAt` | Store this timestamp with each monitor audit. | | Billing checkpoint | `nextBillingAt` | Review available credits before this time. | ### What should a webhook receiver save? Save the monitor ID, username, user ID, event type, event time, and delivery ID. Use the monitor ID to group alerts for one account. Use the delivery ID to stop the same job twice. Keep the event ID for later checks. These fields support replay, audits, retries, and alert routing. Active account monitors check every 1 second. Each active hour costs 30 credits. You need 30 available credits to create or restore a monitor. They pay for the first active hour. The username lookup is free. Pause the monitor through [Update Monitor](/api-reference/monitors/update) (`PATCH /monitors/{id}`). Set `{ "isActive": false }` when alerts should stop. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Send your Xquik API key. Create one in the [Xquik dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | Send an X (Twitter) username or the account's numeric user ID. A username has 1-15 letters, numerals, or underscores. Xquik removes a leading `@` before validation. A number is a user ID, up to 19 digits. | | `name` | `string` | No | Your own label for the monitor, 1 to 80 characters. Every event the monitor produces carries it as `monitorName`. With it, you can route events from the payload. Xquik normalizes whitespace. | | `eventTypes` | `string[]` | Yes | Array of event types to subscribe to. At least 1 required. See [Valid Event Types](#valid-event-types) below. | ## Valid event types Choose only the exact event types in the goal map below. ### Match event types to monitor goals | Monitor goal | Event types | Stored signal | | - | - | - | | New posts and conversations | `tweet.new`, `tweet.reply`, `tweet.quote`, `tweet.retweet` | Original posts, replies, quotes, or reposts from one profile. | | Tweet content formats | `tweet.media`, `tweet.link`, `tweet.poll`, `tweet.mention`, `tweet.hashtag`, `tweet.longform` | Posts containing the selected format or reference. | | Profile text changes | `profile.name.changed`, `profile.username.changed`, `profile.bio.changed`, `profile.location.changed`, `profile.url.changed` | Previous and current profile text values. | | Profile image changes | `profile.avatar.changed`, `profile.banner.changed` | Old and new avatar or banner references. | | Profile state changes | `profile.verified.changed`, `profile.protected.changed`, `profile.pinned_tweet.changed`, `profile.unavailable.changed` | Verification, visibility, pinned post, or availability changes. | | Deleted posts | `tweet.deleted` | The deleted post as the monitor last saw it. | | Live videos and Spaces | `broadcast.started`, `space.started` | The post that shares the running live video or Space. | | Follows and unfollows | `following.added`, `following.removed` | The followed or unfollowed account's profile, or its ID alone. | | New and lost followers | `follower.added`, `follower.removed` | The new or lost follower's profile, or its ID alone. | | Follower and following counts | `profile.followers.changed`, `profile.following.changed` | The previous and current count and their difference. | ## Response ### 201 Created | Field | Type | Description | | - | - | - | | `id` | `string` | Unique monitor ID. | | `username` | `string` | The username X shows for the account. You get it whether you sent a username or a user ID. | | `name` | `string` | Your label for the monitor. Present when you set one. | | `xUserId` | `string` | Resolved X (Twitter) user ID for the account. | | `eventTypes` | `string[]` | Event types this monitor is subscribed to. | | `isActive` | `boolean` | Whether the monitor is active. | | `createdAt` | `string` | Xquik records the creation time in ISO 8601 format. | | `nextBillingAt` | `string` | Next hourly credit charge time. New active monitors are due immediately. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "7", "username": "elonmusk", "xUserId": "44196397", "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T10:30:00.000Z" } ``` ### 400 Invalid input Missing `username` or missing/invalid `eventTypes` array. A `username` that's no X (Twitter) username or user ID gets its own message. `{ "error": "invalid_input", "message": "Set username to an X username or user ID, like @NASA." }` ### 401 Missing API key Missing or invalid API key or OAuth bearer token. ### 402 Payment required Keep at least 30 credits available before sending this request. The API may return `insufficient_credits` when the balance is too low. ### 404 User not found Xquik could not find that username or user ID. Check the spelling. ### 409 Duplicate An active monitor already tracks this X account. Use [Update Monitor](/api-reference/monitors/update) to change event types instead. [Create or Update Monitor](/api-reference/monitors/create-or-update) skips this answer. It updates the monitor you have and answers `200`. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > Xquik reactivates a previously deleted monitor with new event types. An active > duplicate returns `409`. > [!NOTE] > > **Next steps.** > > * [List Monitors](/api-reference/monitors/list) to view account monitors. > * [Get Monitor](/api-reference/monitors/twitter-account-monitor-status) to fetch one monitor. > * [Update Monitor](/api-reference/monitors/update) to pause or resume checks. > * [Create Webhook](/api-reference/webhooks/create) to receive events. > * [List Webhooks](/api-reference/webhooks/list) to check subscriptions. > * [List Events](/api-reference/events/list) to audit stored events. > * [Get Event](/api-reference/events/get) to inspect one event. > * [List Deliveries](/api-reference/webhooks/deliveries) to inspect webhook attempts. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **409** `{ "error": "monitor_already_exists", "message": "Monitor already exists." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Create a keyword monitor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/create-keyword Create a 1-second keyword monitor for an X (Twitter) search query. Store matching tweet events and send them to signed webhooks. Costs 30 credits/hour. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/monitors/keywords` Create a Twitter keyword monitor when one search query needs continuous tweet checks. Track brand mentions, handles, hashtags, products, campaigns, replies, reposts, links, or media. Store its ID, query, event types, billing time, and webhook destinations. **Requires 30 available credits.** Active keyword monitors bill 30 credits per hour. > [!NOTE] > > Keyword monitors are unlimited. Active monitors check every 1 second. Active monitor billing includes webhook and event deliveries. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/monitors/keywords \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "query": "xquik api", "eventTypes": ["tweet.new"] }' | jq -c '{ keyword_monitor_id: .id, query: .query, event_types: .eventTypes, is_active: .isActive, created_at: .createdAt, next_billing_at: .nextBillingAt, verify_endpoint: "/api/v1/monitors/keywords/\(.id)", update_endpoint: "/api/v1/monitors/keywords/\(.id)", delete_endpoint: "/api/v1/monitors/keywords/\(.id)", events_endpoint: "/api/v1/events?keywordMonitorId=\(.id)", event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries" }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/monitors/keywords", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ query: "xquik api", eventTypes: ["tweet.new"], }), }); const monitor = await response.json(); const monitorState = { keyword_monitor_id: monitor.id, query: monitor.query, event_types: monitor.eventTypes, is_active: monitor.isActive, created_at: monitor.createdAt, next_billing_at: monitor.nextBillingAt, verify_endpoint: `/api/v1/monitors/keywords/${monitor.id}`, update_endpoint: `/api/v1/monitors/keywords/${monitor.id}`, delete_endpoint: `/api/v1/monitors/keywords/${monitor.id}`, events_endpoint: `/api/v1/events?keywordMonitorId=${monitor.id}`, event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries", }; process.stdout.write(`${JSON.stringify(monitorState)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.post( "https://xquik.com/api/v1/monitors/keywords", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={"query": "xquik api", "eventTypes": ["tweet.new"]}, ) monitor = response.json() monitor_state = { "keyword_monitor_id": monitor["id"], "query": monitor["query"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "created_at": monitor["createdAt"], "next_billing_at": monitor["nextBillingAt"], "verify_endpoint": f"/api/v1/monitors/keywords/{monitor['id']}", "update_endpoint": f"/api/v1/monitors/keywords/{monitor['id']}", "delete_endpoint": f"/api/v1/monitors/keywords/{monitor['id']}", "events_endpoint": f"/api/v1/events?keywordMonitorId={monitor['id']}", "event_detail_endpoint_pattern": "/api/v1/events/{event_id}", "webhooks_endpoint": "/api/v1/webhooks", "deliveries_endpoint_pattern": "/api/v1/webhooks/{webhook_id}/deliveries", } print(json.dumps(monitor_state)) ``` The cURL, Node.js, and Python examples convert the created or reactivated keyword monitor. The result is one state row. Store `keyword_monitor_id`, `query`, `event_types`, `is_active`, `next_billing_at`, `verify_endpoint`, `update_endpoint`, `delete_endpoint`, and `events_endpoint` before routing alerts. Also store `event_detail_endpoint_pattern`, `webhooks_endpoint`, and `deliveries_endpoint_pattern` before routing alerts. ## Keyword monitor handoff `POST /monitors/keywords` sets up 1-second checks for one X (Twitter) search query. Use it when a queue, CRM, warehouse, Slack alert, or agent needs those checks. Create the monitor first. Then create a signed webhook with [`POST /webhooks`](/api-reference/webhooks/create). Test it with [`POST /webhooks/{id}/test`](/api-reference/webhooks/test). > [card] Monitor ID > > Store `id` as `keyword_monitor_id`. Use > [Get Keyword Monitor](/api-reference/monitors/get-keyword) to verify state. > Use [Update Keyword Monitor](/api-reference/monitors/update-keyword) to > pause or resume. Use > [Delete Keyword Monitor](/api-reference/monitors/delete-keyword) only when > the query should stop permanently. > [card] Normalized query > > Store `query`. Xquik includes it on keyword monitor events and signed > webhook payloads. > [card] Event filter > > Store `eventTypes`. Keep [List Webhooks](/api-reference/webhooks/list) > subscriptions aligned so expected tweets deliver. > [card] Active state > > Read `isActive` and `nextBillingAt` before enabling alerts or estimating > hourly monitor cost. > [card] Stored event join > > Use `monitorType: "keyword"`, `keywordMonitorId`, and `query` from > [List Events](/api-reference/events/list). They join stored events back to > the monitor. Use [Get Event](/api-reference/events/get) for one event's full > payload. > [card] Webhook delivery join > > Use `deliveryId` for receiver idempotency and > [List Deliveries](/api-reference/webhooks/deliveries) for delivery audit > rows. Join delivery `streamEventId` to event IDs. Do not use `x_event_id` as > the delivery join key. Active keyword monitors check every 1 second and cost 30 credits per active monitor-hour. Creation or reactivation requires 30 available credits. Pause with [Update Keyword Monitor](/api-reference/monitors/update-keyword) and `{ "isActive": false }` when the alert should stop. ## How do I monitor Twitter keywords with an API? Use one focused query for each alert purpose. First, write the exact words, phrases, handles, or hashtags requiring alerts. Then select the tweet event types your workers need. Create the monitor and store its returned ID. Next, connect a signed webhook for the selected event types. Send a signed test before accepting production alerts. Store each event before returning a successful receiver response. Use the event ID and delivery ID for separate idempotency checks. Your application needs no open stream connection. The Twitter keyword monitor checks its stored query every second. Matching tweets become stored events and signed webhook deliveries. Use [List Events](/api-reference/events/list) when a webhook consumer needs recovery. ## How do I choose Twitter keywords to monitor? Start with terms that lead to one action. Support teams can watch product names, error phrases, or direct handles. Campaign teams can watch campaign hashtags and reply language. Developers can watch API names, integration phrases, or release mentions. Prefer an exact phrase when word order changes meaning. Use `OR` when any listed term should match. Use a space when every listed term must appear. Use a leading minus sign to exclude known noise. Group mixed `OR` conditions with parentheses. For example, monitor direct mentions with `@NASA`. Monitor a phrase with `"x api"`. Combine related terms with `(@NASA OR "nasa artemis")`. Exclude reposts with `-is:retweet` when repost alerts add no value. Test the proposed query with [Search Tweets](/api-reference/x/search-tweets) first. Review returned tweets before enabling continuous keyword monitoring. Narrow irrelevant matches before paying for an active monitor. Never add undocumented operators to widen coverage. ## How do I track Twitter mentions and brand keywords? Include the exact handle when direct mentions require action. Add the brand name when plain-text mentions also matter. Add specific product names only when workers own those alerts. Keep unrelated brands in separate monitors and queues. For every matched tweet, store its ID, author ID, event type, query, and timestamp. Keep `keywordMonitorId` beside each stored event. This join shows which query matched the tweet. The selected query monitors conversations across public matching tweets. It does not calculate sentiment or brand reputation. It also cannot reveal private tweets or direct messages. A match shows that a tweet contains your terms. It does not show opinion. ## When should I use keyword alerts, tweet search, or account monitoring? Choose the option that matches the required time range and scope. | Requirement | Use | Result | | - | - | - | | Continuous matches across many accounts | Keyword monitor | Stored matching tweet events and real time alerts. | | Historical or on-demand query results | [Search Tweets](/api-reference/x/search-tweets) | One cursor-paginated tweet result set. | | Selected changes from one known account | [Create Account Monitor](/api-reference/monitors/create) | Post, profile, and follower events from that username. | Do not mix these 3 scopes in one tool. Use Twitter search for backfill and investigation. Use an account monitor for one known profile. Use keyword alerts for continuous matches across public tweets. Brand monitoring often needs both keyword and account monitors. Keep their event IDs, monitor IDs, and queue routes separate. Workers can then tell which source produced each alert. ## How do real-time tweet alerts reach my application? Create the keyword monitor before registering its webhook destination. Subscribe the webhook to the same selected event types. Then send a signed test to validate the receiver. Verify every signature before parsing the request body. Store `deliveryId` before you queue work. Store `streamEventId` before processing the matching tweet. Return success only after the queue write completes. The Events API provides recovery when live delivery fails. The Deliveries API shows webhook attempts for one registered endpoint. Use [Webhook Verification](/webhooks/verification) for receiver validation. Use [List Deliveries](/api-reference/webhooks/deliveries) for delivery audits. API access errors require different recovery actions. Replace invalid credentials after a `401` response. Add credits before retrying a `402` response. Respect `Retry-After` before repeating a `429` request. ## How do I backfill tweets before starting keyword monitoring? Run the same query through Search Tweets before creating the monitor. Page until the response reports no next page. Store every tweet ID and its source query. Record the newest collected tweet timestamp as the handoff boundary. Then create the keyword monitor with the reviewed query. Deduplicate backfill and monitor events by stable tweet ID. Keep the stored monitor ID beside every continuous event. Do not reuse a search cursor after changing the query. Keep historical results separate from live alerts. Search results answer an on-demand time range. Monitor events represent continuous checks after activation. Combining both sources without a boundary creates duplicate tweets. ## How do I monitor multiple keyword groups? Use one monitor when all terms share one alert action. Combine those terms with explicit `OR` grouping. Use separate monitors when terms require different owners or queues. Separate monitors also keep distinct query evidence. Store each monitor ID, normalized query, event types, and billing time. Pause obsolete monitors instead of creating uncertain duplicates. List keyword monitors before repeating a timed-out create request. A paused duplicate can reactivate with the submitted event types. Review active monitors before each billing checkpoint. Every active keyword monitor adds its hourly charge. Pause queries that no longer trigger an action. Do not broaden queries to generate more alerts. ## How do I keep Twitter keyword alerts actionable? Assign one owner and queue to each monitor ID. Route alerts by query, event type, and matched tweet ID. Keep support alerts separate from campaign or competitor alerts. Define the required action before activating the monitor. Review false matches from stored events at a regular interval. Add exact phrases or exclusions when irrelevant tweets repeat. Remove a term when nobody acts on its alerts. Keep the previous query beside every configuration change. Do not delete evidence when a query changes. Stored events explain why earlier alerts reached their original queue. Record the change time and the responsible operator. Use a new monitor when the owner or alert purpose changes. Measure matched tweets, accepted alerts, rejected alerts, and processing failures. Those counts show how precise the query is. Pause noisy monitors while operators correct their stored queries. Resume only after a reviewed search returns useful tweets. ## What does a Twitter keyword monitor not provide? A keyword monitor does not return a complete historical archive. It does not provide follower, following, like, or bookmark changes. It does not verify giveaway follows, replies, or reposts by itself. It does not calculate sentiment, reach, or engagement quality. Use an [account monitor](/api-reference/monitors/create) for new and lost followers. Use [Followers](/api-reference/x/followers) for the current follower list. Use focused tweet endpoints for replies, quotes, and retweeters. Use Search Tweets when an operator needs historical matching tweets. This endpoint tracks one query and delivers matches to webhooks. It stores matched tweets. It infers nothing about them. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `query` | `string` | Yes | X (Twitter) search query to monitor. Xquik normalizes whitespace. Maximum length is 512 characters. | | `name` | `string` | No | Your own label for the monitor, 1 to 80 characters. Every event the monitor produces carries it as `monitorName`. With it, you can route events from the payload. Xquik normalizes whitespace. | | `eventTypes` | `string[]` | Yes | Array of event types to subscribe to. At least 1 required. See [Valid Event Types](#valid-event-types) below. | ## Valid event types Keyword monitors accept `tweet.new`, `tweet.quote`, `tweet.reply`, `tweet.retweet`, `tweet.media`, `tweet.link`, `tweet.poll`, `tweet.mention`, `tweet.hashtag`, `tweet.longform`. > [card] tweet.new > > Matching tweet returned by the query. Xquik uses it when no reply, quote, > or retweet signal is present. > [card] tweet.quote > > Matching quote tweet returned by the query. Include this when quote > activity should create keyword monitor events and webhook deliveries. > [card] tweet.reply > > Matching reply returned by the query. Include this when support routing, > conversation tracking, or alerting needs replies. > [card] tweet.retweet > > Matching retweet returned by the query. Include this when repost activity > should create keyword monitor events and webhook deliveries. ## Response ### 201 Created | Field | Type | Description | | - | - | - | | `id` | `string` | Unique keyword monitor ID. | | `query` | `string` | Normalized query being monitored. | | `eventTypes` | `string[]` | Event types this monitor is subscribed to. | | `isActive` | `boolean` | Whether the monitor is active. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `nextBillingAt` | `string` | Next hourly credit charge time. New active monitors are due immediately. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "21", "query": "xquik api", "eventTypes": ["tweet.new"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T10:30:00.000Z" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Invalid query or event types" }` Missing query, query longer than 512 characters, or invalid `eventTypes`. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 402 Payment required `{ "error": "insufficient_credits", "message": "Insufficient credits" }` You need at least 30 available credits to create an active keyword monitor. You need the same to reactivate one. Possible errors include `no_credits` and `insufficient_credits`. ### 409 Duplicate An active keyword monitor already exists for this normalized query. Use [Update Keyword Monitor](/api-reference/monitors/update-keyword) to change event types or pause it. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > A paused keyword monitor for the same query may already exist. If so, creating it again reactivates that monitor with the new event types. > [!NOTE] > > **Next steps.** > > * [List Keyword Monitors](/api-reference/monitors/list-keywords) > * [Get Keyword Monitor](/api-reference/monitors/get-keyword) > * [Update Keyword Monitor](/api-reference/monitors/update-keyword) > * [Create Webhook](/api-reference/webhooks/create) > * [List Webhooks](/api-reference/webhooks/list) > * [List Events](/api-reference/events/list) > * [Get Event](/api-reference/events/get) > * [List Deliveries](/api-reference/webhooks/deliveries) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **409** `{ "error": "monitor_already_exists", "message": "Monitor already exists." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Monitor a Twitter Account or Update Its Monitor on X Source: https://docs.xquik.com/api-reference/monitors/create-or-update Monitor one X (Twitter) account by username in 1 call. Xquik creates the monitor if it does not exist, or updates it. The created field says which ran. > For the complete documentation index, see [llms.txt](/llms.txt). `PUT https://xquik.com/api/v1/monitors/username/{username}` **Creating requires 30 available credits.** They pay for the first active monitor hour. Updating a running monitor is free. Keep 1 X account under watch with the event types you choose. Send its username in the path. Xquik creates the monitor if it's missing, or updates it. The same call twice still leaves 1 monitor. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | An X username or the account's numeric user ID. A username has 1 to 15 letters, numerals or underscores. A leading `@` is optional. A number is a user ID, up to 19 digits. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your Xquik API key. Create one in the [Xquik dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `eventTypes` | `string[]` | Yes | Event types to monitor. Send at least 1. An update replaces the current list. See [Valid Event Types](/api-reference/monitors/create#valid-event-types). | | `name` | `string \| null` | No | Your label for the monitor, 1 to 80 characters. Every event carries it as `monitorName`. Leave it out to keep the current label. Send `null` to remove it. | ## When to use this route Use it when your app knows the username but not the monitor ID. It replaces a create call, a `409` answer & a list search. Agents & schedulers can send it on every run. | Your situation | Route | | - | - | | You know the username & want its monitor to exist | `PUT /monitors/username/{username}` | | You want a `409` when the monitor already exists | [Create Account Monitor](/api-reference/monitors/create) | | You hold the monitor ID & want to pause or resume it | [Update Monitor](/api-reference/monitors/update) | ## How Xquik picks create or update Xquik looks up the X account for the username, then matches its user ID. Case & a leading `@` make no difference. A renamed account keeps its monitor. * Xquik creates a monitor & answers `201` when you have none for the account. * Xquik turns a stopped monitor back on & answers `201`. * Xquik updates a running monitor & answers `200`. `created` is `true` in a `201` answer & `false` in a `200` answer. Read it instead of comparing monitor lists. An update replaces `eventTypes`. It changes `name` only when you send it. Send `null` to remove the label. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PUT https://xquik.com/api/v1/monitors/username/elonmusk \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "eventTypes": ["tweet.new", "tweet.reply"], "name": "Launch watch" }' | jq -c '{ created, monitor_id: .id, username, x_user_id: .xUserId, event_types: .eventTypes, is_active: .isActive, events_endpoint: ("/api/v1/events?monitorId=" + .id) }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/monitors/username/elonmusk", { method: "PUT", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ eventTypes: ["tweet.new", "tweet.reply"], name: "Launch watch", }), }); const monitor = await response.json(); const monitorState = { created: monitor.created, monitor_id: monitor.id, username: monitor.username, x_user_id: monitor.xUserId, event_types: monitor.eventTypes, is_active: monitor.isActive, events_endpoint: `/api/v1/events?monitorId=${monitor.id}`, }; process.stdout.write(`${JSON.stringify(monitorState)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.put( "https://xquik.com/api/v1/monitors/username/elonmusk", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "eventTypes": ["tweet.new", "tweet.reply"], "name": "Launch watch", }, ) monitor = response.json() monitor_state = { "created": monitor["created"], "monitor_id": monitor["id"], "username": monitor["username"], "x_user_id": monitor["xUserId"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "events_endpoint": f"/api/v1/events?monitorId={monitor['id']}", } print(json.dumps(monitor_state)) ``` ## Response ### 200 Updated | Field | Type | Description | | - | - | - | | `created` | `boolean` | `true` when this call created the monitor or turned it back on. `false` when it updated a running monitor. | | `id` | `string` | Unique monitor ID. It stays the same across updates. | | `username` | `string` | The username X shows for the account. | | `name` | `string` | Your label for the monitor. Present when you set one. | | `xUserId` | `string` | Resolved X user ID for the account. | | `eventTypes` | `string[]` | Event types this monitor is subscribed to. | | `isActive` | `boolean` | Whether the monitor is active. | | `createdAt` | `string` | Xquik records the creation time in ISO 8601 format. | | `nextBillingAt` | `string` | Next hourly credit charge time. A new monitor is due immediately. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "created": false, "id": "7", "username": "elonmusk", "xUserId": "44196397", "name": "Launch watch", "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T11:30:00.000Z" } ``` ### 201 Created The answer has the same fields, and `created` is `true`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "created": true, "id": "7", "username": "elonmusk", "xUserId": "44196397", "name": "Launch watch", "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T10:30:00.000Z" } ``` ### 400 Invalid input ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "invalid_input", "message": "Invalid input. Check the request body." } ``` The body has no `eventTypes` array, or it holds an unknown event type. A path that is no X username or user ID gets its own message. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "invalid_input", "message": "Set username to an X username or user ID, like @NASA." } ``` ### 401 Missing API key ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." } ``` Missing or invalid API key or OAuth bearer token. ### 402 Payment required ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." } ``` Creating needs 30 available credits. An update of a running monitor never returns `402`. ### 404 User not found ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "user_not_found", "message": "X user not found. Check the username." } ``` Xquik could not find that username or user ID. Check the spelling. ### 429 Rate limited ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 } ``` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Next steps.** > > * [Create Webhook](/api-reference/webhooks/create) to receive events. > * [List Events](/api-reference/events/list) to audit stored events. > * [Get Monitor](/api-reference/monitors/twitter-account-monitor-status) to fetch one monitor. > * [Delete Twitter Account Monitor](/api-reference/monitors/delete-twitter-account-monitor) to stop checks for good. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Create a tweet monitor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/create-post Track 1 X post's replies, quotes, edits, deletion & 6 metrics. Send each change to signed webhooks. Costs 30 credits an hour, events & deliveries included. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/monitors/posts` Create a post monitor when 1 X post needs live tracking. It reports new replies, new quotes, edits & deletion. It also tracks views, likes, retweets, replies, quotes & bookmarks. **Requires 30 available credits.** Active post monitors bill 30 credits per hour. > [!NOTE] > > The hourly price covers stored events & webhook deliveries. Xquik charges an > hour only after a read that finds the post. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/monitors/posts \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "post": "https://x.com/NASA/status/2102882545427714266", "name": "Launch post" }' | jq -c '{ post_monitor_id: .id, post_id: .postId, post_url: .postUrl, event_types: .eventTypes, is_active: .isActive, next_billing_at: .nextBillingAt, likes: .metrics.likes.current, verify_endpoint: "/api/v1/monitors/posts/\(.id)", metrics_endpoint: "/api/v1/monitors/posts/\(.id)/metrics", events_endpoint: "/api/v1/events?postMonitorId=\(.id)" }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/monitors/posts", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ post: "https://x.com/NASA/status/2102882545427714266", name: "Launch post", }), }); const monitor = await response.json(); const monitorState = { post_monitor_id: monitor.id, post_id: monitor.postId, post_url: monitor.postUrl, event_types: monitor.eventTypes, is_active: monitor.isActive, next_billing_at: monitor.nextBillingAt, likes: monitor.metrics.likes.current, verify_endpoint: `/api/v1/monitors/posts/${monitor.id}`, metrics_endpoint: `/api/v1/monitors/posts/${monitor.id}/metrics`, events_endpoint: `/api/v1/events?postMonitorId=${monitor.id}`, }; process.stdout.write(`${JSON.stringify(monitorState)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.post( "https://xquik.com/api/v1/monitors/posts", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "post": "https://x.com/NASA/status/2102882545427714266", "name": "Launch post", }, ) monitor = response.json() monitor_state = { "post_monitor_id": monitor["id"], "post_id": monitor["postId"], "post_url": monitor["postUrl"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "next_billing_at": monitor["nextBillingAt"], "likes": monitor["metrics"]["likes"]["current"], "verify_endpoint": f"/api/v1/monitors/posts/{monitor['id']}", "metrics_endpoint": f"/api/v1/monitors/posts/{monitor['id']}/metrics", "events_endpoint": f"/api/v1/events?postMonitorId={monitor['id']}", } print(json.dumps(monitor_state)) ``` Each example turns the new monitor into 1 state row. Store `post_monitor_id`, `post_id`, `event_types` & `next_billing_at` before you route alerts. ## Post monitor handoff Create the monitor first. Then create a signed webhook with [`POST /webhooks`](/api-reference/webhooks/create) for the same event types. Test it with [`POST /webhooks/{id}/test`](/api-reference/webhooks/test). > [card] Monitor ID > > Store `id` as `post_monitor_id`. Use it with > [Get Post Monitor](/api-reference/monitors/get-post), > [Update Post Monitor](/api-reference/monitors/update-post) & > [Delete Post Monitor](/api-reference/monitors/delete-post). > [card] Tracked post > > Store `postId`, `postUrl` & `authorUsername`. Every post event carries > them, so receivers can route without a lookup. > [card] Metric history > > Read hourly values & gains with > [Post Monitor Metrics](/api-reference/monitors/post-metrics). Xquik keeps > 730 days of history. > [card] Stored event join > > Pass `id` as `postMonitorId` to > [List Events](/api-reference/events/list). Post events carry > `monitorType: "post"` & the same `monitorId`. ## How do I track a tweet's engagement with an API? Send the post link or ID as `post`. Xquik reads the post once & returns its current metrics. Each metric starts with a gain of `0`. Xquik then reads the post every 2 to 4 seconds. A metric event fires when a count holds a new value. Each metric fires at most once a minute. The event covers the whole change since the last one. New replies & quotes come as their own events. Each one carries the reply or quote as `data`, like `tweet.new`. Xquik sends them oldest first. ## What happens when the author edits or deletes the post? X moves engagement to the newest version of an edited post. The monitor follows that version, so metrics keep counting after an edit. `post.edited` carries `previousText`, `text` & `versionId`. `post.deleted` fires when the post is deleted. It carries the last text the monitor saw. When X stops showing the post, Xquik pauses the monitor. `pausedReason` says why. A paused monitor costs nothing. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `post` | `string` | Yes | Post link or ID, up to 2,048 characters. The x.com, twitter.com, mobile & `/i/web/status/` links work with any query string. | | `name` | `string \| null` | No | Your own label for the monitor, 1 to 80 characters. Every event the monitor produces carries it as `monitorName`. Xquik normalizes whitespace. | | `eventTypes` | `string[]` | No | Post event types to send, 1 to 10. Without it, the monitor sends `post.reply.new`, `post.quote.new`, `post.likes.changed`, `post.retweets.changed`, `post.edited` & `post.deleted`. | | `isActive` | `boolean` | No | Send `false` to create the monitor paused. A paused monitor reads nothing & costs nothing until a PATCH sets `isActive` to `true`. | ## Valid event types | Event type | Fires when | `data` | | - | - | - | | `post.reply.new` | A new direct reply appears. | The reply. | | `post.quote.new` | A new quote of the post appears. | The quote. | | `post.likes.changed` | The like count holds a new value. | `metric`, `previous`, `current`, `change`. | | `post.retweets.changed` | The retweet count holds a new value. | `metric`, `previous`, `current`, `change`. | | `post.replies.changed` | The reply count holds a new value. | `metric`, `previous`, `current`, `change`. | | `post.quotes.changed` | The quote count holds a new value. | `metric`, `previous`, `current`, `change`. | | `post.bookmarks.changed` | The bookmark count holds a new value. | `metric`, `previous`, `current`, `change`. | | `post.views.changed` | The view count holds a new value. | `metric`, `previous`, `current`, `change`. | | `post.edited` | The author edits the post. | `previousText`, `text`, `versionId`. | | `post.deleted` | The post is deleted. | `text`, the last text the monitor saw. | The reply count can include replies X does not list. `post.reply.new` reports the replies X (Twitter) lists. ## Response ### 201 Created | Field | Type | Description | | - | - | - | | `id` | `string` | Unique post monitor ID. | | `name` | `string` | Your label for the monitor, when set. | | `postId` | `string` | ID of the post you gave. | | `postUrl` | `string` | Link to the post. | | `authorId` | `string` | Permanent X (Twitter) user ID of the post's author. | | `authorUsername` | `string` | Username of the post's author. | | `authorName` | `string` | Display name of the post's author. | | `text` | `string` | Text of the newest version Xquik read. | | `postedAt` | `string` | ISO 8601 time X published the post. | | `eventTypes` | `string[]` | Post event types this monitor sends. | | `isActive` | `boolean` | Whether the monitor is active. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `nextBillingAt` | `string` | Next hourly credit charge time. | | `pausedReason` | `string` | Why Xquik paused the monitor. Absent while active. | | `pausedAt` | `string` | When Xquik paused the monitor. | | `metrics` | `object` | `views`, `likes`, `retweets`, `replies`, `quotes` & `bookmarks`. Each holds `current` & `gain` since tracking began. Both are `null` when X shows no count, as for views on old posts. | ### 400 Invalid input `post` is missing or is not a post link or ID. The message says what to fix. ### 401 Unauthenticated Missing or invalid API key. ### 402 Payment required You need at least 30 available credits to create a post monitor. ### 404 Tweet not found X shows no such post, so Xquik creates nothing. `reason` is `deleted`, `author_deactivated`, `author_suspended`, `protected` or `unavailable` when X names it. ### 409 Duplicate An active monitor already tracks this post. Use [Update Post Monitor](/api-reference/monitors/update-post) to change it. ### 422 Post unavailable The author limits who can see the post. Choose a public post. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. ### 502 X unavailable X failed the read. Retry after a short wait. ### 503 Busy Xquik is busy right now. Wait for `Retry-After`, then retry. > [!NOTE] > > Creating a monitor for a paused post again turns it back on. It keeps its > start values & history, and takes the new name & event types. > [!NOTE] > > **Next steps.** [List Post Monitors](/api-reference/monitors/list-posts), [Post Monitor Metrics](/api-reference/monitors/post-metrics), [Create Webhook](/api-reference/webhooks/create), [List Events](/api-reference/events/list), or [Get Event](/api-reference/events/get). ## Response examples ### 201 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "31", "postId": "2102882545427714266", "postUrl": "https://x.com/NASA/status/2102882545427714266", "authorId": "11348282", "authorUsername": "NASA", "authorName": "NASA", "media": [], "text": "Today, Croatia became the 74th nation that has committed to a peaceful and prosperous exploration of space.", "postedAt": "2026-09-23T22:07:23.000Z", "eventTypes": ["post.reply.new"] } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **409** `{ "error": "monitor_already_exists", "message": "Monitor already exists." }` * **422** `{ "error": "post_unavailable", "message": "This post's author limits who can see it. Try again once the post is public." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Delete a keyword monitor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/delete-keyword Stop a Twitter keyword monitor and future query checks. Xquik removes stored events in batches. Poll the status URL until deletion finishes with a 404 status. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/monitors/keywords/{id}` Delete a keyword monitor only when its tweet query should stop permanently. Pause it instead when future monitoring might resume. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/monitors/keywords/21 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const monitorId = "21"; const response = await fetch(`https://xquik.com/api/v1/monitors/keywords/${monitorId}`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const result = await response.json(); const deletionReceipt = { keyword_monitor_id: monitorId, success: result.success === true, verify_endpoint: result.statusUrl, list_endpoint: "/api/v1/monitors/keywords", }; process.stdout.write(`${JSON.stringify(deletionReceipt)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests monitor_id = "21" response = requests.delete( f"https://xquik.com/api/v1/monitors/keywords/{monitor_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) result = response.json() deletion_receipt = { "keyword_monitor_id": monitor_id, "success": result["success"] is True, "verify_endpoint": result["statusUrl"], "list_endpoint": "/api/v1/monitors/keywords", } print(json.dumps(deletion_receipt)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" "os" ) type DeleteResult struct { StatusURL string `json:"statusUrl"` Success bool `json:"success"` } type KeywordMonitorDeletion struct { KeywordMonitorID string `json:"keyword_monitor_id"` Success bool `json:"success"` VerifyEndpoint string `json:"verify_endpoint"` ListEndpoint string `json:"list_endpoint"` } func main() { monitorID := "21" req, err := http.NewRequest( "DELETE", "https://xquik.com/api/v1/monitors/keywords/"+monitorID, nil, ) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var result DeleteResult if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { log.Fatal(err) } receipt := KeywordMonitorDeletion{ KeywordMonitorID: monitorID, Success: result.Success, VerifyEndpoint: result.StatusURL, ListEndpoint: "/api/v1/monitors/keywords", } if err := json.NewEncoder(os.Stdout).Encode(receipt); err != nil { log.Fatal(err) } } ``` The examples store a deletion receipt. Poll `verify_endpoint` while it returns `200`. Deletion finishes when it returns `404`. Respect `Retry-After` between requests. ## Remove one term from a monitored query A keyword monitor stores one query. The API has no route that deletes a single term. This route deletes the whole monitor. To drop a term, create a new monitor with the revised query. Export the old monitor's stored events. Then pause or delete the old monitor. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique keyword monitor ID. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 202 Accepted | Field | Type | Description | | - | - | - | | `deletionStatus` | `string` | Returns `deleting` while cleanup runs. | | `statusUrl` | `string` | Poll this URL until it returns `404`. | | `success` | `boolean` | Always `true` when deletion starts. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "deletionStatus": "deleting", "statusUrl": "/api/v1/monitors/keywords/21", "success": true } ``` The response includes `Location` and `Retry-After` headers. Poll `Location` after the stated interval. ### 400 Invalid ID `{ "error": "invalid_id", "message": "Invalid ID format." }` The provided monitor ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 404 Not found `{ "error": "not_found", "message": "Monitor not found" }` No keyword monitor exists with this ID, or it belongs to a different account. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. ## Deletion handoff Use this endpoint when a keyword query should stop permanently. Use [Update Keyword Monitor](/api-reference/monitors/update-keyword) with `isActive: false` when you only need to pause alerts. That keeps the monitor available. > [card] Permanent remove > > Delete stops the monitor immediately. Poll `statusUrl` until it returns > `404`. You cannot update or resume the deleted ID. > [card] Stored history > > Xquik removes stored events and webhook delivery records for this monitor > in batches. Export required records before deletion. > [card] Pause instead > > Use `PATCH /monitors/keywords/{id}` with `isActive: false` to stop future > polling, alerts, and hourly billing. The monitor record stays. > [card] Verify removal > > Call [List Keyword Monitors](/api-reference/monitors/list-keywords) after > deletion. [Get Keyword Monitor](/api-reference/monitors/get-keyword) should > return `404` for the deleted ID. > [card] Track new query > > Create a new keyword monitor when the X (Twitter) search query changes. Store the new > `id`, `query`, `eventTypes`, `isActive`, and `nextBillingAt`. > [card] Webhook reuse > > Existing webhook endpoints remain configured. Keep their `eventTypes` > aligned. Then run [Test Webhook](/api-reference/webhooks/test) before > relying on new keyword monitor alerts. > [!NOTE] > > Xquik deletes the keyword monitor and its stored events. Pause with `isActive: false` if you want to stop new checks without deleting the monitor. > [!NOTE] > > **Related.** > > * [List Keyword Monitors](/api-reference/monitors/list-keywords) to verify removal. > * [Create Keyword Monitor](/api-reference/monitors/create-keyword) to track a new query. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Delete a tweet monitor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/delete-post Stop a post monitor. Xquik removes its stored events & hourly metric history in batches. Poll the status URL until it answers 404, then deletion is done. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/monitors/posts/{id}` Delete a post monitor only when you no longer need its events or metrics. Pause it instead when you might resume. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/monitors/posts/31 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const monitorId = "31"; const response = await fetch(`https://xquik.com/api/v1/monitors/posts/${monitorId}`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const result = await response.json(); const receipt = { post_monitor_id: monitorId, success: result.success === true, verify_endpoint: result.statusUrl, }; process.stdout.write(`${JSON.stringify(receipt)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests monitor_id = "31" response = requests.delete( f"https://xquik.com/api/v1/monitors/posts/{monitor_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) result = response.json() receipt = { "post_monitor_id": monitor_id, "success": result["success"] is True, "verify_endpoint": result["statusUrl"], } print(json.dumps(receipt)) ``` Poll `verify_endpoint` while it answers `200`. Deletion is done when it answers `404`. Wait for `Retry-After` between requests. ## Before you delete Export the events & metrics you need first. Deletion removes the monitor's stored events & hourly metric history. A monitor that Xquik paused for a deleted post costs nothing. Delete it to tidy your list. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The post monitor ID. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 202 Accepted | Field | Type | Description | | - | - | - | | `deletionStatus` | `string` | Returns `deleting` while cleanup runs. | | `statusUrl` | `string` | Poll this URL until it answers `404`. | | `success` | `boolean` | Returns `true` when deletion starts. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "deletionStatus": "deleting", "statusUrl": "/api/v1/monitors/posts/31", "success": true } ``` The response also has `Location` & `Retry-After` headers. ### 400 Invalid input The monitor ID is not valid. ### 401 Unauthenticated Missing or invalid API key. ### 403 Forbidden This API key can't change monitors. Use a Full access key. ### 404 Not found No post monitor has this ID on your account. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** > > * [List Post Monitors](/api-reference/monitors/list-posts) to check removal. > * [Create Post Monitor](/api-reference/monitors/create-post) to track a new post. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Delete an account monitor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/delete-twitter-account-monitor Stop one Xquik account monitor and future checks. Xquik removes stored events in batches. Poll the status URL until it returns 404. The X account stays as is. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/monitors/{id}` This endpoint stops one account monitor immediately. It then removes stored events and linked webhook deliveries in batches. The tracked X account and its public data remain unchanged. > [!WARNING] > > This operation is permanent. Pause the monitor when its alerts may resume. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/monitors/7 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq -c '{ monitor_id: "7", success: .success == true, verify_endpoint: .statusUrl, list_endpoint: "/api/v1/monitors", events_endpoint: "/api/v1/events?monitorId=7", event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries" }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const monitorId = "7"; const response = await fetch(`https://xquik.com/api/v1/monitors/${monitorId}`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const result = await response.json(); const deletionReceipt = { monitor_id: monitorId, success: result.success === true, verify_endpoint: result.statusUrl, list_endpoint: "/api/v1/monitors", events_endpoint: `/api/v1/events?monitorId=${monitorId}`, event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries", }; process.stdout.write(`${JSON.stringify(deletionReceipt)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests monitor_id = "7" response = requests.delete( f"https://xquik.com/api/v1/monitors/{monitor_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) result = response.json() deletion_receipt = { "monitor_id": monitor_id, "success": result["success"] is True, "verify_endpoint": result["statusUrl"], "list_endpoint": "/api/v1/monitors", "events_endpoint": f"/api/v1/events?monitorId={monitor_id}", "event_detail_endpoint_pattern": "/api/v1/events/{event_id}", "webhooks_endpoint": "/api/v1/webhooks", "deliveries_endpoint_pattern": "/api/v1/webhooks/{webhook_id}/deliveries", } print(json.dumps(deletion_receipt)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" "os" ) type DeleteResult struct { StatusURL string `json:"statusUrl"` Success bool `json:"success"` } type AccountMonitorDeletion struct { MonitorID string `json:"monitor_id"` Success bool `json:"success"` VerifyEndpoint string `json:"verify_endpoint"` ListEndpoint string `json:"list_endpoint"` EventsEndpoint string `json:"events_endpoint"` EventDetailEndpointPattern string `json:"event_detail_endpoint_pattern"` WebhooksEndpoint string `json:"webhooks_endpoint"` DeliveriesEndpointPattern string `json:"deliveries_endpoint_pattern"` } func main() { monitorID := "7" req, err := http.NewRequest( "DELETE", "https://xquik.com/api/v1/monitors/"+monitorID, nil, ) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var result DeleteResult if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { log.Fatal(err) } receipt := AccountMonitorDeletion{ MonitorID: monitorID, Success: result.Success, VerifyEndpoint: result.StatusURL, ListEndpoint: "/api/v1/monitors", EventsEndpoint: "/api/v1/events?monitorId=" + monitorID, EventDetailEndpointPattern: "/api/v1/events/{event_id}", WebhooksEndpoint: "/api/v1/webhooks", DeliveriesEndpointPattern: "/api/v1/webhooks/{webhook_id}/deliveries", } if err := json.NewEncoder(os.Stdout).Encode(receipt); err != nil { log.Fatal(err) } } ``` The examples store a deletion receipt. Poll `verify_endpoint` while it returns `200`. Deletion finishes when it returns `404`. Respect `Retry-After` between requests. ## Before you delete an account monitor Delete only when the account monitor should never run again. Confirm the monitor ID, X (Twitter) username, user ID, and event types first. Save required events before deletion. Record the approver and final monitor identity in your own system. Use keyword monitor deletion only for a keyword monitor. Keep other account and keyword monitors when their checks must continue. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique monitor ID. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 202 Accepted | Field | Type | Description | | - | - | - | | `deletionStatus` | `string` | Returns `deleting` while cleanup runs. | | `statusUrl` | `string` | Poll this URL until it returns `404`. | | `success` | `boolean` | Always `true` when deletion starts. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "deletionStatus": "deleting", "statusUrl": "/api/v1/monitors/7", "success": true } ``` The response includes `Location` and `Retry-After` headers. Poll `Location` after the stated interval. ### 400 Invalid ID `{ "error": "invalid_id", "message": "Invalid ID format." }` The provided monitor ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 404 Not found `{ "error": "not_found", "message": "Monitor not found" }` No monitor exists with this ID, or it belongs to a different account. ### 429 Rate limited Too many requests. Follow the `Retry-After` interval before another request. ## Does this delete the X account or its tweets? No. This route deletes an Xquik account monitor only. This route cannot deactivate X accounts. It does not remove tweets, followers, following, replies, or likes. It also keeps reposts, media, lists, communities, and profile details. The tracked X account remains unchanged. Its public activity remains available through the applicable X API endpoints. Xquik removes only its saved monitor and related monitor records. ## Should I pause or delete account monitoring? Pause when alerts may resume. Send `isActive: false` through [Update Monitor](/api-reference/monitors/update). Pausing keeps the monitor ID, profile, event filters, and stored history. It stops future checks, deliveries, and hourly monitor billing. Delete when monitoring will never resume. Deletion removes the saved monitor and its stored history. A replacement monitor receives another ID. | Decision | Use it when | Result | | - | - | - | | Pause | Account monitoring may resume. | Keeps the monitor and history. | | Update filters | Only future event coverage changes. | Replaces `eventTypes`. | | Delete | The monitor and its history are no longer required. | Permanently removes both. | ## What does monitor deletion remove? Deleting the monitor removes its settings and stored tweet events. It also removes stored profile events, search records, and webhook delivery attempts. These records depend on the deleted monitor. Webhook endpoints remain configured. Existing endpoints can serve another monitor with matching event subscriptions. Other account monitors and keyword monitors remain active. ## How do I verify monitor deletion? 1. Save the monitor ID before sending `DELETE`. 2. Require `202` with `deletionStatus: "deleting"` and `success: true`. 3. Poll `statusUrl` until it returns `404 not_found`. 4. List monitors and confirm the ID is absent. 5. Treat another `DELETE` response of `404` as already removed. A network timeout does not prove deletion. Confirm the monitor state before another deletion request. Wait for `Retry-After` after a `429` response. ## Deletion handoff Use this endpoint when a tracked account should stop permanently. Use [Update Monitor](/api-reference/monitors/update) with `isActive: false` when you only need to pause alerts. That keeps the monitor available. | Account monitor deletion check | Source | Completion rule | | - | - | - | | Delete receipt | `deletionStatus`, `statusUrl`, `success` | Continue only after `202` with `success: true`. | | Monitor inventory | `GET /monitors` | Confirm the deleted monitor ID is absent. | | Detail lookup | `GET /monitors/{id}` | Expect `404 not_found` after deletion. | | Stored events | `GET /events?monitorId={id}` | Save required events first. | | Delivery history | `GET /webhooks/{id}/deliveries` | Keep required delivery evidence first. | | Temporary stop | `PATCH /monitors/{id}` | Use `isActive: false` instead of deletion. | ## Plan retention before monitor deletion Cleanup removes stored events and linked delivery records in batches. Decide which records your team must keep before sending `DELETE`. Export required tweet events and profile events first. Keep each event's `id`, `type`, `monitorId`, `username`, and `occurredAt`. Keep the complete `data` object for later processing. Support teams may also need webhook delivery evidence. Save delivery status, attempt counts, receiver responses, errors, and timestamps before deletion. Store these records in your approved system. Never place API keys in exports. Deletion does not create an archive. Xquik cannot return deleted monitor events through the events endpoints later. Finish retention checks before approval. ## Select the exact Twitter account monitor Never select a monitor from a display label alone. Read the account monitor and compare its `id`, `username`, `xUserId`, `eventTypes`, and `isActive` values. Use [List Monitors](/api-reference/monitors/list) when the monitor ID is unknown. Then use [Get Monitor](/api-reference/monitors/twitter-account-monitor-status) to confirm the selected record. Record the final identity beside the approval. Delete account monitors and keyword monitors through their matching routes. Use [Delete Keyword Monitor](/api-reference/monitors/delete-keyword) for a keyword query. Never send a keyword monitor ID to this account monitor endpoint. The route deletes by Xquik monitor ID. It does not delete by X (Twitter) username. One account name then cannot select several monitor records. ## Keep stored events Call [List Events](/api-reference/events/list) with the selected `monitorId`. Follow every cursor until `hasMore` becomes `false`. Complete every cursor page to include older events. Use [Get Event](/api-reference/events/get) for every event needing full detail. Keep `event.id` as the stable Xquik event identifier. Keep `event.type` to separate tweet events from profile changes. Store `occurredAt` with each event payload. It holds X's time of the event when X gives one. This applies to a post, a live video & a Space. Else it holds the time Xquik saw the event. This applies to a deleted post, a profile change & a follow list change. Keep the monitor ID with every exported row. You can then reconcile rows after the monitor record disappears. Validate the export before deletion. Compare exported IDs with the final list response. Retry incomplete pages before approving monitor removal. ## Keep webhook delivery evidence List configured endpoints through [List Webhooks](/api-reference/webhooks/list). Then call [List Deliveries](/api-reference/webhooks/deliveries) for each relevant endpoint. Join each delivery's `streamEventId` to the exported event `id`. Do not use `x_event_id` as the delivery join key. That value identifies an external event, not the stored Xquik event row. Keep `status`, `attempts`, `lastStatusCode`, `lastError`, `createdAt`, and `deliveredAt`. These fields explain successful deliveries, receiver failures, and retries still waiting. Deleting the monitor removes linked delivery attempts. It does not remove the webhook endpoint. Reuse that endpoint when another monitor emits matching event types. Test the endpoint before depending on new alerts. ## Handle every delete response A `202` response starts deletion. Require `success: true`, then poll `statusUrl`. Close the workflow when that URL returns `404`. A `400` response means the ID format is invalid. Correct the path value before another request. Do not substitute an X (Twitter) username for the monitor ID. A `401` response means authentication failed. Replace the invalid API key or session. Never expose that credential in logs or support tickets. Treat a `404` response as an unavailable monitor. It may already be deleted. It may also belong to another account. Verify the account context before proceeding. A `429` response means the rate limit blocked the request. Read `Retry-After`, wait for that interval, and check the monitor again. ## Resolve an unknown delete result A client timeout does not prove failure. The server may have completed the deletion before the connection ended. Read the same monitor ID after the timeout. A `404` response confirms that the record is unavailable. A successful read shows that the monitor still exists. List account monitors as a second check. Confirm that the deleted ID is absent. Do not rely on an empty event search alone. An event filter can be wrong while the monitor still exists. Repeated deletion leaves the final state unchanged. The first accepted request returns `202`. Later requests return `404` after cleanup finishes. ## Recreate monitoring after deletion A deleted account monitor cannot resume. Create another monitor when checks must restart. The replacement receives a different monitor ID. Use the saved X (Twitter) username, user ID, and event types for reconstruction. Review those values before creating the replacement. Do not assume the old filters still match the current workflow. Existing webhook endpoints remain available. Confirm their event subscriptions before connecting the replacement monitor. Run [Test Webhook](/api-reference/webhooks/test) to validate receiver access and response handling. Update dependent jobs with the new monitor ID. Replace stored event filters, verification links, and support references. The deleted ID will continue returning `404`. ## Account monitor deletion checklist 1. Confirm the monitor ID, X (Twitter) username, and X (Twitter) user ID. 2. Review `eventTypes`, `isActive`, and the deletion reason. 3. Export every required event. 4. Keep required webhook delivery attempts and receiver results. 5. Obtain approval for permanent removal. 6. Send `DELETE` and require `202` with `success: true`. 7. Poll `statusUrl` and require `404 not_found`. 8. List monitors and confirm that the ID is absent. 9. Update references to the removed monitor in other systems. Pause with `isActive: false` when monitoring may resume. Delete only after the retention, approval, and verification steps finish. ## Related account monitor operations Use [List Monitors](/api-reference/monitors/list) to find and verify account monitors. Use [Get Monitor](/api-reference/monitors/twitter-account-monitor-status) to confirm the selected ID and its final `404` response. Use [List Events](/api-reference/events/list) and [Get Event](/api-reference/events/get) to retain event evidence. Use [List Webhooks](/api-reference/webhooks/list) and [List Deliveries](/api-reference/webhooks/deliveries) for delivery evidence. Use [Create Monitor](/api-reference/monitors/create) when a replacement account monitor is required. Store the new ID before restoring dependent workflows. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Get a keyword monitor's status, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/get-keyword Get one keyword monitor's X query, tracked event types, active state, creation time, and next billing time. Use it before you pause, edit, or debug alerts. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/monitors/keywords/{id}` ## Inspect one Twitter keyword monitor Use this route when a workflow already stores one keyword monitor ID. It returns the exact X (Twitter) search query, tracked tweet events, and active state. It also returns creation time and next billing checkpoint. Use the list route when the ID is unknown. Check `query` before routing new matches. It holds the Twitter keyword search that created the monitor. Check `eventTypes` before assuming replies, quotes, reposts, or other tweet events are enabled. | Single-monitor question | Response field | Incident decision | | - | - | - | | Is this the intended search? | `id` and `query` | Stop if either value differs from the stored alert. | | Can it capture new tweets? | `isActive` | Resume only when future polling is required. | | Which tweet events qualify? | `eventTypes` | Compare the exact types with webhook subscriptions. | | When is the next charge? | `nextBillingAt` | Confirm credits before the billing checkpoint. | | Where are matching tweets? | `GET /events?keywordMonitorId={id}` | Inspect stored events separately from configuration. | Store `id`, `query`, `eventTypes`, `isActive`, and `nextBillingAt` together. Pass the same monitor ID to event filters, updates, deletion, and webhook workflows. Every step then refers to the same tracked search. Use this status check before pausing or editing a monitor. A successful read does not prove a matching tweet exists. Read the events endpoint for captured tweets. Then open one event for its complete payload. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET https://xquik.com/api/v1/monitors/keywords/21 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq -c '{ keyword_monitor_id: .id, query: .query, event_types: .eventTypes, is_active: .isActive, next_billing_at: .nextBillingAt, update_endpoint: "/api/v1/monitors/keywords/\(.id)", delete_endpoint: "/api/v1/monitors/keywords/\(.id)", events_endpoint: "/api/v1/events?keywordMonitorId=\(.id)", event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries" }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const monitorId = "21"; const response = await fetch(`https://xquik.com/api/v1/monitors/keywords/${monitorId}`, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const monitor = await response.json(); const monitorState = { keyword_monitor_id: monitor.id, query: monitor.query, event_types: monitor.eventTypes, is_active: monitor.isActive, created_at: monitor.createdAt, next_billing_at: monitor.nextBillingAt, update_endpoint: `/api/v1/monitors/keywords/${monitor.id}`, delete_endpoint: `/api/v1/monitors/keywords/${monitor.id}`, events_endpoint: `/api/v1/events?keywordMonitorId=${monitor.id}`, event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries", }; process.stdout.write(`${JSON.stringify(monitorState)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests monitor_id = "21" response = requests.get( f"https://xquik.com/api/v1/monitors/keywords/{monitor_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) monitor = response.json() monitor_state = { "keyword_monitor_id": monitor["id"], "query": monitor["query"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "created_at": monitor["createdAt"], "next_billing_at": monitor["nextBillingAt"], "update_endpoint": f"/api/v1/monitors/keywords/{monitor['id']}", "delete_endpoint": f"/api/v1/monitors/keywords/{monitor['id']}", "events_endpoint": f"/api/v1/events?keywordMonitorId={monitor['id']}", "event_detail_endpoint_pattern": "/api/v1/events/{event_id}", "webhooks_endpoint": "/api/v1/webhooks", "deliveries_endpoint_pattern": "/api/v1/webhooks/{webhook_id}/deliveries", } print(json.dumps(monitor_state)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" "os" ) type KeywordMonitor struct { ID string `json:"id"` Query string `json:"query"` EventTypes []string `json:"eventTypes"` IsActive bool `json:"isActive"` CreatedAt string `json:"createdAt"` NextBillingAt string `json:"nextBillingAt"` } type KeywordMonitorState struct { KeywordMonitorID string `json:"keyword_monitor_id"` Query string `json:"query"` EventTypes []string `json:"event_types"` IsActive bool `json:"is_active"` CreatedAt string `json:"created_at"` NextBillingAt string `json:"next_billing_at"` UpdateEndpoint string `json:"update_endpoint"` DeleteEndpoint string `json:"delete_endpoint"` EventsEndpoint string `json:"events_endpoint"` EventDetailEndpointPattern string `json:"event_detail_endpoint_pattern"` WebhooksEndpoint string `json:"webhooks_endpoint"` DeliveriesEndpointPattern string `json:"deliveries_endpoint_pattern"` } func main() { monitorID := "21" req, err := http.NewRequest("GET", "https://xquik.com/api/v1/monitors/keywords/"+monitorID, nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var monitor KeywordMonitor if err := json.NewDecoder(resp.Body).Decode(&monitor); err != nil { log.Fatal(err) } state := KeywordMonitorState{ KeywordMonitorID: monitor.ID, Query: monitor.Query, EventTypes: monitor.EventTypes, IsActive: monitor.IsActive, CreatedAt: monitor.CreatedAt, NextBillingAt: monitor.NextBillingAt, UpdateEndpoint: "/api/v1/monitors/keywords/" + monitor.ID, DeleteEndpoint: "/api/v1/monitors/keywords/" + monitor.ID, EventsEndpoint: "/api/v1/events?keywordMonitorId=" + monitor.ID, EventDetailEndpointPattern: "/api/v1/events/{event_id}", WebhooksEndpoint: "/api/v1/webhooks", DeliveriesEndpointPattern: "/api/v1/webhooks/{webhook_id}/deliveries", } if err := json.NewEncoder(os.Stdout).Encode(state); err != nil { log.Fatal(err) } } ``` The cURL, Node.js, Python, and Go examples convert the fetched keyword monitor. The result is one state snapshot row. Store `keyword_monitor_id`, `query`, `event_types`, `is_active`, `next_billing_at`, `update_endpoint`, `delete_endpoint`, `events_endpoint`, `event_detail_endpoint_pattern`, `webhooks_endpoint`, and `deliveries_endpoint_pattern`. Do this before changing filters, pausing alerts, or reconciling webhooks. ## State handoff Use `GET /monitors/keywords/{id}` before changing routing, billing checks, or alert state for one keyword monitor. The endpoint returns the current stored monitor for your account only. Deleted or cross-account IDs return `404`. | Keyword monitor column | Response source | Decision rule | | - | - | - | | Monitor ID | `id` | Use this ID for updates, events, and deletion. | | X search query | `query` | Compare the stored query with the intended search. | | Tweet event filter | `eventTypes` | Align webhook subscriptions with these event types. | | Polling state | `isActive` | Resume only when future tweet checks are required. | | Creation time | `createdAt` | Keep the monitor creation timestamp. | | Billing checkpoint | `nextBillingAt` | Review credits before the next active charge. | | Missing monitor | `404 not_found` | Stop changes for deleted or cross-account IDs. | > [card] Current filter > > `query` and `eventTypes` decide which tweets match. Copy > `eventTypes` into [List Webhooks](/api-reference/webhooks/list) before > relying on signed alerts. > [card] Active state > > Use `isActive` to decide whether the monitor should poll and bill. Use > [Update Keyword Monitor](/api-reference/monitors/update-keyword) to pause or > resume it. > [card] Billing check > > Read `nextBillingAt` before credit alerts, budget checks, or account > handoffs. Paused monitors stay visible but add no hourly charge. > [card] Event join > > Use `id` as `keywordMonitorId` with > [List Events](/api-reference/events/list). Then reconcile stored events and > webhook deliveries for this query. Use > [Get Event](/api-reference/events/get) for one event's full payload. > [card] Delivery audit > > Use [List Deliveries](/api-reference/webhooks/deliveries) when you must > retain webhook delivery evidence. Join delivery `streamEventId` to event > IDs. Do not use `x_event_id` as the delivery join key. > [card] Delete path > > Use [Delete Keyword Monitor](/api-reference/monitors/delete-keyword) only > when the query should stop permanently. Export event and delivery evidence > first when support or audit workflows need history. ## Verify one alert before incident review Inspect one stored monitor before investigating a missed or unexpected alert. Start with the monitor ID recorded by the alerting system. A list response does not show which row the workflow used. Compare the returned `query` with the intended Twitter search expression. Check capitalization, quoted phrases, exclusions, and operators. Store the returned value as evidence. Do not reconstruct it from a dashboard label. Next, compare `eventTypes` with the event under review. A monitor configured only for `tweet.new` cannot explain an expected reply alert. Update the filter only after recording its current value. Read `isActive` before examining an empty event window. A paused monitor stays available through this endpoint. It does not create future matching events. Check `nextBillingAt` when the monitor should be active. Xquik may have paused the monitor because the balance could not pay an hour. If so, it has `pausedReason` `insufficient_credits` and `pausedAt`. Add credits, then resume it. Use the returned ID to query stored events. Keep these outcomes separate. * The monitor exists, but its query does not match the expected tweet. * The query matches, but the required event type is absent. * The event type exists, but the monitor is paused. * The monitor is active, but no stored event matches the review window. * A stored event exists, but its webhook delivery needs inspection. Open the matching event before diagnosing webhook delivery. Then join its event ID with `streamEventId` from delivery records. You can then tell a matching problem from a delivery problem. Finish with a short incident note. Record monitor ID, exact query, active state, event types, event ID, and delivery result. That record lets another operator repeat the check without listing every monitor. ## Diagnose one keyword monitor Start with the returned monitor ID, query, event types, and active state. Check `nextBillingAt` and remaining credits before investigating a missing alert. Run the exact query through tweet search. Relevant results confirm query coverage, not webhook delivery. Inspect stored events by `keywordMonitorId`. Inspect delivery records by webhook ID. Keep `streamEventId` separate from each delivery ID. Do not edit the monitor during diagnosis. Capture its previous state before any approved change. ## Prove a keyword alert with stored evidence Collect evidence for the alert in 3 steps. Start with this endpoint's monitor response. Save its ID, exact query, active state, and event types. Run the exact query through [Tweet Search](/api-reference/x/search-tweets). Save matching Tweet IDs and creation times. A search match proves query coverage. It does not prove that a monitor stored an event. Next, list stored events for the same keyword monitor ID. Match the expected Tweet ID when the event payload exposes it. Save the event ID and event timestamp. An event proves the monitor stored the tweet. It does not prove webhook delivery. Finally, inspect deliveries for the subscribed webhook. Join each delivery's `streamEventId` to the stored event ID. Record its status and attempt time. A delivery record proves Xquik sent the notification. Keep 3 outcomes separate. * Search found the tweet, but no monitor event exists. * A monitor event exists, but no delivery references it. * A delivery exists, but the receiving application rejected it. Report each outcome separately. Each outcome needs a different correction. Query changes affect matching. Monitor state affects future event creation. Webhook changes affect delivery. Record the investigation window in UTC. Compare tweet, event, and delivery timestamps inside that window. Avoid using dashboard refresh time as evidence. Finish with one incident record. Include monitor ID, query, Tweet ID, event ID, webhook ID, and delivery result. Link every conclusion to a returned field. Another operator can then repeat the review. ## Distinguish configuration drift from missing tweets Compare the returned query with the approved query character by character. Check quoted phrases, exclusions, hashtags, usernames, and search operators. One missing operator can change every matched tweet. Compare `eventTypes` with the approved event scope. Keep the full returned array. Do not summarize several values as a broad monitoring label. Check `isActive` and `nextBillingAt` together. A stored monitor can remain visible while paused. A future billing timestamp tells you when the next charge is due. Neither field proves that a specific tweet created an event. Use [Update Account Monitor](/api-reference/monitors/update) only for account monitors. Keyword monitors use their dedicated update route. Keep monitor types separate when support tickets contain several IDs. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique keyword monitor ID. Returned when you [create a keyword monitor](/api-reference/monitors/create-keyword) or [list keyword monitors](/api-reference/monitors/list-keywords). | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | Unique keyword monitor ID. | | `query` | `string` | Normalized X (Twitter) search query. | | `eventTypes` | `string[]` | Subscribed event types. | | `isActive` | `boolean` | Whether the monitor is active. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `nextBillingAt` | `string` | Next hourly credit charge time for active monitor billing. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "21", "query": "xquik OR \"x api\"", "eventTypes": ["tweet.new"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T11:30:00.000Z" } ``` ### 400 Invalid ID `{ "error": "invalid_id", "message": "Invalid ID format." }` The provided monitor ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 404 Not found `{ "error": "not_found", "message": "Monitor not found" }` No keyword monitor exists with this ID, or it belongs to a different account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** > > * [List Keyword Monitors](/api-reference/monitors/list-keywords) > * [Update Keyword Monitor](/api-reference/monitors/update-keyword) > * [Delete Keyword Monitor](/api-reference/monitors/delete-keyword) > * [List Events](/api-reference/events/list) > * [Get Event](/api-reference/events/get) > * [List Webhooks](/api-reference/webhooks/list) > * [List Deliveries](/api-reference/webhooks/deliveries) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Get a tweet monitor's status, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/get-post Get 1 post monitor with its post, author, event types, active state, pause reason & 6 metrics. Each metric shows its current value & gain since tracking began. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/monitors/posts/{id}` Read 1 post monitor by ID. Use it to check live metrics, pause state, or event types before changing alerts. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/monitors/posts/31 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq -c '{ post_monitor_id: .id, post_url: .postUrl, text: .text, is_active: .isActive, paused_reason: (.pausedReason // null), views: .metrics.views.current, likes: .metrics.likes.current, like_gain: .metrics.likes.gain }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const monitorId = "31"; const response = await fetch(`https://xquik.com/api/v1/monitors/posts/${monitorId}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const monitor = await response.json(); const state = { post_monitor_id: monitor.id, post_url: monitor.postUrl, text: monitor.text, is_active: monitor.isActive, paused_reason: monitor.pausedReason ?? null, views: monitor.metrics.views.current, likes: monitor.metrics.likes.current, like_gain: monitor.metrics.likes.gain, }; process.stdout.write(`${JSON.stringify(state)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests monitor_id = "31" response = requests.get( f"https://xquik.com/api/v1/monitors/posts/{monitor_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) monitor = response.json() state = { "post_monitor_id": monitor["id"], "post_url": monitor["postUrl"], "text": monitor["text"], "is_active": monitor["isActive"], "paused_reason": monitor.get("pausedReason"), "views": monitor["metrics"]["views"]["current"], "likes": monitor["metrics"]["likes"]["current"], "like_gain": monitor["metrics"]["likes"]["gain"], } print(json.dumps(state)) ``` ## Check 1 monitor before you act | Question | Field | Next step | | - | - | - | | Is it the right post? | `postUrl` & `text` | `text` is the newest version Xquik read. | | Can it send events? | `isActive` & `pausedReason` | Resume with `isActive: true` once X shows it. | | Which events does it send? | `eventTypes` | Match your webhook subscriptions to this list. | | How did engagement move? | `metrics.*.gain` | Read hourly buckets for the trend. | `pausedReason` is `insufficient_credits` when the balance could not pay an hour. Add credits, then resume. The other 3 reasons mean X stopped showing the post. Read stored events with `GET /events?postMonitorId={id}`. Read hourly values with [Post Monitor Metrics](/api-reference/monitors/post-metrics). ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The post monitor ID. [Create Post Monitor](/api-reference/monitors/create-post) & [List Post Monitors](/api-reference/monitors/list-posts) return it. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | Unique post monitor ID. | | `name` | `string` | Your label for the monitor, when set. | | `postId` | `string` | ID of the post you gave. | | `postUrl` | `string` | Link to the post. | | `authorId` | `string` | Permanent X (Twitter) user ID of the post's author. | | `authorUsername` | `string` | Username of the post's author. | | `authorName` | `string` | Display name of the post's author. | | `text` | `string` | Text of the newest version Xquik read. | | `postedAt` | `string` | ISO 8601 time X published the post. | | `eventTypes` | `string[]` | Post event types this monitor sends. | | `isActive` | `boolean` | Whether the monitor is active. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `nextBillingAt` | `string` | Next hourly credit charge time. | | `pausedReason` | `string` | `insufficient_credits`, `x_post_deleted`, `x_post_protected` or `x_post_unavailable`. Absent when active or paused by you. | | `pausedAt` | `string` | When Xquik paused the monitor. | | `metrics` | `object` | `views`, `likes`, `retweets`, `replies`, `quotes` & `bookmarks`. Each holds `current` & `gain` since tracking began. Both are `null` when X shows no count. | ### 400 Invalid input The monitor ID is not valid. ### 401 Unauthenticated Missing or invalid API key. ### 404 Not found No post monitor has this ID on your account. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Update Post Monitor](/api-reference/monitors/update-post), [Delete Post Monitor](/api-reference/monitors/delete-post), [Post Monitor Metrics](/api-reference/monitors/post-metrics), or [List Events](/api-reference/events/list). ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "31", "postId": "2102882545427714266", "postUrl": "https://x.com/NASA/status/2102882545427714266", "authorId": "11348282", "authorUsername": "NASA", "authorName": "NASA", "media": [], "text": "Today, Croatia became the 74th nation that has committed to a peaceful and prosperous exploration of space.", "postedAt": "2026-09-23T22:07:23.000Z", "eventTypes": ["post.reply.new"] } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List account monitors, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/list List X (Twitter) account monitors with tracked profiles, event filters and active states. Each monitor shows its creation time and billing checkpoints. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/monitors` ## Inventory every Twitter account monitor Use `GET /monitors` when you monitor multiple Twitter accounts. It returns up to 10,000 account monitors in one response. The route lists only monitors that belong to the signed-in user. Each row identifies one tracked X profile. It also shows enabled event types and the active state. The row includes its creation time. Check `nextBillingAt` for the next active-monitor charge. Use the single-monitor route for one known ID. Group rows by `username` or stable `xUserId`. Keep `eventTypes` with every row because two monitors can track different changes. Separate inactive monitors before calculating which profiles still produce events. Store `monitorId` before handing a row to event or webhook processing. Event queries use that ID to isolate the monitor's events. Webhook deliveries remain separate from monitor inventory. Review `nextBillingAt` before enabling more monitors. Listing is free, but active monitors consume credits each hour. Delete unused monitors. Do not call a monitor idle after one empty event window. **Free.** This endpoint does not consume credits. ## How do you monitor multiple Twitter accounts? Create one account monitor for each X (Twitter) username. Select only the required tweet and profile event types. Then call this route to rebuild the complete list. Store each returned `id` as the stable monitor key. Keep `xUserId` beside the username because an account can change its username. Use `isActive` to filter rows before estimating costs. Group active rows by owner, workflow, or webhook receiver. Keep paused rows in the same inventory because their configuration still exists. Use [List Events](/api-reference/events/list) to retrieve stored events for one monitor. Pass the returned monitor ID as `monitorId`. Use [List Webhooks](/api-reference/webhooks/list) to inspect receivers. Use [List Deliveries](/api-reference/webhooks/deliveries) to audit each delivery. This route lists monitor settings, not stored events. ## What does the monitor inventory include? Each row shows the monitor ID, username, and stable X (Twitter) user ID. Use that user ID for account joins. The `eventTypes` array lists the changes the monitor tracks. The `isActive` field separates running monitors from paused ones. The timestamps show when Xquik created the monitor and its next billing point. Tweet filters cover new posts, replies, quotes, reposts, media, and links. They also cover polls, mentions, hashtags, and long-form posts. Profile filters include the avatar, banner, name, username, biography, and location. They also cover URL, verification, protection, pinned tweets, and account availability. Activity filters cover deleted posts, live videos, and Spaces. Follow filters cover follows, new and lost followers, and follower and following counts. Read `eventTypes` from every row. Do not assume every monitor uses identical filters. The response also includes `total`. Compare it with the emitted monitor count. A mismatch usually means the client dropped rows during local processing. The route returns up to 10,000 monitors per page. When `hasMore` is `true`, pass `nextCursor` as `cursor` to read the next page. ## Does this route return tweets or analytics? No. `GET /monitors` returns account-monitor configurations. It does not return tweet timelines, engagement totals, audience reports, or sentiment scores. Use [List Events](/api-reference/events/list) for stored monitor events. Use [Get Event](/api-reference/events/get) to inspect one stored event. The route also does not publish or schedule posts. Use the [X Write API](/api-reference/x-write/create-tweet) for publishing workflows. Do not use the monitor list as an event feed or a publishing queue. ## How do you set alerts for several X accounts? First, create one monitor per username. Give each monitor only the event types its receiver understands. Then create a webhook for the matching event types. Store the monitor ID with every workflow rule. You can then tell the source when several profiles send similar events. Re-list monitors after every create, update, pause, or delete operation. Check that the intended row exists and has the expected `eventTypes`. Confirm `isActive` before waiting for a new alert. Paused monitors retain their settings. They stop polling until reactivated. Audit webhook deliveries separately. Join a delivery to its stored event with the documented event ID. Do not infer success from the monitor's active state. Polling state and webhook delivery status are separate. ## How should teams manage many tracked profiles? Assign one owner when managing multiple Twitter accounts. Store that owner outside the API response. Save the monitor ID, X (Twitter) user ID, selected event types, and active state. Add the owner and review date. Assign ownership by workflow. Support teams can process replies and mentions. Research teams can own new posts, quotes, or media events. Account teams can own profile-name, biography, verification, or availability changes. Match each assignment to the exact `eventTypes` returned for that monitor. Agencies should separate client profiles before reporting active-monitor costs. Review paused and active rows together, but count their costs separately. Record every approved state change. With that history, a cleanup for one client cannot change another client's monitor. ## Is listing Twitter account monitors free? Yes. This `GET` request consumes no credits. Active monitors cost 30 credits per monitor-hour. Paused monitors stay listed and stop active-monitor billing. Review `isActive` and `nextBillingAt` before enabling more profiles. A quiet event window is no reason to cut cost. A valid monitor may receive no matching event during that period. Confirm its owner and selected filters before pausing it. Delete a monitor only when its configuration is no longer required. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET https://xquik.com/api/v1/monitors \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq -c '.monitors[] | { monitor_id: .id, username, x_user_id: .xUserId, event_types: .eventTypes, is_active: .isActive, created_at: .createdAt, next_billing_at: .nextBillingAt, monitor_detail_endpoint: ("/api/v1/monitors/" + .id), events_endpoint: ("/api/v1/events?monitorId=" + .id), event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries" }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/monitors", { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const payload = await response.json(); for (const monitor of payload.monitors) { const monitorRow = { monitor_id: monitor.id, username: monitor.username, x_user_id: monitor.xUserId, event_types: monitor.eventTypes, is_active: monitor.isActive, created_at: monitor.createdAt, next_billing_at: monitor.nextBillingAt, monitor_detail_endpoint: `/api/v1/monitors/${monitor.id}`, events_endpoint: `/api/v1/events?monitorId=${monitor.id}`, event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries", }; process.stdout.write(`${JSON.stringify(monitorRow)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/monitors", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) payload = response.json() for monitor in payload["monitors"]: monitor_row = { "monitor_id": monitor["id"], "username": monitor["username"], "x_user_id": monitor["xUserId"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "created_at": monitor["createdAt"], "next_billing_at": monitor["nextBillingAt"], "monitor_detail_endpoint": f"/api/v1/monitors/{monitor['id']}", "events_endpoint": f"/api/v1/events?monitorId={monitor['id']}", "event_detail_endpoint_pattern": "/api/v1/events/{event_id}", "webhooks_endpoint": "/api/v1/webhooks", "deliveries_endpoint_pattern": "/api/v1/webhooks/{webhook_id}/deliveries", } print(json.dumps(monitor_row)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" "os" ) type Monitor struct { ID string `json:"id"` Username string `json:"username"` XUserID string `json:"xUserId"` EventTypes []string `json:"eventTypes"` IsActive bool `json:"isActive"` CreatedAt string `json:"createdAt"` NextBillingAt string `json:"nextBillingAt"` } type MonitorListResponse struct { Monitors []Monitor `json:"monitors"` Total int `json:"total"` } type MonitorRow struct { DeliveriesEndpointPattern string `json:"deliveries_endpoint_pattern"` EventDetailEndpointPattern string `json:"event_detail_endpoint_pattern"` EventsEndpoint string `json:"events_endpoint"` EventTypes []string `json:"event_types"` CreatedAt string `json:"created_at"` IsActive bool `json:"is_active"` MonitorDetailEndpoint string `json:"monitor_detail_endpoint"` MonitorID string `json:"monitor_id"` NextBillingAt string `json:"next_billing_at"` Username string `json:"username"` WebhooksEndpoint string `json:"webhooks_endpoint"` XUserID string `json:"x_user_id"` } func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/monitors", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var payload MonitorListResponse if err := json.NewDecoder(resp.Body).Decode(&payload); err != nil { log.Fatal(err) } encoder := json.NewEncoder(os.Stdout) for _, monitor := range payload.Monitors { row := MonitorRow{ DeliveriesEndpointPattern: "/api/v1/webhooks/{webhook_id}/deliveries", EventDetailEndpointPattern: "/api/v1/events/{event_id}", EventsEndpoint: "/api/v1/events?monitorId=" + monitor.ID, EventTypes: monitor.EventTypes, CreatedAt: monitor.CreatedAt, IsActive: monitor.IsActive, MonitorDetailEndpoint: "/api/v1/monitors/" + monitor.ID, MonitorID: monitor.ID, NextBillingAt: monitor.NextBillingAt, Username: monitor.Username, WebhooksEndpoint: "/api/v1/webhooks", XUserID: monitor.XUserID, } if err := encoder.Encode(row); err != nil { log.Fatal(err) } } } ``` The Node.js, Python, and Go examples emit one structured monitor record. Save each record with its support, event, and webhook audit history. ## Inventory handoff Use `GET /monitors` after create, update, pause, or delete operations. That rebuilds your account monitor inventory. The response returns up to 10,000 monitors ordered by creation time. It also returns a `total` count for the returned set. | Account monitor inventory column | Response source | Inventory check | | - | - | - | | Monitor ID | `monitors[].id` | Use this ID for status, updates, and events. | | X username | `monitors[].username` | Display the tracked account without `@`. | | X user ID | `monitors[].xUserId` | Use this stable ID for account joins. | | Event filter | `monitors[].eventTypes` | Compare these types with webhook subscriptions. | | Polling state | `monitors[].isActive` | Separate active and paused account monitors. | | Billing checkpoint | `monitors[].nextBillingAt` | Schedule the next active monitor credit check. | | Inventory count | `total` | Compare this count with emitted monitor rows. | > [card] Tracked accounts > > Store each monitor's `id`, `username`, and `xUserId` with your CRM, > warehouse, or queue records. > [card] Detail handoff > > [Get Monitor](/api-reference/monitors/twitter-account-monitor-status) > returns one account monitor's latest event filter, active state, and billing > checkpoint. Use it with each `id` when a support workflow needs any of them. > [card] Active billing > > Filter monitors where `isActive` is `true`. Each active account monitor > bills 30 credits per active monitor-hour. Use `nextBillingAt` to schedule > credit checks or pause stale alerts. > [card] Webhook alignment > > Compare each monitor's `eventTypes` with [List Webhooks](/api-reference/webhooks/list) > before relying on signed alerts. > [card] Event backfill > > Use `id` as `monitorId` with [List Events](/api-reference/events/list) to > audit stored account monitor events. Open one returned ID with > [Get Event](/api-reference/events/get) to inspect the complete stored event. > [card] Delivery audit > > Use [List Deliveries](/api-reference/webhooks/deliveries) for each webhook > and join delivery `streamEventId` to event IDs. Do not use `x_event_id` as > the delivery join key. > [card] State repair > > Use [Update Monitor](/api-reference/monitors/update) to replace `eventTypes` > or toggle `isActive`. Use [Delete Monitor](/api-reference/monitors/delete-twitter-account-monitor) > only when the tracked account should stop permanently. ## Reconcile an account monitor inventory Store one row per monitor ID. Include its username, X (Twitter) user ID, and event types. Add the active state and billing date. Join monitors to webhooks by configured ownership. Flag missing webhooks, extra webhooks, and mismatched event types. Compare completed snapshots to identify new, paused, resumed, or removed monitors. Do not compare incomplete snapshots. Use the single-monitor route for an incident review. Update only the monitors approved for change. ## Assign account monitor ownership Use the complete list to assign every tracked X profile. Start with monitor ID, `username`, and stable `xUserId`. Keep the stable ID when a username changes. Group rows by the team consuming their events. Support teams may own reply and mention events. Research teams may own new posts. Account operations may own profile changes. Store ownership outside returned API fields. Compare `eventTypes` with the events each receiver handles. A webhook receiving only tweet events cannot process a profile biography change. Flag missing subscriptions before calling the monitor healthy. Then inspect active state. Active monitors can produce new account events. Paused monitors keep their configuration and do not poll. Keep both groups in the inventory. Never treat a paused row as deleted. Use `nextBillingAt` for active-budget reviews. Listing remains free. Count active account monitors separately from keyword monitors. They track different targets and event types. Publish one ownership row per monitor ID. Include username, X (Twitter) user ID, event types, active state, and billing checkpoint. Add its owner and review date. Later monitor changes then show up as changed rows. ## Prepare a bulk account monitor cleanup Begin from one complete list response. Do not combine partial snapshots. Mark rows lacking an owner, current workflow, or required webhook subscription. Inspect recent stored events before proposing a pause. An empty window does not prove the profile is irrelevant. Confirm the account, event types, and review window with the owner. Pause monitors through the update route first. Keep their IDs and previous event types in the change record. Watch receiver queues before you delete. Delete only approved rows. Re-list monitors after every batch. Confirm removed IDs are absent and paused IDs remain present. Record billing checkpoints for the remaining active rows. Handle uncertain changes individually. Use the single-monitor status route for each affected ID. Never replay a bulk delete because the client lost its local response. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. You can also sign in with a session cookie. Create a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Maximum items per page, from 1 to 10,000. Default 200. | | `cursor` | `string` | No | `nextCursor` from the previous page. The `after` alias also works. Offset pagination is not supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `monitors` | `object[]` | Array of monitor objects. | | `monitors[].id` | `string` | Unique monitor ID. | | `monitors[].username` | `string` | Normalized X (Twitter) username. | | `monitors[].xUserId` | `string` | Resolved X (Twitter) user ID. | | `monitors[].eventTypes` | `string[]` | Subscribed event types. | | `monitors[].isActive` | `boolean` | Whether the monitor is active. | | `monitors[].createdAt` | `string` | ISO 8601 creation timestamp. | | `monitors[].nextBillingAt` | `string` | Next hourly credit charge time for active monitor billing. | | `total` | `number` | Account monitors on this page. | | `hasMore` | `boolean` | Whether more rows follow this page. | | `nextCursor` | `string` | Pass it as `cursor` for the next page. Present when `hasMore` is `true`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "monitors": [ { "id": "7", "username": "elonmusk", "xUserId": "44196397", "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T11:30:00.000Z" }, { "id": "12", "username": "xquik_", "xUserId": "1849726401547751424", "eventTypes": ["tweet.new", "tweet.quote", "tweet.reply", "tweet.retweet"], "isActive": true, "createdAt": "2026-02-25T14:00:00.000Z", "nextBillingAt": "2026-02-25T15:00:00.000Z" } ], "total": 2, "hasMore": false } ``` ### 400 Invalid cursor `{ "error": "invalid_input", "message": "Cursor invalid. Use nextCursor from the previous page, or omit it to start over." }` The `cursor` is not one this list returned. Send the `nextCursor` of the previous page, or omit it. ### 401 Missing API key Missing or invalid API key. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > Returns up to 10,000 monitors per page. Pass `nextCursor` as `cursor` for the next page. > [!NOTE] > > **Related.** > > * [Create Monitor](/api-reference/monitors/create) to add a new monitor. > * [Get Monitor](/api-reference/monitors/twitter-account-monitor-status) to fetch one monitor. > * [List Events](/api-reference/events/list) to audit stored events. > * [Get Event](/api-reference/events/get) to inspect one event. > * [List Webhooks](/api-reference/webhooks/list) to compare subscriptions. > * [List Deliveries](/api-reference/webhooks/deliveries) to audit webhook delivery status. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List keyword monitors, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/list-keywords List up to 10,000 keyword monitors with X (Twitter) search queries and event types. Each shows active state, creation time, and next billing. Listing is free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/monitors/keywords` ## Reconcile every keyword monitor Use this endpoint when the exact monitor ID is unknown. It returns up to 10,000 stored searches per page plus `total`. Follow `nextCursor` for the rest. | Monitor list check | Inventory calculation | Reconciliation decision | | - | - | - | | Active searches | Count `monitors[].isActive === true` | Include only active rows in current polling reviews. | | Paused searches | Count `monitors[].isActive === false` | Keep them for history or later reactivation. | | Duplicate queries | Group by normalized `monitors[].query` | Compare `eventTypes` before treating rows as duplicates. | | Webhook gaps | Compare every `eventTypes` array | Add only missing receiver subscriptions. | | Billing order | Sort active `nextBillingAt` values | Review the nearest credit checkpoints first. | | Inventory completeness | Compare `monitors.length` with `total` | Contact support when the list is incomplete. | Use the detail endpoint only after choosing one monitor ID from this inventory. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET https://xquik.com/api/v1/monitors/keywords \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq -c '.monitors[] | { keyword_monitor_id: .id, query: .query, event_types: .eventTypes, is_active: .isActive, next_billing_at: .nextBillingAt, events_endpoint: "/api/v1/events?keywordMonitorId=\(.id)", event_detail_endpoint_pattern: "/api/v1/events/{event_id}", verify_endpoint: "/api/v1/monitors/keywords/\(.id)", update_endpoint: "/api/v1/monitors/keywords/\(.id)", delete_endpoint: "/api/v1/monitors/keywords/\(.id)", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries" }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/monitors/keywords", { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const payload = await response.json(); for (const monitor of payload.monitors) { const monitorRow = { keyword_monitor_id: monitor.id, query: monitor.query, event_types: monitor.eventTypes, is_active: monitor.isActive, created_at: monitor.createdAt, next_billing_at: monitor.nextBillingAt, events_endpoint: `/api/v1/events?keywordMonitorId=${monitor.id}`, event_detail_endpoint_pattern: "/api/v1/events/{event_id}", verify_endpoint: `/api/v1/monitors/keywords/${monitor.id}`, update_endpoint: `/api/v1/monitors/keywords/${monitor.id}`, delete_endpoint: `/api/v1/monitors/keywords/${monitor.id}`, webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries", }; process.stdout.write(`${JSON.stringify(monitorRow)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/monitors/keywords", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) payload = response.json() for monitor in payload["monitors"]: monitor_row = { "keyword_monitor_id": monitor["id"], "query": monitor["query"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "created_at": monitor["createdAt"], "next_billing_at": monitor["nextBillingAt"], "events_endpoint": f"/api/v1/events?keywordMonitorId={monitor['id']}", "event_detail_endpoint_pattern": "/api/v1/events/{event_id}", "verify_endpoint": f"/api/v1/monitors/keywords/{monitor['id']}", "update_endpoint": f"/api/v1/monitors/keywords/{monitor['id']}", "delete_endpoint": f"/api/v1/monitors/keywords/{monitor['id']}", "webhooks_endpoint": "/api/v1/webhooks", "deliveries_endpoint_pattern": "/api/v1/webhooks/{webhook_id}/deliveries", } print(json.dumps(monitor_row)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" "os" ) type KeywordMonitor struct { ID string `json:"id"` Query string `json:"query"` EventTypes []string `json:"eventTypes"` IsActive bool `json:"isActive"` CreatedAt string `json:"createdAt"` NextBillingAt string `json:"nextBillingAt"` } type KeywordMonitorListResponse struct { Monitors []KeywordMonitor `json:"monitors"` Total int `json:"total"` } type KeywordMonitorRow struct { KeywordMonitorID string `json:"keyword_monitor_id"` Query string `json:"query"` EventTypes []string `json:"event_types"` IsActive bool `json:"is_active"` CreatedAt string `json:"created_at"` NextBillingAt string `json:"next_billing_at"` EventsEndpoint string `json:"events_endpoint"` EventDetailEndpointPattern string `json:"event_detail_endpoint_pattern"` VerifyEndpoint string `json:"verify_endpoint"` UpdateEndpoint string `json:"update_endpoint"` DeleteEndpoint string `json:"delete_endpoint"` WebhooksEndpoint string `json:"webhooks_endpoint"` DeliveriesEndpointPattern string `json:"deliveries_endpoint_pattern"` } func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/monitors/keywords", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var payload KeywordMonitorListResponse if err := json.NewDecoder(resp.Body).Decode(&payload); err != nil { log.Fatal(err) } encoder := json.NewEncoder(os.Stdout) for _, monitor := range payload.Monitors { row := KeywordMonitorRow{ KeywordMonitorID: monitor.ID, Query: monitor.Query, EventTypes: monitor.EventTypes, IsActive: monitor.IsActive, CreatedAt: monitor.CreatedAt, NextBillingAt: monitor.NextBillingAt, EventsEndpoint: "/api/v1/events?keywordMonitorId=" + monitor.ID, EventDetailEndpointPattern: "/api/v1/events/{event_id}", VerifyEndpoint: "/api/v1/monitors/keywords/" + monitor.ID, UpdateEndpoint: "/api/v1/monitors/keywords/" + monitor.ID, DeleteEndpoint: "/api/v1/monitors/keywords/" + monitor.ID, WebhooksEndpoint: "/api/v1/webhooks", DeliveriesEndpointPattern: "/api/v1/webhooks/{webhook_id}/deliveries", } if err := encoder.Encode(row); err != nil { log.Fatal(err) } } } ``` The cURL, Node.js, Python, and Go examples convert each monitor into one inventory row. Store `keyword_monitor_id`, `query`, `event_types`, `is_active`, `next_billing_at`, `events_endpoint`, `event_detail_endpoint_pattern`, `verify_endpoint`, `update_endpoint`, `delete_endpoint`, `webhooks_endpoint`, and `deliveries_endpoint_pattern`. Do this before reconciling events, webhooks, or paused queries. ## Inventory handoff Use `GET /monitors/keywords` after create, update, pause, or delete operations. That rebuilds your keyword monitor inventory. The response returns up to 10,000 keyword monitors ordered by creation time. It also returns a `total` count for the returned set. | Keyword monitor inventory column | Response source | Reconciliation rule | | - | - | - | | Monitor ID | `monitors[].id` | Use this ID for status, updates, and events. | | X search query | `monitors[].query` | Keep the exact stored query text. | | Tweet event filter | `monitors[].eventTypes` | Compare these types with webhook subscriptions. | | Polling state | `monitors[].isActive` | Separate active and paused keyword monitors. | | Creation time | `monitors[].createdAt` | Track how old each configuration is. | | Billing checkpoint | `monitors[].nextBillingAt` | Schedule the next active monitor credit check. | | Inventory count | `total` | Compare this count with emitted monitor rows. | > [card] Active burn > > Filter monitors where `isActive` is `true`. Each active keyword monitor > bills 30 credits per active monitor-hour. Use `nextBillingAt` to schedule > credit checks or pause stale alerts. > [card] Webhook alignment > > Compare each monitor's `eventTypes` with > [List Webhooks](/api-reference/webhooks/list) before relying on signed > alerts. > [card] Event backfill > > Use `id` as `keywordMonitorId` with > [List Events](/api-reference/events/list) to audit stored monitor events. > Use [Get Event](/api-reference/events/get) for one event's full payload. > [card] Delivery audit > > Use [List Deliveries](/api-reference/webhooks/deliveries) when you must > retain webhook delivery evidence. Join delivery `streamEventId` to event > IDs. Do not use `x_event_id` as the delivery join key. > [card] Detail check > > Use [Get Keyword Monitor](/api-reference/monitors/get-keyword) before > changing a row. Store the returned `query`, `eventTypes`, `isActive`, and > `nextBillingAt`. > [card] State repair > > Use [Update Keyword Monitor](/api-reference/monitors/update-keyword) to > replace `eventTypes` or toggle `isActive`. Use > [Delete Keyword Monitor](/api-reference/monitors/delete-keyword) only when > the query should stop permanently. ## Review every tracked search Use the returned list to inspect every stored Twitter keyword query. Start with `total`, then count the emitted `monitors` rows. Store the snapshot time beside both values. A later comparison needs a complete inventory. Classify each query by what it searches for. Separate brand handles, product names, campaign hashtags, support phrases, and competitor terms. Keep the original `query` text. Do not replace it with a dashboard label. Group identical normalized queries before changing anything. Two active rows can watch the same phrase with different event types. Compare `eventTypes` before calling them duplicates. Keep rows that route to different receivers on purpose. Next, separate active and paused rows. Active rows can create new matching events. Paused rows remain useful for history and later reactivation. Never infer activity from an empty event window alone. Compare every active row with webhook subscriptions. Flag missing event types, unused webhook event types, and receivers without an owner. Use the monitor ID to inspect stored events. Use event IDs to inspect delivery attempts. Finish with one inventory record per keyword monitor. Keep the monitor ID, query, event types, active state, creation time, and billing checkpoint. Add the responsible team and review date outside the API response. ## Prepare a keyword monitor budget report Count only active keyword monitors when estimating hourly monitor use. Each active monitor bills 30 credits per active monitor-hour. Listing the inventory remains free. Sort active rows by `nextBillingAt` to see the next charges. Sorting changes no monitor state. Join each row with its owner and campaign end date. Pause expired campaigns through the update route. Exclude paused monitors from the active cost total. Keep deleted monitors outside the current inventory. Keep separate history when compliance or support needs older events. Rebuild the report after every create, update, pause, resume, or delete. Compare complete snapshots by monitor ID. Report new, reactivated, paused, and removed queries separately. One total count would hide those state changes. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Maximum items per page, from 1 to 10,000. Default 200. | | `cursor` | `string` | No | `nextCursor` from the previous page. The `after` alias also works. Offset pagination is not supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `monitors` | `object[]` | Array of keyword monitor objects. | | `monitors[].id` | `string` | Unique keyword monitor ID. | | `monitors[].query` | `string` | Normalized X (Twitter) search query. | | `monitors[].eventTypes` | `string[]` | Subscribed event types. | | `monitors[].isActive` | `boolean` | Whether the monitor is active. | | `monitors[].createdAt` | `string` | ISO 8601 creation timestamp. | | `monitors[].nextBillingAt` | `string` | Next hourly credit charge time for active monitor billing. | | `total` | `number` | Keyword monitors on this page. | | `hasMore` | `boolean` | Whether more rows follow this page. | | `nextCursor` | `string` | Pass it as `cursor` for the next page. Present when `hasMore` is `true`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "monitors": [ { "id": "21", "query": "xquik OR \"x api\"", "eventTypes": ["tweet.new"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T11:30:00.000Z" } ], "total": 1, "hasMore": false } ``` ### 400 Invalid cursor `{ "error": "invalid_input", "message": "Cursor invalid. Use nextCursor from the previous page, or omit it to start over." }` The `cursor` is not one this list returned. Send the `nextCursor` of the previous page, or omit it. ### 401 Unauthenticated Missing or invalid API key. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > Returns up to 10,000 keyword monitors per page. Pass `nextCursor` as `cursor` for the next page. > [!NOTE] > > **Related.** > > * [Create Keyword Monitor](/api-reference/monitors/create-keyword) to add a query. > * [Get Keyword Monitor](/api-reference/monitors/get-keyword) to fetch one monitor. > * [Update Keyword Monitor](/api-reference/monitors/update-keyword) to pause or edit it. > * [Delete Keyword Monitor](/api-reference/monitors/delete-keyword) to remove it. > * [List Events](/api-reference/events/list) and [Get Event](/api-reference/events/get) to audit events. > * [List Webhooks](/api-reference/webhooks/list) and [List Deliveries](/api-reference/webhooks/deliveries) to audit delivery evidence. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List tweet monitors & metrics, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/list-posts List up to 10,000 post monitors a page with each post, author, event types, active state & 6 metrics with gains since tracking began. Listing monitors is free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/monitors/posts` List every post monitor on your account. Each row holds the post, its author, its event types & its 6 metrics. Each metric shows its current value & its gain since tracking began. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/monitors/posts?limit=50" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq -c '.monitors[] | { post_monitor_id: .id, post_url: .postUrl, author_username: .authorUsername, is_active: .isActive, paused_reason: (.pausedReason // null), likes: .metrics.likes.current, like_gain: .metrics.likes.gain }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/monitors/posts?limit=50", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const page = await response.json(); for (const monitor of page.monitors) { const row = { post_monitor_id: monitor.id, post_url: monitor.postUrl, author_username: monitor.authorUsername, is_active: monitor.isActive, paused_reason: monitor.pausedReason ?? null, likes: monitor.metrics.likes.current, like_gain: monitor.metrics.likes.gain, }; process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/monitors/posts", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"limit": 50}, ) page = response.json() for monitor in page["monitors"]: row = { "post_monitor_id": monitor["id"], "post_url": monitor["postUrl"], "author_username": monitor["authorUsername"], "is_active": monitor["isActive"], "paused_reason": monitor.get("pausedReason"), "likes": monitor["metrics"]["likes"]["current"], "like_gain": monitor["metrics"]["likes"]["gain"], } print(json.dumps(row)) ``` Each example prints 1 row per monitor. Pass `nextCursor` as `cursor` until `hasMore` is `false`. ## Review every tracked post | Question | Field | Next step | | - | - | - | | Which post is this? | `postUrl` & `authorUsername` | Open the post before you change the monitor. | | Is it still billing? | `isActive` & `nextBillingAt` | Pause monitors nobody reads. | | Did Xquik pause it? | `pausedReason` | Add credits, or delete monitors of deleted posts. | | How far has engagement moved? | `metrics.*.gain` | Read hourly gains for the trend. | A monitor paused with `insufficient_credits` resumes once you add credits & turn it on. `x_post_deleted`, `x_post_protected` & `x_post_unavailable` mean X stopped showing the post. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Monitors per page, from 1 to 10,000. Default `200`. | | `cursor` | `string` | No | The previous page's `nextCursor`. The `after` alias also works. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `monitors` | `object[]` | Post monitors, each shaped like the [Get Post Monitor](/api-reference/monitors/get-post) response. | | `total` | `number` | Post monitors on this page. | | `hasMore` | `boolean` | `true` when another page exists. | | `nextCursor` | `string` | Cursor for the next page. Present when `hasMore` is `true`. | ### 400 Invalid input `limit` or `cursor` is invalid. Send a `nextCursor` value unchanged. ### 401 Unauthenticated Missing or invalid API key. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Create Post Monitor](/api-reference/monitors/create-post), [Get Post Monitor](/api-reference/monitors/get-post), [Post Monitor Metrics](/api-reference/monitors/post-metrics), or [List Events](/api-reference/events/list). ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "monitors": [], "total": 0, "hasMore": false } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Hourly tweet monitor metrics, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/post-metrics Get hourly views, likes, retweets, replies, quotes & bookmarks for 1 monitored X post. Each hour shows its closing value & gain. Read 1 to 17,520 hours free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/monitors/posts/{id}/metrics` Read a monitored post's metrics hour by hour. Each bucket holds every metric's value at the hour's end. It also holds each metric's gain over that hour. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/monitors/posts/31/metrics?hours=24" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq -c '.buckets[] | { hour: .at, views: .metrics.views.value, view_gain: .metrics.views.gain, likes: .metrics.likes.value, like_gain: .metrics.likes.gain }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const monitorId = "31"; const response = await fetch( `https://xquik.com/api/v1/monitors/posts/${monitorId}/metrics?hours=24`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" } }, ); const history = await response.json(); for (const bucket of history.buckets) { const row = { hour: bucket.at, views: bucket.metrics.views.value, view_gain: bucket.metrics.views.gain, likes: bucket.metrics.likes.value, like_gain: bucket.metrics.likes.gain, }; process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests monitor_id = "31" response = requests.get( f"https://xquik.com/api/v1/monitors/posts/{monitor_id}/metrics", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"hours": 24}, ) history = response.json() for bucket in history["buckets"]: row = { "hour": bucket["at"], "views": bucket["metrics"]["views"]["value"], "view_gain": bucket["metrics"]["views"]["gain"], "likes": bucket["metrics"]["likes"]["value"], "like_gain": bucket["metrics"]["likes"]["gain"], } print(json.dumps(row)) ``` ## How do I chart a tweet's engagement over time? Buckets come oldest first, 1 per hour. The last bucket is the current hour, so its values keep moving. Hours before tracking began carry the starting values with a gain of `0`. Xquik keeps 730 days of history, which matches the 17,520-hour limit. Sum the gains for a period's total. Use the last bucket's value for the current count. A value & its gain are `null` when X shows no count. Views on old posts are one example. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The post monitor ID. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `hours` | `integer` | No | Hours to return, from 1 to 17,520. Default `12`. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `hours` | `integer` | Number of hours returned. | | `buckets` | `object[]` | Hourly buckets, oldest first. | | `buckets[].at` | `string` | ISO 8601 start of the hour. | | `buckets[].metrics` | `object` | `views`, `likes`, `retweets`, `replies`, `quotes` & `bookmarks`. Each holds `value` at the hour's end & `gain` over that hour. | ### 400 Invalid input `hours` is not a whole number from 1 to 17,520. ### 401 Unauthenticated Missing or invalid API key. ### 404 Not found No post monitor has this ID on your account. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Get Post Monitor](/api-reference/monitors/get-post), [List Post Monitors](/api-reference/monitors/list-posts), or [List Events](/api-reference/events/list). ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "hours": 1, "buckets": [ { "at": "2026-10-22T11:00:00.000Z", "metrics": { "views": { "value": 541600, "gain": 500 }, "likes": { "value": 1890, "gain": 5 }, "retweets": { "value": 112, "gain": 0 }, "replies": { "value": 86, "gain": 1 }, "quotes": { "value": 87, "gain": 0 } } } ] } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Account monitor status, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/twitter-account-monitor-status Check one Twitter account activity tracker for its X profile, post, profile and follower event filters, alert state, billing, events, and webhook deliveries. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/monitors/{id}` ## Check one Twitter account activity tracker Use this route for one Twitter account activity tracker status check. It returns the tracked X profile, selected event types, active state, and billing timing. Use update to change event filters or pause the monitor. Use list for the complete monitor inventory. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET https://xquik.com/api/v1/monitors/7 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '{ monitor_id: .id, username: .username, x_user_id: .xUserId, event_types: .eventTypes, is_active: .isActive, created_at: .createdAt, next_billing_at: .nextBillingAt, update_endpoint: ("/api/v1/monitors/" + .id), events_endpoint: ("/api/v1/events?monitorId=" + .id), event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries" }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const monitorId = "7"; const response = await fetch(`https://xquik.com/api/v1/monitors/${monitorId}`, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const monitor = await response.json(); const monitorState = { monitor_id: monitor.id, username: monitor.username, x_user_id: monitor.xUserId, event_types: monitor.eventTypes, is_active: monitor.isActive, created_at: monitor.createdAt, next_billing_at: monitor.nextBillingAt, update_endpoint: `/api/v1/monitors/${monitor.id}`, events_endpoint: `/api/v1/events?monitorId=${monitor.id}`, event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries", }; process.stdout.write(`${JSON.stringify(monitorState)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests monitor_id = "7" response = requests.get( f"https://xquik.com/api/v1/monitors/{monitor_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) monitor = response.json() monitor_state = { "monitor_id": monitor["id"], "username": monitor["username"], "x_user_id": monitor["xUserId"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "created_at": monitor["createdAt"], "next_billing_at": monitor["nextBillingAt"], "update_endpoint": f"/api/v1/monitors/{monitor['id']}", "events_endpoint": f"/api/v1/events?monitorId={monitor['id']}", "event_detail_endpoint_pattern": "/api/v1/events/{event_id}", "webhooks_endpoint": "/api/v1/webhooks", "deliveries_endpoint_pattern": "/api/v1/webhooks/{webhook_id}/deliveries", } print(json.dumps(monitor_state)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" "os" ) type Monitor struct { ID string `json:"id"` Username string `json:"username"` XUserID string `json:"xUserId"` EventTypes []string `json:"eventTypes"` IsActive bool `json:"isActive"` CreatedAt string `json:"createdAt"` NextBillingAt string `json:"nextBillingAt"` } type MonitorState struct { DeliveriesEndpointPattern string `json:"deliveries_endpoint_pattern"` EventDetailEndpointPattern string `json:"event_detail_endpoint_pattern"` EventsEndpoint string `json:"events_endpoint"` EventTypes []string `json:"event_types"` CreatedAt string `json:"created_at"` IsActive bool `json:"is_active"` MonitorID string `json:"monitor_id"` NextBillingAt string `json:"next_billing_at"` UpdateEndpoint string `json:"update_endpoint"` Username string `json:"username"` WebhooksEndpoint string `json:"webhooks_endpoint"` XUserID string `json:"x_user_id"` } func main() { monitorID := "7" req, err := http.NewRequest("GET", "https://xquik.com/api/v1/monitors/"+monitorID, nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var monitor Monitor if err := json.NewDecoder(resp.Body).Decode(&monitor); err != nil { log.Fatal(err) } state := MonitorState{ DeliveriesEndpointPattern: "/api/v1/webhooks/{webhook_id}/deliveries", EventDetailEndpointPattern: "/api/v1/events/{event_id}", EventsEndpoint: "/api/v1/events?monitorId=" + monitor.ID, EventTypes: monitor.EventTypes, CreatedAt: monitor.CreatedAt, IsActive: monitor.IsActive, MonitorID: monitor.ID, NextBillingAt: monitor.NextBillingAt, UpdateEndpoint: "/api/v1/monitors/" + monitor.ID, Username: monitor.Username, WebhooksEndpoint: "/api/v1/webhooks", XUserID: monitor.XUserID, } if err := json.NewEncoder(os.Stdout).Encode(state); err != nil { log.Fatal(err) } } ``` The Node.js, Python, and Go examples produce one normalized monitor snapshot. Store `monitor_id`, `event_types`, `is_active`, `next_billing_at`, `update_endpoint`, `events_endpoint`, `event_detail_endpoint_pattern`, `webhooks_endpoint`, and `deliveries_endpoint_pattern` before changing filters. Do the same before pausing alerts or reconciling webhooks. ## State handoff Use `GET /monitors/{id}` before changing routing, billing checks, or alert state for one account monitor. The endpoint returns the current stored monitor for your account only. Deleted or cross-account IDs return `404`. | Account monitor status column | Response source | Decision rule | | - | - | - | | Monitor ID | `id` | Use this ID for updates, events, and deletion. | | X username | `username` | Confirm the intended tracked profile. | | X user ID | `xUserId` | Use this stable ID for account verification. | | Event filter | `eventTypes` | Align webhook subscriptions before enabling alerts. | | Polling state | `isActive` | Decide whether checks and billing should continue. | | Creation time | `createdAt` | Record when Xquik created the monitor. | | Billing checkpoint | `nextBillingAt` | Review credits before the next active charge. | > [card] Tracked account > > Treat `username` and `xUserId` as the resolved X account identity. Store > both with your CRM, warehouse, or queue records. > [card] Current filter > > `eventTypes` decides which changes match. Copy those event > types into webhook subscriptions before relying on signed alerts. > [card] Active state > > Use `isActive` to decide whether the monitor should poll and bill. Use > [Update Monitor](/api-reference/monitors/update) to pause or resume it. > [card] Event join > > Use `id` as `monitorId` with [List Events](/api-reference/events/list). Then > reconcile stored events and webhook deliveries for this account. > [card] Event detail > > Use event IDs returned by [List Events](/api-reference/events/list) with > [Get Event](/api-reference/events/get). Do this when a support, audit, or > agent workflow needs the full tweet payload. > [card] Webhook alignment > > Use [List Webhooks](/api-reference/webhooks/list) to compare webhook > `eventTypes` with this monitor. Do this before relying on signed alerts. > [card] Delivery audit > > Use [List Deliveries](/api-reference/webhooks/deliveries) for each webhook > and join delivery `streamEventId` to event IDs. Do not use `x_event_id` as > the delivery join key. ## What does Twitter account activity tracker status prove? The response proves which X profile one monitor targets. Confirm both `username` and `xUserId`. Keep the X (Twitter) user ID. It stays the same when a username changes. `eventTypes` lists the changes the monitor matches now. Tweet filters include new posts, replies, quotes, reposts, media, links, and polls. Additional filters detect mentions, hashtags, and long-form posts. Profile filters cover avatar, banner, name, username, biography, location, and URL. They also cover verification, protection, pinned tweets, and account availability. Activity filters cover deleted posts, live videos, and Spaces. The response returns only the selected filters. Follow filters report each account the profile follows or unfollows. Follower filters report new and lost followers. Each event holds the other account's profile when X shows one. Count filters report moves in the follower and following counts. See [follower events](/api-reference/monitors/create#which-twitter-account-activity-can-trigger-alerts) for each payload. Read `isActive` as the polling state. Active monitors capture selected future account changes. Pausing retains the profile and filters while disabling future monitoring. Read `nextBillingAt` as the next scheduled charge. It does not prove that an event or webhook delivery succeeded. ## How do I check whether Twitter account activity alerts are active? Check the monitor before diagnosing a missing alert. A working account alert needs 4 checks to pass. | Alert layer | Status check | Required evidence | | - | - | - | | Tracked profile | `username` and `xUserId` | Both identify the intended X account. | | Event filter | `eventTypes` | The expected event type is selected. | | Polling | `isActive` | The monitor was active during the expected change. | | Delivery | Events and webhook deliveries | A stored event exists and the receiver accepted its delivery. | First, confirm the tracked profile. Next, find the expected type in `eventTypes`. Then verify `isActive`. Query [List Events](/api-reference/events/list) with this monitor ID. Finally, join the stored event to [webhook deliveries](/api-reference/webhooks/deliveries) through `streamEventId`. An active flag alone does not prove the alert works. The monitor may poll correctly while a webhook fails. A webhook may also work while the monitor omits the expected event type. Check configuration, events, and deliveries separately. ## How do I track mentions and replies for one account? Confirm that `eventTypes` contains `tweet.mention` for mentions. For reply alerts, require the `tweet.reply` event type. Configure either event type independently or enable both together. The status route shows the stored selection. It does not return the matching tweets. Use [List Events](/api-reference/events/list) with `monitorId` after confirming the filters. Filter stored events by the required type and time window. Open the complete record through [Get Event](/api-reference/events/get). The response contains the matched tweet payload. Add any missing filter before monitoring future alerts. Resume a paused monitor when the filter already exists. If both checks pass, trace the stored event and its webhook delivery. Never infer missing tweet activity from one failed receiver attempt. ## Does this endpoint return account analytics or historical reports? No. This endpoint returns one monitor configuration. It does not calculate engagement rate, follower growth, posting frequency, reach, impressions, or sentiment. It also does not backfill a native X (Twitter) analytics report. Monitor event history begins after monitor creation. [List Events](/api-reference/events/list) returns cursor-based pages of stored event records. Call [X user tweets](/api-reference/x/user-tweets) when an audit requires recent profile posts. Use an extraction job for follower CSV exports. Keep these outputs separate. A monitor status snapshot shows configuration. An event record proves one matched change. A delivery record proves one webhook delivery attempt. A follower export records a dated follower list. None of those outputs is an engagement analytics dashboard. ## How do Twitter analytics tools differ from monitor status? Twitter analytics tools usually calculate performance from posts and account metrics. They may summarize likes, replies, reposts, views, or follower changes. Those values are engagement metrics. This endpoint reports the saved profile, filters, and polling status. The response describes one saved monitor. It identifies the tracked account and selected event filters. It also reports whether monitoring continues. The response never calculates reach, impressions, engagement rates, or audience growth. Check monitor status before investigating account activity. First, confirm the stable `xUserId`. Then inspect `eventTypes` and `isActive`. These fields prove whether Xquik could capture the expected change. They do not prove that the change occurred. Use [List Events](/api-reference/events/list) to find changes captured by the monitor. Open each event before making an activity claim. Use [webhook deliveries](/api-reference/webhooks/deliveries) to verify receiver attempts. None of these steps produce an analytics report. Do not compare an empty event list with a complete analytics report. Event history begins when the monitor captures a selected change. Paused monitors do not capture additional account events. Omitted filters cannot produce corresponding event records. Record both conditions before drawing activity conclusions. ## What should a Twitter account activity audit store? Start an audit with the monitor response. Store `id`, `username`, and `xUserId`. Add `eventTypes`, `isActive`, `createdAt`, and `nextBillingAt`. Together, these fields form one monitor snapshot. Record the request timestamp beside the response. The endpoint returns monitor creation time, not the audit observation time. Keep the HTTP status and monitor ID with that entry. Record the intended event beside the stored filters. For a reply alert, record the `tweet.reply` type. For a profile-name change, record `profile.name.changed`. This comparison shows whether the required filter existed during the review. When an event exists, store its event ID and `monitorId`. Open the event and confirm its type. Then connect delivery `streamEventId` values to that event ID. Store each `deliveryId` and delivery status. With these IDs, you can tell a missing event from a failed receiver. Repeat the status request after each approved update. Compare the account, filters, polling status, and next scheduled charge. Keep both snapshots with the approved change ticket. Reject the update when `xUserId` changes. A `404` means the monitor does not exist or belongs to another account. Never infer previous monitor states from that response. Before continuing, confirm the authenticated account and monitor ID. Treat `429` as a temporary request limit. Read the response `Retry-After` header and pause for the supplied duration before retrying. Do not change the audit conclusion. ## Approve one account monitor change Fetch the monitor just before an approved update. Store its monitor ID, username, and stable X (Twitter) user ID. Add event types, active state, and billing schedule. Compare later snapshots against this one. Confirm the target profile first. Usernames can change. The stable `xUserId` prevents a renamed profile from looking like another account. Stop when the requested profile does not match the stored target. Review existing and proposed `eventTypes` together. List every added and removed account event. Check whether existing webhooks accept the proposed types. Update webhook subscriptions before relying on new alerts. Read `isActive` separately from event configuration. A pause keeps the target and event types. A resume restarts polling with the stored event types. Record the previous state before toggling it. After the update, fetch the same monitor ID again. Compare its target, event types, active state, and `nextBillingAt`. Keep both snapshots with the approved change ticket. The 2 snapshots show what changed. ## Trace one missing profile alert Start with the monitor ID from the affected workflow. Confirm its username and stable X (Twitter) user ID. Then verify the expected event type exists. Check `isActive` during the missing-alert window. A paused monitor does not create future account events. Check `nextBillingAt` and available credits when monitoring should continue. Query stored events with `monitorId`. Separate an absent event from an absent webhook delivery. Open the matching event before inspecting receiver attempts. For delivery review, join the event ID with delivery `streamEventId`. Keep `deliveryId` as the delivery identity. Do not join through an X Tweet ID. Record one diagnosis outcome. The monitor may target the wrong profile. It may omit the event type or remain paused. It may lack a stored event. The webhook delivery may fail. Those outcomes require different fixes. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique monitor ID. Returned when you [create a monitor](/api-reference/monitors/create) or [list monitors](/api-reference/monitors/list). | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | Unique monitor ID. | | `username` | `string` | Normalized X (Twitter) username. | | `xUserId` | `string` | Resolved X (Twitter) user ID. | | `eventTypes` | `string[]` | Subscribed event types. | | `isActive` | `boolean` | Indicates whether monitoring continues. | | `createdAt` | `string` | Creation time in ISO 8601 format. | | `nextBillingAt` | `string` | Next hourly credit charge time for active monitor billing. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "7", "username": "elonmusk", "xUserId": "44196397", "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T11:30:00.000Z" } ``` ### 400 Invalid ID `{ "error": "invalid_id", "message": "Invalid ID format." }` The provided monitor ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 404 Not found `{ "error": "not_found", "message": "Monitor not found" }` No monitor exists with this ID, or it belongs to a different account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** > > * [List Monitors](/api-reference/monitors/list) to see all monitors. > * [List Events](/api-reference/events/list) to audit stored events. > * [List Deliveries](/api-reference/webhooks/deliveries) to audit webhook delivery status. > * [Update Monitor](/api-reference/monitors/update) to change event types or toggle active status. > * [Delete Monitor](/api-reference/monitors/delete-twitter-account-monitor) to remove this monitor. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Update an account monitor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/update Update Twitter account alert settings by replacing all event filters or pausing and resuming a monitor. Returns 409 if the X account is gone or private. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/monitors/{id}` **Free.** This endpoint does not consume credits. Set Twitter alerts for one saved X (Twitter) profile. This route replaces the event filters. It can also pause or resume the same monitor. The response shows the updated account and event filter. This route cannot change profile, keyword query, webhook URL, alert threshold, or sentiment rule. Manage webhook delivery separately. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/monitors/7 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true }' | jq -c '{ monitor_id: .id, username, x_user_id: .xUserId, event_types: .eventTypes, is_active: .isActive, created_at: .createdAt, next_billing_at: .nextBillingAt, verify_endpoint: ("/api/v1/monitors/" + .id), list_endpoint: "/api/v1/monitors", events_endpoint: ("/api/v1/events?monitorId=" + .id), event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries" }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const monitorId = "7"; const response = await fetch(`https://xquik.com/api/v1/monitors/${monitorId}`, { method: "PATCH", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ eventTypes: ["tweet.new", "tweet.reply"], isActive: true, }), }); const monitor = await response.json(); const monitorState = { monitor_id: monitor.id, username: monitor.username, x_user_id: monitor.xUserId, event_types: monitor.eventTypes, is_active: monitor.isActive, created_at: monitor.createdAt, next_billing_at: monitor.nextBillingAt, verify_endpoint: `/api/v1/monitors/${monitor.id}`, list_endpoint: "/api/v1/monitors", events_endpoint: `/api/v1/events?monitorId=${monitor.id}`, event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries", }; process.stdout.write(`${JSON.stringify(monitorState)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests monitor_id = "7" response = requests.patch( f"https://xquik.com/api/v1/monitors/{monitor_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "eventTypes": ["tweet.new", "tweet.reply"], "isActive": True, }, ) monitor = response.json() monitor_state = { "monitor_id": monitor["id"], "username": monitor["username"], "x_user_id": monitor["xUserId"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "created_at": monitor["createdAt"], "next_billing_at": monitor["nextBillingAt"], "verify_endpoint": f"/api/v1/monitors/{monitor['id']}", "list_endpoint": "/api/v1/monitors", "events_endpoint": f"/api/v1/events?monitorId={monitor['id']}", "event_detail_endpoint_pattern": "/api/v1/events/{event_id}", "webhooks_endpoint": "/api/v1/webhooks", "deliveries_endpoint_pattern": "/api/v1/webhooks/{webhook_id}/deliveries", } print(json.dumps(monitor_state)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "log" "net/http" "os" ) type Monitor struct { ID string `json:"id"` Username string `json:"username"` XUserID string `json:"xUserId"` EventTypes []string `json:"eventTypes"` IsActive bool `json:"isActive"` CreatedAt string `json:"createdAt"` NextBillingAt string `json:"nextBillingAt"` } type MonitorState struct { DeliveriesEndpointPattern string `json:"deliveries_endpoint_pattern"` EventDetailEndpointPattern string `json:"event_detail_endpoint_pattern"` EventsEndpoint string `json:"events_endpoint"` EventTypes []string `json:"event_types"` CreatedAt string `json:"created_at"` IsActive bool `json:"is_active"` ListEndpoint string `json:"list_endpoint"` MonitorID string `json:"monitor_id"` NextBillingAt string `json:"next_billing_at"` Username string `json:"username"` VerifyEndpoint string `json:"verify_endpoint"` WebhooksEndpoint string `json:"webhooks_endpoint"` XUserID string `json:"x_user_id"` } func main() { body, _ := json.Marshal(map[string]interface{}{ "eventTypes": []string{"tweet.new", "tweet.reply"}, "isActive": true, }) monitorID := "7" req, err := http.NewRequest("PATCH", "https://xquik.com/api/v1/monitors/"+monitorID, bytes.NewReader(body)) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var monitor Monitor if err := json.NewDecoder(resp.Body).Decode(&monitor); err != nil { log.Fatal(err) } state := MonitorState{ DeliveriesEndpointPattern: "/api/v1/webhooks/{webhook_id}/deliveries", EventDetailEndpointPattern: "/api/v1/events/{event_id}", EventsEndpoint: "/api/v1/events?monitorId=" + monitor.ID, EventTypes: monitor.EventTypes, CreatedAt: monitor.CreatedAt, IsActive: monitor.IsActive, ListEndpoint: "/api/v1/monitors", MonitorID: monitor.ID, NextBillingAt: monitor.NextBillingAt, Username: monitor.Username, VerifyEndpoint: "/api/v1/monitors/" + monitor.ID, WebhooksEndpoint: "/api/v1/webhooks", XUserID: monitor.XUserID, } if err := json.NewEncoder(os.Stdout).Encode(state); err != nil { log.Fatal(err) } } ``` The Node.js, Python, and Go examples print one reusable monitor record. Store `monitor_id`, `event_types`, `is_active`, `next_billing_at`, `verify_endpoint`, `list_endpoint`, `events_endpoint`, `event_detail_endpoint_pattern`, `webhooks_endpoint`, and `deliveries_endpoint_pattern`. Do this before resuming alerts or webhook checks. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique monitor ID. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body At least 1 field is required. | Body parameter | Type | Required | Description | | - | - | - | - | | `eventTypes` | `string[]` | No | Updated array of event types. Must contain at least 1 valid account monitor type. Valid types are `tweet.new`, `tweet.quote`, `tweet.reply`, `tweet.retweet`, `tweet.media`, `tweet.link`, `tweet.poll`, `tweet.mention`, `tweet.hashtag`, `tweet.longform`. Valid types are also `profile.avatar.changed`, `profile.banner.changed`, `profile.name.changed`, `profile.username.changed`, `profile.bio.changed`, `profile.location.changed`, `profile.url.changed`, `profile.verified.changed`, `profile.protected.changed`, `profile.pinned_tweet.changed`. Valid types are also `profile.unavailable.changed`, `tweet.deleted`, `broadcast.started`, `space.started`, `following.added`, `following.removed`, `follower.added`, `follower.removed`, `profile.followers.changed`, `profile.following.changed`. | | `name` | `string \| null` | No | New label for the monitor, 1 to 80 characters. Send `null` to remove the label. The next event carries the new `monitorName`. | | `isActive` | `boolean` | No | Set to `false` to pause monitoring, or `true` to resume. Paused account monitors do not consume hourly monitor credits. A resumed monitor starts from the moment it resumes. It sends no event for a post made while it was paused. | ## How to set Twitter alerts for an existing account monitor Read the monitor before changing its Twitter alert settings. Save its `id`, `username`, `xUserId`, `eventTypes`, `isActive`, and `nextBillingAt`. Send the complete `eventTypes` array when coverage changes. The new array replaces every existing event type. Omit it when only `isActive` changes. If the account is gone or private, the API returns `409 monitor_profile_unavailable`. Retry once it is back and public. Finally, compare the returned account, filter, and active state with the approved request. ## Which Twitter alert settings can this endpoint change? | Alert setting | PATCH behavior | Correct route when PATCH does not apply | | - | - | - | | Event filters | Replace `eventTypes` with the complete desired array. | Use this route. | | Monitoring state | Set `isActive` to pause or resume checks. | Use this route. | | Tracked X profile | Cannot change `username` or `xUserId`. | Delete this monitor and [create another account monitor](/api-reference/monitors/create). | | Keyword, hashtag, or product query | Cannot change an account monitor into a keyword monitor. | Create or [update a keyword monitor](/api-reference/monitors/update-keyword). | | Webhook destination | Cannot change an HTTPS receiver or delivery state. | [Update the webhook](/api-reference/webhooks/update). | | Delivery channels | Cannot send Slack, CRM, email, or queue messages directly. | Process a signed webhook in your integration. | | Volume or sentiment rules | This route has no threshold or sentiment field. | Evaluate stored events in your workflow. | Account filters select future events. Your webhook receiver can notify Slack, update a CRM record, or queue work. ## How do Twitter account alert settings work in this Twitter monitoring tool? Twitter account alert settings choose the captured changes. Authenticate with an API key or bearer token. To receive notifications, subscribe a webhook to the same event types. Webhook notification settings choose the HTTPS receiver. They do not change the Twitter account or event filter. Use keyword alerts for brand mentions, hashtags, products, or campaign phrases. Manage keyword monitoring through [Update Keyword Monitor](/api-reference/monitors/update-keyword). ## How do I send Twitter account alerts to Slack or a CRM? Update the account filter, then compare it with [List Webhooks](/api-reference/webhooks/list). Subscribe the receiver to every required event type. Run [Test Webhook](/api-reference/webhooks/test) before waiting for account activity. Validate each signature, then acknowledge valid requests before slow work. Process slower Slack or CRM work after acknowledgment. [List Events](/api-reference/events/list) confirms event storage. [List Deliveries](/api-reference/webhooks/deliveries) confirms delivery attempts. ## How do I reduce high-volume Twitter alert noise? Select only required events. Select mention and reply events when those interactions matter. Add repost, quote, media, or link events only when your workflow uses those payloads. Use a keyword monitor for words, hashtags, products, or campaigns. Account monitor event types do not express Boolean search rules, languages, sensitivity, or sentiment. Keep webhook subscriptions aligned. Join delivery attempts to stored events with `streamEventId`. ## Update handoff Use this endpoint to change event scope. You can also pause or resume an account alert without creating another monitor ID. | Account monitor update column | Request or response source | Verification rule | | - | - | - | | Monitor ID | Path `{id}` and response `id` | Require both IDs to match. | | Event filter | `eventTypes` in the request and response | Match every event type. | | Polling state | `isActive` in the request and response | Match the pause or resume choice. | | X username | Response `username` | Confirm the tracked profile did not change. | | X user ID | Response `xUserId` | Join account records on this ID. It does not change. | | Webhook alignment | `GET /webhooks` | Match subscriptions before you rely on alerts. | > [card] Returned state > > Store returned `id`, `username`, `xUserId`, `eventTypes`, `isActive`, > `createdAt`, and `nextBillingAt`. They are the current account monitor > configuration. > [card] Inventory sync > > After the PATCH, refresh [List Monitors](/api-reference/monitors/list) and > compare > [Get Monitor](/api-reference/monitors/twitter-account-monitor-status) for > the same `id`. Do this before updating queues, CRM records, or support > notes. > [card] Event filter > > `eventTypes` replaces the current filter. Keep [List Webhooks](/api-reference/webhooks/list) > subscriptions aligned with the monitor event types you expect to deliver. > [card] Pause monitoring > > `isActive: false` pauses future account checks, stored events, future webhook > deliveries, and hourly monitor billing. It applies to this monitor. > [card] Resume monitoring > > `isActive: true` resumes checks for matching future account activity. Check > `nextBillingAt`, then run [Test Webhook](/api-reference/webhooks/test) > before relying on production alerts. Posts made during the pause send no > event. Read them with [User Tweets](/api-reference/x/user-tweets) or > [Search Tweets](/api-reference/x/search-tweets). > [card] Account identity > > PATCH cannot change `username` or `xUserId`. Delete this monitor and create > a new account monitor when the tracked account changes. > [card] Downstream join > > After the update, keep using `monitorId` and `username` from > [List Events](/api-reference/events/list). Use them to reconcile stored > events. Use event IDs with [Get Event](/api-reference/events/get) when a > workflow needs the full tweet payload. > [card] Delivery audit > > Use [List Deliveries](/api-reference/webhooks/deliveries) for each webhook > and join delivery `streamEventId` to event IDs. Do not use `x_event_id` as > the delivery join key. ## Change one account monitor Read the current monitor first. Send every approved `eventTypes` value. Use `isActive: false` for a temporary stop. Check credits before sending `true`. Then verify `id`, `username`, `xUserId`, `eventTypes`, and `nextBillingAt`. PATCH changes future monitoring only. It never rewrites stored events or past deliveries. Create another monitor when the tracked profile changes. ## Prepare a reversible account monitor change Record the current ID, username, events, active state, and billing time. Add the approved future values beside them. Send only supported PATCH fields. If verification fails, read the monitor again. Do not send an automatic rollback. Another approved update may already exist. ## Separate pausing, filtering, and deletion Pause when the monitor may resume. Replace `eventTypes` to change future scope. Delete only for permanent removal. Create another monitor for another profile. This does not change past account events. ## Verify the first event after resuming Read the monitor and confirm `isActive: true`. Then inspect the first matching event's type and timestamp. Check deliveries separately. A successful PATCH does not prove delivery. ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | Unique monitor ID. | | `username` | `string` | Normalized X (Twitter) username. | | `xUserId` | `string` | Resolved X (Twitter) user ID. | | `eventTypes` | `string[]` | Updated event types. | | `isActive` | `boolean` | Current active status after update. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `nextBillingAt` | `string` | Next hourly credit charge time for active monitor billing. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "7", "username": "elonmusk", "xUserId": "44196397", "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T11:30:00.000Z" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Empty body, invalid event types, or invalid isActive type" }` Empty body, invalid `eventTypes` values, or invalid `isActive` type. `{ "error": "invalid_id", "message": "Invalid ID format." }` The provided monitor ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 404 Not found `{ "error": "not_found", "message": "Monitor not found" }` No monitor exists with this ID, or it belongs to a different account. ### 409 Profile unavailable The X account is gone or private. Resume the monitor once it is back & public. You can still pause it or change its event filters. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > `isActive: false` pauses future checks, stored events, webhook deliveries, and > hourly monitor billing. It applies to this monitor. `isActive: true` resumes > future checks with the returned `eventTypes`. > [!NOTE] > > **Related.** > > * [List Monitors](/api-reference/monitors/list) to refresh inventory. > * [Get Monitor](/api-reference/monitors/twitter-account-monitor-status) to verify this monitor. > * [List Events](/api-reference/events/list) to audit stored events. > * [Get Event](/api-reference/events/get) to inspect one event. > * [List Webhooks](/api-reference/webhooks/list) to compare subscriptions. > * [List Deliveries](/api-reference/webhooks/deliveries) to audit webhook delivery status. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "monitor_profile_unavailable", "message": "X account is gone or private. Resume once it is back & public." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Update a keyword monitor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/update-keyword Update a keyword monitor's tweet event types or pause and resume it. The X (Twitter) search query stays fixed. The monitor ID and stored events remain usable. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/monitors/keywords/{id}` ## When to update a keyword monitor Use this route to change one keyword monitor's event types or active state. Use get to read one monitor. Use list to see every keyword monitor on the account. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/monitors/keywords/21 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true }' | jq -c '{ keyword_monitor_id: .id, query: .query, event_types: .eventTypes, is_active: .isActive, created_at: .createdAt, next_billing_at: .nextBillingAt, verify_endpoint: "/api/v1/monitors/keywords/\(.id)", delete_endpoint: "/api/v1/monitors/keywords/\(.id)", events_endpoint: "/api/v1/events?keywordMonitorId=\(.id)", event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries" }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const monitorId = "21"; const response = await fetch(`https://xquik.com/api/v1/monitors/keywords/${monitorId}`, { method: "PATCH", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ eventTypes: ["tweet.new", "tweet.reply"], isActive: true, }), }); const monitor = await response.json(); const monitorState = { keyword_monitor_id: monitor.id, query: monitor.query, event_types: monitor.eventTypes, is_active: monitor.isActive, created_at: monitor.createdAt, next_billing_at: monitor.nextBillingAt, verify_endpoint: `/api/v1/monitors/keywords/${monitor.id}`, delete_endpoint: `/api/v1/monitors/keywords/${monitor.id}`, events_endpoint: `/api/v1/events?keywordMonitorId=${monitor.id}`, event_detail_endpoint_pattern: "/api/v1/events/{event_id}", webhooks_endpoint: "/api/v1/webhooks", deliveries_endpoint_pattern: "/api/v1/webhooks/{webhook_id}/deliveries", }; process.stdout.write(`${JSON.stringify(monitorState)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests monitor_id = "21" response = requests.patch( f"https://xquik.com/api/v1/monitors/keywords/{monitor_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={"eventTypes": ["tweet.new", "tweet.reply"], "isActive": True}, ) monitor = response.json() monitor_state = { "keyword_monitor_id": monitor["id"], "query": monitor["query"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "created_at": monitor["createdAt"], "next_billing_at": monitor["nextBillingAt"], "verify_endpoint": f"/api/v1/monitors/keywords/{monitor['id']}", "delete_endpoint": f"/api/v1/monitors/keywords/{monitor['id']}", "events_endpoint": f"/api/v1/events?keywordMonitorId={monitor['id']}", "event_detail_endpoint_pattern": "/api/v1/events/{event_id}", "webhooks_endpoint": "/api/v1/webhooks", "deliveries_endpoint_pattern": "/api/v1/webhooks/{webhook_id}/deliveries", } print(json.dumps(monitor_state)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "log" "net/http" "os" ) type KeywordMonitor struct { ID string `json:"id"` Query string `json:"query"` EventTypes []string `json:"eventTypes"` IsActive bool `json:"isActive"` CreatedAt string `json:"createdAt"` NextBillingAt string `json:"nextBillingAt"` } type KeywordMonitorState struct { KeywordMonitorID string `json:"keyword_monitor_id"` Query string `json:"query"` EventTypes []string `json:"event_types"` IsActive bool `json:"is_active"` CreatedAt string `json:"created_at"` NextBillingAt string `json:"next_billing_at"` VerifyEndpoint string `json:"verify_endpoint"` DeleteEndpoint string `json:"delete_endpoint"` EventsEndpoint string `json:"events_endpoint"` EventDetailEndpointPattern string `json:"event_detail_endpoint_pattern"` WebhooksEndpoint string `json:"webhooks_endpoint"` DeliveriesEndpointPattern string `json:"deliveries_endpoint_pattern"` } func main() { body, _ := json.Marshal(map[string]interface{}{ "eventTypes": []string{"tweet.new", "tweet.reply"}, "isActive": true, }) monitorID := "21" req, err := http.NewRequest( "PATCH", "https://xquik.com/api/v1/monitors/keywords/"+monitorID, bytes.NewReader(body), ) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var monitor KeywordMonitor if err := json.NewDecoder(resp.Body).Decode(&monitor); err != nil { log.Fatal(err) } state := KeywordMonitorState{ KeywordMonitorID: monitor.ID, Query: monitor.Query, EventTypes: monitor.EventTypes, IsActive: monitor.IsActive, CreatedAt: monitor.CreatedAt, NextBillingAt: monitor.NextBillingAt, VerifyEndpoint: "/api/v1/monitors/keywords/" + monitor.ID, DeleteEndpoint: "/api/v1/monitors/keywords/" + monitor.ID, EventsEndpoint: "/api/v1/events?keywordMonitorId=" + monitor.ID, EventDetailEndpointPattern: "/api/v1/events/{event_id}", WebhooksEndpoint: "/api/v1/webhooks", DeliveriesEndpointPattern: "/api/v1/webhooks/{webhook_id}/deliveries", } if err := json.NewEncoder(os.Stdout).Encode(state); err != nil { log.Fatal(err) } } ``` The cURL, Node.js, Python, and Go examples convert the updated keyword monitor. The result is one state row. Store `keyword_monitor_id`, `query`, `event_types`, `is_active`, `next_billing_at`, `verify_endpoint`, `delete_endpoint`, `events_endpoint`, `event_detail_endpoint_pattern`, `webhooks_endpoint`, and `deliveries_endpoint_pattern`. Do this before resuming alerts or webhook checks. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique keyword monitor ID. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body At least 1 field is required. | Body parameter | Type | Required | Description | | - | - | - | - | | `eventTypes` | `string[]` | No | Updated array of event types. Must contain at least 1 valid keyword monitor type. Valid types are `tweet.new`, `tweet.quote`, `tweet.reply`, `tweet.retweet`, `tweet.media`, `tweet.link`, `tweet.poll`, `tweet.mention`, `tweet.hashtag`, `tweet.longform`. | | `name` | `string \| null` | No | New label for the monitor, 1 to 80 characters. Send `null` to remove the label. The next event carries the new `monitorName`. | | `isActive` | `boolean` | No | Set to `false` to pause monitoring, or `true` to resume. Paused keyword monitors do not consume hourly monitor credits. A resumed monitor starts from the moment it resumes. It sends no event for a post made while it was paused. | > [!NOTE] > > You cannot change the monitored `query`. Delete this monitor and create another one to track a different query. ## Update handoff Use this endpoint when a keyword alert changes scope or needs a temporary pause. Also use it when the alert must resume without creating a new monitor ID. | Keyword monitor update column | Request or response source | Verification rule | | - | - | - | | Monitor ID | Path `{id}` and response `id` | Require both IDs to match. | | X search query | Response `query` | Confirm the query did not change. | | Tweet event filter | Request and response `eventTypes` | Confirm the complete replacement filter. | | Polling state | Request and response `isActive` | Confirm the intended pause or resume state. | | Creation time | Response `createdAt` | Keep the original creation timestamp. | | Billing checkpoint | Response `nextBillingAt` | Recalculate the next credit review. | | Webhook alignment | `GET /webhooks` | Match subscriptions before you rely on alerts. | > [card] Returned state > > Store returned `id`, `query`, `eventTypes`, `isActive`, `createdAt`, and > `nextBillingAt`. They are the current keyword monitor configuration. > [card] Event filter > > `eventTypes` replaces the current filter. Keep > [List Webhooks](/api-reference/webhooks/list) subscriptions aligned with the > monitor event types you expect to deliver. > [card] Pause monitoring > > `isActive: false` pauses keyword polling, stored events, future webhook > deliveries, and hourly monitor billing. It applies to this monitor. > [card] Resume monitoring > > `isActive: true` resumes polling for matching future tweets. Check > `nextBillingAt`, then run [Test Webhook](/api-reference/webhooks/test) > before relying on production alerts. Posts made during the pause send no > event. Read them with [Search Tweets](/api-reference/x/search-tweets). > [card] Query change > > PATCH cannot change `query`. Delete this monitor and create a new keyword > monitor. Do this when the X (Twitter) search query changes. > [card] Downstream join > > After the update, keep using `keywordMonitorId` and `query` from > [List Events](/api-reference/events/list). Use them to reconcile stored > events and signed webhook payloads. Use > [Get Event](/api-reference/events/get) for one event's full payload. > [card] Delivery audit > > Use [List Deliveries](/api-reference/webhooks/deliveries) when you must > retain webhook delivery evidence. Join delivery `streamEventId` to event > IDs. Do not use `x_event_id` as the delivery join key. > [card] Delete path > > Use [Delete Keyword Monitor](/api-reference/monitors/delete-keyword) only > when the query should stop permanently. Export event and delivery evidence > first when support or audit workflows need history. ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | Unique keyword monitor ID. | | `query` | `string` | Normalized X (Twitter) search query. | | `eventTypes` | `string[]` | Updated event types. | | `isActive` | `boolean` | Current active status after update. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `nextBillingAt` | `string` | Next hourly credit charge time for active monitor billing. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "21", "query": "xquik api", "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T11:30:00.000Z" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Empty body, invalid event types, or invalid isActive type" }` Empty body, invalid `eventTypes` values, or invalid `isActive` type. `{ "error": "invalid_id", "message": "Invalid ID format." }` The provided monitor ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 404 Not found `{ "error": "not_found", "message": "Monitor not found" }` No keyword monitor exists with this ID, or it belongs to a different account. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** > > * [Get Keyword Monitor](/api-reference/monitors/get-keyword) to verify state. > * [Delete Keyword Monitor](/api-reference/monitors/delete-keyword) to remove it. > * [List Events](/api-reference/events/list) > * [Get Event](/api-reference/events/get) > * [List Webhooks](/api-reference/webhooks/list) > * [List Deliveries](/api-reference/webhooks/deliveries) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Update a tweet monitor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/monitors/update-post Rename a post monitor, change its post event types, or pause & resume it. Resuming reads the post first & answers 409 while X still hides it from public view. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/monitors/posts/{id}` Change a post monitor's label, event types or active state. The tracked post stays the same, so the monitor ID & its history stay usable. **Free.** This endpoint does not consume credits. Active monitors bill 30 credits per hour. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/monitors/posts/31 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "eventTypes": ["post.reply.new", "post.likes.changed"], "isActive": true }' | jq -c '{ post_monitor_id: .id, event_types: .eventTypes, is_active: .isActive, next_billing_at: .nextBillingAt }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const monitorId = "31"; const response = await fetch(`https://xquik.com/api/v1/monitors/posts/${monitorId}`, { method: "PATCH", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ eventTypes: ["post.reply.new", "post.likes.changed"], isActive: true, }), }); const monitor = await response.json(); const state = { post_monitor_id: monitor.id, event_types: monitor.eventTypes, is_active: monitor.isActive, next_billing_at: monitor.nextBillingAt, }; process.stdout.write(`${JSON.stringify(state)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests monitor_id = "31" response = requests.patch( f"https://xquik.com/api/v1/monitors/posts/{monitor_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "eventTypes": ["post.reply.new", "post.likes.changed"], "isActive": True, }, ) monitor = response.json() state = { "post_monitor_id": monitor["id"], "event_types": monitor["eventTypes"], "is_active": monitor["isActive"], "next_billing_at": monitor["nextBillingAt"], } print(json.dumps(state)) ``` ## Pause & resume a post monitor Send `isActive: false` to stop reads, events & hourly billing. The monitor & its history stay. Send `isActive: true` to resume. Xquik reads the post first. While X hides the post, the route answers `409` & changes nothing. The monitor stays paused & costs nothing. A resumed monitor reports nothing from its pause. Its first read sets the new starting point. To track a different post, create a new monitor. Then delete or pause the old one. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The post monitor ID. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body Send at least 1 field. | Body parameter | Type | Required | Description | | - | - | - | - | | `eventTypes` | `string[]` | No | Post event types to send, 1 to 10. Replaces the current list. Valid types are `post.reply.new`, `post.quote.new`, `post.likes.changed`, `post.retweets.changed`, `post.replies.changed`, `post.quotes.changed`, `post.bookmarks.changed`, `post.views.changed`, `post.edited` & `post.deleted`. | | `name` | `string \| null` | No | New label, 1 to 80 characters. Send `null` to remove it. | | `isActive` | `boolean` | No | `false` pauses the monitor. `true` resumes it once X shows the post. | ## Response ### 200 OK Returns the updated monitor, shaped like the [Get Post Monitor](/api-reference/monitors/get-post) response. | Field | Type | Description | | - | - | - | | `id` | `string` | Unique post monitor ID. | | `eventTypes` | `string[]` | Post event types this monitor sends. | | `isActive` | `boolean` | Whether the monitor is active. | | `nextBillingAt` | `string` | Next hourly credit charge time. | | `metrics` | `object` | The 6 metrics, each with `current` & `gain` since tracking began. | ### 400 Invalid input No field to change, or a field is invalid. The message says what to fix. ### 401 Unauthenticated Missing or invalid API key. ### 404 Not found No post monitor has this ID on your account. ### 409 Post unavailable X still hides the post, so the monitor stays paused. `reason` is `deleted`, `protected`, `author_deactivated`, `author_suspended` or `unavailable` when X names it. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. ### 502 X unavailable X failed the read while resuming. Retry after a short wait. ### 503 Busy Xquik is busy right now. Wait for `Retry-After`, then retry. > [!NOTE] > > **Related.** [Get Post Monitor](/api-reference/monitors/get-post), [Delete Post Monitor](/api-reference/monitors/delete-post), [Update Webhook](/api-reference/webhooks/update), or [List Events](/api-reference/events/list). ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "31", "postId": "2102882545427714266", "postUrl": "https://x.com/NASA/status/2102882545427714266", "authorId": "11348282", "authorUsername": "NASA", "authorName": "NASA", "media": [], "text": "Today, Croatia became the 74th nation that has committed to a peaceful and prosperous exploration of space.", "postedAt": "2026-09-23T22:07:23.000Z", "eventTypes": ["post.reply.new"] } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "post_unavailable", "message": "The author deleted this post. Delete this monitor." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Xquik X (Twitter) API docs for REST, SDKs & MCP Source: https://docs.xquik.com/api-reference/overview Use Xquik as an X (Twitter) API alternative. Search tweets, export followers and replies, retrieve profiles, monitor accounts, post tweets, and send webhooks. > For the complete documentation index, see [llms.txt](/llms.txt). [![Play Framer's video on YouTube. Framer builds a tweet ticker with Xquik.](https://img.youtube.com/vi/4UOSpoOoC3Y/maxresdefault.jpg)](https://youtu.be/4UOSpoOoC3Y?t=367) Watch Framer build a tweet ticker with Xquik, from 6:07. Framer posted it on June 16, 2026. Use Xquik as an X (Twitter) API alternative for public reads and automated actions. It works as an X API alternative across REST, SDKs, webhooks, and MCP. The Twitter search API and tweet scraping API search recent and top tweets. The follower scraping API exports follower and following profiles. Use tweet reply scraping for conversations and authors. The Twitter webhook API delivers signed monitor events. You can also post tweets and monitor accounts every second. See [every Xquik feature](/api-reference/features) in 1 list, grouped by theme. > [!NOTE] > > Public reads cover tweets, profiles, followers, replies, timelines, communities, and > lists. They need no connected X account. Every X write requires one. Private reads > also require one. They cover DMs, bookmarks, notifications, home timeline, likes, > likers & mutual followers. See [Connect X account](/api-reference/x-accounts/connect). ## Choose an X (Twitter) API workflow Start with the task you need. * [Search recent or top tweets](/api-reference/x/search-tweets) by query. * [Export tweet replies](/api-reference/x/tweet-replies) with author profiles. * [Export followers](/api-reference/x/followers) with pagination cursors. * [Export following profiles](/api-reference/x/following) for one account. * [Retrieve profiles](/api-reference/x/twitter-profile-lookup) by username or user ID. * [Create account monitors](/api-reference/monitors/create) for new tweets, profile changes, and new or lost followers. * [Create keyword monitors](/api-reference/monitors/create-keyword) for matching tweets. * [Send Twitter webhook events](/api-reference/webhooks/create) to your HTTPS endpoint. The Twitter scraper API returns structured JSON. It covers tweets, profiles, timelines, communities, lists, and media. > [card] [Monitors & events](/api-reference/monitors/create) > > Create account and keyword monitors, retrieve events, and manage webhooks > [card] [Draws & extractions](/api-reference/draws/create) > > Run tweet giveaway draws. Extract tweets, replies, profiles, and followers > [card] [Tweets, profiles & followers](/api-reference/x/twitter-profile-lookup) > > Search tweets, retrieve profiles, export followers, and download media > [card] [X write actions](/api-reference/x-write/create-tweet) > > Post tweets, like, retweet, follow, send DMs, and update profiles > [card] [Account & billing](/api-reference/account/get) > > Manage credits, API keys, drafts, styles, and subscriptions > [card] [Accountless paid reads](/guides/guest-wallets) > > Prepaid guest keys for the eligible paid-read routes > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Popular Twitter scraper API tasks > [card] [Estimate tweet scraping credits](/api-reference/extractions/twitter-scraping-cost-estimator) > > Quote credits before scraping tweets, followers, replies, profiles, or timelines. > [card] [Review Twitter scraping jobs](/api-reference/extractions/twitter-scraping-job-history) > > List past tweet, follower, reply, profile, and timeline extraction jobs. > [card] [Check account monitor status](/api-reference/monitors/twitter-account-monitor-status) > > Inspect one Twitter account monitor's profile, event filters, and active state. > [card] [Stop a Twitter account monitor](/api-reference/monitors/delete-twitter-account-monitor) > > Delete an account monitor and stop its alerts. > [card] [Review Twitter giveaway history](/api-reference/draws/twitter-giveaway-history) > > List past tweet giveaway draws with tweet URLs, statuses, and entry counts. > [card] [Activate an Xquik subscription](/api-reference/account/subscription-checkout) > > Create a hosted checkout for API access and recurring credits. ## X (Twitter) community & audience scraping > [card] [Retrieve X community details](/api-reference/x/community-info) > > Read a community's rules, member count, creator, moderators, and join policy. > [card] [Export X community members](/api-reference/x/community-members) > > Retrieve community member profiles, usernames, verification, and follower counts. > [card] [Export X community moderators](/api-reference/x/community-moderators) > > Retrieve moderator profiles, bios, verification, followers, and following. > [card] [Scrape X community tweets](/api-reference/x/community-tweets) > > Export recent community tweets, authors, replies, reposts, likes, and media. > [card] [Search tweets in one community](/api-reference/x/community-search) > > Filter one community's tweets by keyword, recency, or top results. > [card] [Export a Twitter account's following](/api-reference/x/following) > > Retrieve profiles for every account one Twitter user follows. > [card] [Scrape tweet retweeters & repost users](/api-reference/x/retweeters) > > Retrieve profiles for accounts that retweeted or reposted one tweet. ## Base URL ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} https://xquik.com/api/v1 ``` Xquik serves all endpoints over HTTPS only. Always use the full HTTPS base URL. ## OpenAPI spec Xquik publishes the full API specification as an OpenAPI 3.1 document. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} https://xquik.com/openapi.json ``` Xquik also serves YAML at this URL. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} https://docs.xquik.com/openapi.yaml ``` Use either format with OpenAPI tools or client generators. Xquik publishes the spec through [RFC 9727](https://www.rfc-editor.org/rfc/rfc9727) service discovery. Xquik publishes its [API catalog](https://xquik.com/.well-known/api-catalog) at this URL. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} https://xquik.com/.well-known/api-catalog ``` ## Versioning & deprecation The base URL names the version, v1. Version v1 stays compatible, and new fields can appear at any time. A breaking removal gets at least 90 days of notice. A request with a deprecated query parameter or search filter gets a `Deprecation` header. A `Sunset` header gives the removal date once it is set. Read the [versioning & deprecation policy](/guides/versioning) or its [Markdown copy](https://xquik.com/deprecation-policy.md). ## Run in Postman Fork the official Xquik collection into your Postman workspace. It holds every request you can send with an API key. It groups them by tag, with example responses. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/12709954-5ee4fae0-138a-4615-ae47-ac4be7904df2?action=collection%2Ffork\&source=rip_markdown\&collection-url=entityId%3D12709954-5ee4fae0-138a-4615-ae47-ac4be7904df2%26entityType%3Dcollection%26workspaceId%3Db77ecb6f-d780-4179-968c-95dc06ae28c0) Paste your API key into the collection's `apiKey` variable, then send any request. Browse the [public Postman workspace](https://www.postman.com/xquik-dev/xquik-apis) or the [hosted collection docs](https://documenter.getpostman.com/view/12709954/2sBY4TpxXK). To import it into another tool, use the [collection file](https://xquik.com/xquik.postman_collection.json). ## Authentication Account API keys can use `x-api-key`. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-api-key: xq_your_api_key_here ``` Generate account keys from the [API Keys dashboard](https://dashboard.xquik.com/en/api-keys). Xquik API keys also support `Authorization: Bearer xq_your_api_key_here`. OAuth 2.1 Bearer tokens keep their granted account scopes. Accountless guest keys use `Authorization: Bearer` with the fixed `paid_reads` scope on the [eligible routes](/guides/guest-wallets#eligible-paid-read-routes). A verified payment activates each key. See [Authentication](/api-reference/authentication). ### Machine Payments Protocol Fixed-price GET operations accept anonymous [MPP](/mpp/machine-payments-protocol) payments. The server returns `402` with a `WWW-Authenticate: Payment` challenge. The response can include a guest wallet action. Complete the MPP challenge or ask the user to confirm a guest wallet. A failed request creates no checkout. ### Accountless guest wallets `POST /api/v1/guest-wallets` creates a hosted checkout after the user confirms. It returns a guest key and status URL. It needs no account, email, or dashboard. Verified payment activates paid reads for that key. Anonymous requests to non-MPP paid reads return `401`. It includes a Bearer challenge and a guest wallet action. The direct MPP reads return `402`. It includes a Payment challenge and the same optional action. Neither response creates checkout. See [Accountless guest wallets](/guides/guest-wallets) for creation, polling, top-ups, scope boundaries, and MCP behavior. ## First request Run this request to verify your API key. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s https://xquik.com/api/v1/account \ -H "x-api-key: xq_your_api_key_here" | jq ``` **Response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "plan": "active", "monitorsAllowed": 9007199254740991, "monitorsUsed": 0, "monitorBilling": { "activeDailyEstimate": "0", "activeHourlyBurn": "0", "creditsPerActiveMonitorDay": "720", "creditsPerActiveMonitorHour": "30", "eventsIncluded": true, "instantCheckIntervalSeconds": 1, "unlimitedSlots": true }, "creditInfo": { "balance": "140000", "lifetimePurchased": "140000", "lifetimeUsed": "0", "autoTopupEnabled": false, "autoTopupAmountDollars": 10, "autoTopupThreshold": "50000" } } ``` Replace `xq_your_api_key_here` with your key. If you get `401`, check the `x-api-key` header and the `xq_` prefix. ## Path IDs Post & user parameters in `/x/tweets`, `/x/articles`, `/x/users` & `/x/dm` paths take these forms. | Param | Send | Examples | | - | - | - | | Post `id` or `tweetId` | Post ID or post URL | `2102882545427714266`, `x.com/nasa/status/2102882545427714266` | | User `id` or `userId` | User ID, username or profile URL | `11348282`, `nasa`, `@nasa`, `x.com/nasa`, `x.com/i/user/11348282` | URL-encode a URL in the path, as in `/x/tweets/x.com%2Fnasa%2Fstatus%2F2102882545427714266`. Post URLs work on x.com & twitter.com, with or without `https://`, `www.` or `mobile.`. Queries, fragments, `/i/status/` & `/i/web/status/` links work too. A number is always a user ID. Usernames have up to 15 characters. Writes look up a username's user ID first. An unknown username returns `422 x_target_not_found`. Other input returns `400 invalid_tweet_id` or `400 invalid_user_id`. The message says what to send. ## Production integration Use the [X API integration checklist](/guides/x-api-integration-checklist) before launching a client, workflow, or agent. It covers authentication, pagination, billing, rate limits, and writes that survive retries. ## Rate limits > [card] Read requests > > The read bucket covers `GET`, `HEAD`, and `OPTIONS`. > It allows 500 calls each second. > Standard read throttles return `Retry-After: 1`. > [card] Change requests > > Other methods on Xquik resources share a 6,000 per 60s user bucket. > Throttled changes return `Retry-After` of up to 60. > [card] X action requests > > Actions through a connected X account share a 120 per 60s user bucket. > Throttled X (Twitter) actions return `Retry-After` of up to 60. Exceeding a bucket returns `429 rate_limit_exceeded` with `Retry-After` and a JSON `retryAfter` field. See the [Rate Limits guide](/guides/rate-limits) for backoff implementations. ## Response, error & event contracts Use these references while building production integrations. * [X API integration checklist](/guides/x-api-integration-checklist) covers IDs, timestamps, pagination, normalized responses, and monitor events. * [Error handling](/guides/error-handling) lists error codes and retry actions. * [Monitor events](/api-reference/events/list) documents every event filter. * [Webhook testing](/guides/twitter-webhook-testing) verifies signed deliveries and retries. ## Next steps > [card] [Error handling](/guides/error-handling) > > Handle error codes with retries and fallbacks. > [card] [Rate limits](/guides/rate-limits) > > Read the limits and add backoff. > [card] [Workflows](/guides/workflows) > > End-to-end examples for monitors, events, and webhooks. > [card] [Tweets, profiles & followers](/api-reference/x/twitter-profile-lookup) > > User lookups, tweet search, trends, and media downloads. > [card] [X write actions](/api-reference/x-write/create-tweet) > > Create tweets, likes, retweets, follows, DMs, and profile updates. > [card] [Monitors](/api-reference/monitors/create) > > Check X accounts every second and receive signed webhook events. # Social media monitoring API, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/radar/list Monitor Reddit, GitHub, search trends, technology news, Wikipedia, prediction markets, and startup topics through one social media monitoring API with filters. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/radar` **Free.** This endpoint does not consume credits. Build a social media monitoring feed from ranked public topics. Radar covers Reddit, GitHub, technology news, search trends, Wikipedia, prediction markets, and startup growth. Apply the relevant source, category, region, and time window to each request. Authenticate every Radar request. You need no active subscription. Radar consumes no credits. ## What is a social media monitoring API? A social media monitoring API returns public posts and trends as structured records. Radar exposes those records through one REST API endpoint. Each response uses structured JSON and stable field names. Radar gives every supported public source the same `RadarItem` shape. The `GET /radar` endpoint filters items by source, category, region, and age. The response ranks recent topics. Radar is not an exhaustive source archive. Radar combines several public topic sources. It does not mirror every social network. It also does not return X tweets, replies, followers, or timelines. For X-specific monitoring, [Search Tweets](/api-reference/x/search-tweets) finds brand mentions, hashtags, replies, and keyword matches. Use stable fields to compare titles, regions, timestamps, and scores. You need no separate adapter per source. Keep full social listening data in a dedicated platform API. Radar is not a social listening API for every major social platform. It does not replace platform APIs for unsupported social platforms. Radar returns ranked topics, not complete post, comment, or brand-mention records. Radar provides no keyword search volume or long-term history. Radar includes no more than 168 hours of history. ## Build a trending topics API feed Use Radar as a trending topics API for dashboards, alerts, and research queues. Start with a narrow time window. Apply source and category together or separately. 1. Call `GET /radar` with your API key. 2. Filter one source when the request names a platform. 3. Limit the region when location affects the result. 4. Sort or filter records by `score` in your application. 5. Store each `id` to prevent duplicate dashboard rows. 6. Continue with `nextCursor` while `hasMore` stays `true`. Use `source=reddit` for Reddit posts. Use `source=github` for trending repositories. Other source identifiers work the same way. One request format covers every supported feed. ## Is Radar real-time for monitoring trending topics? Radar returns recently indexed topics. It does not stream every new event. Use `publishedAt` for source timing. Use `createdAt` for indexing timing. Start each scheduled poll without `after`. Use `nextCursor` only for later pages within that poll. The contract guarantees neither cross-poll cursor lifetime nor snapshots. Deduplicate records by `items[].id`. Never use an item ID to order separate polling runs. Respect every `429` rate limit response. Wait before the next poll. Polling tracks recent changes. It promises no delivery deadline. ## Can Radar track brand mentions and sentiment? Radar has no keyword query. Radar does not provide a complete brand monitoring index. Compare returned titles and descriptions against a saved brand dictionary. That comparison covers only the current Radar feed. Radar does not analyze sentiment. The `score` value measures relevance, not sentiment. Do not classify a high score as positive or negative sentiment. Use [Search Tweets](/api-reference/x/search-tweets) to query exact X (Twitter) mentions. Use Radar for ranked cross-source topics. Radar does not cover every brand mention. ## How do you evaluate Radar topic accuracy? Evaluate each item against the source fields. A high trend score does not prove a claim is correct or popular everywhere. 1. Match `source` and `sourceId` to the intended feed. 2. Open `url` when present. Compare its title and description with the item. 3. Compare `publishedAt` with `createdAt` to separate publication from indexing. 4. Confirm `region`, `category`, and `language` match the intended alert. 5. Interpret `metadata` with the source-specific fields documented below. 6. Deduplicate by `id`, then retain the score used for that polling run. Radar does not guarantee complete source coverage or independent fact verification. Review the original source before publishing an alert, report, or customer-facing dashboard entry. ## Integrate Radar into a monitoring dashboard Request one page, validate the response, and render each `RadarItem`. Save the item ID, source, source ID, score, region, and timestamps. Group rows by `source` for a multi-feed dashboard. Rank dashboard rows by the returned `score` value, then filter them by `publishedAt`. Open the returned `url` when present. Use `hasMore` and `nextCursor` for background ingestion. Never construct a cursor. Keep it with matching filters during one pagination run. Changing `source`, `category`, `region`, or `hours` starts a different result set. Choose a searchable news API for exact keyword or domain matching. Use Radar for normalized records from its documented sources only. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Your API key. Xquik also accepts session cookie authentication. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `source` | `string` | No | Filter with one source identifier. Use `reddit` for Reddit, `github` for GitHub, or `trustmrr` for startup growth. Use `hacker_news` for technology news, `google_trends` for search trends, or `wikipedia` for Wikipedia. Or use `polymarket` for prediction markets. Omit this filter to return every available stream. | | `category` | `string` | No | Filter by category. Use `general`, `tech`, `dev`, `science`, `culture`, `politics`, `business`, or `entertainment`. Omit to return all categories. Xquik assigns categories from each source and item. | | `hours` | `integer` | No | Look-back window in hours. Accepts 1-168. Smaller values return the most recent trends. Larger values give a broader snapshot. Default is 6 hours. Default `6`. | | `limit` | `integer` | No | Items per page. Accepts 1-1,000. Use smaller values (10-20) for quick polling, larger values for batch processing. Default is 50. Default `50`. | | `region` | `string` | No | Region filter. Use `US`, `GB`, `TR`, `ES`, `DE`, `FR`, `JP`, `IN`, `BR`, `CA`, `MX`, or `global`. Default `global` returns items from all regions. | | `after` | `string` | No | Cursor for pagination. Pass `nextCursor` from the previous response. Treat cursors as opaque base64 strings. Do not construct them. | | Radar monitoring column | Response source | Queue rule | | - | - | - | | Item ID | `items[].id` | Deduplicate one indexed Radar item. | | Source record | `items[].source` and `items[].sourceId` | Keep the original source and its record ID. | | Topic | `items[].title` | Display the concrete trend or discussion. | | Category | `items[].category` | Route technology, business, culture, or other topics. | | Region | `items[].region` | Keep the market with every queue row. | | Trend score | `items[].score` | Sort higher-scoring items first. | | Published at | `items[].publishedAt` | Measure source freshness. | | Source fields | `items[].metadata` | Interpret the fields documented below for that source. | | Next page | `nextCursor` | Continue only when `hasMore` is `true`. | ## Response | Field | Type | Required | Description | | - | - | - | - | | `items` | `RadarItem[]` | Yes | Array of radar items sorted by score (descending). | | `hasMore` | `boolean` | Yes | Whether more items are available after this page. | | `nextCursor` | `string` | No | Pagination cursor. Present only when `hasMore` is `true`. Pass as the `after` query parameter on the next request. | ### RadarItem fields | Field | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Radar item identifier. | | `title` | `string` | Yes | Item title. | | `description` | `string` | No | Item description. The API omits this field when the source provides no value. | | `url` | `string` | No | Link to the original source. The API omits this field when no link exists. | | `imageUrl` | `string` | No | Source image URL. Startup growth items return the logo here. The API omits this field when no image exists. | | `source` | `string` | Yes | Radar source identifier. Reuse this value in `source` to request the same stream. | | `sourceId` | `string` | Yes | Unique identifier within the source. | | `category` | `string` | Yes | The category is `general`, `tech`, `dev`, `science`, `culture`, `politics`, `business`, or `entertainment`. | | `region` | `string` | Yes | Region code (for example `US`, `TR`, `global`). | | `language` | `string` | Yes | The `language` value uses a BCP-47 code such as `en`, `tr`, or `ja`. The value `und` means the source did not identify a language. | | `score` | `number` | Yes | This 0-10,000 relevance score ranks trending items. Higher values indicate a stronger trend signal within the result set. | | `metadata` | `object` | Yes | Source-specific fields appear here. See the source tables below. | | `publishedAt` | `string` | Yes | This shows when the source published the item or Radar found it. The value follows ISO 8601. | | `createdAt` | `string` | Yes | This records when Radar indexed the item. The value follows ISO 8601. | ## Metadata Use `source` to interpret `metadata`. Multiword fields use camelCase in the default REST response and snake_case through API MCP. ### Reddit Every Reddit item identifies `author`, `subreddit`, and `sourceFormat`. Items include available post content, media, and engagement metrics. Older items can hold fewer fields. | Fields | Description | | - | - | | `author`, `authorId` | Author username and optional Reddit author ID | | `subreddit`, `subredditId`, `subredditSubscribers` | Community name and optional ID. Legacy JSON rows can include subscriber count | | `sourceFormat` | `html`, `json` or `rss` | | `score`, `upvoteRatio` | Reddit's public net score and public upvote ratio | | `estimatedUpvotes`, `estimatedDownvotes` | Estimates derived from score and ratio | | `numberComments`, `totalAwardsReceived` | Available engagement counts | | `selftext`, `contentUrl`, `domain`, `postHint`, `linkFlairText` | Available post text, destination, and labels | | `numberCrossposts`, `viewCount`, `distinguished`, `editedAt`, `galleryImageUrls`, `redditVideo` | Additional fields retained on legacy JSON rows | | `archived`, `contestMode`, `isCrosspostable`, `isMeta`, `isNsfw`, `isOriginalContent`, `isRobotIndexable`, `isSelf`, `isSpoiler`, `isVideo`, `locked`, `stickied` | Post state flags | Reddit does not publish exact upvote and downvote counts. Treat `estimatedUpvotes` and `estimatedDownvotes` as estimates because Reddit may fuzz public score and ratio. `numberComments` is a count. Radar returns no comment bodies. ### Startup growth Startup growth items always include `mrr`, `growthPercent`, `last30Days`, `total`, `customers`, `activeSubscriptions`, and `onSale`. | Fields | Description | | - | - | | `xHandle` | Founder X (Twitter) username without `@` | | `category`, `country`, `foundedDate`, `targetAudience` | Available company details | | `askingPrice`, `multiple`, `paymentProvider` | Available sale and payment details | | `growthMrrPercent`, `profitMarginLast30Days`, `revenuePerVisitor` | Available reported growth and efficiency metrics | | `googleSearchImpressionsLast30Days`, `visitorsLast30Days` | Available 30-day acquisition metrics | | `rank` | Revenue rank reported by the source | Radar orders these items by reported 30-day revenue growth. `metadata.rank` is the revenue rank reported by the source. It does not equal the result position. The top-level `imageUrl` contains the startup logo when available. ### Other sources | Source | Metadata | | - | - | | GitHub (`github`) | Stars added today in `starsToday` | | Technology news (`hacker_news`) | Public points and comment count in `points` and `numberComments` | | Search trends (`google_trends`) | Approximate traffic in `approxTraffic`, its history in `volumes` | | Polymarket (`polymarket`) | Reported 24-hour volume in `volume24hr` | | Wikipedia (`wikipedia`) | Public page views in `views` | ## Examples ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/radar?category=tech&hours=12&limit=10" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/radar?category=tech&hours=12&limit=10", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const { items, hasMore, nextCursor } = await response.json(); for (const item of items) { console.log(`[${item.source}] ${item.title} (score: ${item.score})`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/radar", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"category": "tech", "hours": 12, "limit": 10}, ) data = response.json() for item in data["items"]: print(f"[{item['source']}] {item['title']} (score: {item['score']})") ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} req, _ := http.NewRequest("GET", "https://xquik.com/api/v1/radar?category=tech&hours=12&limit=10", nil) req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var data struct { Items []map[string]interface{} `json:"items"` HasMore bool `json:"hasMore"` NextCursor string `json:"nextCursor"` } json.NewDecoder(resp.Body).Decode(&data) for _, item := range data.Items { fmt.Printf("[%s] %s (score: %.0f)\n", item["source"], item["title"], item["score"]) } ``` **Response.** > [tab] 200 OK > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "items": [ > { > "id": "12345", > "title": "Open-source deployment platform launches preview environments", > "description": "A self-hosted platform adds preview environments and edge functions.", > "url": "https://example.com/radar/items/12345", > "source": "github", > "sourceId": "github_12345", > "category": "dev", > "region": "global", > "language": "en", > "score": 450, > "metadata": { > "starsToday": 450, > "language": "TypeScript" > }, > "publishedAt": "2026-03-04T08:30:00.000Z", > "createdAt": "2026-03-04T08:35:00.000Z" > } > ], > "hasMore": true, > "nextCursor": "NDUwfDIwMjYtMDMtMDRUMDg6MzA6MDAuMDAwWnwxMjM0NQ==" > } > ``` > [tab] 400 Invalid input > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "invalid_input" } > ``` > > Invalid `source` or `category` value. Xquik clips numeric `hours` and `limit` values to the accepted range. Non-numeric values use defaults. > [tab] 401 Unauthenticated > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "unauthenticated" } > ``` > > Missing or invalid API key. Check the `x-api-key` header value. > [tab] 429 Rate limited > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 } > ``` > > Wait for the `Retry-After` value before requesting another Radar page. ## Pagination Radar uses cursor-based pagination. When `hasMore` is `true`, pass `nextCursor` as `after` to fetch the next page. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # First page curl "https://xquik.com/api/v1/radar?limit=20" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq # Next page curl "https://xquik.com/api/v1/radar?limit=20&after=NDUwfDIwMjYtMDMtMDRUMDg6MzA6MDAuMDAwWnwxMjM0NQ==" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} let cursor = undefined; const allItems = []; do { const params = new URLSearchParams({ limit: "20" }); if (cursor) params.set("after", cursor); const data = await fetch(`https://xquik.com/api/v1/radar?${params}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }).then((r) => r.json()); allItems.push(...data.items); cursor = data.hasMore ? data.nextCursor : undefined; } while (cursor); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} all_items = [] cursor = None while True: params = {"limit": 20} if cursor: params["after"] = cursor data = requests.get( "https://xquik.com/api/v1/radar", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params=params, ).json() all_items.extend(data["items"]) if data["hasMore"]: cursor = data["nextCursor"] else: break ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} var allItems []map[string]interface{} cursor := "" for { url := "https://xquik.com/api/v1/radar?limit=20" if cursor != "" { url += "&after=" + cursor } req, _ := http.NewRequest("GET", url, nil) req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, _ := http.DefaultClient.Do(req) var data struct { Items []map[string]interface{} `json:"items"` HasMore bool `json:"hasMore"` NextCursor string `json:"nextCursor"` } json.NewDecoder(resp.Body).Decode(&data) resp.Body.Close() allItems = append(allItems, data.Items...) if !data.HasMore { break } cursor = data.NextCursor } ``` > [!NOTE] > > **Next steps.** > > * [Trends guide](/guides/trends) for content strategy workflows. > * [Create Tweet](/api-reference/x-write/create-tweet) to post about trending topics. > * [Compose](/api-reference/compose/create) to plan and check a draft about a Radar item. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "hasMore": false, "items": [] } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Analyze a tweet writing style, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/styles/analyze Cache recent tweet writing samples for one X (Twitter) username. Reuse fresh profiles, refresh stale samples, and read authors, timestamps, and exact Tweet IDs. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/styles` **Free from cache.** A refresh costs 1 credit per tweet returned. ## Build a reusable tweet writing profile Send one X (Twitter) username. Xquik saves the account's recent posts as writing samples. Each sample keeps its Tweet ID, text, author, and time. This route manages cache creation and refreshes. It does not generate a tone label, vocabulary summary, sentence score, or engagement analysis. Use the returned samples for your approved writing review. Use [Analyze Performance](/api-reference/styles/performance) for current likes, replies, reposts, quotes, bookmarks, and views. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/styles \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "username": "NASA" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/styles", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ username: "NASA" }), }); const result = await response.json(); if (!response.ok) { throw new Error(`${result.error}: ${result.message}`); } const cacheWasRefreshed = response.status === 201; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/styles", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={"username": "NASA"}, timeout=30, ) response.raise_for_status() result = response.json() cache_was_refreshed = response.status_code == 201 ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, err := json.Marshal(map[string]string{"username": "NASA"}) if err != nil { panic(err) } req, err := http.NewRequest( http.MethodPost, "https://xquik.com/api/v1/styles", bytes.NewReader(body), ) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var result map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { panic(err) } if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { panic(fmt.Sprintf("style request failed: %v", result)) } cacheWasRefreshed := resp.StatusCode == http.StatusCreated fmt.Println(cacheWasRefreshed) } ``` ## Understand cached and refreshed responses The HTTP status explains the cache action. Always inspect `fetchedAt` too. | Status | Cache condition | X request | Credit result | | - | - | - | - | | `200` | Profile is under 7 days old | No | Free cached response | | `200` | Profile is older, and credits cannot cover a refresh | No | Existing stale cache returned | | `201` | Profile is missing or older, and credits cover a refresh | Yes | 1 credit per returned Tweet | | `402` | No cache exists, and credits cannot cover a refresh | No | `no_cached_style` returned | A `200` response does not guarantee a recent refresh. Compare `fetchedAt` with your freshness policy before using the samples. The route has no `force` parameter. Repeating POST on a fresh profile returns the same cache without another X request. ## Send a normalized X (Twitter) username Send a non-empty X (Twitter) username without `@`, spaces, or a profile URL. Xquik lowercases the value before lookup and storage. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "username": "NASA" } ``` The request body accepts one field only. | Field | Type | Required | Rule | | - | - | - | - | | `username` | string | Yes | Send the X (Twitter) handle without `@`. | Missing, empty, or non-string values return `400 invalid_input`. Keep the returned `xUsername` value for Get, Compare, Delete, and Performance requests. ## Read the cached tweet writing samples The profile response contains exact cached examples. It does not contain derived writing conclusions. | Profile field | Meaning | Integration use | | - | - | - | | `xUsername` | Lowercase analyzed X username | Use as the profile key. | | `tweetCount` | Number of cached Tweet samples | Record the sample size and refresh cost. | | `isOwnAccount` | Ownership classification stored during refresh | Separate owned and external profiles. | | `fetchedAt` | ISO 8601 fetch time | Apply your cache freshness policy. | | `tweets` | Cached tweet writing samples | Review the source text directly. | `isOwnAccount` compares the username with the saved [X identity](/api-reference/account/x-identity) during a refresh. A cached `200` response does not recompute that flag. ## Parse every cached tweet Each public `tweets[]` entry contains these fields. | Tweet field | Required | Meaning | | - | - | - | | `id` | Yes | Exact Tweet ID as a string | | `text` | Yes | Cached tweet text | | `authorUsername` | No | Tweet author's X (Twitter) username | | `createdAt` | No | ISO 8601 publication time | Keep Tweet IDs as strings. JavaScript numbers cannot represent every X Tweet ID exactly. The public Style Profile contract does not include cached media objects. Use a Tweet or media endpoint when your workflow requires images, videos, or GIFs. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "xUsername": "nasa", "tweetCount": 2, "isOwnAccount": false, "fetchedAt": "2026-08-02T12:00:00.000Z", "tweets": [ { "id": "1950882898740914261", "text": "Export tweet replies to JSON or CSV.", "authorUsername": "NASA", "createdAt": "2026-08-02T11:30:00.000Z" } ] } ``` ## Review observable tweet writing features The response provides source text for your analysis. Start with observable features before assigning subjective voice or tone labels. | Writing feature | Sample calculation | Review question | | - | - | - | | Post length | Median `text.length` | Does the profile prefer short tweets? | | Questions | Samples containing `?` | How often does the profile invite replies? | | Links | Samples containing an HTTP URL | How often does it cite another page? | | Hashtags | Count `#` tokens | Does it label topics with hashtags? | | Openings | Compare first sentences | Which hooks recur? | | Vocabulary | Count repeated meaningful words | Which specific terms define the sample? | | Cadence | Compare available `createdAt` values | How closely were samples published? | Do not infer future engagement from writing samples. Refresh public metrics through Analyze Performance when outcome comparisons are required. ## Build a Twitter brand voice workflow 1. Set the [X identity](/api-reference/account/x-identity) before refreshing. 2. Send one public X (Twitter) username to this endpoint. 3. Branch on HTTP `200` or `201`. 4. Store `xUsername`, `fetchedAt`, and `tweetCount`. 5. Store every Tweet ID and text value. 6. Review observable patterns with a human editor. 7. Keep current product claims out of copied historical tweets. Use cached examples as references. Never copy another person's distinctive phrasing without authorization. ## Analyze another public X account You can cache recent public tweets from another username. The resulting profile belongs only to the authenticated Xquik account. This route does not expose drafts, private posts, or private analytics. It also does not expose followers, following, profile visits, or direct messages. ## Budget a style refresh Cached `200` responses are free. A `201` refresh costs 1 credit per Tweet returned and stored. Use `tweetCount` to reconcile the refresh. The endpoint accepts no limit parameter, date range, pagination cursor, or requested sample count. When a stale cache exists without enough credits, Xquik returns that cache with `200`. It does not delete the existing writing samples. ## Handle style cache errors | Status | Error | Meaning | Recovery | | - | - | - | - | | `200` | None | Cached profile returned | Inspect `fetchedAt` before use. | | `201` | None | Profile fetched and stored | Record `tweetCount` for billing. | | `400` | `invalid_input` | Username is missing, empty, or not a string | Send one username string. | | `401` | `unauthenticated` | Credential is missing or invalid | Replace the API key or bearer token. | | `402` | `no_cached_style` | No cache exists, and credits cannot cover a refresh | Top up or save approved examples. | | `429` | `rate_limit_exceeded` | Request exceeded the rate limit | Wait for `Retry-After`, then retry once. | The response widget lists every status in the OpenAPI contract. ## Headers Send `x-api-key` with an Xquik API key. OAuth clients can send a bearer token through the `Authorization` header instead. | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | Non-empty X (Twitter) username without `@`. Xquik lowercases the value. | ## Response ### 200 OK Returns a cached profile. It can be fresh, or stale when credits cannot cover a refresh. ### 201 Created Returns a newly fetched and stored profile. | Field | Type | Description | | - | - | - | | `xUsername` | `string` | Lowercase analyzed X (Twitter) username. | | `tweetCount` | `number` | Number of cached Tweet samples. | | `isOwnAccount` | `boolean` | Stored ownership classification. | | `fetchedAt` | `string` | ISO 8601 cache fetch timestamp. | | `tweets` | `object[]` | Cached tweet writing samples. | | `tweets[].id` | `string` | Exact Tweet ID. | | `tweets[].text` | `string` | Cached tweet text. | | `tweets[].authorUsername` | `string` | Optional author username. | | `tweets[].createdAt` | `string` | Optional ISO 8601 publication time. | ### 400 Invalid input Username is missing, empty, or not a string. Send one username string. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Authentication failed. Replace the missing or invalid credential. ### 402 No cached style `{ "error": "no_cached_style", "message": "No cached style for @username. Share 5-10 example tweet texts, then save via PUT /api/v1/styles/username." }` No cache exists, and credits cannot cover a refresh. Top up through the [billing page](https://dashboard.xquik.com/en/account?tab=subscription). Or save approved tweet examples with [Save Custom Style](/api-reference/styles/save). ### 429 Rate limited Too many requests. Wait for `Retry-After`, then retry once. ### How do I analyze a Twitter writing style? Cache one public username, then review the returned tweet text. This endpoint supplies writing samples. Your application performs any voice or tone analysis. ### Does analyze style return tone or vocabulary scores? No. It returns Tweet IDs, text, authors, timestamps, and cache metadata. It does not return generated style labels or scores. ### Why did analyze style return 200 instead of 201? The route reused an existing cache. Check `fetchedAt`. A `200` can also return a stale cache when credits cannot cover a refresh. ### Can I force a Twitter style refresh? No force parameter exists. Fresh profiles return from cache. To refresh early, delete the profile and create it again. Deletion is permanent. ### Can I analyze another Twitter account? Yes, for recent public tweets. Only your authenticated Xquik account can read the cached profile. > [!NOTE] > > **Next.** [Get Style](/api-reference/styles/get) reads samples without a > refresh. [Compare Styles](/api-reference/styles/compare) retrieves 2 profiles. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "xUsername": "elonmusk", "tweetCount": 50, "isOwnAccount": true, "fetchedAt": "2025-01-15T12:00:00Z", "tweets": [ { "id": "1234567890", "text": "Just launched our new feature!" } ] } ``` ### 201 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "xUsername": "elonmusk", "tweetCount": 50, "isOwnAccount": true, "fetchedAt": "2025-01-15T12:00:00Z", "tweets": [ { "id": "1234567890", "text": "Just launched our new feature!" } ] } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Compare 2 tweet writing styles, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/styles/compare Compare 2 cached tweet writing profiles for X (Twitter) usernames or custom labels. Retrieve both sample sets, authors, timestamps, counts, and ownership. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/styles/compare` **Free.** This endpoint does not consume credits. ## Retrieve 2 cached tweet writing profiles Call this endpoint to retrieve 2 cached writing profiles together. Supply 2 X usernames, 2 custom labels, or one of each. Xquik performs 2 account-scoped cache lookups. It does not contact X, refresh tweets, or calculate a writing-style score. The response keeps request order. `style1` matches `username1`. `style2` matches `username2`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/styles/compare \ --data-urlencode "username1=NASA" \ --data-urlencode "username2=product updates" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ username1: "NASA", username2: "product updates", }); const response = await fetch(`https://xquik.com/api/v1/styles/compare?${params}`, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const result = await response.json(); if (!response.ok) { throw new Error(`${result.error}: ${result.message}`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/styles/compare", params={"username1": "NASA", "username2": "product updates"}, headers={"x-api-key": "xq_YOUR_KEY_HERE"}, timeout=30, ) response.raise_for_status() result = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" "net/url" ) func main() { endpoint, err := url.Parse("https://xquik.com/api/v1/styles/compare") if err != nil { panic(err) } query := endpoint.Query() query.Set("username1", "NASA") query.Set("username2", "product updates") endpoint.RawQuery = query.Encode() req, err := http.NewRequest(http.MethodGet, endpoint.String(), nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var result map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { panic(err) } if resp.StatusCode != http.StatusOK { panic(fmt.Sprintf("style comparison failed: %v", result)) } } ``` ## Select comparable tweet style keys Both query values use the same keys as [Get Style](/api-reference/styles/get). Xquik lowercases each value before lookup. | Profile source | Query value | Example | | - | - | - | | [Analyze & Cache Style](/api-reference/styles/analyze) | Returned `xUsername` | `nasa` | | [Save Custom Style](/api-reference/styles/save) | Returned lowercase label | `product updates` | | [List Styles](/api-reference/styles/list) | Any `styles[].xUsername` | `founder voice` | The query parameter names say `username`. They also accept saved custom labels. Do not send numeric database IDs. Use 2 different keys. The API accepts the same key twice. But both response objects then contain the same profile. ## Understand what compare styles returns This endpoint groups 2 stored sample sets into one response. It does not generate conclusions about voice, tone, vocabulary, readability, or sentiment. | Response field | Meaning | Comparison use | | - | - | - | | `style1` | Profile selected by `username1` | Treat as the first sample set. | | `style2` | Profile selected by `username2` | Treat as the second sample set. | | `xUsername` | Lowercase X username or custom label | Keep each profile key. | | `tweetCount` | Stored tweet sample count | Check whether sample sizes differ. | | `isOwnAccount` | Stored ownership classification | Separate owned and external profiles. | | `fetchedAt` | ISO 8601 cache timestamp | Check whether collection times differ. | | `tweets` | Cached or supplied tweet examples | Perform your approved comparison. | The 2 profiles can have different sample counts. They can also have different cache timestamps. Compare equivalent subsets when those differences matter. ## Inspect every tweet writing sample Both `style1.tweets[]` and `style2.tweets[]` use this public contract. | Tweet field | Required | Meaning | | - | - | - | | `id` | Yes | Stored Tweet ID or generated custom-sample ID | | `text` | Yes | Cached tweet or supplied writing example | | `authorUsername` | No | X author username or custom label | | `createdAt` | No | ISO 8601 tweet or custom-sample timestamp | Keep Tweet IDs as strings. JavaScript numbers cannot represent every X Tweet ID exactly. Do not send generated custom-sample IDs to X tweet endpoints. They identify local writing examples only. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "style1": { "xUsername": "nasa", "tweetCount": 2, "fetchedAt": "2026-07-31T10:30:00.000Z", "isOwnAccount": false, "tweets": [ { "id": "1950882898740914261", "text": "Export tweet replies to JSON or CSV.", "authorUsername": "NASA", "createdAt": "2026-07-31T09:00:00.000Z" } ] }, "style2": { "xUsername": "product updates", "tweetCount": 2, "fetchedAt": "2026-07-31T10:35:00.000Z", "isOwnAccount": false, "tweets": [ { "id": "0", "text": "Ship notes should name the endpoint and user outcome.", "authorUsername": "product updates", "createdAt": "2026-07-31T10:35:00.000Z" } ] } } ``` ## Compare tweet writing with observable features Voice describes a consistent brand personality. Tone can change with context. This API returns the source text needed for your own review. Use observable text features before assigning subjective labels. | Writing feature | Calculation | Review question | | - | - | - | | Post length | Compare median `text.length` | Which profile writes shorter tweets? | | Questions | Count samples containing `?` | Which profile asks readers more often? | | Links | Count samples containing an HTTP URL | Which profile cites external pages? | | Hashtags | Count `#` tokens | Which profile uses topic labels? | | Openings | Compare each sample's first sentence | Which recurring openings appear? | | Vocabulary | Compare repeated meaningful words | Which terms distinguish each profile? | | Cadence | Compare available `createdAt` values | Were the samples posted in similar periods? | Review examples in context. A small or stale cache cannot prove a permanent brand voice. Avoid copying personal phrases without authorization. ## Separate writing style from Twitter analytics Compare Styles returns no likes, replies, reposts, quotes, bookmarks, views, followers, or impressions. It cannot prove which writing style performs better. Use [Analyze Performance](/api-reference/styles/performance) for current tweet engagement. Compare equivalent periods and sample sizes before drawing an outcome conclusion. ## Compare equivalent tweet samples 1. List cached profiles with the same Xquik credential. 2. Select 2 returned profile keys. 3. Review `fetchedAt` and `tweetCount` for both profiles. 4. Refresh stale X (Twitter) profiles through Analyze when required. 5. Call Compare Styles with both URL-encoded keys. 6. Compare equivalent tweet subsets using observable features. 7. Store both source keys with any conclusion you draw. The endpoint does not modify either cache. Repeating the same request returns the stored profiles until another route changes them. ## Handle tweet style comparison errors | Status | Error | Meaning | Recovery | | - | - | - | - | | `200` | None | Both profiles exist | Compare `style1` and `style2` in order. | | `400` | `missing_params` | One or both query values are absent | Send both non-empty query parameters. | | `401` | `unauthenticated` | The credential is missing or invalid | Replace the API key or bearer token. | | `404` | `style_not_found` | At least one account-scoped key is missing | List profiles, then create the missing cache. | | `429` | `rate_limit_exceeded` | The request exceeded the rate limit | Wait for `Retry-After`, then retry once. | A `404` response does not identify which key failed. Call Get Style for each key when you need to isolate the missing profile. The contract documents no `402` response. Comparing cached profiles costs no credits. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `username1` | `string` | Yes | First X (Twitter) username or saved custom style label. Xquik lowercases this value and returns its profile as `style1`. | | `username2` | `string` | Yes | Second X (Twitter) username or saved custom style label. Xquik lowercases this value and returns its profile as `style2`. | ## Headers Send `x-api-key` with an Xquik API key. OAuth clients can send a bearer token through the `Authorization` header instead. | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `style1` | `object` | First cached profile. | | `style1.xUsername` | `string` | Lowercase X (Twitter) username or custom label. | | `style1.tweetCount` | `number` | Stored tweet writing sample count. | | `style1.isOwnAccount` | `boolean` | Stored ownership classification. | | `style1.fetchedAt` | `string` | ISO 8601 cache fetch or custom-save timestamp. | | `style1.tweets` | `object[]` | Cached or supplied tweet writing samples. | | `style1.tweets[].id` | `string` | Tweet ID or generated custom-sample ID. | | `style1.tweets[].text` | `string` | Cached tweet or supplied writing example. | | `style1.tweets[].authorUsername` | `string` | Optional author username or custom label. | | `style1.tweets[].createdAt` | `string` | Optional ISO 8601 sample timestamp. | | `style2` | `object` | Second cached profile. It follows the same contract as `style1`. | ### 400 Missing parameters `{ "error": "missing_params", "message": "Both usernames are required" }` One or both query values are missing. Send `username1` and `username2`. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Authentication failed. Replace the missing or invalid credential. ### 404 Style not found `{ "error": "style_not_found", "message": "No cached style found for this username" }` At least one cache key is missing for this Xquik account. List styles first. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for `Retry-After`, then retry once. ### Does compare styles calculate tone or brand voice? No. It returns 2 cached tweet sample sets. Your application performs any tone, voice, vocabulary, or sentence-pattern analysis. ### Can I compare an X (Twitter) username with a custom style? Yes. Send the analyzed username and the saved custom label as the 2 query values. Both profiles must belong to the authenticated Xquik account. ### Can I compare Twitter analytics for another account? Not with this endpoint. Compare Styles returns writing samples, not engagement metrics. Analyze Performance retrieves current metrics for cached tweets. ### Why does compare styles return 404? At least one lowercase key is missing from this account. List styles, verify both keys, then analyze or save the missing profile. > [!NOTE] > > **Related.** [Get Style](/api-reference/styles/get) isolates one profile. > [Delete Style](/api-reference/styles/delete) removes a cached profile. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "style1": { "xUsername": "elonmusk", "tweetCount": 50, "isOwnAccount": true, "fetchedAt": "2025-01-15T12:00:00Z", "tweets": [ { "id": "1234567890", "text": "Just launched our new feature!" } ] }, "style2": { "xUsername": "BillGates", "tweetCount": 40, "isOwnAccount": false, "fetchedAt": "2025-01-15T12:00:00Z", "tweets": [ { "id": "9876543210", "text": "Climate change is a global challenge." } ] } } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Delete a cached writing style, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/styles/delete Delete a cached Twitter writing-style profile and its stored tweet samples by username. The X account and every live tweet stay. Includes error recovery. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/styles/{id}` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/styles/elonmusk \ -H "x-api-key: xq_YOUR_KEY_HERE" -w "\n%{http_code}" ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const username = "elonmusk"; const response = await fetch(`https://xquik.com/api/v1/styles/${username}`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); console.log(response.ok); // true on success (204 No Content) ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests username = "elonmusk" response = requests.delete( f"https://xquik.com/api/v1/styles/{username}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) response.raise_for_status() # 204 No Content on success ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "net/http" ) func main() { username := "elonmusk" req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/styles/"+username, nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() fmt.Println(resp.StatusCode) // 204 on success } ``` ## Delete a cached Twitter writing style Delete a style when its sampled tweets no longer represent the intended voice. The request removes one cached writing-style profile owned by your Xquik account. It also removes the tweet samples stored with that profile. Use the `xUsername` returned by [List Styles](/api-reference/styles/list). Place that username in the `{id}` path segment. The examples use `elonmusk`. Do not include the leading `@` character. | Deleted record | Unchanged record | | - | - | | Cached X (Twitter) username | The connected X account | | Stored tweet samples | Every live tweet on X | | Cache metadata (`tweetCount`, `fetchedAt`, `isOwnAccount`) | X profile name, bio, avatar, and banner | | Custom style examples saved under that label | Followers, following, replies, likes, and reposts | > [!WARNING] > > Deletion is permanent. Xquik does not provide a restore endpoint for deleted > style profiles. Analyze the username again to build a new cache. ## Handle a 204 response without JSON A successful deletion returns `204 No Content`. The response body is empty. Check `response.status === 204` or `response.ok`. Do not call `response.json()` after a successful request. ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const username = "elonmusk"; const response = await fetch(`https://xquik.com/api/v1/styles/${username}`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); if (response.status !== 204) { const error = await response.json(); throw new Error(`${error.error}: ${error.message}`); } ``` Call [List Styles](/api-reference/styles/list) after deletion when reconciliation matters. The removed username should no longer appear in that account's list. ## Recover from style deletion errors | Status | Meaning | Recovery | | - | - | - | | `204` | Xquik deleted the cached style | Stop. Do not parse a body. | | `401` | Authentication failed | Replace the missing or invalid credential. | | `404` | No matching cached style belongs to this account | Check the username with List Styles. | | `429` | The request exceeded the rate limit | Wait for `Retry-After`, then retry once. | A repeated deletion returns `404` after the cache is gone. Treat that result as success only when your workflow allows it. Never retry `404` in a loop. ### Does this delete tweets from X? No. This route deletes Xquik's cached samples only. The source tweets remain on X. The connected X account also remains available for approved workflows. ### Can I restore a deleted Twitter writing style? No restore route exists. Use [Analyze & Cache Style](/api-reference/styles/analyze) to fetch current tweets and create a fresh writing-style profile. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Style profile ID or X (Twitter) username whose cached style to delete. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response > [tab] 204 No content > > Empty response body. Xquik deleted the style. > [tab] 401 Unauthenticated > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "unauthenticated", "message": "Missing or invalid API key" } > ``` > > Missing or invalid API key. > [tab] 404 Not found > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "style_not_found", "message": "No cached style found for this username" } > ``` > > No cached style exists for this username, or it belongs to a different account. > [tab] 429 Rate limited > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 } > ``` > > Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** > > * [List Styles](/api-reference/styles/list) to verify the removal. > * [Analyze & Cache Style](/api-reference/styles/analyze) to cache a new style. ## Response examples * **204** `No response body.` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Get a cached writing style, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/styles/get Retrieve cached tweet writing samples for one X (Twitter) username or custom style label. Read tweet text, authors, timestamps, sample count, and ownership. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/styles/{id}` **Free.** This endpoint does not consume credits. ## Retrieve one cached tweet writing profile Call this endpoint to retrieve stored tweet samples for one writing profile. The request reads Xquik's existing cache. It does not contact X or refresh tweets. Use an analyzed X (Twitter) username or a saved custom label as `{id}`. Xquik lowercases the path value before lookup. The route does not accept a numeric database ID. The lookup stays inside the authenticated Xquik account. Another customer can cache the same username. You cannot read their profile. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET https://xquik.com/api/v1/styles/elonmusk \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const styleKey = "elonmusk"; const response = await fetch(`https://xquik.com/api/v1/styles/${encodeURIComponent(styleKey)}`, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const result = await response.json(); if (!response.ok) { throw new Error(`${result.error}: ${result.message}`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from urllib.parse import quote import requests style_key = "elonmusk" response = requests.get( f"https://xquik.com/api/v1/styles/{quote(style_key, safe='')}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, timeout=30, ) response.raise_for_status() result = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" "net/url" ) func main() { styleKey := "elonmusk" endpoint := "https://xquik.com/api/v1/styles/" + url.PathEscape(styleKey) req, err := http.NewRequest(http.MethodGet, endpoint, nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var result map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { panic(err) } if resp.StatusCode != http.StatusOK { panic(fmt.Sprintf("style request failed: %v", result)) } } ``` ## Choose the correct tweet style key The path names the value `{id}`. The route reads it as a profile key, not a numeric record ID. | Profile source | Value to send in `{id}` | Example | | - | - | - | | [Analyze & Cache Style](/api-reference/styles/analyze) | Returned `xUsername` | `nasa` | | [Save Custom Style](/api-reference/styles/save) | Returned lowercase `xUsername` label | `product updates` | | [List Styles](/api-reference/styles/list) | Any listed `styles[].xUsername` | `founder voice` | Encode spaces and punctuation in custom labels. Do not include `@` before an X (Twitter) username. Keep the response's `xUsername` value for later requests. ## Read the cached tweet style response The response contains stored tweet text and profile metadata. It returns no generated tone summary, vocabulary list, hook score, or sentiment classification. | Field | Meaning | Integration use | | - | - | - | | `xUsername` | Lowercase X username or custom style label | Store it as the reusable profile key. | | `tweetCount` | Number of tweet samples recorded for the profile | Display the writing sample size. | | `isOwnAccount` | Ownership classification stored with the profile | Label an owned or external writing profile. | | `fetchedAt` | ISO 8601 cache timestamp | Show when Xquik refreshed or saved the profile. | | `tweets` | Stored tweet writing samples | Use approved samples in composition or review. | `tweetCount` describes the cached writing sample. It is not the X profile's lifetime post count. `fetchedAt` has 2 meanings. An analyzed profile records its last X fetch. A custom profile records when Xquik saved its supplied tweet examples. `isOwnAccount` is a stored snapshot. This GET request does not recompute it after an [X identity](/api-reference/account/x-identity) change. Set the X identity before creating or refreshing an analyzed profile. ## Parse every tweet writing sample Each `tweets[]` entry follows the public style profile contract. | Tweet field | Required | Meaning | | - | - | - | | `id` | Yes | Stored Tweet ID or generated custom-sample ID | | `text` | Yes | Full cached tweet or custom writing example | | `authorUsername` | No | X author username or custom style label | | `createdAt` | No | ISO 8601 tweet or custom-sample timestamp | Treat `id` as a string. X Tweet IDs can exceed JavaScript's safe integer range. Do not cast them to `number`. Custom profiles generate local sample IDs. Do not use them with X tweet lookup, reply, like, repost, or media endpoints. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "xUsername": "elonmusk", "tweetCount": 20, "isOwnAccount": false, "fetchedAt": "2026-02-24T10:30:00.000Z", "tweets": [ { "id": "1893456789012345678", "text": "The future is now.", "authorUsername": "elonmusk", "createdAt": "2026-02-24T14:22:00.000Z" } ] } ``` ## Separate tweet style from Twitter analytics This route retrieves writing samples. It does not fetch likes, replies, reposts, quotes, bookmarks, views, followers, or impressions. Use [Analyze Performance](/api-reference/styles/performance) when you need live engagement metrics for the cached tweets. Keep writing-style review separate from Twitter analytics for another account. | Goal | Endpoint | Result | | - | - | - | | Retrieve unchanged tweet samples | Get Style | Cached text, authors, and timestamps | | Create or refresh an X profile | [Analyze Style](/api-reference/styles/analyze) | Current cached writing samples | | Store approved examples | [Save Custom Style](/api-reference/styles/save) | A custom tweet voice profile | | Compare 2 cached profiles | [Compare Styles](/api-reference/styles/compare) | Both stored sample sets | | Refresh tweet engagement | [Analyze Performance](/api-reference/styles/performance) | Likes, replies, reposts, and views | ## Review a saved tweet style 1. Call [List Styles](/api-reference/styles/list) with the same credential. 2. Select one returned `xUsername` profile key. 3. URL-encode that value and call this endpoint. 4. Store `xUsername`, `fetchedAt`, and `tweetCount` with the samples. 5. Review every `tweets[].text` value before composition. 6. Refresh the profile through Analyze only when required. Use cached samples as writing references. A sample can hold an outdated product claim or an unapproved fact. ## Handle tweet style retrieval errors | Status | Error | Meaning | Recovery | | - | - | - | - | | `200` | None | The cached tweet style exists | Read every documented field. | | `401` | `unauthenticated` | The credential is missing or invalid | Replace the API key or bearer token. | | `404` | `style_not_found` | This account has no matching cache key | List styles or analyze the username first. | | `429` | `rate_limit_exceeded` | The request exceeded the rate limit | Wait for `Retry-After`, then retry once. | The contract documents no `402` response for this cache read. A missing balance does not block retrieval of an existing style profile. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Lowercase X (Twitter) username or saved custom style label. Xquik lowercases this value before an account-scoped lookup. It is not a numeric database ID. | ## Headers Send `x-api-key` with an Xquik API key. OAuth clients can send a bearer token through the `Authorization` header instead. | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `xUsername` | `string` | Lowercase X (Twitter) username or custom style label. | | `tweetCount` | `number` | Number of stored tweet writing samples. | | `isOwnAccount` | `boolean` | Stored ownership classification for this profile. | | `fetchedAt` | `string` | ISO 8601 cache fetch or custom-save timestamp. | | `tweets` | `object[]` | Stored tweet writing samples. | | `tweets[].id` | `string` | Tweet ID or generated custom-sample ID. | | `tweets[].text` | `string` | Cached tweet or supplied writing example. | | `tweets[].authorUsername` | `string` | Optional author username or custom label. | | `tweets[].createdAt` | `string` | Optional ISO 8601 sample timestamp. | ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Authentication failed. Replace the missing or invalid credential. ### 404 Style not found `{ "error": "style_not_found", "message": "No cached style found for this username" }` No matching cache key exists for this Xquik account. Call List Styles first. Analyze the X (Twitter) username when no profile exists. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for `Retry-After`, then retry once. ### How do I retrieve a cached tweet writing style? List styles, copy one `xUsername`, then send it as `{id}`. This endpoint returns the saved tweet text without refreshing the X profile. ### Can I retrieve another account's Twitter writing style? Yes, after your Xquik account analyzes that public username. You cannot read a style profile cached by another Xquik customer. ### Does get style return Twitter analytics? No. It returns tweet writing samples and cache metadata. Use Analyze Performance for current likes, replies, reposts, and views. ### Why does get style return 404? The credential cannot access a matching lowercase username or label. Call List Styles, check the exact key, then analyze or save the profile. > [!NOTE] > > **Related.** [List Styles](/api-reference/styles/list) lists profile > keys. [Delete Style](/api-reference/styles/delete) removes a cached profile. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "xUsername": "elonmusk", "tweetCount": 50, "isOwnAccount": true, "fetchedAt": "2025-01-15T12:00:00Z", "tweets": [ { "id": "1234567890", "text": "Just launched our new feature!" } ] } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List cached writing styles, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/styles/list List cached Twitter writing-style profiles for one Xquik account. Read every X (Twitter) username, analyzed tweet count, ownership flag, and fetch timestamp. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/styles` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET https://xquik.com/api/v1/styles \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/styles", { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/styles", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/styles", nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## List cached Twitter writing styles Call this endpoint to list the writing-style profiles in one Xquik account. Each item summarizes one cached X (Twitter) username or custom label. The list does not include tweet text, tone analysis, vocabulary, or engagement metrics. An empty response is valid. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "styles": [] } ``` An empty `styles` array means this Xquik account has no cached profiles. Use [Analyze & Cache Style](/api-reference/styles/analyze) to create one. ## Read each writing style summary | Field | Meaning | Integration use | | - | - | - | | `xUsername` | Normalized X (Twitter) username for the cached profile | Build Get, Delete, Compare, or Performance requests. | | `tweetCount` | Number of tweet samples stored in this profile | Show the sample size. | | `isOwnAccount` | Whether the profile represents the authenticated user's X account | Label owned and external profile samples. | | `fetchedAt` | ISO 8601 time when Xquik fetched the tweet samples | Decide whether to refresh the cache. | Do not interpret `tweetCount` as the X profile's lifetime tweet total. It only counts the tweet samples stored for this writing-style profile. `fetchedAt` records the cache fetch time. It is not a tweet publication time, profile update time, or writing-style creation timestamp. ## Choose the next style request Use the summary fields to choose the next endpoint. | Goal | Next request | Input from this response | | - | - | - | | Inspect sampled tweet text | [Get Style](/api-reference/styles/get) | Pass `xUsername` in `{id}`. | | Refresh stale samples | [Analyze & Cache Style](/api-reference/styles/analyze) | Send `xUsername` as `username`. | | Compare 2 account voices | [Compare Styles](/api-reference/styles/compare) | Send 2 cached usernames. | | Refresh likes, replies, reposts, and views | [Analyze Performance](/api-reference/styles/performance) | Pass `xUsername` in `{id}`. | | Remove a cached profile | [Delete Style](/api-reference/styles/delete) | Pass `xUsername` in `{id}`. | The response pages by cursor. When `hasMore` is `true`, pass `nextCursor` as `cursor` for the next page. Do not invent `page` or `total` fields. ## Handle list style errors | Status | Meaning | Recovery | | - | - | - | | `200` | The style summary list is available | Read `styles`, including an empty array. | | `401` | Authentication failed | Replace the missing or invalid credential. | | `429` | The request exceeded the rate limit | Wait for `Retry-After`, then retry once. | ### Does list styles return the analyzed tweets? No. This endpoint returns summaries only. Use [Get Style](/api-reference/styles/get) to retrieve the stored tweet samples for one username. ### Why is the Twitter writing style list empty? The authenticated Xquik account has no cached profiles. Analyze an X (Twitter) username first. Then call this endpoint again with the same Xquik credentials. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Maximum items per page, from 1 to 10,000. Default 200. | | `cursor` | `string` | No | `nextCursor` from the previous page. The `after` alias also works. Offset pagination is not supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `styles` | `object[]` | Array of cached style summaries. | | `styles[].xUsername` | `string` | Normalized X (Twitter) username. | | `styles[].tweetCount` | `number` | Number of cached tweets. | | `styles[].fetchedAt` | `string` | ISO 8601 timestamp when Xquik fetched the tweets. | | `styles[].isOwnAccount` | `boolean` | Whether this is the authenticated user's own X account. | | `hasMore` | `boolean` | Whether more rows follow this page. | | `nextCursor` | `string` | Pass it as `cursor` for the next page. Present when `hasMore` is `true`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "styles": [ { "xUsername": "elonmusk", "tweetCount": 20, "fetchedAt": "2026-02-24T10:30:00.000Z", "isOwnAccount": false }, { "xUsername": "sama", "tweetCount": 18, "fetchedAt": "2026-02-25T14:00:00.000Z", "isOwnAccount": false } ], "hasMore": false } ``` ### 400 Invalid cursor `{ "error": "invalid_input", "message": "Cursor invalid. Use nextCursor from the previous page, or omit it to start over." }` The `cursor` is not one this list returned. Send the `nextCursor` of the previous page, or omit it. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** > > * [Analyze & Cache Style](/api-reference/styles/analyze) to add a new style. > * [Get Style](/api-reference/styles/get) to fetch full tweet data for a specific style. > * [Compare Styles](/api-reference/styles/compare) to compare 2 cached styles. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Tweet performance analytics, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/styles/performance Refresh tweet analytics for cached X posts. Retrieve likes, replies, reposts, quotes, bookmarks, views, post text, IDs, tweet count, and snapshot guidance. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/styles/{id}/performance` **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ## Refresh tweet engagement for a cached style Call this endpoint to refresh public engagement counts for cached tweets. Xquik looks up each stored Tweet ID and returns current cumulative metrics. Start with [Analyze & Cache Style](/api-reference/styles/analyze). Then pass its returned `xUsername` as `{id}`. The lookup stays inside the authenticated Xquik account. This route contacts X on every request. It does not return saved analytics, historical deltas, or a precomputed engagement rate. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET https://xquik.com/api/v1/styles/NASA/performance \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const username = "NASA"; const endpoint = `https://xquik.com/api/v1/styles/${encodeURIComponent(username)}/performance`; const response = await fetch(endpoint, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const result = await response.json(); if (!response.ok) { throw new Error(`${result.error}: ${result.message}`); } const snapshot = { measuredAt: new Date().toISOString(), ...result, }; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from datetime import UTC, datetime from urllib.parse import quote import requests username = "NASA" endpoint = ( "https://xquik.com/api/v1/styles/" f"{quote(username, safe='')}/performance" ) response = requests.get( endpoint, headers={"x-api-key": "xq_YOUR_KEY_HERE"}, timeout=30, ) response.raise_for_status() result = response.json() snapshot = { "measuredAt": datetime.now(UTC).isoformat(), **result, } ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" "net/url" "time" ) func main() { username := "NASA" endpoint := "https://xquik.com/api/v1/styles/" + url.PathEscape(username) + "/performance" req, err := http.NewRequest(http.MethodGet, endpoint, nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var result map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { panic(err) } if resp.StatusCode != http.StatusOK { panic(fmt.Sprintf("tweet analytics failed: %v", result)) } result["measuredAt"] = time.Now().UTC().Format(time.RFC3339) fmt.Println(result) } ``` ## Use an analyzed X username The path names the value `{id}`. The route reads it as a lowercase cache key, not a numeric database ID. Use an analyzed X (Twitter) username whose samples contain live Tweet IDs. A custom style saved from supplied text contains local sample IDs. Those IDs cannot produce X tweet analytics. | Profile source | Performance result | | - | - | | Analyzed public X (Twitter) username | Refreshes public metrics for cached Tweet IDs | | Saved custom style label | Local sample IDs cannot resolve as X Tweets | | Numeric database ID | Unsupported lookup key | | Another customer's cache | Inaccessible to this credential | The route processes at most 100 cached Tweet records. Use [Get Style](/api-reference/styles/get) to inspect the stored sample count first. ## Read every tweet analytics field The response returns one row per refreshed Tweet. Each count is cumulative at request time. | Field | Meaning | Analytics use | | - | - | - | | `id` | Live Tweet ID | Join snapshots without numeric conversion. | | `text` | Current Tweet text | Store the measured post with its counts. | | `likeCount` | Likes | Count likes. | | `replyCount` | Replies | Count replies. | | `retweetCount` | Reposts without comments | Count reposts without comment. | | `quoteCount` | Quote posts with comments | Count reposts with comment. | | `bookmarkCount` | Bookmarks | Count private saves. X (Twitter) reports only the total. | | `viewCount` | Public view or impression count | Use as exposure, not unique people. | Reposts and quote posts are separate counts. Do not add quotes into `retweetCount` twice. `viewCount` is not a unique-audience field. Repeat exposure can increase the count. See the [X public metric definitions](https://docs.x.com/x-api/fundamentals/metrics). ## Store tweet analytics snapshots The response does not provide a measurement timestamp or historical baseline. Record the client request time beside every successful response. Keep each Tweet ID, metric row, and measurement time together. Use this snapshot key. | Snapshot column | Source | | - | - | | Profile key | `xUsername` | | Tweet key | `tweets[].id` | | Measurement time | Client UTC timestamp | | Tweet text | `tweets[].text` | | Public counts | All 6 count fields | Do not overwrite an earlier snapshot. Store each request separately. Calculate deltas only between snapshots for the same Tweet ID. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "measuredAt": "2026-08-02T12:00:00.000Z", "xUsername": "nasa", "tweetId": "1950882898740914261", "likeCount": 420, "replyCount": 18, "retweetCount": 54, "quoteCount": 11, "bookmarkCount": 87, "viewCount": 28000 } ``` ## Calculate tweet engagement rates Xquik returns counts. Your application can derive rates to compare tweets. Label them as application metrics, not fields returned by Xquik. Let `views` equal `viewCount`. Use `null` when `views` equals 0. | Derived metric | Formula | Interpretation | | - | - | - | | Public interactions | `likes + replies + reposts + quotes + bookmarks` | Total counted interaction actions | | Interaction rate | `public interactions / views` | Counted actions per view | | Conversation rate | `replies / views` | Replies per view | | Amplification rate | `(reposts + quotes) / views` | Reposts and quotes per view | | Save rate | `bookmarks / views` | Bookmarks per view | | Like rate | `likes / views` | Likes per view | Do not include `viewCount` in the interaction numerator. A view is the denominator for these derived rates. Use medians when comparing several tweets. One viral post can distort an average. Keep raw counts beside every derived rate. ## Compare current and earlier tweet metrics For 2 snapshots, subtract earlier counts from later counts. Reject negative deltas until you confirm both used the same Tweet and field meaning. | Delta | Formula | | - | - | | New likes | `later.likeCount - earlier.likeCount` | | New replies | `later.replyCount - earlier.replyCount` | | New reposts | `later.retweetCount - earlier.retweetCount` | | New quotes | `later.quoteCount - earlier.quoteCount` | | New bookmarks | `later.bookmarkCount - earlier.bookmarkCount` | | New views | `later.viewCount - earlier.viewCount` | Counts can change after publication. Avoid comparing posts measured at different ages without labeling that difference. ## Separate tweet analytics from account analytics This route measures only the cached tweets in one style profile. It does not return follower growth, following changes, profile visits, or link clicks. It also does not return audience demographics or an account-wide Twitter analytics report. You can analyze another public X account after caching its username. The result covers cached public Tweets only. It does not expose private analytics. Use [Compare Styles](/api-reference/styles/compare) for 2 writing sample sets. That route does not fetch live engagement metrics. ## Budget a tweet analytics refresh Each returned Tweet costs 1 credit. Check `tweetCount` through Get Style before requesting a refresh. The route can process up to 100 cached Tweets. Store the returned `tweetCount` with billing reconciliation. It counts metric rows returned by this request, not the profile's lifetime Tweet total. ## Handle unavailable cached tweets Every cached ID must still resolve as a live X Tweet. Deleted, protected, or otherwise unavailable Tweets cannot produce a metric row. Re-analyze the username when the cache contains stale Tweet IDs. Never replace an unavailable Tweet ID with another post during snapshot reconciliation. ## Handle tweet analytics errors | Status | Error | Meaning | Recovery | | - | - | - | - | | `200` | None | Current metrics are available | Store counts with a client timestamp. | | `401` | `unauthenticated` | The credential is missing or invalid | Replace the API key or bearer token. | | `402` | `insufficient_credits` | The balance cannot cover the request | Top up, then retry. | | `404` | `style_not_found` | No valid cached profile matches `{id}` | Analyze the username first. | | `429` | `rate_limit_exceeded` | The request exceeded the rate limit | Wait for `Retry-After`, then retry once. | The response widget lists every status in the OpenAPI contract. The route returns no partial-success or asynchronous job responses. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Analyzed X (Twitter) username whose cache contains live Tweet IDs. Xquik lowercases the value before an account-scoped lookup. It is not a numeric database ID. | ## Headers Send `x-api-key` with an Xquik API key. OAuth clients can send a bearer token through the `Authorization` header instead. | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `xUsername` | `string` | Lowercase analyzed X (Twitter) username. | | `tweetCount` | `number` | Number of Tweet metric rows returned. | | `tweets` | `object[]` | Current Tweet text and public engagement counts. | | `tweets[].id` | `string` | Live Tweet ID. | | `tweets[].text` | `string` | Current Tweet text. | | `tweets[].bookmarkCount` | `number` | Current bookmark count. | | `tweets[].likeCount` | `number` | Current like count. | | `tweets[].quoteCount` | `number` | Current quote-post count. | | `tweets[].replyCount` | `number` | Current reply count. | | `tweets[].retweetCount` | `number` | Current repost count, excluding quotes. | | `tweets[].viewCount` | `number` | Current public view or impression count. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "xUsername": "nasa", "tweetCount": 1, "tweets": [ { "id": "1950882898740914261", "text": "Export tweet replies to JSON or CSV.", "bookmarkCount": 87, "likeCount": 420, "quoteCount": 11, "replyCount": 18, "retweetCount": 54, "viewCount": 28000 } ] } ``` ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Authentication failed. Replace the missing or invalid credential. ### 402 Insufficient credits The balance cannot cover the request. Top up through the [billing page](https://dashboard.xquik.com/en/account?tab=subscription). ### 404 Style not found `{ "error": "style_not_found", "message": "No cached style found for this username" }` No analyzed profile exists for this username and Xquik account. Analyze it first. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for `Retry-After`, then retry once. ### How do I check tweet analytics through the API? Analyze an X (Twitter) username, then call this route with its returned `xUsername`. Store each response with your own UTC measurement timestamp. ### Does this return live Twitter analytics? Yes. Each request refreshes current public counts for cached Tweet IDs. It does not return private metrics or historical deltas. ### Can I check X (Twitter) analytics for another account? Yes, for public Tweets cached by your Xquik account. The response excludes private account analytics, follower growth, profile visits, and link clicks. ### Is `viewCount` a unique viewer count? No. Treat it as exposure, not unique people. Repeat views can increase the count. ### Why does tweet analytics return 404? The Xquik account has no analyzed profile for that lowercase username. Call Analyze Style, then retry with the returned `xUsername`. > [!NOTE] > > **Related.** [Get Style](/api-reference/styles/get) inspects cached Tweet IDs. > [List Styles](/api-reference/styles/list) lists analyzed profiles. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **422** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Save a custom writing style, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/styles/save Save 1-100 approved tweet examples as a reusable writing profile under its lowercase path ID. Saving the same path ID replaces every example. The call is free. > For the complete documentation index, see [llms.txt](/llms.txt). `PUT https://xquik.com/api/v1/styles/{id}` **Free.** This endpoint does not consume credits. Save approved Tweet text as a reusable, account-scoped writing profile. Xquik stores each example as written. It generates no style labels. The endpoint stores 1-100 Tweet objects under the lowercase path `{id}`. It trims outer whitespace from every example. Internal punctuation, casing, links, and line breaks remain available for later review. It does not infer tone, vocabulary, sentiment, readability, or engagement. It also does not fetch likes, replies, reposts, quotes, views, or followers. ## Save approved tweet writing samples Use this endpoint when you already have reviewed examples. Those examples can come from approved drafts, published Tweets, or internal writing guidelines. | Tweet style profile column | Request or response source | Reuse rule | | - | - | - | | Profile key | Path `{id}` | Reuse the returned lowercase key. | | Source tweets | Request `tweets[].text` | Review every supplied post before saving. | | Sample ID | Response `tweets[].id` | Treat it as a local array position. | | Sample author | Response `tweets[].authorUsername` | Expect the normalized label. | | Sample timestamp | Response `tweets[].createdAt` | Record the style save time. | | Profile timestamp | Response `fetchedAt` | Detect later replacements. | | Ownership flag | Response `isOwnAccount` | Expect `false` for custom samples. | These local sample IDs are not X Tweet IDs. Do not send them to Tweet lookup or Tweet analytics endpoints. ## Choose representative tweet examples Save posts that show the patterns you want future drafts to follow. | Writing feature | Include when relevant | Review before saving | | - | - | - | | Opening structure | Questions, statements, or short hooks | Remove accidental clickbait | | Sentence length | Short posts and longer explanations | Keep the intended pacing | | Formatting | Paragraphs, lists, or single lines | Keep line breaks that carry meaning | | Punctuation | Colons, parentheses, or exclamation marks | Remove unapproved habits | | Calls to action | Replies, links, or product prompts | Keep claims accurate | | X vocabulary | Product names and audience terms | Remove internal jargon | | Emoji and hashtags | Only approved usage | Avoid one-off campaign tags | | Replies | Useful support or community responses | Exclude private customer details | Do not treat every published Tweet as a good example. Remove crisis posts, temporary promotions, outdated claims, and accidental wording. The endpoint stores text exactly after trimming outer whitespace. It does not decide whether an example fits your Twitter writing style. ## Name the profile in the path The path `{id}` names the stored profile. Xquik trims it, drops a leading `@` and converts it to lowercase before saving. The body `label` is optional. When you send it, it must match `{id}`, ignoring case and a leading `@`. The PUT route rejects a mismatch. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} PUT /api/v1/styles/product-updates body.label = "product-updates" response.xUsername = "product-updates" ``` Spaces are valid inside `label`. Encode them when using the same path value. A simple hyphenated label avoids confusing URLs. ## Replace an existing tweet style Profiles belong to the authenticated Xquik account. The normalized path `{id}` forms the account-scoped storage key. Sending the same label replaces the entire saved Tweet array. It also resets every local sample ID and save timestamp. Send the complete approved set during every replacement. Omitting an old example removes it from the saved profile. A different path `{id}` creates or replaces another normalized key. Delete the old key separately. ## Reuse saved tweet examples Use the returned `xUsername` value as the profile key. The name remains `xUsername` for both analyzed accounts and custom labels. | Next operation | Key to send | Purpose | | - | - | - | | [Get Style](/api-reference/styles/get) | Path `{id}` | Retrieve all saved examples | | [List Styles](/api-reference/styles/list) | None | Review available labels and counts | | [Compare Styles](/api-reference/styles/compare) | `username1` or `username2` | Load 2 sample sets side by side | | [Build a Post Draft](/api-reference/compose/create) | `styleUsername` | Return matched examples as `styleTweets` | | [Delete Style](/api-reference/styles/delete) | Path `{id}` | Remove the profile | Custom samples contain local sequential IDs. So they cannot provide live likes, replies, reposts, quotes, bookmarks, or view counts. ## Request examples ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PUT https://xquik.com/api/v1/styles/product-updates \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "label": "product-updates", "tweets": [ {"text": "Shipped faster follower exports today. CSV files now preserve profile IDs."}, {"text": "New: filter Tweet replies before sending results to your webhook."}, {"text": "Building an X monitor? Start with one profile and verify every event."} ] }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/styles/product-updates", { method: "PUT", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ label: "product-updates", tweets: [ { text: "Shipped faster follower exports today. CSV files now preserve profile IDs.", }, { text: "New: filter Tweet replies before sending results to your webhook.", }, { text: "Building an X monitor? Start with one profile and verify every event.", }, ], }), }); const result = await response.json(); if (!response.ok) { throw new Error(`${response.status}: ${result.message}`); } console.log(result.xUsername, result.tweetCount); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.put( "https://xquik.com/api/v1/styles/product-updates", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "label": "product-updates", "tweets": [ { "text": ( "Shipped faster follower exports today. " "CSV files now preserve profile IDs." ) }, { "text": ( "New: filter Tweet replies before sending results " "to your webhook." ) }, { "text": ( "Building an X monitor? Start with one profile " "and verify every event." ) }, ], }, timeout=30, ) response.raise_for_status() result = response.json() print(result["xUsername"], result["tweetCount"]) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, err := json.Marshal(map[string]interface{}{ "label": "product-updates", "tweets": []map[string]string{ {"text": "Shipped faster follower exports today. CSV files now preserve profile IDs."}, {"text": "New: filter Tweet replies before sending results to your webhook."}, {"text": "Building an X monitor? Start with one profile and verify every event."}, }, }) if err != nil { panic(err) } request, err := http.NewRequest( http.MethodPut, "https://xquik.com/api/v1/styles/product-updates", bytes.NewReader(body), ) if err != nil { panic(err) } request.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") request.Header.Set("Content-Type", "application/json") response, err := http.DefaultClient.Do(request) if err != nil { panic(err) } defer response.Body.Close() var result map[string]interface{} if err := json.NewDecoder(response.Body).Decode(&result); err != nil { panic(err) } if response.StatusCode != http.StatusOK { panic(fmt.Sprintf("style save failed: %v", result)) } fmt.Println(result["xUsername"], result["tweetCount"]) } ``` ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Route identifier. Keep it equal to the body `label`. The body label controls the stored profile key for PUT requests. | ## Headers Send `x-api-key` with an Xquik API key. OAuth clients can send a bearer token through the `Authorization` header instead. | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `label` | `string` | No | Optional profile label. When sent, it must match the path `{id}`, ignoring case and a leading `@`. It contains 1-50 characters and must start with a letter, number, or underscore. It accepts letters, numbers, spaces, dots, hyphens, apostrophes, and underscores. Xquik trims and lowercases this value. | | `tweets` | `object[]` | Yes | Complete array of 1-100 approved Tweet examples. | | `tweets[].text` | `string` | Yes | Non-empty Tweet text. Xquik trims outer whitespace before storage. | ## Response ### 200 OK Returns the complete saved profile after insertion or replacement. | Field | Type | Description | | - | - | - | | `xUsername` | `string` | Normalized lowercase value from the body `label`. | | `tweetCount` | `number` | Number of saved examples. Matches the submitted array length. | | `isOwnAccount` | `boolean` | Always `false` for a custom profile created from supplied text. | | `fetchedAt` | `string` | ISO 8601 save timestamp shared by every returned sample. | | `tweets` | `object[]` | Complete saved Tweet sample array. | | `tweets[].id` | `string` | Local zero-based array position. This is not an X Tweet ID. | | `tweets[].text` | `string` | Submitted Tweet text after trimming outer whitespace. | | `tweets[].authorUsername` | `string` | Normalized custom profile label, not an X account lookup. | | `tweets[].createdAt` | `string` | ISO 8601 save timestamp, not an X publication time. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "xUsername": "product-updates", "tweetCount": 3, "isOwnAccount": false, "fetchedAt": "2026-08-02T18:30:00.000Z", "tweets": [ { "id": "0", "text": "Shipped faster follower exports today. CSV files now preserve profile IDs.", "authorUsername": "product-updates", "createdAt": "2026-08-02T18:30:00.000Z" }, { "id": "1", "text": "New: filter Tweet replies before sending results to your webhook.", "authorUsername": "product-updates", "createdAt": "2026-08-02T18:30:00.000Z" }, { "id": "2", "text": "Building an X monitor? Start with one profile and verify every event.", "authorUsername": "product-updates", "createdAt": "2026-08-02T18:30:00.000Z" } ] } ``` ## Handle save-style errors | Status | Error | Cause | Fix | | - | - | - | - | | `200` | None | Profile saved or replaced | Store `xUsername` for later requests. | | `400` | `invalid_input` | Label or Tweet array failed validation | Correct the rejected field. | | `401` | `unauthenticated` | Credential is missing or invalid | Replace the API key or bearer token. | | `429` | `rate_limit_exceeded` | Request exceeded the rate limit | Wait for `Retry-After`, then retry once. | The response widget lists every status in the OpenAPI contract. ### 400 Invalid input A request returns `400` when any required input fails validation. | Invalid input | Required correction | | - | - | | Missing or non-string `label` | Send one label string. | | Blank `label` | Add at least 1 visible character. | | Label longer than 50 characters | Shorten the label. | | Unsupported label character | Use letters, numbers, spaces, dots, hyphens, apostrophes, or underscores. | | Missing or non-array `tweets` | Send an array of Tweet objects. | | Empty `tweets` array | Add at least 1 example. | | More than 100 Tweet objects | Split or reduce the sample set. | | Missing, non-string, or blank `text` | Send non-empty text for every object. | Label validation can return a specific message. Other body failures use the general invalid-input response. `{ "error": "invalid_input", "message": "Label can only contain letters, numbers, spaces, dots, hyphens, and apostrophes." }` The validator also accepts underscores. Its current message omits that character. ### 401 Unauthenticated Replace the credential before retrying. Do not retry invalid credentials in a loop. ### 429 Rate limited Wait for the `Retry-After` header. Then retry the complete replacement body. ## Tweet style save checklist * Review every Tweet example before sending it. * Remove customer names, private replies, and temporary claims. * Name the profile in the path `{id}`. The `label` is optional. * Send 1-100 objects with non-empty `text` strings. * Store the returned lowercase `xUsername` key. * Confirm `tweetCount` matches the intended sample count. * Expect `isOwnAccount` to remain `false`. * Treat returned sample IDs as local positions. * Keep a copy of the full array before replacing an existing profile. * Handle `400`, `401`, and `429`. ## Tweet writing style questions ### What does save style analyze? Nothing. Save Style stores the supplied Tweet text and profile metadata. It does not calculate tone, vocabulary, sentiment, or performance. ### How many tweet examples can I save? Send between 1 and 100 Tweet objects. Prefer examples that show repeatable wording, structure, replies, links, and calls to action. ### Can I update an existing Twitter writing style? Yes. Send the same normalized body label with the complete replacement array. The operation replaces every stored example under that account-scoped key. ### Does the path ID rename a tweet style? No. The body label controls the stored key. Keep both values aligned, and delete the old key after creating a new label. ### Can saved tweet samples provide engagement analytics? No. Custom samples use local sequential IDs. Use cached live Tweet samples for likes, replies, reposts, quotes, bookmarks, and view counts. ### Can another Xquik account read my saved style? No. Retrieval uses both the authenticated user and normalized profile key. Another Xquik account has a separate style namespace. ### How do I use the style in a post draft? Pass the returned `xUsername` as `styleUsername` to [Build a Post Draft](/api-reference/compose/create). The response can include the matched examples in `styleTweets`. > [!NOTE] > > Compare [Analyze Style](/api-reference/styles/analyze) before saving custom > examples. Analyze Style caches Tweets from one X (Twitter) username. Save Style stores > only the text you supply. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Create a support ticket, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/support/create Open a private support ticket with a subject, message, screenshots, or videos. Save its ticket ID for replies, status updates, and downloads. Tickets are free. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/support/tickets` ## When to open a new ticket Use this route to open a new conversation with support. Send JSON for text-only tickets and multipart data for attachments. Use reply only after the response provides a ticket ID. **Free.** This endpoint does not consume credits. Use JSON for text-only tickets. Use `multipart/form-data` when attaching media. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/support/tickets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: replace-with-one-random-value" \ -H "Content-Type: application/json" \ -d '{ "subject": "Cannot connect X account", "body": "I keep getting a connection error when trying to link my account." }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/support/tickets", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json", }, body: JSON.stringify({ subject: "Cannot connect X account", body: "I keep getting a connection error when trying to link my account.", }), }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/support/tickets", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "replace-with-one-random-value", }, json={ "subject": "Cannot connect X account", "body": "I keep getting a connection error when trying to link my account.", }, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "subject": "Cannot connect X account", "body": "I keep getting a connection error when trying to link my account.", }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/support/tickets", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "replace-with-one-random-value") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` | Support ticket receipt column | Request or response source | Handoff rule | | - | - | - | | Idempotency key | Request header | Reuse it only for an identical retry. | | Ticket subject | Request `subject` | State the affected tweet, follower, or account workflow. | | Initial message | Request `body` | Include the failure and attempted fix. | | Ticket ID | Response `publicId` | Use this ID for status and reply requests. | | Attachment ID | `attachments[].publicId` | Store the attachment ID with the ticket. | | Attachment state | `attachments[].status` | Continue only when the attachment is `ready`. | | Safe replay | `Idempotency-Replayed: true` | Reuse the original ticket response. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Use `application/json` for text only. Use `multipart/form-data` for media. | | `Idempotency-Key` | `string` | No | Generate one random value for this submission. Reuse it only when retrying identical text and attachments. A replay returns the original ticket with `Idempotency-Replayed: true`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `subject` | `string` | Yes | Ticket subject. 1-500 characters. | | `body` | `string` | Yes | Initial message. 1-10,000 characters. | | `attachments` | `file[]` | No | Up to 4 JPEG, PNG, GIF, WebP, MP4, MOV, or WebM files. Images can be 10 MB each. Videos can be 25 MB each. Combined media can be 30 MB. | For a media-only ticket, omit `body` and include at least 1 attachment. ```bash cURL With Media theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/support/tickets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: replace-with-one-random-value" \ -F "subject=Video upload problem" \ -F "body=The attached recording shows the failure." \ -F "attachments=@screen.png" \ -F "attachments=@recording.mp4" | jq ``` ## Response ### 201 Created | Field | Type | Description | | - | - | - | | `publicId` | `string` | Unique ticket public ID. | | `attachments` | `object[]` | Created media receipts. | | `attachments[].publicId` | `string` | Private attachment public ID. | | `attachments[].status` | `string` | The upload status is `ready` or `failed`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "publicId": "tkt_a1b2c3d4e5f6a1b2c3d4e5f6", "attachments": [ { "publicId": "att_a1b2c3d4e5f6a1b2c3d4e5f6", "status": "ready" } ] } ``` ### 200 Replayed Returns the original response after a safe retry. The `Idempotency-Replayed` response header is `true`. ### 400 Invalid input Missing or invalid `subject` or `body` field. ### 401 Unauthenticated Missing or invalid API key. ### 409 Conflict The `Idempotency-Key` already belongs to different text or attachments. Generate a new key for the changed request. ### 429 Rate limited Wait for the `Retry-After` value before opening another ticket. > [!NOTE] > > **Next steps.** [Support Media](/api-reference/support/media) explains privacy, formats, limits, status handling, and downloads. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "publicId": "tkt_a1b2c3d4e5f6a1b2c3d4e5f6", "attachments": [] } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **409** `{ "error": "idempotency_key_conflict", "message": "Reuse this Idempotency-Key only with the original request." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Get a support ticket, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/support/get Retrieve one support ticket by ID with its subject, status, complete message history, private attachments, and timestamps. Reading a ticket costs no credits. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/support/tickets/{id}` ## When to read one ticket Use this route when one ticket ID needs full message history. Use list for summaries across tickets. Use reply or update only when the conversation or status must change. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET https://xquik.com/api/v1/support/tickets/tkt_a1b2c3d4e5f6a1b2c3d4e5f6 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const ticketId = "tkt_a1b2c3d4e5f6a1b2c3d4e5f6"; const response = await fetch(`https://xquik.com/api/v1/support/tickets/${ticketId}`, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests ticket_id = "tkt_a1b2c3d4e5f6a1b2c3d4e5f6" response = requests.get( f"https://xquik.com/api/v1/support/tickets/{ticket_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" ) func main() { ticketID := "tkt_a1b2c3d4e5f6a1b2c3d4e5f6" req, err := http.NewRequest("GET", "https://xquik.com/api/v1/support/tickets/"+ticketID, nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` | Support ticket history column | Response source | Review rule | | - | - | - | | Ticket ID | `publicId` | Match the requested ticket before processing. | | Ticket subject | `subject` | Keep the reported workflow visible. | | Current state | `status` | Handle open, in-progress, resolved, and closed tickets separately. | | Message author | `messages[].sender` | Separate user and support replies. | | Message text | `messages[].body` | Keep messages in time order. | | Attachment state | `messages[].attachments[].status` | Download only ready attachments. | | Updated at | `updatedAt` | Stop polling after the expected state arrives. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ticket public ID (for example `tkt_a1b2c3d4e5f6a1b2c3d4e5f6`). Returned when you [create a ticket](/api-reference/support/create) or [list tickets](/api-reference/support/list). | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `publicId` | `string` | Unique ticket public ID. | | `subject` | `string` | Ticket subject. | | `status` | `string` | The current status is `open`, `in_progress`, `resolved`, or `closed`. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `updatedAt` | `string` | ISO 8601 last update timestamp. | | `messages` | `object[]` | Array of message objects in time order. | | `messages[].body` | `string` | Message content. | | `messages[].sender` | `string` | The sender is `user` or `support`. | | `messages[].createdAt` | `string` | ISO 8601 timestamp of when the sender posted the message. | | `messages[].attachments` | `object[]` | Private image and video attachments. | | `messages[].attachments[].publicId` | `string` | Attachment public ID. | | `messages[].attachments[].filename` | `string` | Original filename. | | `messages[].attachments[].contentType` | `string` | Validated media type. | | `messages[].attachments[].kind` | `string` | `image` or `video`. | | `messages[].attachments[].sizeBytes` | `integer` | File size in bytes. | | `messages[].attachments[].status` | `string` | `ready`, `pending`, or `failed`. | | `messages[].attachments[].url` | `string` | Authenticated download path. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "publicId": "tkt_a1b2c3d4e5f6a1b2c3d4e5f6", "subject": "Cannot connect X account", "status": "open", "createdAt": "2026-03-18T10:00:00Z", "updatedAt": "2026-03-18T12:30:00Z", "messages": [ { "body": "I keep getting a connection error when trying to link my account.", "sender": "user", "createdAt": "2026-03-18T10:00:00Z", "attachments": [ { "publicId": "att_a1b2c3d4e5f6a1b2c3d4e5f6", "filename": "recording.mp4", "contentType": "video/mp4", "kind": "video", "sizeBytes": 18294386, "status": "ready", "url": "/api/v1/support/attachments/att_a1b2c3d4e5f6a1b2c3d4e5f6" } ] }, { "body": "Could you try disconnecting and reconnecting your account from the dashboard?", "sender": "support", "createdAt": "2026-03-18T11:15:00Z" } ] } ``` ### 401 Unauthenticated Missing or invalid API key. ### 404 Not found No ticket exists with this ID, or it belongs to a different account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Wait for the `Retry-After` value before fetching the ticket again. > [!NOTE] > > **Related.** [Support Media](/api-reference/support/media) explains how agents should handle attachment statuses and downloads. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List support tickets, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/support/list List up to 10,000 Xquik support tickets in recent-update order. Review each ticket ID, subject, status, message count, creation time & latest update timestamp. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/support/tickets` ## List support tickets for Xquik workflows List the signed-in account's Xquik support tickets. Review connection failures, tweet write errors, follower exports, monitor alerts, webhooks, or billing cases. This endpoint returns the documented ticket summary fields. Fetch [Get Ticket](/api-reference/support/get) when you need message bodies or attachment metadata. **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET https://xquik.com/api/v1/support/tickets \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/support/tickets", { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const result = await response.json(); if (!response.ok) throw new Error(JSON.stringify(result)); const activeTickets = result.tickets.filter((ticket) => ["open", "in_progress"].includes(ticket.status), ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/support/tickets", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) result = response.json() response.raise_for_status() active_tickets = [ ticket for ticket in result["tickets"] if ticket["status"] in {"open", "in_progress"} ] ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" ) func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/support/tickets", nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Read the support ticket list Use the list as a support queue. Store ticket IDs and timestamps before requesting any detailed history. | Support queue column | Response field | Review rule | | - | - | - | | Ticket ID | `publicId` | Use this stable ID for details, replies, and status changes. | | Reported issue | `subject` | Keep the affected Xquik workflow visible. | | Current state | `status` | Handle open, in-progress, resolved, and closed cases separately. | | Conversation size | `messageCount` | Compare with the previously stored count. | | Opened time | `createdAt` | Measure the ticket's age. | | Latest activity | `updatedAt` | Process recently changed tickets first. | The endpoint returns up to 10,000 tickets. It sorts the newest `updatedAt` value first. Pass `nextCursor` as `cursor` to read older tickets. The request has no search or status query parameter. Filter the returned array locally. Match `publicId`, `subject`, or `status` without sending another list request. ## Interpret support ticket status The support ticket API returns 4 status values. Listing tickets never changes any status. | Status | Meaning | Next action | | - | - | - | | `open` | A new ticket or user reply needs review. | Read the complete message history. | | `in_progress` | Support has responded or continues the investigation. | Check the newest support message. | | `resolved` | The reported workflow has a proposed resolution. | Verify the fix before reopening. | | `closed` | The conversation is complete. | Keep the ticket ID for future reference. | Users can set `open`, `resolved`, or `closed` through the update route. Support sets `in_progress`. Do not invent another state in client code. ## Build a support ticket review queue 1. Call `GET /support/tickets` with one Xquik API key. 2. Save the returned `publicId` and `updatedAt` values. 3. Keep the response order for a recent-activity queue. 4. Compare each `messageCount` with your previous list. 5. Fetch ticket details when the count or timestamp changes. 6. Read each message and attachment status before replying. 7. Update the ticket only after confirming the intended state. Use [Reply to Ticket](/api-reference/support/reply) for new investigation details. Use [Update Ticket Status](/api-reference/support/update) for workflow state changes. Both routes keep the existing ticket ID. Do not create a duplicate ticket for every retry. Reuse the original `publicId` while the subject describes the same problem. ## Triage X API and Twitter scraper problems Keep ticket subjects specific. Name the affected tweet, follower, monitor, webhook, X account, or billing workflow. These local queue categories are useful. * X account connection or reauthentication. * Tweet creation, deletion, reply, like, or repost actions. * Follower, following, timeline, reply, or media exports. * Keyword monitors, account monitors, and webhook deliveries. * API key authentication, credits, subscription checkout, or top-ups. The list response does not explain the failure. Fetch the matching ticket before making a product decision. For a `429` response, wait for `Retry-After`. Reuse the last successful list during that pause. ## Support ticket API questions ### Does the list include ticket messages? The response returns `messageCount`, not message text. Fetch the ticket by `publicId` to read its chronological conversation. ### Does the list include attachments? The response omits attachment filenames, types, sizes, states, and download URLs. Fetch the detailed ticket to inspect attachments. ### Can I search support tickets by subject? The endpoint accepts no search query. Filter the returned ticket summaries by `subject` in your client. ### Can I filter tickets by status? The endpoint accepts no status query. Filter `open`, `in_progress`, `resolved`, or `closed` after receiving the list. ### Which ticket should I read first? Start with the first changed ticket. Results already use descending `updatedAt` order. ### Does listing tickets consume Xquik credits? No. Listing support tickets is free for authenticated accounts. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | An OAuth bearer token formatted as `Bearer YOUR_TOKEN`. Send this header or `x-api-key`, not both. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Maximum items per page, from 1 to 10,000. Default 200. | | `cursor` | `string` | No | `nextCursor` from the previous page. The `after` alias also works. Offset pagination is not supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tickets` | `object[]` | Array of ticket objects. | | `tickets[].publicId` | `string` | Unique ticket public ID. | | `tickets[].subject` | `string` | Ticket subject. | | `tickets[].status` | `string` | The current status is `open`, `in_progress`, `resolved`, or `closed`. | | `tickets[].messageCount` | `number` | Total number of messages in the ticket. | | `tickets[].createdAt` | `string` | ISO 8601 creation timestamp. | | `tickets[].updatedAt` | `string` | ISO 8601 last update timestamp. | | `hasMore` | `boolean` | Whether more rows follow this page. | | `nextCursor` | `string` | Pass it as `cursor` for the next page. Present when `hasMore` is `true`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tickets": [ { "publicId": "tkt_a1b2c3d4e5f6a1b2c3d4e5f6", "subject": "Cannot connect X account", "status": "open", "messageCount": 3, "createdAt": "2026-03-18T10:00:00Z", "updatedAt": "2026-03-18T12:30:00Z" } ], "hasMore": false } ``` ### 400 Invalid cursor `{ "error": "invalid_input", "message": "Cursor invalid. Use nextCursor from the previous page, or omit it to start over." }` The `cursor` is not one this list returned. Send the `nextCursor` of the previous page, or omit it. ### 401 Unauthenticated Missing or invalid API key. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Wait for the `Retry-After` value before listing tickets again. > [!NOTE] > > **Related.** > > * [Create Ticket](/api-reference/support/create) to open a new ticket. > * [Get Ticket](/api-reference/support/get) to fetch details and message history for a specific ticket. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Upload support ticket media, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/support/media Upload or download private support ticket screenshots and videos with authenticated multipart requests and attachment IDs. Video downloads accept 1 byte range. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/support/attachments/{id}` Support attachments stay private. Every download requires authentication and access to the parent ticket. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/support/attachments/att_a1b2c3d4e5f6a1b2c3d4e5f6 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ --output attachment.bin ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const attachmentId = "att_a1b2c3d4e5f6a1b2c3d4e5f6"; const response = await fetch(`https://xquik.com/api/v1/support/attachments/${attachmentId}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const bytes = new Uint8Array(await response.arrayBuffer()); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests attachment_id = "att_a1b2c3d4e5f6a1b2c3d4e5f6" response = requests.get( f"https://xquik.com/api/v1/support/attachments/{attachment_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) response.raise_for_status() media_bytes = response.content ``` ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Attachment public ID from a ticket message or upload receipt. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | | `Range` | `string` | No | 1 standard byte range for video seeking or resumable downloads, such as `bytes=0-1048575`. | ## Supported media | Kind | Formats | Per-file limit | | - | - | - | | Image | JPEG, PNG, GIF, WebP | 10 MB | | Video | MP4, MOV, WebM | 25 MB | Each message accepts up to 4 files and 30 MB combined. Per-account upload limits also apply. A `429` response includes `Retry-After`. Xquik validates file signatures and ignores the declared content type. A renamed file with the wrong format fails validation. ## Agent workflow 1. Send multipart fields named `attachments`. 2. Read each returned receipt. 3. Treat `ready` as downloadable. 4. Treat `failed` as unavailable and ask the user to retry. 5. Fetch the ticket before downloading media. 6. Use the returned authenticated `url` unchanged. 7. Reuse the submission `Idempotency-Key` when you retry after a network failure. Ticket and reply retries return the original media receipts. A lost response then creates no duplicate ticket, message, or stored file. Never convert the relative `url` into a public link. It requires the same account authentication as the ticket. ## Range example Video downloads support 1 standard byte range. Use ranges for seeking or resumable playback. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/support/attachments/att_a1b2c3d4e5f6a1b2c3d4e5f6 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Range: bytes=0-1048575" \ --output video-part.bin ``` ## Response > [tab] 200 OK > > Returns the complete image or video body with its validated content type. > [tab] 206 Partial content > > Returns the requested byte range with `Content-Range` and `Accept-Ranges: bytes`. > [tab] 401 Unauthenticated > > Refresh authentication before retrying. > [tab] 404 Not found > > The media is missing, unavailable, or outside the authenticated account. > [tab] 416 Range not satisfiable > > Correct the `Range` header before retrying. > [tab] 429 Rate limited > > Wait for the `Retry-After` value. ## Agent status map | Status | Meaning | Agent action | | - | - | - | | `200` | Complete media | Read or save the body. | | `206` | Requested byte range | Continue range requests when needed. | | `401` | Authentication failed | Refresh authentication. | | `404` | Missing or unauthorized | Do not reveal which condition applied. | | `416` | Invalid range | Correct the `Range` header. | | `429` | Download limit reached | Wait for `Retry-After`. | > [!NOTE] > > Create media with [Create Ticket](/api-reference/support/create) or [Reply to Ticket](/api-reference/support/reply). Read attachment metadata with [Get Ticket](/api-reference/support/get). ## Response examples * **200** `` * **206** `` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **416** `{ "error": "invalid_range", "message": "Use one valid byte range." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Reply to a support ticket, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/support/reply Reply to a support ticket with text, screenshots, or videos. Attach private media and read the saved message receipt. An idempotency key makes retries safe. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/support/tickets/{id}/messages` **Free.** This endpoint does not consume credits. Use JSON for text-only replies. Use `multipart/form-data` when attaching media. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/support/tickets/tkt_a1b2c3d4e5f6a1b2c3d4e5f6/messages \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: replace-with-one-random-value" \ -H "Content-Type: application/json" \ -d '{ "body": "That worked, thank you!" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const ticketId = "tkt_a1b2c3d4e5f6a1b2c3d4e5f6"; const response = await fetch(`https://xquik.com/api/v1/support/tickets/${ticketId}/messages`, { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json", }, body: JSON.stringify({ body: "That worked, thank you!", }), }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests ticket_id = "tkt_a1b2c3d4e5f6a1b2c3d4e5f6" response = requests.post( f"https://xquik.com/api/v1/support/tickets/{ticket_id}/messages", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "replace-with-one-random-value", }, json={"body": "That worked, thank you!"}, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { ticketID := "tkt_a1b2c3d4e5f6a1b2c3d4e5f6" body, _ := json.Marshal(map[string]interface{}{ "body": "That worked, thank you!", }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/support/tickets/"+ticketID+"/messages", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "replace-with-one-random-value") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Send a support reply once Read the ticket before composing a response. Confirm its public ID, status, latest sender, and most recent message. Another operator may have answered already. Choose the request format by content. Send JSON for text only. Use multipart form fields when screenshots or videos are required. Write a specific message body. Reference the observed problem, completed check, or requested next step. Avoid pasting secrets, API keys, or private browser session details. Review every attachment before upload. Use only the documented image and video formats. Keep each file and the combined request within the documented size limits. Generate one idempotency key after the text and attachments are final. Reuse it only when the identical request loses its response. Changed text or files require a new key. Read each reply status. * `201` means Xquik created the new message. * `200` with `Idempotency-Replayed` returns the earlier message. * `409` means the key already represents different content. * `404` means the ticket is missing or belongs to another account. * `429` requires waiting for `Retry-After`. Store the ticket ID, idempotency key, reply time, and attachment receipts. Do not store attachment bytes in shared logs. Fetch the ticket again after creation. Confirm the message appears once and the sender is correct. Inspect each attachment status before telling the user a screenshot or video is available. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ticket public ID (for example `tkt_a1b2c3d4e5f6a1b2c3d4e5f6`). Returned when you [create a ticket](/api-reference/support/create) or [list tickets](/api-reference/support/list). | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Use `application/json` for text only. Use `multipart/form-data` for media. | | `Idempotency-Key` | `string` | No | Generate one random value for this reply. Reuse it only when retrying identical text and attachments. A replay returns the original message with `Idempotency-Replayed: true`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `body` | `string` | Yes | Message content. 1-10,000 characters. | | `attachments` | `file[]` | No | Up to 4 JPEG, PNG, GIF, WebP, MP4, MOV, or WebM files. The same per-file and 30 MB combined limits apply. | For a media-only reply, omit `body` and include at least 1 attachment. ```bash cURL With Media theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/support/tickets/tkt_a1b2c3d4e5f6a1b2c3d4e5f6/messages \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: replace-with-one-random-value" \ -F "body=This recording shows the current behavior." \ -F "attachments=@recording.mp4" | jq ``` ## Response ### 201 Created | Field | Type | Description | | - | - | - | | `publicId` | `string` | Public ID of the ticket that received the message. | | `attachments` | `object[]` | Created media receipts. | | `attachments[].publicId` | `string` | Private attachment public ID. | | `attachments[].status` | `string` | The upload status is `ready` or `failed`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "publicId": "tkt_a1b2c3d4e5f6a1b2c3d4e5f6", "attachments": [] } ``` ### 200 Replayed Returns the original response after a safe retry. The `Idempotency-Replayed` response header is `true`. ### 400 Invalid input Missing or invalid `body` field. ### 401 Unauthenticated Missing or invalid API key. ### 404 Not found No ticket exists with this ID, or it belongs to a different account. ### 409 Conflict The `Idempotency-Key` already belongs to different text or attachments. Generate a new key for the changed reply. ### 429 Rate limited Wait for the `Retry-After` value before adding another reply. > [!NOTE] > > **Related.** [Support Media](/api-reference/support/media) explains private downloads and upload limits. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "publicId": "tkt_a1b2c3d4e5f6a1b2c3d4e5f6", "attachments": [] } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "idempotency_key_conflict", "message": "Reuse this Idempotency-Key only with the original request." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Update a support ticket status, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/support/update Resolve, close, or reopen a support ticket by ID. Its messages and attachments stay unchanged. Support staff alone set in_progress. The call costs no credits. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/support/tickets/{id}` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/support/tickets/tkt_a1b2c3d4e5f6a1b2c3d4e5f6 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "status": "resolved" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const ticketId = "tkt_a1b2c3d4e5f6a1b2c3d4e5f6"; const response = await fetch(`https://xquik.com/api/v1/support/tickets/${ticketId}`, { method: "PATCH", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ status: "resolved", }), }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests ticket_id = "tkt_a1b2c3d4e5f6a1b2c3d4e5f6" response = requests.patch( f"https://xquik.com/api/v1/support/tickets/{ticket_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={"status": "resolved"}, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { ticketID := "tkt_a1b2c3d4e5f6a1b2c3d4e5f6" body, _ := json.Marshal(map[string]interface{}{ "status": "resolved", }) req, err := http.NewRequest("PATCH", "https://xquik.com/api/v1/support/tickets/"+ticketID, bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ticket public ID (for example `tkt_a1b2c3d4e5f6a1b2c3d4e5f6`). Returned when you [create a ticket](/api-reference/support/create) or [list tickets](/api-reference/support/list). | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `status` | `string` | Yes | New status. Use `open`, `resolved`, or `closed`. Support staff set the `in_progress` status. You cannot set it through the API. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `publicId` | `string` | Unique ticket public ID. | | `status` | `string` | Updated ticket status. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "publicId": "tkt_a1b2c3d4e5f6a1b2c3d4e5f6", "status": "resolved" } ``` ### 400 Invalid input Missing or invalid `status` value. ### 401 Unauthenticated Missing or invalid API key. ### 404 Not found `{ "error": "not_found", "message": "Ticket not found." }` No support ticket matches the supplied public ID. ### 429 Rate limited Wait for the `Retry-After` value before updating ticket status again. > [!NOTE] > > **Related.** > > * [Get Ticket](/api-reference/support/get) to fetch ticket details and message history. > * [Reply to Ticket](/api-reference/support/reply) to add a message. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Trending topics & hashtags, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/trends/list Use the Twitter Trends API to get ranked topics and hashtags by WOEID. Return search queries, ranks, public post counts, URLs, and regional result totals. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/trends` ## Use the top-level Twitter trends API `GET /trends` is Xquik's top-level alias for ranked WOEID topics. It returns `total`. `/x/trends` returns `count` instead. Keep one response shape throughout each client. **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/trends?woeid=23424977&count=10" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const regionWoeid = "23424977"; const requestedCount = "10"; const params = new URLSearchParams({ woeid: regionWoeid, count: requestedCount }); const response = await fetch(`https://xquik.com/api/v1/trends?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const returnedTotal = data.trends.length; const trendRows = data.trends.map((trend) => ({ trend_name: trend.name, rank: trend.rank ?? null, description: trend.description ?? null, search_query: trend.query ?? trend.name, region_woeid: data.woeid, requested_count: Number(requestedCount), returned_total: returnedTotal, })); for (const row of trendRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests region_woeid = 23424977 requested_count = 10 response = requests.get( "https://xquik.com/api/v1/trends", params={"woeid": region_woeid, "count": requested_count}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() returned_total = len(data["trends"]) trend_rows = [ { "trend_name": trend["name"], "rank": trend.get("rank"), "description": trend.get("description"), "search_query": trend.get("query", trend["name"]), "region_woeid": data["woeid"], "requested_count": requested_count, "returned_total": returned_total, } for trend in data["trends"] ] for row in trend_rows: print(json.dumps(row)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" "os" ) type Trend struct { Name string `json:"name"` Rank *int `json:"rank,omitempty"` Description *string `json:"description,omitempty"` Query *string `json:"query,omitempty"` } type TrendsResponse struct { Trends []Trend `json:"trends"` Total int `json:"total"` Woeid int `json:"woeid"` } type TrendRow struct { TrendName string `json:"trend_name"` Rank *int `json:"rank"` Description *string `json:"description"` SearchQuery string `json:"search_query"` RegionWoeid int `json:"region_woeid"` RequestedCount int `json:"requested_count"` ReturnedTotal int `json:"returned_total"` } func main() { const requestedCount = 10 req, err := http.NewRequest("GET", "https://xquik.com/api/v1/trends?woeid=23424977&count=10", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_your_api_key_here") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var data TrendsResponse if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { log.Fatal(err) } returnedTotal := len(data.Trends) encoder := json.NewEncoder(os.Stdout) for _, trend := range data.Trends { searchQuery := trend.Name if trend.Query != nil { searchQuery = *trend.Query } if err := encoder.Encode(TrendRow{ TrendName: trend.Name, Rank: trend.Rank, Description: trend.Description, SearchQuery: searchQuery, RegionWoeid: data.Woeid, RequestedCount: requestedCount, ReturnedTotal: returnedTotal, }); err != nil { log.Fatal(err) } } } ``` ## Build a regional Twitter trending monitor Use `GET /trends` for regional dashboards, alerts, queues, warehouses, or agents. The examples emit one JSON line per trend. Store `trend_name`, `rank`, `description`, and `search_query`. Record `region_woeid` and `requested_count` with each snapshot. Record `returned_total` beside those request fields. Map `name` and `query` to the 2 trend text fields. Map `woeid` and request `count` to the 2 request fields. Derive `returned_total` from `trends.length`. The raw `total` counts valid trends before `count` slicing. Pass `search_query` to [Search Tweets](/api-reference/x/search-tweets). That search finds related tweets, hashtags, or brand mentions. Save each snapshot before you search. Compare ranks only within one WOEID. Keep missing optional fields unset. Store null `tweetVolume` values as null. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `woeid` | `number` | No | Region WOEID. See supported regions below. Omit it to use `1` for Worldwide. | | `count` | `number` | No | Number of trends to return. Max `50`, default `30`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `trends` | `object[]` | Ranked topic records. | | `trends[].name` | `string` | Trend name or hashtag. | | `trends[].description` | `string` | Optional trend description. | | `trends[].rank` | `number` | Optional ranking position. | | `trends[].query` | `string` | Optional tweet-search query. | | `trends[].promotedContent` | `string \| null` | Optional promotion ID. Null for organic trends. | | `trends[].tweetVolume` | `number \| null` | Optional public post count. | | `trends[].url` | `string` | Optional trend search URL. | | `total` | `number` | Valid trend count before `count` slicing. | | `woeid` | `number` | Requested region WOEID. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "trends": [ { "name": "#SuperBowl", "description": "Trending in United States", "rank": 1, "query": "%23SuperBowl", "promotedContent": null, "tweetVolume": 250000, "url": "https://x.com/search?q=%23SuperBowl" }, { "name": "Taylor Swift", "rank": 2, "query": "%22Taylor%20Swift%22" } ], "total": 50, "woeid": 1 } ``` ### 400 Invalid input Use a supported WOEID. Invalid `count` values fall back to `30`. ### 401 Unauthenticated Replace the missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get a top-up option. Anonymous direct MPP shows 2 payment choices. Choose either the payment challenge or the guest wallet action. No checkout starts automatically. ### 502 X API unavailable The read service failed. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded Wait for `Retry-After` before retrying. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Twitter trends API questions ### How do I get Twitter trends programmatically? Call `GET /trends` with a WOEID and result count. Read each returned topic field described above. ### Can I get location-based trending topics? Yes. Use a listed WOEID and keep it with each rank snapshot. ### Does the API return historical Twitter trends? This route returns the current list only. `GET /x/trends` takes `at` for a past time, and [Get trends history](/api-reference/x/trends-history) returns a range. The archive starts 2026-10-13 02:20 UTC. ### How do I authenticate to the Twitter trends API? Send an account key, OAuth token, guest key, or direct MPP credential. ### Is the Twitter trends API free? No. The pricing callout shows each successful call's cost. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official trends endpoint. ## Regions Use these WOEIDs in the `woeid` query parameter. Use `1` for Worldwide. > [card] Global & Americas > > * `1` - Worldwide > * `23424977` - United States > * `23424775` - Canada > * `23424900` - Mexico > * `23424768` - Brazil > [card] Europe > > * `23424975` - United Kingdom > * `23424969` - Turkey > * `23424950` - Spain > * `23424829` - Germany > * `23424819` - France > [card] Asia > > * `23424856` - Japan > * `23424848` - India > [!NOTE] > > **Related.** [Billing & Usage](/guides/billing) · [Search Tweets](/api-reference/x/search-tweets) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Create a signed webhook, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/webhooks/create Register an HTTPS endpoint for signed events from account, keyword & post monitors, follower changes too. Choose event types. Xquik returns the secret once. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/webhooks` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-server.com/webhook", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/webhooks", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ url: "https://your-server.com/webhook", eventTypes: ["tweet.new", "tweet.reply"], }), }); const webhook = await response.json(); const webhookSecret = webhook.secret; // Store webhookSecret in your secret manager; do not print it in logs. ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/webhooks", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "url": "https://your-server.com/webhook", "eventTypes": ["tweet.new", "tweet.reply"], }, ) webhook = response.json() webhook_secret = webhook["secret"] # Store webhook_secret in your secret manager; do not print it in logs. ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "log" "net/http" ) func main() { payload := map[string]interface{}{ "url": "https://your-server.com/webhook", "eventTypes": []string{"tweet.new", "tweet.reply"}, } body, err := json.Marshal(payload) if err != nil { log.Fatal(err) } req, err := http.NewRequest("POST", "https://xquik.com/api/v1/webhooks", bytes.NewReader(body)) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var webhook map[string]any if err := json.NewDecoder(resp.Body).Decode(&webhook); err != nil { log.Fatal(err) } secret, _ := webhook["secret"].(string) // Store secret in your secret manager; do not print it in logs. _ = secret } ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `url` | `string` | Yes | HTTPS endpoint URL where Xquik delivers events. Xquik rejects HTTP URLs. It also rejects URLs resolving to private or internal IP addresses. These are localhost, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, and 169.254.x.x. A Discord channel webhook URL, such as `https://discord.com/api/webhooks/...`, gets alerts as Discord messages. A Slack incoming webhook URL, such as `https://hooks.slack.com/services/...`, gets alerts as Slack messages. - The events of 1 post come as 1 alert. An example title is "New post with media". - Alerts that wait together come as 1 message. - A busy channel gets 5 quick messages, then 1 every 30 seconds. - Each event keeps its own delivery. With it, retries and resume work as for any webhook. | | `eventTypes` | `string[]` | Yes | Array of event types to subscribe to. At least 1 required. Use any valid account monitor event type listed below. Keyword monitors emit only `tweet.*` event types. Account monitors can emit both `tweet.*` and `profile.*` event types. [Post monitors](/api-reference/monitors/create-post) emit only `post.*` event types. | ## Valid event types Valid types are `tweet.new`, `tweet.quote`, `tweet.reply`, `tweet.retweet`, `tweet.media`, `tweet.link`, `tweet.poll`, `tweet.mention`, `tweet.hashtag`, `tweet.longform`. Valid types are also `profile.avatar.changed`, `profile.banner.changed`, `profile.name.changed`, `profile.username.changed`, `profile.bio.changed`, `profile.location.changed`, `profile.url.changed`, `profile.verified.changed`, `profile.protected.changed`, `profile.pinned_tweet.changed`. Valid types are also `profile.unavailable.changed`, `tweet.deleted`, `broadcast.started`, `space.started`, `following.added`, `following.removed`, `follower.added`, `follower.removed`, `profile.followers.changed`, `profile.following.changed`. Post monitor types are `post.reply.new`, `post.quote.new`, `post.likes.changed`, `post.retweets.changed`, `post.replies.changed`, `post.quotes.changed`, `post.bookmarks.changed`, `post.views.changed`, `post.edited` & `post.deleted`. A webhook takes up to 40 types. > [card] tweet.new > > Original tweet from an account monitor or matching keyword monitor. Use for > new posts that are not replies, quotes, or retweets. > [card] tweet.quote > > Quote tweet from an account monitor or matching keyword monitor. Pair with > monitors that include `tweet.quote`. > [card] tweet.reply > > Reply from an account monitor or matching keyword monitor. Pair with > monitors that include `tweet.reply`. > [card] tweet.retweet > > Retweet from an account monitor or matching keyword monitor. Pair with > monitors that include `tweet.retweet`. > [!NOTE] > > Only the [Test Webhook](/api-reference/webhooks/test) endpoint sends `webhook.test`. You cannot subscribe to it in `eventTypes`. ## Integration handoff Use this endpoint after you create a monitor. For an account monitor, call [`POST /monitors`](/api-reference/monitors/create). For a keyword monitor, call [`POST /monitors/keywords`](/api-reference/monitors/create-keyword). The webhook stores the HTTPS endpoint and event-type filter. Active monitors produce the events. Monitor billing includes webhook delivery. Store these fields right after creation. > [card] Webhook ID > > Store `id` for `POST /webhooks/{id}/test`, updates, deletes, and delivery > lookups. > [card] Delivery URL > > Store `url` to audit which queue, CRM, warehouse, or app endpoint receives > monitor events. > [card] Event filter > > Store `eventTypes`. Also keep the webhook filter aligned with the account or > keyword monitor event types. > [card] Signing secret > > Store `secret` once and use it to verify `X-Xquik-Signature` on the raw > request body. > [card] Created at > > Store `createdAt` for audit logs and later configuration checks. > [card] Delivery payload > > Expect HTTPS `POST` bodies with `eventType`, `schemaVersion`, `deliveryId`, > `streamEventId`, `occurredAt`, and `data`. Bodies also have `username` for > account monitor events or `query` for keyword monitor events. Every delivery includes `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce` headers. Use `deliveryId` as the per-endpoint idempotency key. Use `streamEventId` when you must process one monitor event once across retries or endpoints. Test the endpoint with [`POST /webhooks/{id}/test`](/api-reference/webhooks/test) before routing production events. Return a `2xx` response within 10 seconds. Process slow Slack, CRM, warehouse, or queue work afterward. Use [Signature Verification](/webhooks/verification) to validate the raw request body before processing. ## Response ### 201 Created | Field | Type | Description | | - | - | - | | `id` | `string` | Unique webhook identifier. | | `url` | `string` | The registered delivery endpoint. | | `eventTypes` | `string[]` | Event types this webhook subscribes to. | | `secret` | `string` | HMAC signing secret (64-character hex string). Xquik returns it only at creation. Store it in a secret manager. | | `createdAt` | `string` | ISO 8601 creation timestamp. | | `ignoredFields` | `string[]` | Fields the request sent that this route does not read, in the order sent. They changed nothing. Omitted when the request sent only `url` and `eventTypes`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "15", "url": "https://your-server.com/webhook", "eventTypes": ["tweet.new", "tweet.reply"], "secret": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2", "createdAt": "2026-02-24T10:30:00.000Z" } ``` > [!WARNING] > > The API returns `secret` once. Store it in a secret manager. You need it to [verify webhook signatures](/webhooks/verification). You cannot retrieve it again. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key or session cookie. ### 400 Invalid input `{ "error": "invalid_input", "message": "Invalid URL or event types" }` Invalid URL (must be HTTPS) or empty `eventTypes` array. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. > [!NOTE] > > This endpoint accepts 2 auth methods. Send an API key in the `x-api-key` header. Or send a session cookie from the dashboard. > > **Next steps.** [List Webhooks](/api-reference/webhooks/list) · [Signature Verification](/webhooks/verification) · [Webhooks Overview](/webhooks/overview) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Delete a webhook endpoint, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/webhooks/delete Deactivate a webhook endpoint and stop future monitor event deliveries to its URL. The record and delivery history stay. Reactivate it later with PATCH. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/webhooks/{id}` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/webhooks/15 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq --arg webhook_id "15" '{ webhook_id: $webhook_id, success, inventory_endpoint: "/api/v1/webhooks", deliveries_endpoint: ("/api/v1/webhooks/" + $webhook_id + "/deliveries") }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const webhookId = "15"; const response = await fetch(`https://xquik.com/api/v1/webhooks/${webhookId}`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const result = await response.json(); const deactivationHandoff = { webhook_id: webhookId, success: result.success === true, inventory_endpoint: "/api/v1/webhooks", deliveries_endpoint: `/api/v1/webhooks/${webhookId}/deliveries`, }; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests webhook_id = "15" response = requests.delete( f"https://xquik.com/api/v1/webhooks/{webhook_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) result = response.json() deactivation_handoff = { "webhook_id": webhook_id, "success": result["success"] is True, "inventory_endpoint": "/api/v1/webhooks", "deliveries_endpoint": f"/api/v1/webhooks/{webhook_id}/deliveries", } ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" ) type DeleteResult struct { Success bool `json:"success"` } type DeactivationHandoff struct { DeliveriesEndpoint string `json:"deliveries_endpoint"` InventoryEndpoint string `json:"inventory_endpoint"` Success bool `json:"success"` WebhookID string `json:"webhook_id"` } func main() { webhookID := "15" req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/webhooks/"+webhookID, nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var result DeleteResult if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { log.Fatal(err) } handoff := DeactivationHandoff{ DeliveriesEndpoint: "/api/v1/webhooks/" + webhookID + "/deliveries", InventoryEndpoint: "/api/v1/webhooks", Success: result.Success, WebhookID: webhookID, } _ = handoff } ``` These snippets build a deactivation receipt. Store the webhook ID with its list and delivery-log endpoints. Do not print the raw delete response. ## What delete does `DELETE /webhooks/{id}` deactivates the endpoint by setting `isActive` to `false`. It does not remove the record. The webhook record stays available in [List Webhooks](/api-reference/webhooks/list). Its previous delivery rows stay available in [List Deliveries](/api-reference/webhooks/deliveries). The response contains only `{ "success": true }`. It does not return the URL, event types, or signing secret. To receive events again, call [Update Webhook](/api-reference/webhooks/update) with `isActive: true`. Then run [Test Webhook](/api-reference/webhooks/test) before routing production monitor events to the receiver. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The webhook ID to deactivate. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. This endpoint also accepts session cookie authentication. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `success` | `boolean` | Always `true` on successful deactivation. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": true } ``` Xquik deactivates the webhook immediately. It may still attempt in-flight deliveries, but it queues no new deliveries. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key or session cookie. ### 400 Invalid ID `{ "error": "invalid_id", "message": "Invalid webhook ID format" }` The provided webhook ID is not a valid format. ### 404 Not found `{ "error": "not_found", "message": "Webhook not found" }` No webhook exists with this ID, or it belongs to a different account. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. ## Deactivation handoff Use this endpoint when a receiver should stop getting future monitor events. The webhook record and delivery history stay for audit or rollback. > [card] Soft deactivate > > The endpoint sets `isActive` to `false` and returns `{ "success": true }`. > It does not return the webhook configuration. > [card] Future deliveries > > Inactive webhooks do not receive new monitor deliveries or scheduled retries. > In-flight delivery attempts may still finish. > [card] Audit trail > > Use [List Webhooks](/api-reference/webhooks/list) to confirm > `webhooks[].isActive: false`. Then use > [List Deliveries](/api-reference/webhooks/deliveries) for prior delivery > status, attempts, errors, and timestamps. > [card] Delivery audit > > Delivery rows for inactive endpoints can show `pending`, `failed`, or > `exhausted`. Reactivate the webhook to receive waiting deliveries before > their 30 days end. > Store `streamEventId`, `status`, `attempts`, > `lastStatusCode`, `lastError`, `createdAt`, and `deliveredAt`. > [card] Event join > > Use delivery `streamEventId` as the `{id}` for > [Get Event](/api-reference/events/get). Store `monitorId`, `monitorType`, > `type`, `occurredAt`, and `data` with the deactivation record. > [card] Receiver cleanup > > Remove queue, CRM, alerting, or warehouse routing only after the endpoint is > inactive. Also wait until you expect no more production events. > [card] Reactivate > > To reuse the same webhook, call > [Update Webhook](/api-reference/webhooks/update) with `isActive: true`, then > run [Test Webhook](/api-reference/webhooks/test). > [card] Signing secret > > Delete returns no `secret`. Keep the original Create Webhook secret for > audit records or future reactivation. > [!NOTE] > > This endpoint accepts 2 auth methods. Send an API key in the `x-api-key` header. Or send a session cookie from the dashboard. > > **Related.** > > * [List Webhooks](/api-reference/webhooks/list) > * [Update Webhook](/api-reference/webhooks/update) > * [Test Webhook](/api-reference/webhooks/test) > * [List Deliveries](/api-reference/webhooks/deliveries) > * [Get Event](/api-reference/events/get) > * [Create Webhook](/api-reference/webhooks/create) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Webhook deliveries & retries, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/webhooks/deliveries Inspect a webhook's 100 most recent monitor event deliveries with attempts, HTTP statuses, errors, and timestamps. Listing these deliveries costs nothing. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/webhooks/{id}/deliveries` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/webhooks/15/deliveries \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '[.deliveries[] | { delivery_id: .id, stream_event_id: .streamEventId, status, attempts, receiver_status: (.lastStatusCode // null), last_error: (.lastError // null), queued_at: .createdAt, delivered_at: (.deliveredAt // null), action: ( if .status == "failed" then "fix_receiver" elif .status == "exhausted" then "read_event" elif .status == "pending" then "wait" else "done" end ) }]' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/webhooks/15/deliveries", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const data = await response.json(); const deliveryActions = { delivered: "done", exhausted: "read_event", failed: "fix_receiver", pending: "wait", }; const deliveryTriage = data.deliveries.map((delivery) => ({ delivery_id: delivery.id, stream_event_id: delivery.streamEventId, status: delivery.status, attempts: delivery.attempts, receiver_status: delivery.lastStatusCode ?? null, last_error: delivery.lastError ?? null, queued_at: delivery.createdAt, delivered_at: delivery.deliveredAt ?? null, action: deliveryActions[delivery.status], })); const failedDeliveries = deliveryTriage.filter((row) => row.action === "fix_receiver"); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/webhooks/15/deliveries", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) data = response.json() delivery_actions = { "delivered": "done", "exhausted": "read_event", "failed": "fix_receiver", "pending": "wait", } delivery_triage = [ { "delivery_id": delivery["id"], "stream_event_id": delivery["streamEventId"], "status": delivery["status"], "attempts": delivery["attempts"], "receiver_status": delivery.get("lastStatusCode"), "last_error": delivery.get("lastError"), "queued_at": delivery["createdAt"], "delivered_at": delivery.get("deliveredAt"), "action": delivery_actions[delivery["status"]], } for delivery in data["deliveries"] ] failed_deliveries = [ row for row in delivery_triage if row["action"] == "fix_receiver" ] ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" ) type Delivery struct { ID string `json:"id"` StreamEventID string `json:"streamEventId"` Status string `json:"status"` Attempts int `json:"attempts"` LastStatusCode *int `json:"lastStatusCode"` LastError *string `json:"lastError"` CreatedAt string `json:"createdAt"` DeliveredAt *string `json:"deliveredAt"` } type DeliveriesResponse struct { Deliveries []Delivery `json:"deliveries"` } type DeliveryTriage struct { DeliveryID string `json:"delivery_id"` StreamEventID string `json:"stream_event_id"` Status string `json:"status"` Attempts int `json:"attempts"` ReceiverStatus *int `json:"receiver_status"` LastError *string `json:"last_error"` QueuedAt string `json:"queued_at"` DeliveredAt *string `json:"delivered_at"` Action string `json:"action"` } func actionForDelivery(delivery Delivery) string { switch delivery.Status { case "failed": return "fix_receiver" case "exhausted": return "read_event" case "pending": return "wait" } return "done" } func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/webhooks/15/deliveries", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var data DeliveriesResponse if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { log.Fatal(err) } deliveryTriage := make([]DeliveryTriage, 0, len(data.Deliveries)) for _, delivery := range data.Deliveries { row := DeliveryTriage{ DeliveryID: delivery.ID, StreamEventID: delivery.StreamEventID, Status: delivery.Status, Attempts: delivery.Attempts, ReceiverStatus: delivery.LastStatusCode, LastError: delivery.LastError, QueuedAt: delivery.CreatedAt, DeliveredAt: delivery.DeliveredAt, Action: actionForDelivery(delivery), } deliveryTriage = append(deliveryTriage, row) } failedDeliveries := make([]DeliveryTriage, 0) for _, row := range deliveryTriage { if row.Action == "fix_receiver" { failedDeliveries = append(failedDeliveries, row) } } _ = failedDeliveries } ``` ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The webhook ID to retrieve deliveries for. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. | ## Operational handoff Use this endpoint when a system needs to check webhook delivery status. That can be your queue, CRM, warehouse, or alerting system. It returns the 100 most recent delivery records for one webhook, newest first. Follow `nextCursor` for older ones. Map each delivery to a small incident row before you pass it on. Keep `id`, `streamEventId`, `status`, `attempts`, receiver status, timestamps, and the chosen action. Do not write the full response to logs. This endpoint returns delivery attempt metadata only. It does not return the webhook URL, event type filter, or signing secret. It also does not return raw payload body, raw signature, or full request headers. Do not depend on a `nextRetryAt` field. The response has none. Triage incidents from `status`, `attempts`, `lastStatusCode`, `lastError`, `createdAt`, and `deliveredAt`. | Webhook delivery incident column | Response source | Triage rule | | - | - | - | | Delivery ID | `deliveries[].id` | Use this ID for idempotency and support lookup. | | Monitor event ID | `deliveries[].streamEventId` | Join the delivery to `GET /events/{id}`. | | Delivery state | `deliveries[].status` | Handle pending, failed, exhausted, and delivered rows separately. | | Attempt count | `deliveries[].attempts` | Count tries so far. Retries stop after 30 days. | | Receiver status | `deliveries[].lastStatusCode` | Separate HTTP failures from unreachable receivers. | | Failure reason | `deliveries[].lastError` | Show the latest receiver error to operators. | | Delivery timing | `createdAt` and `deliveredAt` | Measure queue time and recovery time. | Store these fields for support and retry triage. > [card] Delivery ID > > Store `id` for delivery-level idempotency and support lookup. > [card] Event join > > Store `streamEventId` to join back to the stored monitor event with > `GET /events/{id}`. > [card] Status route > > Use `status` to route `pending`, `failed`, and `exhausted` deliveries to the > right queue. > [card] Attempt count > > Use `attempts` to see how often Xquik tried a delivery. Retries continue > until your endpoint returns `2xx` or 30 days pass. > [card] Receiver result > > Use `lastStatusCode` to separate receiver errors like `500` from unreachable > endpoints with status `0`. > [card] Failure reason > > Show `lastError` as the most recent failure reason for the operator. > [card] Timing > > Compare `createdAt` and `deliveredAt` to measure delivery latency and > recovery time. ## Incident response handoff Use one row per delivery when the receiver owner must act. Ignore `delivered` rows, wait on `pending`, and act on `failed`. An `exhausted` row means 30 days passed without a `2xx`. Read its event with `GET /api/v1/events/{id}`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "webhook_delivery_incident_handoff", "webhook_id": "15", "delivery_id": "503", "stream_event_id": "9003", "status": "failed", "attempts": 4, "receiver_status": 503, "last_error": "HTTP 503", "event_join": "GET /api/v1/events/9003", "verification_check": "POST /api/v1/webhooks/15/test", "action": "fix_receiver", "handoff_state": "fix_receiver_then_send_signed_test" } ``` > [card] Repeated failure > > Warn after repeated `failed` rows. Include `attempts`, `lastStatusCode`, and > `lastError`. That lets the receiver owner separate code errors from > reachability failures. > [card] 30-day window > > Xquik retries every `failed` delivery until 30 days pass. No delivery ends > earlier, even after `410 Gone`. > [card] Event join > > Store `streamEventId` and link `GET /api/v1/events/{id}`. That lets support > inspect the monitor event that triggered the delivery. > [card] Receiver proof > > After fixing the endpoint, send `POST /webhooks/{id}/test`. Attach the > signed test result to the incident before waiting for the next event. Xquik retries failed deliveries for 30 days. While your endpoint fails, Xquik retries 1 waiting delivery at a time. It checks the endpoint at least every 15 minutes. New deliveries wait as `pending`. Return `2xx` for a delivery you will never accept. See the [retry policy](/webhooks/overview#retry-policy). Fix the receiving endpoint first. Use [`POST /webhooks/{id}/test`](/api-reference/webhooks/test) to confirm it accepts signed requests. Then call [Resume Webhook](/api-reference/webhooks/resume) to start sending waiting and rejected deliveries at once. Without it, a rejected delivery can wait until its 30 days end. ### Receiver backfill handoff This endpoint returns 100 delivery rows per page for 1 webhook, newest first. Xquik resends failed deliveries on its own. Use stored event pages only to rebuild work your receiver lost. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "webhook_delivery_backfill_handoff", "delivery_source": "GET /api/v1/webhooks/15/deliveries", "event_source": "GET /api/v1/events?limit=100&cursor={nextCursor}", "source_filter": "monitorId for account monitors, keywordMonitorId for keyword monitors", "join_key": "delivery.streamEventId == event.id", "store": ["deliveryId", "streamEventId", "status", "attempts", "eventId", "nextCursor"], "stop_when": "hasMore is false", "handoff_state": "receiver_fixed_backfill_lost_events" } ``` Store `nextCursor` after every event page. Continue `GET /api/v1/events?limit=100&cursor={nextCursor}` until `hasMore` is `false`. Then compare each event `id` with delivery `streamEventId` values before replaying your own work. Add `monitorId` when replaying one account monitor, or `keywordMonitorId` when replaying one keyword monitor. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Maximum deliveries per page, from 1 to 10,000. Default 100. | | `cursor` | `string` | No | `nextCursor` from the previous page. The `after` alias also works. Offset pagination is not supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `deliveries` | `array` | List of delivery attempts, most recent first. Returns up to 10,000 deliveries per page. | | `deliveries[].id` | `string` | Unique delivery identifier. | | `deliveries[].streamEventId` | `string` | ID of the stream event that triggered this delivery. | | `deliveries[].status` | `string` | The current delivery status is `pending`, `delivered`, `failed`, or `exhausted`. | | `deliveries[].attempts` | `number` | Total number of delivery attempts made. Retries stop after 30 days. | | `deliveries[].lastStatusCode` | `number` | HTTP status code returned by your endpoint on the most recent attempt. Omitted if Xquik has made no attempt yet. | | `deliveries[].lastError` | `string` | Error message from the most recent failed attempt. Omitted on success. | | `deliveries[].createdAt` | `string` | ISO 8601 timestamp of when Xquik queued the delivery. | | `deliveries[].deliveredAt` | `string` | ISO 8601 timestamp of successful delivery. Omitted if not yet delivered. | | `hasMore` | `boolean` | Whether more rows follow this page. | | `nextCursor` | `string` | Pass it as `cursor` for the next page. Present when `hasMore` is `true`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "deliveries": [ { "id": "501", "streamEventId": "9001", "status": "delivered", "attempts": 1, "lastStatusCode": 200, "createdAt": "2026-02-24T14:22:01.000Z", "deliveredAt": "2026-02-24T14:22:02.000Z" }, { "id": "502", "streamEventId": "9002", "status": "failed", "attempts": 3, "lastStatusCode": 500, "lastError": "HTTP 500", "createdAt": "2026-02-24T14:25:00.000Z" }, { "id": "503", "streamEventId": "9003", "status": "failed", "attempts": 12, "lastStatusCode": 410, "lastError": "HTTP 410", "createdAt": "2026-02-24T14:30:00.000Z" }, { "id": "504", "streamEventId": "9004", "status": "pending", "attempts": 0, "createdAt": "2026-02-24T14:35:00.000Z" } ], "hasMore": false } ``` ### 400 Invalid cursor `{ "error": "invalid_input", "message": "Cursor invalid. Use nextCursor from the previous page, or omit it to start over." }` The `cursor` is not one this list returned. Send the `nextCursor` of the previous page, or omit it. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 400 Invalid ID `{ "error": "invalid_id" }` The provided webhook ID is not a valid format. ### 404 Not found No webhook exists with this ID, or it belongs to a different account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. ## Delivery statuses > [card] pending > > Xquik has not sent this delivery yet. It may wait while your endpoint is > failing. > [card] delivered > > Your endpoint returned `2xx`. Delivery is complete. > [card] failed > > The last attempt failed because the endpoint returned non-`2xx` or the > network failed. Xquik retries with exponential backoff until your endpoint > returns `2xx` or 30 days pass. > [card] exhausted > > 30 days passed without a `2xx`. `lastError` says why. Read the event with > `GET /api/v1/events/{id}`. Xquik retries deliveries until your endpoint returns `2xx` or 30 days pass. Pausing or deleting the webhook holds its deliveries. Each one shows `exhausted` once its 30 days end. Events expire 30 days after Xquik creates them. An event whose delivery ended as `exhausted` stays 30 days after that delivery ended. > [!NOTE] > > **Related.** [Webhooks Overview](/webhooks/overview) · [Resume Webhook](/api-reference/webhooks/resume) · [Webhook Testing Guide](/guides/twitter-webhook-testing) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List webhook endpoints, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/webhooks/list List up to 10,000 webhook endpoints with URLs, event filters, active states, delivery status, failure counts & creation times. The signing secret never appears. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/webhooks` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/webhooks \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '.webhooks[] | { webhook_id: .id, url, event_types: .eventTypes, is_active: .isActive, delivery_status: .deliveryStatus, consecutive_failures: .consecutiveFailures, failure_hard_cap: .failureHardCap, created_at: .createdAt, update_endpoint: ("/api/v1/webhooks/" + .id), delete_endpoint: ("/api/v1/webhooks/" + .id), test_endpoint: ("/api/v1/webhooks/" + .id + "/test"), resume_endpoint: ("/api/v1/webhooks/" + .id + "/resume"), deliveries_endpoint: ("/api/v1/webhooks/" + .id + "/deliveries"), signing_secret_available: false }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/webhooks", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const data = await response.json(); const webhookRows = data.webhooks.map((webhook) => ({ webhook_id: webhook.id, url: webhook.url, event_types: webhook.eventTypes, is_active: webhook.isActive, delivery_status: webhook.deliveryStatus, consecutive_failures: webhook.consecutiveFailures, failure_hard_cap: webhook.failureHardCap, created_at: webhook.createdAt, update_endpoint: `/api/v1/webhooks/${webhook.id}`, delete_endpoint: `/api/v1/webhooks/${webhook.id}`, test_endpoint: `/api/v1/webhooks/${webhook.id}/test`, resume_endpoint: `/api/v1/webhooks/${webhook.id}/resume`, deliveries_endpoint: `/api/v1/webhooks/${webhook.id}/deliveries`, signing_secret_available: false, })); for (const row of webhookRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/webhooks", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) data = response.json() webhook_rows = [ { "webhook_id": webhook["id"], "url": webhook["url"], "event_types": webhook["eventTypes"], "is_active": webhook["isActive"], "delivery_status": webhook["deliveryStatus"], "consecutive_failures": webhook["consecutiveFailures"], "failure_hard_cap": webhook["failureHardCap"], "created_at": webhook["createdAt"], "update_endpoint": f"/api/v1/webhooks/{webhook['id']}", "delete_endpoint": f"/api/v1/webhooks/{webhook['id']}", "test_endpoint": f"/api/v1/webhooks/{webhook['id']}/test", "resume_endpoint": f"/api/v1/webhooks/{webhook['id']}/resume", "deliveries_endpoint": f"/api/v1/webhooks/{webhook['id']}/deliveries", "signing_secret_available": False, } for webhook in data["webhooks"] ] for row in webhook_rows: print(json.dumps(row)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" "os" ) type Webhook struct { ConsecutiveFailures int `json:"consecutiveFailures"` CreatedAt string `json:"createdAt"` DeliveryStatus string `json:"deliveryStatus"` EventTypes []string `json:"eventTypes"` FailureHardCap int `json:"failureHardCap"` ID string `json:"id"` IsActive bool `json:"isActive"` URL string `json:"url"` } type WebhookResponse struct { Webhooks []Webhook `json:"webhooks"` } type WebhookRow struct { WebhookID string `json:"webhook_id"` URL string `json:"url"` EventTypes []string `json:"event_types"` IsActive bool `json:"is_active"` DeliveryStatus string `json:"delivery_status"` ConsecutiveFailures int `json:"consecutive_failures"` FailureHardCap int `json:"failure_hard_cap"` CreatedAt string `json:"created_at"` UpdateEndpoint string `json:"update_endpoint"` DeleteEndpoint string `json:"delete_endpoint"` TestEndpoint string `json:"test_endpoint"` ResumeEndpoint string `json:"resume_endpoint"` DeliveriesEndpoint string `json:"deliveries_endpoint"` SigningSecretAvailable bool `json:"signing_secret_available"` } func main() { req, err := http.NewRequest("GET", "https://xquik.com/api/v1/webhooks", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var data WebhookResponse if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { log.Fatal(err) } encoder := json.NewEncoder(os.Stdout) for _, webhook := range data.Webhooks { row := WebhookRow{ WebhookID: webhook.ID, URL: webhook.URL, EventTypes: webhook.EventTypes, IsActive: webhook.IsActive, DeliveryStatus: webhook.DeliveryStatus, ConsecutiveFailures: webhook.ConsecutiveFailures, FailureHardCap: webhook.FailureHardCap, CreatedAt: webhook.CreatedAt, UpdateEndpoint: "/api/v1/webhooks/" + webhook.ID, DeleteEndpoint: "/api/v1/webhooks/" + webhook.ID, TestEndpoint: "/api/v1/webhooks/" + webhook.ID + "/test", ResumeEndpoint: "/api/v1/webhooks/" + webhook.ID + "/resume", DeliveriesEndpoint: "/api/v1/webhooks/" + webhook.ID + "/deliveries", SigningSecretAvailable: false, } if err := encoder.Encode(row); err != nil { log.Fatal(err) } } } ``` These examples build one row per webhook. They do not print the full response page. Split the rows by `is_active` and `delivery_status`. Then store update, delete, test, resume, and delivery-log endpoints with each receiver. List responses never include the signing secret. Keep the one-time `secret` from [Create Webhook](/api-reference/webhooks/create) in your secret manager. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Maximum items per page, from 1 to 10,000. Default 200. | | `cursor` | `string` | No | `nextCursor` from the previous page. The `after` alias also works. Offset pagination is not supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `webhooks` | `array` | List of webhook objects for your account. Returns up to 10,000 webhooks per page. | | `webhooks[].id` | `string` | Unique webhook identifier. | | `webhooks[].url` | `string` | Delivery endpoint URL. | | `webhooks[].eventTypes` | `string[]` | Event types this webhook subscribes to. | | `webhooks[].isActive` | `boolean` | Whether the webhook is active. | | `webhooks[].consecutiveFailures` | `number` | Consecutive delivery failures recorded for this webhook. | | `webhooks[].deliveryStatus` | `string` | `active`, `paused`, or `needs_attention`. | | `webhooks[].failureHardCap` | `number` | Failure count that sets `needs_attention`. Delivery continues past it. | | `webhooks[].createdAt` | `string` | ISO 8601 creation timestamp. | | `hasMore` | `boolean` | Whether more rows follow this page. | | `nextCursor` | `string` | Pass it as `cursor` for the next page. Present when `hasMore` is `true`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "webhooks": [ { "id": "15", "url": "https://your-server.com/webhook", "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true, "consecutiveFailures": 0, "deliveryStatus": "active", "failureHardCap": 200, "createdAt": "2026-02-24T10:30:00.000Z" }, { "id": "16", "url": "https://backup.example.com/xquik", "eventTypes": ["tweet.new"], "isActive": false, "consecutiveFailures": 200, "deliveryStatus": "needs_attention", "failureHardCap": 200, "createdAt": "2026-02-20T08:15:00.000Z" } ], "hasMore": false } ``` List responses never include the `secret`. The API returns it once at creation time. ### 400 Invalid cursor `{ "error": "invalid_input", "message": "Cursor invalid. Use nextCursor from the previous page, or omit it to start over." }` The `cursor` is not one this list returned. Send the `nextCursor` of the previous page, or omit it. ### 401 Unauthenticated Missing or invalid API key or session cookie. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Too many requests. Wait for the `Retry-After` header before retrying. ## Inventory handoff This endpoint shows which signed webhook endpoints the account has configured. Use it for an ops job, CRM integration, alert worker, or agent. | Webhook inventory column | Response source | Reconciliation rule | | - | - | - | | Webhook ID | `webhooks[].id` | Use this ID for updates, tests, and deliveries. | | Receiver URL | `webhooks[].url` | Confirm the intended HTTPS destination. | | Event filter | `webhooks[].eventTypes` | Match account and keyword monitor event types. | | Active state | `webhooks[].isActive` | Separate active and inactive delivery targets. | | Delivery status | `webhooks[].deliveryStatus` | Alert the owner on `needs_attention`. | | Consecutive failures | `webhooks[].consecutiveFailures` | Alert before the receiver reaches its hard cap. | | Failure cap | `webhooks[].failureHardCap` | Record the `needs_attention` threshold. | | Creation time | `webhooks[].createdAt` | Track how old each configuration is. | > [card] Configuration ID > > Store `webhooks[].id` for updates, deletes, test deliveries, and delivery > history lookups. > [card] Delivery target > > Store `webhooks[].url` so configuration reviews can detect stale receiver > endpoints before production events fail. > [card] Event filter > > Store `webhooks[].eventTypes` and compare it with monitor event types. Do > this before expecting `tweet.new`, `tweet.quote`, `tweet.reply`, or > `tweet.retweet`. > [card] Active state > > Store `webhooks[].isActive`. Inactive webhooks do not receive monitor > events. Use `deliveryStatus` to distinguish paused from needs-attention > receivers. > [card] Delivery status > > Store `webhooks[].deliveryStatus`. Alert the receiver owner on > `needs_attention`. Xquik keeps retrying. After the fix, call > [Resume Webhook](/api-reference/webhooks/resume) to start sending waiting > deliveries at once. > [card] Failure counter > > Store `webhooks[].consecutiveFailures` and `webhooks[].failureHardCap` for > alerting before the receiver reaches the failure cap. > [card] Change links > > For each row, link active receivers to [Update Webhook](/api-reference/webhooks/update) and > [Test Webhook](/api-reference/webhooks/test). Also link them to > [Resume Webhook](/api-reference/webhooks/resume) and > [List Deliveries](/api-reference/webhooks/deliveries). Link stale receivers to > [Delete Webhook](/api-reference/webhooks/delete). > [card] Inactive review > > Inactive rows are configuration records, not active delivery targets. Keep > their `webhooks[].id` so deactivation receipts and rollback plans can find > the same webhook. > [card] Delivery audit > > Store `streamEventId`, `status`, `attempts`, `lastStatusCode`, `lastError`, > `createdAt`, and `deliveredAt` from the per-webhook deliveries endpoint. > [card] Event join > > Use delivery `streamEventId` as the `{id}` for > [Get Event](/api-reference/events/get). Store `monitorId`, `monitorType`, > `type`, `occurredAt`, and `data` with the inventory audit. > [card] Created at > > Store `webhooks[].createdAt` for audit logs and later configuration checks. > [card] Signing secret > > The list omits the signing `secret`. Store it from > [Create Webhook](/api-reference/webhooks/create), then verify deliveries > with [Signature Verification](/webhooks/verification). > [!NOTE] > > This endpoint accepts 2 auth methods. Send an API key in the `x-api-key` header. Or send a session cookie from the dashboard. > > **Next steps.** > > * [Create Webhook](/api-reference/webhooks/create) > * [Update Webhook](/api-reference/webhooks/update) > * [Test Webhook](/api-reference/webhooks/test) > * [Resume Webhook](/api-reference/webhooks/resume) > * [List Deliveries](/api-reference/webhooks/deliveries) > * [Get Event](/api-reference/events/get) > * [Delete Webhook](/api-reference/webhooks/delete) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Resume webhook deliveries, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/webhooks/resume Resume a webhook and start sending waiting deliveries at once. Xquik sends a signed test first and resumes only after a 2xx response. The call is free. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/webhooks/{id}/resume` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks/15/resume \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq '{ webhook_id: .webhook.id, resumed: (.success == true), status_code: .statusCode, delivery_status: .webhook.deliveryStatus, consecutive_failures: .webhook.consecutiveFailures, failure_hard_cap: .webhook.failureHardCap, test_endpoint: ("/api/v1/webhooks/" + .webhook.id + "/test"), deliveries_endpoint: ("/api/v1/webhooks/" + .webhook.id + "/deliveries") }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/webhooks/15/resume", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const result = await response.json(); const resumeHandoff = { webhook_id: result.webhook.id, resumed: result.success === true, status_code: result.statusCode, delivery_status: result.webhook.deliveryStatus, consecutive_failures: result.webhook.consecutiveFailures, failure_hard_cap: result.webhook.failureHardCap, test_endpoint: `/api/v1/webhooks/${result.webhook.id}/test`, deliveries_endpoint: `/api/v1/webhooks/${result.webhook.id}/deliveries`, }; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/webhooks/15/resume", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) result = response.json() webhook = result["webhook"] resume_handoff = { "webhook_id": webhook["id"], "resumed": result["success"] is True, "status_code": result["statusCode"], "delivery_status": webhook["deliveryStatus"], "consecutive_failures": webhook["consecutiveFailures"], "failure_hard_cap": webhook["failureHardCap"], "test_endpoint": f"/api/v1/webhooks/{webhook['id']}/test", "deliveries_endpoint": f"/api/v1/webhooks/{webhook['id']}/deliveries", } ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" ) type Webhook struct { ConsecutiveFailures int `json:"consecutiveFailures"` CreatedAt string `json:"createdAt"` DeliveryStatus string `json:"deliveryStatus"` EventTypes []string `json:"eventTypes"` FailureHardCap int `json:"failureHardCap"` ID string `json:"id"` IsActive bool `json:"isActive"` URL string `json:"url"` } type ResumeResponse struct { StatusCode int `json:"statusCode"` Success bool `json:"success"` Webhook Webhook `json:"webhook"` } type ResumeHandoff struct { ConsecutiveFailures int `json:"consecutive_failures"` DeliveriesEndpoint string `json:"deliveries_endpoint"` DeliveryStatus string `json:"delivery_status"` FailureHardCap int `json:"failure_hard_cap"` Resumed bool `json:"resumed"` StatusCode int `json:"status_code"` TestEndpoint string `json:"test_endpoint"` WebhookID string `json:"webhook_id"` } func main() { req, err := http.NewRequest("POST", "https://xquik.com/api/v1/webhooks/15/resume", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var result ResumeResponse if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { log.Fatal(err) } handoff := ResumeHandoff{ ConsecutiveFailures: result.Webhook.ConsecutiveFailures, DeliveriesEndpoint: "/api/v1/webhooks/" + result.Webhook.ID + "/deliveries", DeliveryStatus: result.Webhook.DeliveryStatus, FailureHardCap: result.Webhook.FailureHardCap, Resumed: result.Success, StatusCode: result.StatusCode, TestEndpoint: "/api/v1/webhooks/" + result.Webhook.ID + "/test", WebhookID: result.Webhook.ID, } _ = handoff } ``` These snippets build a recovery row. Store `delivery_status`, `consecutive_failures`, `failure_hard_cap`, `status_code`, and the delivery-log endpoint beside the webhook ID. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The webhook ID to test and resume. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. This endpoint also accepts session cookie authentication. | ## What happens Xquik sends a signed `webhook.test` request to the webhook URL. If your receiver returns a `2xx` status, Xquik reactivates the webhook. It resets `consecutiveFailures` to `0` and returns the updated webhook object. Xquik then starts sending waiting deliveries at once. This includes failed deliveries and ones that waited when you paused the webhook. A paused webhook holds each waiting delivery until its 30 days end. Events expire 30 days after Xquik creates them. Events that happen during a pause may never arrive. To catch up, page through [List Events](/api-reference/events/list). If the signed test fails, Xquik returns `400` with `success: false`, `statusCode`, and `error`. Xquik does not reactivate the webhook. This endpoint does not rotate or return the signing secret. Keep using the one-time secret from [Create Webhook](/api-reference/webhooks/create). | Webhook resume check | Response source | Recovery rule | | - | - | - | | Signed test result | `success` | Resume only when this value is `true`. | | Receiver status | `statusCode` | Require a `2xx` response. | | Webhook ID | `webhook.id` | Match the receiver you are recovering. | | Delivery URL | `webhook.url` | Confirm the repaired HTTPS endpoint. | | Event filter | `webhook.eventTypes` | Confirm the filter still covers your monitor event types. | | Active state | `webhook.isActive` | Expect `true` after recovery. | | Failure count | `webhook.consecutiveFailures` | Expect `0` after recovery. | | Delivery state | `webhook.deliveryStatus` | Expect `active` after recovery. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `success` | `boolean` | `true` when the signed test request succeeded and Xquik resumed the webhook. | | `statusCode` | `number` | HTTP status code returned by your receiver during the signed test. | | `webhook` | `object` | Updated webhook configuration. | | `webhook.id` | `string` | Unique webhook identifier. | | `webhook.url` | `string` | Delivery endpoint URL. | | `webhook.eventTypes` | `string[]` | Event types this webhook subscribes to. | | `webhook.isActive` | `boolean` | `true` after a successful resume. | | `webhook.consecutiveFailures` | `number` | Consecutive receiver failures. Resets to `0` after a successful resume. | | `webhook.deliveryStatus` | `string` | `active`, `paused`, or `needs_attention`. | | `webhook.failureHardCap` | `number` | Failure count that sets `needs_attention`. Delivery continues past it. | | `webhook.createdAt` | `string` | ISO 8601 creation timestamp. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": true, "statusCode": 200, "webhook": { "id": "15", "url": "https://your-server.com/webhook", "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true, "consecutiveFailures": 0, "deliveryStatus": "active", "failureHardCap": 200, "createdAt": "2026-02-24T10:30:00.000Z" } } ``` ### 400 Test failed | Field | Type | Description | | - | - | - | | `success` | `boolean` | `false` when the signed test did not receive a `2xx` response. | | `statusCode` | `number` | HTTP status code from the receiver, or `0` if it was unreachable. | | `error` | `string` | Delivery failure reason. | `{ "success": false, "statusCode": 500, "error": "HTTP 500" }` Fix the receiver, then retry this endpoint. ### 400 Invalid request `{ "error": "invalid_id", "message": "Invalid webhook ID format" }` The provided webhook ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key or session cookie. ### 404 Not found `{ "error": "not_found", "message": "Webhook not found" }` No webhook exists with this ID, or it belongs to a different account. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. ## Recovery handoff Use this endpoint to reactivate a webhook you paused. Also use it after you fix a failing receiver. Xquik sends a signed test first, then starts sending waiting deliveries at once. > [card] Needs attention > > `deliveryStatus: "needs_attention"` means 200 failed checks in a row. Each > check retries 1 real waiting delivery. Delivery continues. After you fix > the receiver, call Resume to start sending at once. > [card] Signed test required > > Resume succeeds only after your receiver answers a signed `webhook.test` request with `2xx`. > [card] Failure counter > > Store `consecutiveFailures` and `failureHardCap` for alerting and recovery > dashboards. > [card] No secret rotation > > Resume does not return or rotate `secret`. Keep verifying delivery > signatures with the secret returned at creation time. > [card] Delivery log > > After resuming, check > [List Deliveries](/api-reference/webhooks/deliveries) for recent `status`, > `attempts`, `lastStatusCode`, and `lastError` rows. > [card] Event replay > > Use delivery `streamEventId` with [Get Event](/api-reference/events/get) or > event list pages to backfill missed work. > [!NOTE] > > This endpoint accepts 2 auth methods. Send an API key in the `x-api-key` header. Or send a session cookie from the dashboard. > > **Related.** [List Webhooks](/api-reference/webhooks/list) · [Update Webhook](/api-reference/webhooks/update) · [Test Webhook](/api-reference/webhooks/test) · [List Deliveries](/api-reference/webhooks/deliveries) · [Webhook Verification](/webhooks/verification) ## Response examples * **400** `{ "error": "Connection timed out" }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Telegram alerts for monitors, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/webhooks/telegram Get a t.me link that connects a Telegram chat to your monitor events. Press Start in @XquikBot and each event arrives as a message. It costs no credits. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/webhooks/telegram` **Free.** Connecting a chat and its messages cost no credits. Get your monitor events in Telegram with no server of your own. The call returns a link to @XquikBot. Open it and press Start. The chat is connected. ## How it works 1. Call this endpoint. It returns a `url` like `https://t.me/XquikBot?start=...`. 2. Open the link on a phone or computer with Telegram, then press **Start**. 3. @XquikBot answers "Connected." Each alert then arrives as a message. It shows the account and the event in bold. It also shows the post's text or the profile change, and a link. * Alerts that wait together come as 1 digest. * A busy chat gets 5 quick messages, then 1 every 30 seconds. A quiet chat gets each alert at once. * Only the first message of a minute rings. The rest arrive silently. * A post that is new and has media is 1 alert. Its title is "New post with media". * A link works once, within 15 minutes. Make a new one if it expires. * The chat appears in [List webhooks](/api-reference/webhooks/list) with the URL `telegram:`. [Deliveries](/api-reference/webhooks/deliveries), retries, [Resume](/api-reference/webhooks/resume) and [Test webhook](/api-reference/webhooks/test) work as for any webhook. * In the chat, send `/stop` to pause alerts and `/status` to check them. A new link turns them on again. * Telegram can ask Xquik to slow down. When it does, the retry waits as long as it asks. * @XquikBot works in private chats. It answers in English, Spanish, Turkish, Japanese, Korean or Chinese, by your Telegram language. Other languages get English. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST "https://xquik.com/api/v1/webhooks/telegram" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{"eventTypes": ["tweet.new", "tweet.reply"]}' \ | jq -r '.url' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/webhooks/telegram", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ eventTypes: ["tweet.new", "tweet.reply"] }), }); const link = await response.json(); console.log(`Open ${link.url} before ${link.expiresAt}`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/webhooks/telegram", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={"eventTypes": ["tweet.new", "tweet.reply"]}, ) link = response.json() print(f"Open {link['url']} before {link['expiresAt']}") ``` ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `eventTypes` | `string[]` | No | The event types the chat gets, like `tweet.new` or `tweet.reply`. Omit the body or this field to get new posts only. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. | ## Response ### 201 Created ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "url": "https://t.me/XquikBot?start=Q2hhdExpbmtDb2RlRXhhbXBsZTAx", "expiresAt": "2025-01-15T12:15:00.000Z" } ``` | Field | Type | Description | | - | - | - | | `url` | `string` | Opens @XquikBot with the link's code. Open it and press Start. | | `expiresAt` | `string` | When the link stops working, 15 minutes after it was made. | ### 400 Invalid input `{ "error": "invalid_input", "message": "Pick at least 1 valid event type, like tweet.new." }` An event type is unknown. Use the types the monitor endpoints list. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 503 Telegram unavailable Telegram delivery is off for now. Try again later. > [!NOTE] > > **Related.** [Webhooks overview](/webhooks/overview) · [List webhooks](/api-reference/webhooks/list) · [Webhook deliveries](/api-reference/webhooks/deliveries) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **503** `{ "error": "telegram_unavailable", "message": "Telegram alerts are off right now. Try again later." }` # Test a signed webhook delivery, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/webhooks/test Send a signed test event to a webhook URL. Verify HTTPS reachability, response status, and signature handling. The test changes no webhook state and is free. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/webhooks/{id}/test` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks/15/test \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq --arg webhook_id "15" '{ webhook_id: $webhook_id, accepted: (.success == true), status_code: .statusCode, error: (.error // null) }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/webhooks/15/test", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const result = await response.json(); const testOutcome = { webhook_id: "15", accepted: result.success === true, status_code: result.statusCode, error: result.error ?? null, }; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/webhooks/15/test", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) result = response.json() test_outcome = { "webhook_id": "15", "accepted": result["success"] is True, "status_code": result["statusCode"], "error": result.get("error"), } ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "log" "net/http" ) type TestOutcome struct { WebhookID string `json:"webhook_id"` Accepted bool `json:"accepted"` StatusCode int `json:"status_code"` Error *string `json:"error"` } func main() { req, err := http.NewRequest("POST", "https://xquik.com/api/v1/webhooks/15/test", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var result struct { Error *string `json:"error"` StatusCode int `json:"statusCode"` Success bool `json:"success"` } if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { log.Fatal(err) } outcome := TestOutcome{ WebhookID: "15", Accepted: result.Success, StatusCode: result.StatusCode, Error: result.Error, } _ = outcome } ``` These snippets build a small deployment-check record. Store `accepted`, `status_code`, and `error` with the webhook ID. Do not print the full test response. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The webhook ID to test. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. This endpoint also accepts session cookie authentication. | ## What happens Xquik sends a `webhook.test` event to your endpoint, HMAC-signed with the webhook's secret. ```json Payload delivered to your endpoint theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "webhook.test", "data": { "message": "Test delivery from Xquik" }, "timestamp": "2026-02-27T12:00:00.000Z" } ``` The signed request includes the `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce` headers. Verify the signature against the raw request body before parsing JSON. Reject stale timestamps and reused nonces. Production monitor deliveries need the same checks. You can test active, paused, or needs-attention webhooks. This endpoint reports whether the receiver accepted the signed test request. It does not change `isActive`, `deliveryStatus`, or `consecutiveFailures`. Xquik keeps retrying an active webhook. After a fix, call [Resume Webhook](/api-reference/webhooks/resume). It runs the same test, then starts sending waiting and rejected deliveries at once. It also reactivates a paused webhook. The test endpoint does not return or rotate the signing secret. Keep using the secret returned by [Create Webhook](/api-reference/webhooks/create) for signature verification. Keep raw request bodies, raw signatures, and full headers out of deployment logs. `webhook.test` payloads include `eventType`, `data`, and `timestamp`. They do not include `deliveryId` or `streamEventId`. Use them for reachability and signature checks. They cannot test receiver idempotency. ## Response ### 200 OK (success) | Field | Type | Description | | - | - | - | | `success` | `boolean` | `true` when your endpoint responded with a 2xx status code. | | `statusCode` | `number` | The HTTP status code returned by your endpoint. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": true, "statusCode": 200 } ``` ### 200 OK (delivery failed) | Field | Type | Description | | - | - | - | | `success` | `boolean` | `false` when your endpoint returned a non-2xx status or was unreachable. | | `statusCode` | `number` | The HTTP status code returned by your endpoint, or `0` if unreachable. | | `error` | `string` | Error description (for example `"HTTP 500"` or a network error message). | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": false, "statusCode": 500, "error": "HTTP 500" } ``` ### 400 Invalid request `{ "error": "invalid_id", "message": "Invalid webhook ID format" }` The provided webhook ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key or session cookie. ### 404 Not found `{ "error": "not_found", "message": "Webhook not found" }` No webhook exists with this ID, or it belongs to a different account. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. ## Test result handoff Use this endpoint before routing production monitor events to a new receiver. Also use it after changing webhook code, secrets, firewall rules, or queue routing. > [card] Receiver accepted > > Treat `success: true` and a `2xx` `statusCode` as proof. They show the > receiver accepted the signed `webhook.test` request. > [card] Receiver rejected > > Treat `success: false` with a non-`2xx` `statusCode` as a receiver error. > Fix the endpoint before waiting for the next production monitor event. > [card] Endpoint unreachable > > Treat `statusCode: 0` as a network or reachability failure. Check DNS, > TLS, firewall rules, and the public HTTPS URL. > [card] Error string > > Store `error` with your deployment logs. That lets support, queue, or > incident workers see the latest test failure reason. > [card] Paused or needs attention > > Xquik still sends tests to paused and needs-attention webhooks. A passing test > proves reachability only. Use [Resume Webhook](/api-reference/webhooks/resume) > to reactivate a paused webhook. It also starts sending waiting deliveries at > once. > [card] Signature path > > Validate `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce` on > the raw request body. Do this before accepting test or production events. > [card] Test payload > > `webhook.test` payloads include `eventType`, `data`, and `timestamp`. > They do not include `deliveryId` or `streamEventId`. > [card] Production triage > > After the receiver accepts this signed test, debug real monitor events with > [List Deliveries](/api-reference/webhooks/deliveries). Delivery rows contain > `id`, `streamEventId`, `status`, `attempts`, `lastStatusCode`, `lastError`, > `createdAt`, and `deliveredAt`. > [card] Event join > > For failed production deliveries, use delivery `streamEventId` > as the `{id}` for [Get Event](/api-reference/events/get). Store the event > `monitorId`, `monitorType`, `type`, `occurredAt`, and `data` with the > receiver incident. > [!NOTE] > > This endpoint accepts 2 auth methods. Send an API key in the `x-api-key` header. Or send a session cookie from the dashboard. > > **Related.** [List Webhooks](/api-reference/webhooks/list) · [Resume Webhook](/api-reference/webhooks/resume) · [List Deliveries](/api-reference/webhooks/deliveries) · [Get Event](/api-reference/events/get) · [Webhook Verification](/webhooks/verification) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Update a webhook endpoint, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/webhooks/update Change a webhook's HTTPS URL, its post, profile and follower event filters, or its active state. The signing secret stays the same. It costs no credits. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/webhooks/{id}` **Free.** This endpoint does not consume credits. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/webhooks/15 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "url": "https://new-server.com/webhook", "eventTypes": ["tweet.new"], "isActive": false }' | jq '{ webhook_id: .id, url, event_types: .eventTypes, is_active: .isActive, delivery_status: .deliveryStatus, consecutive_failures: .consecutiveFailures, failure_hard_cap: .failureHardCap, test_endpoint: ("/api/v1/webhooks/" + .id + "/test"), resume_endpoint: ("/api/v1/webhooks/" + .id + "/resume"), deliveries_endpoint: ("/api/v1/webhooks/" + .id + "/deliveries") }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/webhooks/15", { method: "PATCH", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ url: "https://new-server.com/webhook", eventTypes: ["tweet.new"], isActive: false, }), }); const webhook = await response.json(); const updateHandoff = { webhook_id: webhook.id, url: webhook.url, event_types: webhook.eventTypes, is_active: webhook.isActive, delivery_status: webhook.deliveryStatus, consecutive_failures: webhook.consecutiveFailures, failure_hard_cap: webhook.failureHardCap, test_endpoint: `/api/v1/webhooks/${webhook.id}/test`, resume_endpoint: `/api/v1/webhooks/${webhook.id}/resume`, deliveries_endpoint: `/api/v1/webhooks/${webhook.id}/deliveries`, }; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.patch( "https://xquik.com/api/v1/webhooks/15", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "url": "https://new-server.com/webhook", "eventTypes": ["tweet.new"], "isActive": False, }, ) webhook = response.json() update_handoff = { "webhook_id": webhook["id"], "url": webhook["url"], "event_types": webhook["eventTypes"], "is_active": webhook["isActive"], "delivery_status": webhook["deliveryStatus"], "consecutive_failures": webhook["consecutiveFailures"], "failure_hard_cap": webhook["failureHardCap"], "test_endpoint": f"/api/v1/webhooks/{webhook['id']}/test", "resume_endpoint": f"/api/v1/webhooks/{webhook['id']}/resume", "deliveries_endpoint": f"/api/v1/webhooks/{webhook['id']}/deliveries", } ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "log" "net/http" ) type Webhook struct { ConsecutiveFailures int `json:"consecutiveFailures"` DeliveryStatus string `json:"deliveryStatus"` EventTypes []string `json:"eventTypes"` FailureHardCap int `json:"failureHardCap"` ID string `json:"id"` IsActive bool `json:"isActive"` URL string `json:"url"` } type UpdateHandoff struct { ConsecutiveFailures int `json:"consecutive_failures"` DeliveriesEndpoint string `json:"deliveries_endpoint"` DeliveryStatus string `json:"delivery_status"` EventTypes []string `json:"event_types"` FailureHardCap int `json:"failure_hard_cap"` IsActive bool `json:"is_active"` ResumeEndpoint string `json:"resume_endpoint"` TestEndpoint string `json:"test_endpoint"` URL string `json:"url"` WebhookID string `json:"webhook_id"` } func main() { payload := map[string]interface{}{ "url": "https://new-server.com/webhook", "eventTypes": []string{"tweet.new"}, "isActive": false, } body, err := json.Marshal(payload) if err != nil { log.Fatal(err) } req, err := http.NewRequest("PATCH", "https://xquik.com/api/v1/webhooks/15", bytes.NewReader(body)) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var webhook Webhook if err := json.NewDecoder(resp.Body).Decode(&webhook); err != nil { log.Fatal(err) } handoff := UpdateHandoff{ ConsecutiveFailures: webhook.ConsecutiveFailures, DeliveriesEndpoint: "/api/v1/webhooks/" + webhook.ID + "/deliveries", DeliveryStatus: webhook.DeliveryStatus, EventTypes: webhook.EventTypes, FailureHardCap: webhook.FailureHardCap, IsActive: webhook.IsActive, ResumeEndpoint: "/api/v1/webhooks/" + webhook.ID + "/resume", TestEndpoint: "/api/v1/webhooks/" + webhook.ID + "/test", URL: webhook.URL, WebhookID: webhook.ID, } _ = handoff } ``` These snippets build a reconfiguration row. Store the current webhook configuration with its test and delivery-log endpoints. Do not print the full update response. | Webhook update column | Request or response source | Verification rule | | - | - | - | | Webhook ID | Path `{id}` and response `id` | Require both IDs to match. | | Receiver URL | Request and response `url` | Confirm the intended HTTPS endpoint. | | Event filter | Request and response `eventTypes` | Confirm the complete replacement list. | | Active state | Request and response `isActive` | Verify the intended pause or activation. | | Failure count | Response `consecutiveFailures` | Confirm whether activation reset failures. | | Delivery state | Response `deliveryStatus` | Handle active, paused, and needs-attention receivers separately. | | Failure cap | Response `failureHardCap` | Record the failure cap. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The webhook ID to update. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. This endpoint also accepts session cookie authentication. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body At least 1 field is required. | Body parameter | Type | Required | Description | | - | - | - | - | | `url` | `string` | No | New HTTPS endpoint URL. Xquik rejects HTTP URLs. | | `eventTypes` | `string[]` | No | Updated event types to subscribe to. Replaces the existing list. At least 1 required when provided. Use any valid account monitor event type listed below. Keyword monitor webhooks should stay on `tweet.*` event types. Account monitor webhooks can use both `tweet.*` and `profile.*` event types. Post monitor webhooks use `post.*` event types. | ## Valid event types Valid types are `tweet.new`, `tweet.quote`, `tweet.reply`, `tweet.retweet`, `tweet.media`, `tweet.link`, `tweet.poll`, `tweet.mention`, `tweet.hashtag`, `tweet.longform`. Valid types are also `profile.avatar.changed`, `profile.banner.changed`, `profile.name.changed`, `profile.username.changed`, `profile.bio.changed`, `profile.location.changed`, `profile.url.changed`, `profile.verified.changed`, `profile.protected.changed`, `profile.pinned_tweet.changed`. Valid types are also `profile.unavailable.changed`, `tweet.deleted`, `broadcast.started`, `space.started`, `following.added`, `following.removed`, `follower.added`, `follower.removed`, `profile.followers.changed`, `profile.following.changed`. Post monitor types are `post.reply.new`, `post.quote.new`, `post.likes.changed`, `post.retweets.changed`, `post.replies.changed`, `post.quotes.changed`, `post.bookmarks.changed`, `post.views.changed`, `post.edited` & `post.deleted`. A webhook takes up to 40 types. > [card] tweet.new > > Original tweet from an account monitor or matching keyword monitor. Use for > new posts that are not replies, quotes, or retweets. > [card] tweet.quote > > Quote tweet from an account monitor or matching keyword monitor. Keep this > only when your systems handle quote payloads. > [card] tweet.reply > > Reply from an account monitor or matching keyword monitor. Keep this when > reply alerts or support routing should continue. > [card] tweet.retweet > > Retweet from an account monitor or matching keyword monitor. Keep this when > repost activity should keep triggering deliveries. > [!NOTE] > > Only the [Test Webhook](/api-reference/webhooks/test) endpoint generates `webhook.test`. You cannot add it to a webhook subscription. | Body parameter | Type | Required | Description | | - | - | - | - | | `isActive` | `boolean` | No | Set to `false` to pause deliveries. Set to `true` to turn it on and start sending waiting deliveries at once. Either value resets `consecutiveFailures` to `0`. To require a signed test first, use [Resume Webhook](/api-reference/webhooks/resume). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | Unique webhook identifier. | | `url` | `string` | The current delivery endpoint URL. | | `eventTypes` | `string[]` | Event types this webhook subscribes to. | | `isActive` | `boolean` | Whether the webhook is active. | | `consecutiveFailures` | `number` | Consecutive delivery failures recorded for this webhook. | | `deliveryStatus` | `string` | `active`, `paused`, or `needs_attention`. | | `failureHardCap` | `number` | Failure count that sets `needs_attention`. Delivery continues past it. | | `createdAt` | `string` | ISO 8601 creation timestamp. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "15", "url": "https://new-server.com/webhook", "eventTypes": ["tweet.new"], "isActive": false, "consecutiveFailures": 0, "deliveryStatus": "paused", "failureHardCap": 200, "createdAt": "2026-02-24T10:30:00.000Z" } ``` ### 401 Unauthenticated Missing or invalid API key or session cookie. ### 400 Invalid input Invalid URL (must be HTTPS), empty `eventTypes`, or no fields provided. `{ "error": "invalid_id" }` The provided webhook ID is not a valid format. ### 404 Not found No webhook exists with this ID, or it belongs to a different account. ### 429 Rate limited Too many requests. Wait for the `Retry-After` header before retrying. ## Reconfiguration handoff Use this endpoint when a receiver URL or event filter changes. It also pauses or resumes webhook delivery without creating a new endpoint. > [card] Updated inventory > > Store returned `id`, `url`, `eventTypes`, `isActive`, `deliveryStatus`, > `consecutiveFailures`, `failureHardCap`, and `createdAt`. They are the > current webhook configuration. > [card] URL change > > After changing `url`, run [Test Webhook](/api-reference/webhooks/test). Do > this before expecting production monitor events at the new receiver. > [card] Event filter > > `eventTypes` replaces the previous list. Keep it aligned with account or > keyword monitor event types. > [card] Pause delivery > > `isActive: false` stops future deliveries. Existing stored events and > delivery records remain available. Xquik keeps queued events until all > deliveries finish. Events expire 30 days after Xquik creates them. > [card] Resume delivery > > `isActive: true` resumes delivery for matching future monitor events. It > also starts sending waiting deliveries at once. Events that happen during > a pause may never arrive. To catch up, page through > [List Events](/api-reference/events/list). Use > [Resume Webhook](/api-reference/webhooks/resume) when the receiver must pass a > signed test first. > [card] Signing secret > > This endpoint does not rotate or return `secret`. Keep using the secret from > [Create Webhook](/api-reference/webhooks/create) for signature verification. > [card] Delivery check > > After the signed test passes, production monitor events may still miss the > receiver. If so, use [List Deliveries](/api-reference/webhooks/deliveries). > Check `status`, `attempts`, `lastStatusCode`, `lastError`, `createdAt`, and > `deliveredAt`. > [card] Event join > > Use delivery `streamEventId` as the `{id}` for > [Get Event](/api-reference/events/get). Store `monitorId`, `monitorType`, > `type`, `occurredAt`, and `data` with the reconfiguration incident. > [!NOTE] > > This endpoint accepts 2 auth methods. Send an API key in the `x-api-key` header. Or send a session cookie from the dashboard. > > **Related.** > > * [List Webhooks](/api-reference/webhooks/list) > * [Test Webhook](/api-reference/webhooks/test) > * [Resume Webhook](/api-reference/webhooks/resume) > * [List Deliveries](/api-reference/webhooks/deliveries) > * [Get Event](/api-reference/events/get) > * [Delete Webhook](/api-reference/webhooks/delete) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Bulk retry account connections, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/bulk-retry Clear temporary login failures for connected X accounts in one call. Credential, TOTP, passkey, locked, or suspended accounts need re-authentication or X fixes. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/accounts/bulk-retry` **Free.** This endpoint does not consume credits. > [!WARNING] > > This takes a dashboard session, or a key with the **Connect X accounts** permission. Turn it on at [dashboard.xquik.com/en/api-keys](https://dashboard.xquik.com/en/api-keys). Full access doesn't include it. A key without it gets `403 x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`. > [!NOTE] > > Bulk retry clears only `transient` and `automated` login-failure states. It does not update passwords, TOTP secret keys, passkeys, or email challenges. It does not update locked or suspended accounts either. Use re-authentication or reconnect for credential and 2FA fixes. Resolve locks or suspensions on X first. This route clears temporary login-failure state. Those accounts retry on the next read, write, monitor, or account action. Use it when the dashboard shows accounts with temporary issues. ## What gets retried > [card] Xquik clears temporary issues > > Xquik clears accounts whose stored failure reason is `transient` or `automated`. These accounts become eligible to reconnect on their next use. > [card] Xquik skips credential fixes > > Accounts that need fresh credentials or a security challenge stay unchanged. Use [Re-authenticate](/api-reference/x-accounts/reauth) or reconnect the account instead. > [card] X restrictions stay blocked > > Locked and suspended accounts stay unchanged. Resolve the restriction on X first, then re-authenticate or reconnect if needed. > [card] Response is an aggregate > > The API returns only `cleared`, the number of accounts reset for retry. Call [List X Accounts](/api-reference/x-accounts/list) before and after if you need per-account status. The dashboard button works the same way. It appears when accounts have temporary issues. After you confirm, it clears retryable failures and refreshes the account list. It does not reconnect the accounts immediately. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://dashboard.xquik.com/api/v1/x/accounts/bulk-retry \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://dashboard.xquik.com/api/v1/x/accounts/bulk-retry", { method: "POST", headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE", Origin: "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin", }, }); const data = await response.json(); ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Or `Cookie` | An API key holding the Connect X accounts permission. | | `Cookie` | `string` | Or `x-api-key` | Your signed-in dashboard session cookie, `__Host-xquik_session`. | | `Origin` | `string` | With `Cookie` | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `accountIds` | `string[]` | No | IDs of the X accounts to retry, as many as the account holds. Each ID can be a number or start with `xacct_`. Leave the body out to retry every account with a temporary failure. Accounts that failed for another reason stay as they are. So do accounts that belong to someone else. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `cleared` | `integer` | Number of accounts cleared for retry. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "cleared": 3 } ``` ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 429 Rate limited Wait for the `Retry-After` value before retrying account recovery again. > [!NOTE] > > **Related.** [List X Accounts](/api-reference/x-accounts/list) to check account statuses, or [Re-authenticate](/api-reference/x-accounts/reauth) to fix one account. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Connect an account to Xquik, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/connect Connect an X account with username, email, password, and its saved Authenticator App TOTP secret for tweet, reply, DM, and profile actions. Connecting is free. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/accounts` **Free.** This endpoint does not consume credits. > [!WARNING] > > This takes a dashboard session, or a key with the **Connect X accounts** permission. Turn it on at [dashboard.xquik.com/en/api-keys](https://dashboard.xquik.com/en/api-keys). Full access doesn't include it. A key without it gets `403 x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`. With a key, your backend receives the user's X password and 2FA secret. Read [your duties](/guides/connect-x-accounts-for-your-users#your-duties) first. > [!WARNING] > > Xquik encrypts credentials at rest. It uses them only to maintain the > connection. Xquik never stores plaintext passwords. A durable Xquik connection requires Authenticator App 2FA and `totp_secret`. Missing the key? Restart Authentication App 2FA in X to reveal a new secret. Copy it, add it to your authenticator app, and finish X's 6-digit confirmation. Then send the saved long key as `totp_secret`. Xquik does not support custom, dedicated, or user-supplied proxies. Xquik connects from its own infrastructure. A connection can finish immediately or continue as a tracked attempt. It can also ask for an email code. If it continues, follow the returned `Location`. Do not send the credentials again while the attempt is `pending`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://dashboard.xquik.com/api/v1/x/accounts \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" \ -H "Content-Type: application/json" \ -d '{ "username": "your_x_username", "email": "account@example.invalid", "password": "", "totp_secret": "" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://dashboard.xquik.com/api/v1/x/accounts", { method: "POST", headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE", Origin: "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin", "Content-Type": "application/json", }, body: JSON.stringify({ username: "your_x_username", email: "account@example.invalid", password: "", totp_secret: "", }), }); const data = await response.json(); ``` | X account connection result | Response source | Next step | | - | - | - | | Connected account ID | `id` from `201` | Use this ID for write actions and recovery. | | X username | `xUsername` | Confirm the intended profile connected. | | X user ID | `xUserId` | Store it. It stays the same when the username changes. | | Connection state | `status` | Continue only after the account becomes active. | | Login health | `health` | Require `healthy` before durable actions. | | Pending attempt | `id` from `202 pending` | Poll the returned `Location` after `Retry-After`. | | Email challenge | `id` from `202 requires_email_code` | Submit the matching email code before expiry. | | Challenge expiry | `expiresAt` | Stop using an expired challenge. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Or `Cookie` | An API key holding the Connect X accounts permission. | | `Cookie` | `string` | Or `x-api-key` | Your signed-in dashboard session cookie, `__Host-xquik_session`. | | `Origin` | `string` | With `Cookie` | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `username` | `string` | Yes | X (Twitter) username to connect. Xquik strips the `@` prefix if included. | | `email` | `string` | Yes | Email address associated with the X account. | | `password` | `string` | Yes | Password for the X account. Xquik encrypts it at rest on receipt. | | `totp_secret` | `string` | Yes | Authenticator App TOTP secret required for a durable connection. This is the base32-encoded secret, not the 6-digit code. | | `connection_attempt_id` | `string` | No | Your own attempt ID, `xatt_` and 32 lowercase hex characters. Read the result with it if the response never arrives. | ## 2FA secret key setup Xquik needs the authenticator app secret key, not a live 6-digit code. That key belongs to **Authentication App** 2FA. The key is the long base32 string X shows while you set up 2FA. An example is `JBSWY3DPEHPK3PXP`. > [card] Use the secret key > > Paste the long base32 key into `totp_secret`. Xquik uses it to generate fresh 2FA codes during login challenges. > [card] Do not use backup codes > > Do not paste the 6-digit authenticator code. Do not paste the 12-character backup code, a passkey, or a security key prompt. If you already saved the secret key, send it as `totp_secret`. If you did not save it, create a fresh authenticator app secret on X. > [card] You saved the key > > Paste that saved base32 secret into `totp_secret`. Do not paste the current 6-digit authenticator code. > [card] 2FA is on, key is missing > > X shows the text secret only during Authentication App setup. Turn Authentication App off, then on again. Copy the new key, then finish setup on X. > [card] 2FA is not enabled > > Start Authentication App setup on X and reveal the text secret. Copy it and add it to your authenticator app. Confirm the 6-digit code on X, then connect. 1. Open X **Settings and Privacy > Security and Account Access > Security**. 2. Open **Two-Step Verification > Authentication App**. 3. Turn Authentication App off. 4. Turn Authentication App on again. 5. X shows a QR code. Then choose **Can't scan the QR code?** to reveal the text secret. 6. Copy the long secret key. Then store it in a password manager before leaving the setup screen. 7. Add that key to your authenticator app if you are setting it up fresh. 8. Finish enabling 2FA on X by entering the current 6-digit code. The code comes from your authenticator app. 9. Send the saved long key in `totp_secret` when you call Xquik. > [!WARNING] > > Do not stop after copying the secret key. Complete the X-side 2FA confirmation before starting the Xquik connection. Otherwise the key will not work. > [!NOTE] > > Xquik can't complete passkey or security key prompts. If X asks this account for a passkey, delete the passkey on X. In that case, keep Authenticator App 2FA. ## Response ### 201 Created | Field | Type | Description | | - | - | - | | `id` | `string` | Unique account ID. | | `xUsername` | `string` | Connected X (Twitter) username. | | `xUserId` | `string` | X (Twitter) user ID. | | `status` | `string` | Account connection status (for example `"active"`). | | `health` | `string` | Derived login and cookie health. One of `healthy`, `locked`, `needsReauth`, `recovering`, `suspended`, `temporaryIssue`. See [Account health](/api-reference/x-accounts/list#account-health) for meanings. | | `createdAt` | `string` | ISO 8601 time when Xquik connected the account. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "3", "xUsername": "your_x_username", "xUserId": "9876543210", "status": "active", "health": "healthy", "createdAt": "2026-02-20T08:15:00.000Z" } ``` ### 202 Connecting | Field | Type | Description | | - | - | - | | `object` | `string` | Always `x_account_connection_attempt`. | | `id` | `string` | Connection attempt ID. | | `status` | `string` | Always `pending`. | | `pollAfterMs` | `integer` | Milliseconds to wait before checking the status URL. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_account_connection_attempt", "id": "xatt_0123456789abcdef0123456789abcdef", "status": "pending", "pollAfterMs": 3000 } ``` The response includes these headers. * `Location: /api/v1/x/account-connection-attempts/{id}` * `Retry-After: 3` * `Cache-Control: no-store` Wait for `Retry-After`, then call [Get X Account Connection Status](/api-reference/x-accounts/connection-attempt). Keep checking while `status` is `pending`. Do not create another attempt. ### 202 Email code required | Field | Type | Description | | - | - | - | | `object` | `string` | Always `x_account_connection_challenge`. | | `id` | `string` | Challenge ID to submit with the email verification code. | | `status` | `string` | Always `requires_email_code`. | | `expiresAt` | `string` | ISO 8601 expiration time for the challenge. | | `message` | `string` | Human-readable next step. | | `username` | `string` | X (Twitter) username being connected. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_account_connection_challenge", "id": "xch_8vGd8Y9JvH6dV0xA", "status": "requires_email_code", "expiresAt": "2026-05-08T12:10:00Z", "message": "Enter the email verification code to continue.", "username": "elonmusk" } ``` Submit the code to [Submit X Account Email Code](/api-reference/x-accounts/submit-challenge). ### 400 Invalid input Missing `username`, `email`, `password`, or `totp_secret`, or invalid field format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 409 Duplicate Xquik already has this X account connected. The answer never says on which Xquik account. ### 429 Rate limit exceeded `{ "error": "rate_limit_exceeded", "message": "Connection safety limit reached. Try again later.", "retryAfter": 900 }` You sent too many failed logins in 15 minutes. The limit counts this caller or this X account. Wait the `Retry-After` seconds, then try once. Each account a caller connects raises its limit. See the [rate limits guide](/guides/rate-limits) for details. ### 429 Login cooldown `{ "error": "login_cooldown", "message": "Login is temporarily paused", "reason": "automated", "retryAfterMs": 3600000 }` A prior login attempt triggered a cooldown (for example, X flagged the session). Wait for `retryAfterMs` before retrying. The response includes a `Retry-After` header in seconds. ### 422 Login failed `{ "error": "login_failed", "message": "Login failed. Check credentials and try again.", "retryAfterMs": 300000 }` X rejected the submitted username, email, password, or TOTP secret. Retry with the current password and the saved Authenticator App secret key. Use the key, not a 6-digit code. When `retryAfterMs` is present, wait for that duration. The response also includes `Retry-After` in seconds. `{ "error": "passkey_required", "message": "X asked this account to sign in with a passkey. Delete the passkey in X's security settings, keep Authentication app 2FA, then try again.", "retryAfterMs": 3600000 }` X showed this account a passkey sign-in, which Xquik can't complete. Open X **Settings and Privacy > Security and Account Access > Security > Passkey**. Delete the passkey but keep Authenticator App 2FA on, then connect again after `retryAfterMs`. The response also includes `Retry-After` in seconds. `{ "error": "login_failed", "reason": "login_unconfirmed", "message": "X didn't confirm the sign-in after your password. Wait 5 minutes, then try again. Retrying sooner can make X lock the account.", "retryAfterMs": 300000 }` X showed no known page after the password. Xquik sends the password only once per attempt. Wait for `Retry-After`, then try again. Retrying sooner can make X lock the account. ### 502 X user lookup failed `{ "error": "x_user_lookup_failed", "message": "X user not found. Check the username." }` Xquik could not resolve the X (Twitter) username. Verify the handle is correct and that the account exists. ### 503 Service unavailable `{ "error": "service_unavailable", "message": "Service temporarily unavailable. Try again." }` The X connection service is temporarily unavailable. Retry after a short delay. > [!NOTE] > > **Related.** > > * [Get X Account Connection Status](/api-reference/x-accounts/connection-attempt) for a pending attempt. > * [List X Accounts](/api-reference/x-accounts/list) to see connected accounts. > * [Re-authenticate](/api-reference/x-accounts/reauth) if a connection expires later. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **409** `{ "error": "account_already_connected", "message": "This X account is already connected." }` * **422** `{ "error": "login_failed", "message": "Login failed. Check credentials and try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Retry later." }` * **502** `{ "error": "x_user_lookup_failed", "message": "X username lookup failed. Try again later." }` * **503** `{ "error": "service_unavailable", "message": "Service temporarily unavailable. Try again later." }` # Account connection status, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/connection-attempt Poll a tracked X account connection until it succeeds, fails, or requests an email verification code. Wait for Retry-After between checks. Polling is free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/account-connection-attempts/{id}` **Free.** This endpoint does not consume credits. > [!WARNING] > > This takes a dashboard session, or a key with the **Connect X accounts** permission. Turn it on at [dashboard.xquik.com/en/api-keys](https://dashboard.xquik.com/en/api-keys). Full access doesn't include it. A key without it gets `403 x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`. An ID this account never started reads as `pending`, like one still registering. > [!NOTE] > > Check this endpoint after the connect response's `Retry-After` delay. You can > call other Xquik routes while the connection continues. Do not send the credentials again > while `status` is `pending`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/account-connection-attempts/xatt_0123456789abcdef0123456789abcdef \ -H "x-api-key: $XQUIK_API_KEY" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch( "https://xquik.com/api/v1/x/account-connection-attempts/xatt_0123456789abcdef0123456789abcdef", { headers: { "x-api-key": process.env.XQUIK_API_KEY, }, }, ); const data = await response.json(); ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Or `Cookie` | An API key holding the Connect X accounts permission. | | `Cookie` | `string` | Or `x-api-key` | Your signed-in dashboard session cookie, `__Host-xquik_session`. | ## Path | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Connection attempt ID from the `202 pending` connect response. | ## Response Every `200` response includes `Cache-Control: no-store`. ### 200 Pending | Field | Type | Description | | - | - | - | | `object` | `string` | Always `x_account_connection_attempt`. | | `id` | `string` | Connection attempt ID. | | `status` | `string` | Always `pending`. | | `pollAfterMs` | `integer` | Milliseconds to wait before checking again. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_account_connection_attempt", "id": "xatt_0123456789abcdef0123456789abcdef", "status": "pending", "pollAfterMs": 3000 } ``` The response includes `Retry-After: 3`. Wait, then check the same attempt. ### 200 Success | Field | Type | Description | | - | - | - | | `object` | `string` | Always `x_account_connection_attempt`. | | `id` | `string` | Connection attempt ID. | | `status` | `string` | Always `success`. | | `accountId` | `string` | The connected account's ID. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_account_connection_attempt", "id": "xatt_0123456789abcdef0123456789abcdef", "status": "success", "accountId": "42" } ``` The account is ready. Pass `accountId` as `account` on later calls. ### 200 Email code required | Field | Type | Description | | - | - | - | | `object` | `string` | Always `x_account_connection_challenge`. | | `id` | `string` | Challenge ID, not the attempt ID. | | `status` | `string` | Always `requires_email_code`. | | `expiresAt` | `string` | ISO 8601 challenge expiration time. | | `message` | `string` | Human-readable next step. | | `username` | `string` | X (Twitter) username being connected. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_account_connection_challenge", "id": "xch_8vGd8Y9JvH6dV0xA", "status": "requires_email_code", "expiresAt": "2026-05-08T12:10:00Z", "message": "Enter the email verification code to continue.", "username": "your_x_username" } ``` Submit the newest code to [Submit X Account Email Code](/api-reference/x-accounts/submit-challenge). ### 200 Failed | Field | Type | Description | | - | - | - | | `object` | `string` | Always `x_account_connection_attempt`. | | `id` | `string` | Connection attempt ID. | | `status` | `string` | Always `failed`. | | `error` | `string` | Stable public error code. | | `reason` | `string` | More specific reason when available. | | `retryable` | `boolean` | Whether you can attempt another connect request. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_account_connection_attempt", "id": "xatt_0123456789abcdef0123456789abcdef", "status": "failed", "error": "service_unavailable", "retryable": true } ``` Stop checking this attempt. Start a new connection only when `retryable` is `true`. ### 400 Invalid input `{ "error": "invalid_input", "message": "Invalid connection attempt ID. Check the path parameter." }` The attempt ID is malformed, unavailable, or belongs to another account. Xquik does not keep attempts forever. Save the final result. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` The API key is missing or invalid. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Wait for `Retry-After` before checking again. > [!NOTE] > > **Related.** [Connect X Account](/api-reference/x-accounts/connect) starts the > attempt. [Submit X Account Email Code](/api-reference/x-accounts/submit-challenge) > completes an email challenge. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Create X account connect link, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/create-connection-link Create a link where a person connects their X (Twitter) account on a page Xquik hosts. Your backend never receives their password or 2FA secret. Free. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/account-connection-links` **Free.** This endpoint does not consume credits. > [!WARNING] > > Treat `url` like a password until the person uses it. It appears only in this response. > Send it only to the person connecting, and keep it out of your logs. The person opens `url` and enters their X details on a page Xquik hosts. They need no Xquik signup. The account then belongs to your Xquik account. Open the link in a pop-up or a new tab. The page can't load in a frame. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/account-connection-links \ -H "x-api-key: $XQUIK_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "reference": "crm-user-7", "returnUrl": "https://app.example.com/connected" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/account-connection-links", { body: JSON.stringify({ reference: "crm-user-7", returnUrl: "https://app.example.com/connected", }), headers: { "Content-Type": "application/json", "x-api-key": process.env.XQUIK_API_KEY, }, method: "POST", }); const link = await response.json(); ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Or `Cookie` | A Full access API key holding Connect X accounts. | | `Cookie` | `string` | Or `x-api-key` | Your signed-in dashboard session cookie, `__Host-xquik_session`. | | `Content-Type` | `string` | With a body | `application/json` | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `reference` | `string` | No | Your own ID for this person, up to 256 characters. It comes back when you read the link. | | `returnUrl` | `string` | No | A public `https` URL with no port, up to 2,048 characters. The page offers it as a button once the account connects. | | `accountId` | `string` | No | The ID of 1 of your X accounts. The link then reconnects that account, and refuses a sign-in for any other. | Xquik never redirects by itself, and never adds the token to `returnUrl`. ## Response ### 201 Created The response holds every field [Get connect link status](/api-reference/x-accounts/get-connection-link) returns, plus `url`. | Field | Type | Description | | - | - | - | | `url` | `string` | The page to open. It holds the token, so it works once. | | `id` | `string` | The link's ID. Save it to read the result. | | `status` | `string` | Always `pending` here. | | `expiresAt` | `string` | ISO 8601 time, 30 minutes from now. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_account_connection_link", "id": "xlink_AAAAAAAAAAAAAAAA", "purpose": "connect", "status": "pending", "reference": "crm-user-7", "returnUrl": "https://app.example.com/connected", "apiKeyId": "17", "accountId": null, "xUserId": null, "xUsername": null, "health": null, "failure": null, "createdAt": "2026-11-08T12:00:00.000Z", "expiresAt": "2026-11-08T12:30:00.000Z", "completedAt": null, "url": "https://xquik.com/connect-x#token=xclt_YOUR_LINK_TOKEN" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Set returnUrl to a public https URL." }` ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` ### 403 Forbidden The key isn't Full access, or lacks Connect X accounts and gets `x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`, since a link works like a password. ### 404 Not found `accountId` isn't one of your X accounts. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` > [!NOTE] > > **Related.** [Connect your users' X accounts](/guides/connect-x-accounts-for-your-users) compares this with the direct API. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Disconnect a connected account, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/disconnect Delete the stored Xquik connection for one X account. The X account stays unchanged. The old ID then returns 404, and reconnecting creates a new account ID. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/accounts/{id}` **Free.** This endpoint does not consume credits. > [!WARNING] > > This takes a dashboard session, or a key with the **Connect X accounts** permission. Turn it on at [dashboard.xquik.com/en/api-keys](https://dashboard.xquik.com/en/api-keys). Full access doesn't include it. A key without it gets `403 x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`. Only a new sign-in restores the account. Account activity records it with the key's ID. Use this endpoint when a connected account should no longer be available. That covers write actions, DMs, media upload, and profile updates. It deletes only the stored Xquik connection for that account ID. It does not change the X account itself. After success, the old Xquik account ID returns `404`. Reconnect the account to get a new ID. ## What disconnect does > [card] Removes this connection > > Xquik removes the stored connection row from your account. Future `GET /x/accounts/{id}` calls for the same ID return `404`. > [card] Stops writes immediately > > The dashboard Disconnect button uses the same endpoint. It warns that write actions stop immediately. After success, new write, DM, media upload, and profile actions need another connected account. The other way is to reconnect this X account. > [card] Keeps monitors separate > > Account and keyword monitors are independent. Disconnecting credentials for `@username` does not remove monitors that track that username. Delete those monitors separately when tracking should stop. > [card] Reconnect with a new ID > > To use the same X account again, call [Connect X Account](/api-reference/x-accounts/connect). Store the new account `id` from the connect response. Do not reuse the deleted ID. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://dashboard.xquik.com/api/v1/x/accounts/3 \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://dashboard.xquik.com/api/v1/x/accounts/3", { method: "DELETE", headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE", Origin: "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin", }, }); const data = await response.json(); ``` ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique account ID. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Or `Cookie` | An API key holding the Connect X accounts permission. | | `Cookie` | `string` | Or `x-api-key` | Your signed-in dashboard session cookie, `__Host-xquik_session`. | | `Origin` | `string` | With `Cookie` | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `success` | `boolean` | Always `true` on successful disconnection. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": true } ``` ### 400 Invalid ID `{ "error": "invalid_id", "message": "Invalid account ID format" }` The provided account ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 404 Not found No account exists with this ID, or it belongs to a different Xquik account. ### 429 Rate limited Wait for the `Retry-After` value before disconnecting another account. > [!NOTE] > > Xquik disconnects the account and permanently deletes stored credentials. This does not affect your X account itself. > [!NOTE] > > **Related.** > > * [List X Accounts](/api-reference/x-accounts/list) to verify the removal. > * [Connect X Account](/api-reference/x-accounts/connect) to add a new one. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Get a connected account, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/get Check a connected X account before tweets, replies, DMs, likes, follows, or profile updates. Read healthy, recovering, temporaryIssue, or needsReauth. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/accounts/{id}` ## When to check one account Call this route before one connected-account write. Read health, recovery, and credential state before selecting the next action. Use list to see every connected account. **Free.** This endpoint does not consume credits. Use this endpoint before a workflow acts with one connected account. Read `health` first. Write with `healthy`. Use `recovering` on the next action. Wait or bulk retry `temporaryIssue`. Re-authenticate `needsReauth`. Fix `locked` or `suspended` on X before retrying writes. ## Read the account state > [card] Ready for actions > > `health: "healthy"` means the stored session is usable. `connectedAt` shows when the account last connected or reconnected. The API omits it if the account has not authenticated yet. > [card] Needs credentials > > `health: "needsReauth"` means credentials, TOTP, email verification, passkey, or another security challenge blocked login. Use [Re-authenticate](/api-reference/x-accounts/reauth) with current credentials and a valid TOTP secret before retrying writes. > [card] Temporary recovery > > `health: "temporaryIssue"` means a transient or automated cooldown is still active. Wait for recovery, or use [Bulk retry](/api-reference/x-accounts/bulk-retry) for temporary failures. `health: "recovering"` means the account can reconnect on its next use. > [card] X restriction > > `health: "locked"` or `health: "suspended"` means writes stay blocked until you fix the account on X. Re-authenticate or reconnect only after the account is usable again. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET https://xquik.com/api/v1/x/accounts/3 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const accountId = "3"; const response = await fetch(`https://xquik.com/api/v1/x/accounts/${accountId}`, { method: "GET", headers: { "x-api-key": "xq_YOUR_KEY_HERE", }, }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests account_id = "3" response = requests.get( f"https://xquik.com/api/v1/x/accounts/{account_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "net/http" ) func main() { accountID := "3" req, err := http.NewRequest("GET", "https://xquik.com/api/v1/x/accounts/"+accountID, nil) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique account ID. Returned when you [connect an account](/api-reference/x-accounts/connect) or [list accounts](/api-reference/x-accounts/list). | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | Unique account ID. | | `xUsername` | `string` | X (Twitter) username. | | `xUserId` | `string` | X (Twitter) user ID. | | `status` | `string` | Account connection status (for example `"active"`). | | `health` | `string` | Derived login and cookie health. One of `healthy`, `locked`, `needsReauth`, `recovering`, `suspended`, `temporaryIssue`. See [Account health](/api-reference/x-accounts/list#account-health) for meanings. | | `connectedAt` | `string` | ISO 8601 timestamp of when the account last connected or reconnected. Omitted if not yet authenticated. | | `createdAt` | `string` | ISO 8601 timestamp of when you connected the account. | | `updatedAt` | `string` | ISO 8601 timestamp of the last update. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "3", "xUsername": "elonmusk", "xUserId": "44196397", "status": "active", "health": "healthy", "connectedAt": "2026-02-20T08:15:00.000Z", "createdAt": "2026-02-20T08:15:00.000Z", "updatedAt": "2026-02-20T08:15:00.000Z" } ``` ### 400 Invalid ID `{ "error": "invalid_id", "message": "Invalid account ID format" }` The provided account ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 404 Not found No account exists with this ID, or it belongs to a different Xquik account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` Wait for the `Retry-After` value before fetching this account again. > [!NOTE] > > **Related.** > > * [List X Accounts](/api-reference/x-accounts/list) to see all accounts. > * [Disconnect](/api-reference/x-accounts/disconnect) to remove this account. > * [Re-authenticate](/api-reference/x-accounts/reauth) if the session has expired. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Get X account connect link, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/get-connection-link Read what happened on an X (Twitter) connect link. Get status, health, xUserId, xUsername & your own reference once the person finishes. Free to read. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/account-connection-links/{id}` **Free.** This endpoint does not consume credits. Read this when the person comes back, or every few seconds until then. There's no webhook for this yet, since webhooks carry monitor events today. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/account-connection-links/xlink_AAAAAAAAAAAAAAAA \ -H "x-api-key: $XQUIK_API_KEY" | jq ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Or `Cookie` | A Full access API key holding Connect X accounts. | | `Cookie` | `string` | Or `x-api-key` | Your signed-in dashboard session cookie, `__Host-xquik_session`. | ## Path | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The `id` the create response gave you. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `object` | `string` | Always `x_account_connection_link`. | | `id` | `string` | The link's ID. | | `purpose` | `string` | `connect` or `reconnect`. | | `status` | `string` | See the table below. | | `reference` | `string \| null` | Your own ID for this person. | | `returnUrl` | `string \| null` | The URL you gave. | | `apiKeyId` | `string \| null` | The API key that made the link, or null for a dashboard session. | | `accountId` | `string \| null` | The connected account. Pass it as `account` on later calls. | | `xUserId` | `string \| null` | The X user ID. | | `xUsername` | `string \| null` | The X username. | | `health` | `string \| null` | The account's health. | | `failure` | `string \| null` | Why the last login didn't finish. | | `createdAt` | `string` | ISO 8601 time. | | `expiresAt` | `string` | ISO 8601 time. | | `completedAt` | `string \| null` | ISO 8601 time the account connected. | The token never appears here, because Xquik stores only its hash. | `status` | What it means | | - | - | | `pending` | Nobody finished signing in yet. | | `connecting` | A sign-in is running. | | `requires_email_code` | The person is entering a code X emailed them. | | `connected` | The account connected. The link can't be used again. | | `failed` | X refused 5 logins. Create a new link. | | `expired` | The link ran out of time. Create a new link. | | `revoked` | You revoked it, or its key is paused, revoked, expired or no longer Full access. A key that resumes within the link's 30 minutes brings it back to `pending`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_account_connection_link", "id": "xlink_AAAAAAAAAAAAAAAA", "purpose": "connect", "status": "connected", "reference": "crm-user-7", "returnUrl": "https://app.example.com/connected", "apiKeyId": "17", "accountId": "42", "xUserId": "9876543210", "xUsername": "your_x_username", "health": "healthy", "failure": null, "createdAt": "2026-11-08T12:00:00.000Z", "expiresAt": "2026-11-08T12:30:00.000Z", "completedAt": "2026-11-08T12:04:10.000Z" } ``` ### 400 Invalid input `id` isn't a connect link ID. Use the `id` the create response gave you. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` ### 403 Forbidden The key isn't Full access, or lacks Connect X accounts and gets `x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`, since a link works like a password. ### 404 Not found The link doesn't exist, or belongs to another Xquik account. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List connected accounts, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/list Page through connected X accounts, inspect login health, and select the correct Xquik connection before Tweets, replies, DMs, likes, follows, or profile writes. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/accounts` **Free.** This endpoint does not consume credits. List X accounts connected to the authenticated Xquik account. Read each local ID, username, and health before a write. It does not search public Twitter accounts. Use [Search Users](/api-reference/x/search-users) for public profiles. > [!NOTE] > > Check `accounts[].health` before every write. Use only a ready connection. ## Common uses | Workflow | Use the response for | | - | - | | Before a Tweet, reply, DM, like, or follow | Select `accounts[].id` | | After connection or reauthentication | Confirm username and health | | Before scheduled work | Exclude blocked accounts | | During support | Compare status, health, and timestamps | ## Scope, ordering & pagination The response contains only connections owned by the authenticated Xquik account. The API orders accounts by `createdAt` from earliest to latest. The connection ID breaks ties between equal timestamps. Send `limit` to enable cursor pagination. The default is 50. The maximum is 10,000. Pass `nextCursor` unchanged as `cursor` while `hasMore` is true. The opt-in contract paginates by default. Send this header. ```http theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} xquik-api-contract: 2026-04-29 ``` That contract returns `has_more` and `next_cursor`. The examples below show the default v1 camelCase fields. Calls without `limit` or `cursor` return up to 10,000 connections. Existing clients keep working. Larger lists receive cursor fields. Paginate in new integrations. An account without connections receives `{"accounts": [], "hasMore": false}` when pagination is active. ## Request ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/accounts?limit=50" \ -H "x-api-key: xq_YOUR_KEY_HERE" ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/accounts?limit=50", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); if (!response.ok) throw new Error(`List failed: ${response.status}`); const page = await response.json(); ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | OAuth bearer token using `Bearer YOUR_TOKEN`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Page size from 1 through 10,000. Default `50`. Follow `nextCursor` for more. | | `cursor` | `string` | No | Opaque `nextCursor` from the previous page. Do not decode or change it. | ## Read every page ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} let cursor; do { const query = new URLSearchParams({ limit: "100" }); if (cursor) query.set("cursor", cursor); const response = await fetch(`https://xquik.com/api/v1/x/accounts?${query}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); if (!response.ok) throw new Error(`List failed: ${response.status}`); const page = await response.json(); for (const account of page.accounts) { console.log(account.id, account.xUsername, account.health); } cursor = page.hasMore ? page.nextCursor : undefined; } while (cursor); ``` ## Response | Field | Type | Required | Description | | - | - | - | - | | `accounts` | `object[]` | Yes | Connected X accounts. Empty when no connection exists. | | `hasMore` | `boolean` | No | `true` when another cursor page exists. Present on paginated responses. | | `nextCursor` | `string` | No | Opaque cursor for the next page. Present only when another page exists. | | `accounts[].id` | `string` | Yes | Xquik connection ID. Use it as `accountId` for write endpoints. | | `accounts[].xUsername` | `string` | Yes | Connected X (Twitter) username without `@`. | | `accounts[].xUserId` | `string` | Yes | Stable X (Twitter) user ID. This is not the Xquik connection ID. | | `accounts[].status` | `string` | Yes | Stored connection status. Read `health` before writes. | | `accounts[].health` | `string` | Yes | Current write readiness. See [Account health](#account-health). | | `accounts[].connectedAt` | `string` | No | ISO 8601 time when the account last connected or reconnected. Omitted before login. | | `accounts[].createdAt` | `string` | Yes | ISO 8601 connection creation time. | | `accounts[].updatedAt` | `string` | Yes | ISO 8601 time when the connection last changed. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "accounts": [ { "id": "3", "xUsername": "example", "xUserId": "44196397", "status": "active", "health": "healthy", "connectedAt": "2026-02-20T08:15:00.000Z", "createdAt": "2026-02-20T08:15:00.000Z", "updatedAt": "2026-02-20T08:15:00.000Z" } ], "hasMore": true, "nextCursor": "MjAyNi0wMi0yMFQwODoxNTowMC4wMDBafDM=" } ``` ## Choose the correct identifier | Field | Scope | Use | | - | - | - | | `id` | Xquik connection | Pass as `accountId` to write endpoints | | `xUserId` | X account | Correlate public read responses | | `xUsername` | Public handle | Confirm the account the operator meant | Do not send `xUserId` where a write endpoint requires `accountId`. ## Account health The `status` field alone is not enough. Check `health` before every write. | Health | Write readiness | Next action | | - | - | - | | `healthy` | Ready | Continue with the intended write | | `recovering` | Retry on use | Let the next action reconnect | | `temporaryIssue` | Wait | Respect the cooldown | | `needsReauth` | Blocked | Reauthenticate with current credentials | | `locked` | Blocked | Complete recovery on X, then reauthenticate | | `suspended` | Blocked | Resolve the suspension on X | **Recovery details.** `needsReauth` covers credentials, TOTP, email verification, passkeys, and other security challenges. Use [reauth](/api-reference/x-accounts/reauth) after resolving X-side prompts. `locked` can require account-side verification. `suspended` stays blocked until X restores the account. `recovering` reconnects on the next use. `temporaryIssue` stays paused during a transient cooldown. Use [Bulk Retry](/api-reference/x-accounts/bulk-retry) only for eligible temporary failures. It cannot fix credentials, locks, or suspensions. ## Errors ### 400 Invalid input The cursor or limit is invalid. Restart without a cursor or send a valid limit. ### 401 Unauthenticated Send a valid Xquik API key or OAuth bearer token. ### 429 Rate limited Wait for `Retry-After`, then request the same page again. > [!NOTE] > > **Next steps.** [Connect X Account](/api-reference/x-accounts/connect), > [Re-authenticate X Account](/api-reference/x-accounts/reauth), or > [Bulk Retry](/api-reference/x-accounts/bulk-retry). ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "accounts": [ { "id": "42", "xUserId": "9876543210", "xUsername": "elonmusk", "status": "active", "health": "healthy" } ], "hasMore": false } ``` * **400** `{ "error": "invalid_input", "message": "Invalid account list cursor or limit." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # List X account connect links, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/list-connection-links List your X (Twitter) connect links, newest first, with the API key that made each one. Find and revoke the links a leaked API key made. Free to read. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/account-connection-links` **Free.** This endpoint does not consume credits. Lists your connect links, newest first. `apiKeyId` names the API key that made each one. It reads null when a dashboard session made the link. If a key leaks, revoke it first. Then list your links and [revoke](/api-reference/x-accounts/revoke-connection-link) any you didn't send. A link stops while its key is paused. It ends once that key is revoked, rotated, expired or deleted. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/account-connection-links?limit=50" \ -H "x-api-key: $XQUIK_API_KEY" | jq ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Or `Cookie` | A Full access API key holding Connect X accounts. | | `Cookie` | `string` | Or `x-api-key` | Your signed-in dashboard session cookie, `__Host-xquik_session`. | ## Query | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Links per page, from 1 to 10,000. Default 200. | | `cursor` | `string` | No | The previous page's `nextCursor`. The `after` alias also works. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `links` | `array` | Your links, each shaped like [Get connect link status](/api-reference/x-accounts/get-connection-link). | | `hasMore` | `boolean` | Whether another page follows. | | `nextCursor` | `string` | Pass it as `cursor` for the next page. Present only when `hasMore` is true. | No link in the list holds its token, because Xquik stores only its hash. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "links": [ { "object": "x_account_connection_link", "id": "xlink_AAAAAAAAAAAAAAAA", "purpose": "connect", "status": "revoked", "reference": "crm-user-7", "returnUrl": "https://app.example.com/connected", "apiKeyId": "17", "accountId": null, "xUserId": null, "xUsername": null, "health": null, "failure": null, "createdAt": "2026-11-08T12:00:00.000Z", "expiresAt": "2026-11-08T12:30:00.000Z", "completedAt": null } ], "hasMore": false } ``` ### 400 Invalid input `cursor` isn't a `nextCursor` this endpoint gave you. Leave it out to start over. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` ### 403 Forbidden The key isn't Full access, or lacks Connect X accounts and gets `x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`, since a link works like a password. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Reauthenticate an account, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/reauth Restore a connected X account with its current password. Xquik reuses the saved Authenticator App TOTP secret unless you send a replacement. The call is free. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/accounts/{id}/reauth` **Free.** This endpoint does not consume credits. > [!WARNING] > > This takes a dashboard session, or a key with the **Connect X accounts** permission. Turn it on at [dashboard.xquik.com/en/api-keys](https://dashboard.xquik.com/en/api-keys). Full access doesn't include it. A key without it gets `403 x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`. With a key, your backend receives the new X password. Read [your duties](/guides/connect-x-accounts-for-your-users#your-duties) first. > [!NOTE] > > Use this when an account session expires or X requires re-verification. Omit `totp_secret` to reuse the saved key. Send a replacement only if X changed or rejected the saved key. Re-authentication does not guarantee the same public IP. Xquik does not support custom, dedicated, or user-supplied proxies. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://dashboard.xquik.com/api/v1/x/accounts/3/reauth \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" \ -H "Content-Type: application/json" \ -d '{"password": ""}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://dashboard.xquik.com/api/v1/x/accounts/3/reauth", { method: "POST", headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE", Origin: "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin", "Content-Type": "application/json", }, body: JSON.stringify({ password: "", }), }); const data = await response.json(); ``` > [accordion] Replace the saved TOTP secret > > Send `totp_secret` only when the saved key no longer works. > > ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > curl -X POST https://dashboard.xquik.com/api/v1/x/accounts/3/reauth \ > -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ > -H "Origin: https://dashboard.xquik.com" \ > -H "Sec-Fetch-Site: same-origin" \ > -H "Content-Type: application/json" \ > -d '{ > "password": "", > "totp_secret": "" > }' | jq > ``` | X account recovery column | Request or response source | Recovery rule | | - | - | - | | Account ID | Path `{id}` and response `id` | Require both IDs to match. | | Current password | Request `password` | Send it only to this reauthentication request. | | Saved TOTP key | Omitted `totp_secret` | Reuse the stored authenticator secret. | | Replacement TOTP key | Request `totp_secret` | Send the base32 key, never a 6-digit code. | | X username | Response `xUsername` | Confirm the recovered profile. | | X user ID | Response `xUserId` | Store it. It stays the same when the username changes. | | Account state | Response `status` | Require `active` before write actions. | | Login health | Response `health` | Require `healthy` before durable actions. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The unique account ID. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Or `Cookie` | An API key holding the Connect X accounts permission. | | `Cookie` | `string` | Or `x-api-key` | Your signed-in dashboard session cookie, `__Host-xquik_session`. | | `Origin` | `string` | With `Cookie` | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `password` | `string` | Yes | Current password for the X account. | | `totp_secret` | `string` | No | Replacement Authenticator App TOTP secret. Omit it to reuse the saved key. Send the base32 secret, not the 6-digit code. | | `email` | `string` | No | Email for the X account. Updates the stored email during re-authentication. | | `connection_attempt_id` | `string` | No | Your own attempt ID, `xatt_` and 32 lowercase hex characters. Read the result with it if the response never arrives. | ## 2FA re-authentication Xquik reuses the saved TOTP secret by default. Send `totp_secret` only when replacing that key. Never send a 6-digit code, backup code, passkey, or security key prompt. If you never saved the secret key, reset the authenticator app setup before re-authenticating. Do the same if X rejects the current one. > [card] Saved key still works > > Omit `totp_secret`. Xquik reuses the encrypted key saved during connection. > [card] Key is missing > > X shows the text secret only during Authentication App setup. Turn Authentication App off, then on again. Copy the new key, then finish setup on X. > [card] Key was rejected > > Treat the old TOTP secret as stale. Reset Authentication App setup on X and save the new long key. Finish 2FA confirmation, then re-authenticate. 1. Open X **Settings and Privacy > Security and Account Access > Security**. 2. Open **Two-Step Verification > Authentication App**. 3. Turn Authentication App off, then turn it on again. 4. X shows a QR code. Then choose **Can't scan the QR code?** to reveal the text secret. 5. Copy the long secret key. Then store it in a password manager before leaving the setup screen. 6. Add that key to your authenticator app if you are setting it up fresh. 7. Finish enabling 2FA on X by entering the current 6-digit code. The code comes from your authenticator app. 8. Send the new long key in `totp_secret` when you call Xquik. > [!WARNING] > > Finish the X-side 2FA confirmation after copying the secret key. If you abandon setup before confirmation, re-authentication cannot use that key. > [!NOTE] > > See [2FA secret key setup](/api-reference/x-accounts/connect#2fa-secret-key-setup) for the full connection checklist. ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | Account ID. | | `xUsername` | `string` | X (Twitter) username. | | `xUserId` | `string` | X (Twitter) user ID. | | `status` | `string` | Account status (for example `active`). | | `health` | `string` | Derived login and cookie health. One of `healthy`, `locked`, `needsReauth`, `recovering`, `suspended`, `temporaryIssue`. See [Account health](/api-reference/x-accounts/list#account-health) for meanings. | | `createdAt` | `string` | ISO 8601 creation timestamp. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "3", "xUsername": "elonmusk", "xUserId": "44196397", "status": "active", "health": "healthy", "createdAt": "2026-02-20T08:15:00.000Z" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Missing required password field" }` Missing `password` field or invalid format. `{ "error": "invalid_id", "message": "Invalid account ID format" }` The provided account ID is not a valid format. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 202 Sign-in continues A key's sign-in past 75 seconds answers `pending` with a `Location` status URL. Wait for `Retry-After`, then call [Get X Account Connection Status](/api-reference/x-accounts/connection-attempt). X may also ask for an email code, which answers `requires_email_code`. Send it to [Submit Email Code](/api-reference/x-accounts/submit-challenge). ### 404 Not found No account exists with this ID, or it belongs to a different Xquik account. ### 409 Another X account `{ "error": "x_account_mismatch", "message": "This sign-in belongs to a different X account. Connect it as a new account instead." }` The stored login stays as it was. ### 429 Login cooldown `{ "error": "login_cooldown", "message": "Login is temporarily paused", "reason": "automated", "retryAfterMs": 3600000 }` A prior login attempt triggered a cooldown (for example, X flagged the session). Wait for `retryAfterMs` before retrying. The response includes a `Retry-After` header in seconds. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Connection safety limit reached. Try again later.", "retryAfter": 900 }` You sent too many failed logins in 15 minutes. The limit counts this caller or this X account. Wait the `Retry-After` seconds, then try once. Each account a caller connects raises its limit. See the [rate limits guide](/guides/rate-limits) for details. ### 422 Login failed X rejected the submitted password or TOTP secret. Retry with the current password and the saved Authenticator App secret key. Use the key, not a 6-digit code. `{ "error": "passkey_required", "message": "X asked this account to sign in with a passkey. Delete the passkey in X's security settings, keep Authentication app 2FA, then try again." }` X showed this account a passkey sign-in, which Xquik can't complete. Open X **Settings and Privacy > Security and Account Access > Security > Passkey**. Delete the passkey but keep Authenticator App 2FA on, then re-authenticate. ### 503 Service unavailable `{ "error": "service_unavailable", "message": "Service temporarily unavailable. Try again." }` The X re-authentication service is temporarily unavailable. Retry after a short delay. > [!NOTE] > > **Related.** > > * [Get X Account](/api-reference/x-accounts/get) to check account status. > * [Connect X Account](/api-reference/x-accounts/connect) if you need to add a new account instead. ## Response examples ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_account_connection_attempt", "id": "xatt_0123456789abcdef0123456789abcdef", "status": "pending", "pollAfterMs": 3000 } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found." }` * **409** `{ "error": "x_account_mismatch", "message": "This sign-in belongs to a different X account. Connect it as a new account instead." }` * **422** `{ "error": "login_failed", "message": "Login failed. Check credentials and try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Retry later." }` * **503** `{ "error": "service_unavailable", "message": "Service temporarily unavailable. Try again later." }` # Revoke X account connect link, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/revoke-connection-link Stop an X (Twitter) connect link working before it's used. An account it already connected stays connected, and your other links keep working for now. Free. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/account-connection-links/{id}` **Free.** This endpoint does not consume credits. Revoke a link sent to the wrong person, or one nobody needs anymore. To remove an account a link connected, call [Disconnect X account](/api-reference/x-accounts/disconnect). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/x/account-connection-links/xlink_AAAAAAAAAAAAAAAA \ -H "x-api-key: $XQUIK_API_KEY" | jq ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Or `Cookie` | A Full access API key holding Connect X accounts. | | `Cookie` | `string` | Or `x-api-key` | Your signed-in dashboard session cookie, `__Host-xquik_session`. | ## Path | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The `id` the create response gave you. | ## Response ### 200 OK `{ "success": true }` ### 400 Invalid input `id` isn't a connect link ID. Use the `id` the create response gave you. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` ### 403 Forbidden The key isn't Full access, or lacks Connect X accounts and gets `x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`, since a link works like a password. ### 404 Not found The link doesn't exist, belongs to another account, already connected, or was already revoked. ### 429 Rate limited `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }` ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": true } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Submit a login challenge code, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-accounts/submit-challenge Submit an email verification code for an active X account login challenge. Start a fresh connect or reauthentication when the challenge expires. Free to call. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/account-connection-challenges/{id}/submit` **Free.** This endpoint does not consume credits. > [!WARNING] > > This takes a dashboard session, or a key with the **Connect X accounts** permission. Turn it on at [dashboard.xquik.com/en/api-keys](https://dashboard.xquik.com/en/api-keys). Full access doesn't include it. A key without it gets `403 x_account_connect_permission_required`. OAuth tokens and MCP tools get `403 session_required`. Use this endpoint after [Connect X Account](/api-reference/x-accounts/connect) returns `202 Email Code Required`. Submit the one-time code from the account email inbox before `expiresAt`. > [!WARNING] > > This endpoint cannot reopen an expired, failed, completed, or replaced challenge. After `409`, `410`, or `422`, start [Connect X Account](/api-reference/x-accounts/connect) again for a new account. For an existing account, use [Re-authenticate X Account](/api-reference/x-accounts/reauth). Call it with the current password and any required TOTP secret key. ## Continue the pending login > [card] Use the returned challenge ID > > Keep the `id` from the `202` response. Submit the inbox code to that challenge. The challenge belongs to the same pending login attempt. > [card] Enter the account email code > > Use the one-time code X sent to the account email inbox. Xquik strips spaces before submission. `123 456` and `123456` work the same way. > [card] Handle another code prompt > > If X asks for a new email code, this endpoint returns `202` again. Keep the same flow open and submit the next inbox code before `expiresAt`. > [card] Start over when stale > > `410` means the code expired. `409` means the challenge already completed, failed, or expired. `409` can also mean a newer challenge replaced it. Start [Connect X Account](/api-reference/x-accounts/connect) again for a new account. Or use [Re-authenticate X Account](/api-reference/x-accounts/reauth) for an existing account. The dashboard follows the same flow. It keeps the pending row open and asks for the email code. It accepts a new `202` prompt if X asks again. After the `201` response, it refreshes the account list. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://dashboard.xquik.com/api/v1/x/account-connection-challenges/xch_8vGd8Y9JvH6dV0xA/submit \ -H "Cookie: __Host-xquik_session=YOUR_SESSION_COOKIE" \ -H "Origin: https://dashboard.xquik.com" \ -H "Sec-Fetch-Site: same-origin" \ -H "Content-Type: application/json" \ -d '{"email_code": "123456"}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch( "https://dashboard.xquik.com/api/v1/x/account-connection-challenges/xch_8vGd8Y9JvH6dV0xA/submit", { method: "POST", headers: { Cookie: "__Host-xquik_session=YOUR_SESSION_COOKIE", Origin: "https://dashboard.xquik.com", "Sec-Fetch-Site": "same-origin", "Content-Type": "application/json", }, body: JSON.stringify({ email_code: "123456", }), }, ); const data = await response.json(); ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Or `Cookie` | An API key holding the Connect X accounts permission. | | `Cookie` | `string` | Or `x-api-key` | Your signed-in dashboard session cookie, `__Host-xquik_session`. | | `Origin` | `string` | With `Cookie` | Must be `https://dashboard.xquik.com`, sent with `Sec-Fetch-Site` set to `same-origin`. The dashboard sends both. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Challenge ID returned by [Connect X Account](/api-reference/x-accounts/connect). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `email_code` | `string` | Yes | Email verification code for the pending connection. The API accepts codes from 4 to 64 characters. Xquik strips spaces before submission. | ## Response ### 201 Created | Field | Type | Description | | - | - | - | | `id` | `string` | Unique account ID. | | `xUsername` | `string` | Connected X (Twitter) username. | | `xUserId` | `string` | X (Twitter) user ID. | | `status` | `string` | Account connection status (for example `"active"`). | | `health` | `string` | Derived login and cookie health. One of `healthy`, `locked`, `needsReauth`, `recovering`, `suspended`, `temporaryIssue`. See [Account health](/api-reference/x-accounts/list#account-health) for meanings. | | `createdAt` | `string` | ISO 8601 time when Xquik connected the account. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "3", "xUsername": "elonmusk", "xUserId": "44196397", "status": "active", "health": "healthy", "createdAt": "2026-02-20T08:15:00.000Z" } ``` ### 202 Email code required | Field | Type | Description | | - | - | - | | `object` | `string` | Always `x_account_connection_challenge`. | | `id` | `string` | Challenge ID to submit with the next email verification code. | | `status` | `string` | Always `requires_email_code`. | | `expiresAt` | `string` | ISO 8601 expiration time for the challenge. | | `message` | `string` | Human-readable next step. | | `username` | `string` | X (Twitter) username being connected. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_account_connection_challenge", "id": "xch_8vGd8Y9JvH6dV0xA", "status": "requires_email_code", "expiresAt": "2026-05-08T12:10:00Z", "message": "Enter the email verification code to continue.", "username": "elonmusk" } ``` The connection still needs a valid email code. Submit the new code to the same endpoint. ### 400 Invalid input Missing `email_code`, invalid JSON, or a code outside the accepted length. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Missing or invalid API key. ### 404 Not found `{ "error": "connection_challenge_not_found", "message": "Connection challenge not found." }` The challenge ID does not exist or does not belong to the authenticated user. ### 409 Conflict The challenge already completed, failed, or expired, or a newer challenge replaced it. ### 410 Expired Start a new account connection to receive a fresh challenge. ### 422 Login failed X rejected the code or account login state. Start a new connection if the account requires fresh credentials. ### 429 Rate limit exceeded `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` Wait for the `Retry-After` header before retrying. ### 503 Service unavailable Retry after a short delay. > [!NOTE] > > **Related.** [Connect X Account](/api-reference/x-accounts/connect) starts the challenge. [List X Accounts](/api-reference/x-accounts/list) verifies the account after connection. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "connection_challenge_inactive", "message": "Connection challenge is no longer active." }` * **410** `{ "error": "connection_challenge_expired", "message": "Verification code expired. Start again." }` * **422** `{ "error": "login_failed", "message": "Login failed. Check credentials and try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Retry later." }` * **503** `{ "error": "service_unavailable", "message": "Service temporarily unavailable. Try again later." }` # Block a user by user ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/block Block 1 X (Twitter) user by ID from a connected account. Store the write action, result and billed credits. Retry only when safeToRetry is true. 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/users/{id}/block` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Each request blocks 1 user by ID. Each request uses 1 connected X account. X removes follows both ways when the block lands. Unblocking never restores those follows. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/users/44196397/block \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: block-44196397" \ -H "Content-Type: application/json" \ -d '{"account":"myxaccount"}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/44196397/block", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "block-44196397", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxaccount" }), }); const result = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(result)); } process.stdout.write( `${JSON.stringify({ id: result.id, status: result.status, terminal: result.terminal })}\n`, ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/x/users/44196397/block", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "block-44196397", }, json={"account": "myxaccount"}, ) response.raise_for_status() result = response.json() print(result["id"], result["status"], result["terminal"]) ``` ## Block one user by ID Put the exact user ID in the request path. Put the connected account username or ID in the body. That account blocks the user. The blocked user can't follow that account or see its posts while signed in. X tells the blocked user only when they open the account's profile. ## Choose block or mute | Intent | API route | Result | | - | - | - | | Stop a user from following or replying | `POST /x/users/{id}/block` | Blocks the user and removes follows both ways. | | Hide a user's posts without telling them | `POST /x/users/{id}/mute` | Mutes the user. Follows stay. | | Undo a block | `DELETE /x/users/{id}/block` | Unblocks the user. Follows stay removed. | Use [Unblock user](/api-reference/x-write/unblock) to reverse a block. ## Save a receipt Save the action first. Then update your local record. | Column | Source | Rule | | - | - | - | | `acting_account` | Request `account` | Keep the connected X account with the action. | | `user_id` | Path `id` | Keep the exact user ID. | | `idempotency_key` | Request header | Generate 1 key for this account and user ID. | | `write_action_id` | Response `id` | Store the action before polling. | | `terminal` | Response `terminal` | Change the local record only when `true`. | | `safe_to_retry` | Response `safeToRetry` | Retry only when this value is `true`. | ## Handle errors Never infer failure from a client timeout. Poll a returned action before sending another request. * For `400`, correct the user ID or account value. * For `401`, replace invalid Xquik authentication. * For `402`, add credits before another request. * For `403`, reconnect the selected X account. * For `409`, keep the original action and payload. * For `422`, review the X rejection before retrying. * For `429`, wait for `Retry-After`. * For `500` or `503`, follow `safeToRetry` and `terminal`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token. | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User to block. Send a user ID or a username with or without `@`. A URL-encoded profile URL such as `x.com/nasa` also works. An unknown username returns `422 x_target_not_found`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID identifying which connected X account acts. Xquik strips the `@` prefix if included. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "block", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "block", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Bookmark a tweet by ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/bookmark Bookmark 1 tweet by ID from a connected X account. Store the write action, terminal result and billed credits. Retry only when safeToRetry is true. 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/tweets/{id}/bookmark` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Each request bookmarks 1 tweet by ID. Each request uses 1 connected X account. Only that account sees its bookmarks. Create a unique `Idempotency-Key` for the intended bookmark. Store the returned write action and poll `statusUrl` when needed. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets/1895432178065391234/bookmark \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: bookmark-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{"account":"elonmusk"}' | jq '{ status, terminal, safe_to_retry: .safeToRetry, write_action_id: .id, requested_tweet_id: "1895432178065391234", confirmed_tweet_id: (.result.id // .targetId), charged_credits: .billing.chargedCredits, poll_path: (if .terminal then null else .statusUrl end) }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1895432178065391234"; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/bookmark`, { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "bookmark-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "elonmusk" }), }); const result = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(result)); } const bookmarkRecord = { status: result.status, terminal: result.terminal, safe_to_retry: result.safeToRetry, write_action_id: result.id, requested_tweet_id: tweetId, confirmed_tweet_id: result.result?.id ?? result.targetId ?? null, charged_credits: result.billing.chargedCredits, poll_path: result.terminal ? null : result.statusUrl, }; process.stdout.write(`${JSON.stringify(bookmarkRecord)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1895432178065391234" response = requests.post( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/bookmark", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "bookmark-1895432178065391234", }, json={"account": "elonmusk"}, ) result = response.json() response.raise_for_status() bookmark_record = { "status": result["status"], "terminal": result["terminal"], "safe_to_retry": result["safeToRetry"], "write_action_id": result["id"], "requested_tweet_id": tweet_id, "confirmed_tweet_id": (result.get("result") or {}).get("id") or result.get("targetId"), "charged_credits": result["billing"]["chargedCredits"], "poll_path": None if result["terminal"] else result["statusUrl"], } print(json.dumps(bookmark_record)) ``` ## Bookmark one tweet by ID Put the exact Tweet ID in the request path. Put the connected account username or ID in the body. That account saves the bookmark. Copy Tweet IDs as strings. JavaScript numbers cannot represent every X identifier exactly. This endpoint accepts 1 Tweet ID per request. ## Keep bookmarks private to the acting account X shows a bookmark only to the account that saved it. The post's author sees a bookmark count, never who saved it. Bookmarking never notifies the author or adds a like. Read the saved posts with [Bookmarks](/api-reference/x/bookmarks). ## Save a bookmark receipt Save the action first. Then update your reading list. | Bookmark action column | Source | Rule | | - | - | - | | `acting_account` | Request `account` | Keep the connected X account with the bookmark. | | `tweet_id` | Path `id` | Keep the exact Tweet ID the user picked. | | `idempotency_key` | Request header | Generate 1 key for this account and Tweet ID. | | `write_action_id` | Response `id` | Store the action before polling. | | `terminal` | Response `terminal` | Mark the bookmark saved only when `true`. | | `safe_to_retry` | Response `safeToRetry` | Retry only when this value is `true`. | ## Choose bookmark, like, or read bookmarks | Intent | API route | Result | | - | - | - | | Save one tweet privately | `POST /x/tweets/{id}/bookmark` | Adds the post to the account's bookmarks. | | Remove one saved tweet | `DELETE /x/tweets/{id}/bookmark` | Removes the post from the bookmarks. | | Read saved tweets | `GET /x/bookmarks` | Returns the account's bookmarked posts. | | Like one tweet in public | `POST /x/tweets/{id}/like` | Adds a public like instead. | Use [Remove bookmark](/api-reference/x-write/unbookmark) to reverse a bookmark. ## Twitter bookmark API questions ### Can an API bookmark a tweet by ID? Yes. Send the Tweet ID in the path and the connected account in the body. ### Can other people see the bookmark? No. X shows bookmarks only to the account that saved them. The author sees the total bookmark count on the post. ## Handle errors Never infer failure from a client timeout. Poll a returned action before sending another request. * For `400`, correct the Tweet ID or account value. * For `401`, replace invalid Xquik authentication. * For `402`, add credits before another request. * For `403`, reconnect the selected X account. * For `409`, keep the original action and payload. * For `422`, review the X rejection before retrying. * For `429`, wait for `Retry-After`. * For `500` or `503`, follow `safeToRetry` and `terminal`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token. | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of the connected account that bookmarks the tweet. Xquik strips the `@` prefix if included. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "bookmark", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "bookmark", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "x_rate_limited", "message": "X rate limited this account. Try again in about 15 minutes. Send fewer requests from this account." }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Community creation is closed, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/create-community X stopped accepting new Communities in April 2026. POST /x/communities answers x_community_creation_closed and charges nothing. Existing Communities still work. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/communities` ## Why you can't create a community on Twitter X stopped accepting new Communities in April 2026. `POST /x/communities` answers `422 x_community_creation_closed`. Xquik charges nothing. Existing Communities still work. Use [Join Community](/api-reference/x-write/join-community) to enter one and [Community Info](/api-reference/x/community-info) to read one. This route does not add rules, members, moderators, invitations, posts, analytics, or membership settings. **0 credits** when X refuses the request · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/communities \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: community-create-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle", "name": "Crypto Traders Hub", "description": "A community for crypto traders to share insights and strategies." }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/communities", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "community-create-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxhandle", name: "Crypto Traders Hub", description: "A community for crypto traders to share insights and strategies.", }), }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/x/communities", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "community-create-1895432178065391234", }, json={ "account": "myxhandle", "name": "Crypto Traders Hub", "description": "A community for crypto traders to share insights and strategies.", }, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "account": "myxhandle", "name": "Crypto Traders Hub", "description": "A community for crypto traders to share insights and strategies.", }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/x/communities", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "community-create-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Community creation questions ### Do X communities still exist? Yes. Existing Communities still work, and people post in them every day. X stopped accepting new ones in April 2026. ### Do you need X Premium to create a community? Premium doesn't help. X refuses new Communities, so an account upgrade doesn't fix `x_community_creation_closed`. ### Can the API add rules, members, or moderators? No. The request accepts `account`, `name`, and `description`. Never send undocumented fields. ### How should software handle community creation? Treat `422 x_community_creation_closed` as final, and don't retry it. Send people to an existing Community, an XChat group link or an X List. ## Handle creation failures `422 x_community_creation_closed` means X isn't accepting new Communities. Don't retry it or add credits for it. Xquik charges nothing. A `409` means the key already identifies another request. Compare both request bodies. Reuse the key only when every input matches. After `503`, check the write lifecycle before you retry. A disconnected client doesn't prove failure. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | The connected X account to create the community as. Must be a username you have connected to your Xquik account. | | `name` | `string` | Yes | The name for the new community. | | `description` | `string` | No | Optional description for the community explaining its purpose. | ## Response > [tab] 404 Account not found > > Connect the requested account, then submit a newly approved write. ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "create_community", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "create_community", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_community_creation_closed", "message": "X isn't accepting new Communities, so Xquik created nothing. Xquik didn't charge you. Join an existing Community instead." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Create a tweet or reply, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/create-tweet Post tweets and replies from a connected X account with public media URLs or uploaded media IDs. Poll the write status. Text-only posts cost 30 credits each. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/tweets` **30 credits text-only** · attached media adds 2 credits per started MB across all files A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Create a tweet or reply from one connected X account. The route accepts text, public media URLs, and uploaded media IDs. Put public HTTPS images or 1 MP4 URL in `media`. For a local file, call `POST /x/media` and put its `mediaId` in `media_ids`. Send `media` or `media_ids`, not both. Send a unique `Idempotency-Key`. Store the returned write action. Poll `statusUrl` while `terminal` is `false`. X's [Create Post guide](https://docs.x.com/x-api/posts/create-post) covers its separate endpoint. Authenticate with Xquik credentials. Store the write fields listed below. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: tweet-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "elonmusk", "text": "Hello from Xquik!" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/tweets", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "tweet-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "elonmusk", text: "Hello from Xquik!", }), }); const result = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(result)); } const postRecord = { status: result.status, terminal: result.terminal, safe_to_retry: result.safeToRetry, write_action_id: result.id, request_hash: result.request.hash, tweet_id: result.result?.id ?? result.tweetId ?? null, account: result.account, target: result.target, charged: result.billing.charged, charged_credits: result.billing.chargedCredits, poll_path: result.terminal ? null : result.statusUrl, }; process.stdout.write(`${JSON.stringify(postRecord)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests import json response = requests.post( "https://xquik.com/api/v1/x/tweets", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "tweet-1895432178065391234", }, json={ "account": "elonmusk", "text": "Hello from Xquik!", }, ) result = response.json() response.raise_for_status() post_record = { "status": result["status"], "terminal": result["terminal"], "safe_to_retry": result["safeToRetry"], "write_action_id": result["id"], "request_hash": result["request"]["hash"], "tweet_id": (result.get("result") or {}).get("id") or result.get("tweetId"), "account": result["account"], "target": result["target"], "charged": result["billing"]["charged"], "charged_credits": result["billing"]["chargedCredits"], "poll_path": None if result["terminal"] else result["statusUrl"], } print(json.dumps(post_record)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) type CreateTweetResponse struct { ID string `json:"id"` TweetID string `json:"tweetId"` Status string `json:"status"` Terminal bool `json:"terminal"` SafeToRetry bool `json:"safeToRetry"` StatusURL string `json:"statusUrl"` Request struct { Hash *string `json:"hash"` } `json:"request"` Billing struct { Charged bool `json:"charged"` ChargedCredits string `json:"chargedCredits"` } `json:"billing"` Result *struct { ID string `json:"id"` } `json:"result"` } func main() { body, _ := json.Marshal(map[string]interface{}{ "account": "elonmusk", "text": "Hello from Xquik!", }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/x/tweets", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "tweet-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() if resp.StatusCode >= 400 { body, _ := io.ReadAll(resp.Body) panic(string(body)) } var result CreateTweetResponse if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { panic(err) } var tweetID any if result.Result != nil { tweetID = result.Result.ID } else if result.TweetID != "" { tweetID = result.TweetID } var pollPath any if !result.Terminal { pollPath = result.StatusURL } postRecord := map[string]any{ "status": result.Status, "terminal": result.Terminal, "safe_to_retry": result.SafeToRetry, "write_action_id": result.ID, "request_hash": result.Request.Hash, "tweet_id": tweetID, "account": "elonmusk", "charged": result.Billing.Charged, "charged_credits": result.Billing.ChargedCredits, "poll_path": pollPath, } encoded, err := json.Marshal(postRecord) if err != nil { panic(err) } fmt.Println(string(encoded)) } ``` ## Choose the Twitter post request Choose among 7 tweet request formats. Include only the fields required below. To post without code, use the [tweet composer](https://xquik.com/en/tweet-composer) on the Xquik website. It posts from your connected account at the same credit cost. | Post intent | Required fields | Validation before sending | | - | - | - | | Standard tweet | `account` and `text` | Keep standard tweet text at 280 characters or fewer. | | Tweet reply | `account`, `text`, and `reply_to_tweet_id` | Store the parent Tweet ID and confirm the connected account may reply. | | Image tweet | `account`, optional `text`, and 1 to 4 image URLs in `media` | Use public HTTPS JPEG, PNG, GIF, WebP, or AVIF URLs. | | Video tweet | `account`, optional `text`, and 1 MP4 URL in `media` | Keep the public MP4 at 100 MB or less. Do not mix video and images. | | Uploaded media | `account`, optional `text`, and 1 to 4 IDs in `media_ids` | Upload with the same account within 24 hours. Send a video ID alone. | | Note tweet | `account`, `text`, and `is_note_tweet: true` | Keep note tweet text at 25,000 characters or fewer. | | Community post | `account`, `text`, and `community_id` | Join the Community from that account first. Don't add a reply ID. | A Community post lands in its Community, or the write fails and costs nothing. The error code says whether the post is still public. | Error | What happened | | - | - | | `x_community_not_joined` | The account isn't in the Community. Join it on x.com. | | `x_community_not_selectable` | X couldn't post to the Community. Check it on x.com. | | `x_community_post_removed` | X put the post outside the Community, and Xquik deleted it. | | `x_community_post_public` | X put the post outside the Community. Delete it on x.com. | Create one `Idempotency-Key` for each posting request. Reuse that key only when replaying the same network request. A new tweet, reply, caption, media URL, or account requires a new key. This endpoint starts the write immediately. It does not schedule future delivery. Let your scheduler call it at the approved time. One request publishes 1 tweet on X. Create replies with `reply_to_tweet_id`. Create each thread tweet with a separate approved request. For `x_target_not_found`, verify the post ID and your connected account's access. For `x_reply_not_allowed`, choose a post that account can reply to. For `x_reply_target_unavailable`, X says the post is deleted or hidden from your account. Check the post on x.com or reply to another post. Xquik returns `x_reply_not_allowed` or `x_reply_target_unavailable` when X refuses a reply. That account's later replies to the post get the same error for a while. `Retry-After` says when to try again. All 3 return HTTP 422 & charge nothing. Do not retry the unchanged request. See [write error recovery](/guides/error-handling). ## Store the tweet write receipt Store the write receipt before another worker posts. Keep these field groups. * Store `id` and `request.hash` for request matching. * Store `account` and `target` for the selected account and destination. * Store `status`, `terminal`, and `statusUrl` for polling. * Store `safeToRetry` for retry decisions. * Store `result.result?.id` or `tweetId` for the published Tweet ID. * Store `billing.chargedCredits` for billing checks. ## Post with public media URLs Use `media` for an image or MP4 at a public HTTPS URL. For local files, call [Upload Media](/api-reference/x-write/upload-media) first. Pass its returned `mediaUrl` in `media`. Send up to 4 image URLs or exactly 1 MP4 URL. Keep the MP4 at 100 MB or less. Xquik shrinks images over 5 MiB. GIFs and videos go to X unchanged. To post an uploaded file by its ID, use `media_ids` as shown below. Attached media adds 2 credits per started MB across all files. ```bash Image tweet theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: image-tweet-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "brand_account", "text": "Launch notes are live.", "media": ["https://cdn.example.com/product-screenshot.png"] }' | jq ``` ```bash Image reply theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: image-reply-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "brand_account", "text": "Here is the chart.", "reply_to_tweet_id": "1893456789012345678", "media": ["https://cdn.example.com/reply-chart.png"] }' | jq ``` ```bash MP4 video tweet theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: video-tweet-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "brand_account", "text": "Launch walkthrough is live.", "media": ["https://cdn.example.com/product-demo.mp4"] }' | jq ``` Store `id`, `request.hash`, `billing`, `result`, `reply_to_tweet_id`, and `media`. Poll [Get Write Action Status](/api-reference/x-write/get-write-action-status) while `terminal` is `false`. Retry only when `safeToRetry` is `true`, using a new key. ## Post uploaded media by ID Use `media_ids` for files that [Upload Media](/api-reference/x-write/upload-media) returned. Upload each file from the account that posts. Each ID works for 24 hours after its upload. Send up to 4 image IDs or exactly 1 video ID. Send `media` or `media_ids`, never both. Text is optional with either field. Xquik drops a repeated ID, so each file posts and costs once. Attached media adds 2 credits per started MB across all files. ```bash Uploaded video tweet theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: uploaded-video-tweet-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "brand_account", "text": "Launch walkthrough is live.", "media_ids": ["2104371968258560001"] }' | jq ``` None of these 3 errors charges credits. | Error | What happened | | - | - | | `media_not_uploaded` | An ID is missing, expired, or from another account. Upload the file again. | | `unsupported_media_combination` | A video ID came with another ID. Post the video alone. | | `x_media_rejected` | X left the media out of the post. Xquik deleted it. Post it again. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | Choose the connected X account by username or account ID. Xquik removes an optional `@` prefix. | | `text` | `string` | No | Send up to 280 characters for a standard tweet. Note tweets accept up to 25,000 characters. Omit text only when `media` or `media_ids` exists. | | `reply_to_tweet_id` | `string` | No | Set the parent Tweet ID. Xquik posts the new tweet inside that thread. | | `community_id` | `string` | No | Post into a Community you belong to. Use its ID of 1 to 19 digits. Xquik checks that the post lands in the Community. A post X puts outside it is deleted and costs nothing. Not with `reply_to_tweet_id`, since X keeps replies public. | | `is_note_tweet` | `boolean` | No | Set `true` for a note tweet with up to 25,000 characters. The default is `false`. | | `media` | `string[]` | No | Attach public media URLs directly. - Send up to 4 JPEG, PNG, GIF, WebP, or AVIF image URLs. - Send exactly 1 public MP4 URL up to 100 MB. - Never mix video with other media. - Use [Upload Media](/api-reference/x-write/upload-media) to host a local file. - Pass its returned `mediaUrl` in `media`. - Put uploaded `mediaId` values in `media_ids` instead. - Attached media adds 2 credits per started MB across all files. | | `media_ids` | `string[]` | No | Attach media IDs from [Upload Media](/api-reference/x-write/upload-media). - Upload each file from this account within the last 24 hours. - Send up to 4 image IDs or exactly 1 video ID. - Never send it with `media`. - Xquik drops repeated IDs. - Attached media adds 2 credits per started MB across all files. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "create_tweet", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "create_tweet", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **413** `{ "error": "media_too_large", "message": "This image stays over X's size limit after shrinking. Send a smaller one." }` * **415** `{ "error": "unsupported_media_type", "message": "Xquik couldn't read this image. Send a valid image file." }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Delete an owned community, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/delete-community Delete an owned X community by ID and confirmed name. Archive its tweets, members, moderators, and rules, then verify the final write lifecycle state. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/communities/{id}` ## How to delete an X (Twitter) community through REST Call `DELETE /x/communities/{id}` for one community owned by a connected account. Send its exact `community_name` to confirm the target. This route removes the community, not the connected X account. Use [Leave Community](/api-reference/x-write/leave-community) to remove one account's membership. Use [Delete Tweet](/api-reference/x-write/delete-tweet) to remove one owned Community post. **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/x/communities/1893726451023847424 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: community-delete-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle", "community_name": "Crypto Traders Hub" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/communities/1893726451023847424", { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "community-delete-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxhandle", community_name: "Crypto Traders Hub", }), }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.delete( "https://xquik.com/api/v1/x/communities/1893726451023847424", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "community-delete-1895432178065391234", }, json={ "account": "myxhandle", "community_name": "Crypto Traders Hub", }, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "account": "myxhandle", "community_name": "Crypto Traders Hub", }) req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/x/communities/1893726451023847424", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "community-delete-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Archive records before you delete an X (Twitter) community Confirm the community ID, owner, exact name, reason, and approver. Create one `Idempotency-Key` for that deletion. Reuse it only during unchanged network recovery. Xquik has no restore route. Plan for permanent removal. Archive required records before approval. * Save the name, description, rules, creator, and policies from [Community Info](/api-reference/x/community-info). * Follow every [Community Tweets](/api-reference/x/community-tweets) cursor. Store tweet IDs, authors, text, timestamps, media URLs, replies, reposts, and likes. * Follow every [Community Members](/api-reference/x/community-members) cursor. Store stable user IDs and the final `hasMore` value. * Export [Community Moderators](/api-reference/x/community-moderators) separately. Member rows do not prove moderator roles. X says Community posts remain after you delete their Community. Review the [X Communities guide](https://help.x.com/en/using-x/communities) before removal. Keep your archive even when those posts remain visible elsewhere. ## Verify permanent community deletion Store the action ID after `200` or `202`. Poll while `terminal` is `false`. After terminal success, call [Community Info](/api-reference/x/community-info). An unavailable community confirms removal. A temporary read failure does not. Repeat the read before starting another deletion. ## Fix X (Twitter) community deletion errors Fix invalid fields after `400`. Replace credentials after `401`. Add credits after `402`. Reconnect the owner after `403`. Verify the account and community after `404`. Resolve key conflicts after `409`. Review rejected requests after `422`. Honor `Retry-After` after `429`. Check `safeToRetry` after `500` or `503`. ## Delete X (Twitter) community questions ### Can you delete an X (Twitter) community? Yes. Send the community ID and exact name through the connected owner. Xquik then returns a tracked write action. ### Does deletion affect the owner's X profile? No profile field appears in the request body. The route targets one community ID. It does not disconnect or delete the owner's X account. ### Can a deleted community be restored? Xquik documents no restore endpoint. Archive first and treat deletion as permanent within this API workflow. ### Can I transfer ownership instead? This route has no ownership-transfer field. Complete any supported transfer in X before deletion, then verify the intended owner. ### What happens to members and community posts? Members lose access to the deleted Community. X says it keeps existing Community posts when you delete the Community. Archive required posts before removal. Use Delete Tweet for an owned post. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only when every field remains unchanged after interruption. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the community to delete, or its URL-encoded link, such as `x.com/i/communities/1493446837214187523`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | The connected X account that owns the community. Must be a username you have connected to your Xquik account. | | `community_name` | `string` | Yes | The exact community name. Send it to avoid deleting a different Community. | ## Response > [tab] 404 Account not found > > Connect the requested account, then submit a newly approved write. ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "delete_community", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "delete_community", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Delete a direct message by ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/delete-dm Delete 1 direct message from a connected X account's side of its conversation. The other person keeps it. Costs 10 credits, only when X deletes the DM. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/dm/{userId}/messages/{messageId}` **10 credits per deleted DM** · [Compare plans](https://xquik.com/en) A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). ## Delete a direct message with the Twitter DM API This route deletes 1 DM from the connected account's side of the conversation. The other person still sees it. Xquik charges 10 credits only when X deletes the DM. Put the other person in the path and the DM ID in `messageId`. [DM history](/api-reference/x/dm-history) and [Send DM](/api-reference/x-write/send-dm) return DM IDs. Send your connected account in the `account` query parameter. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE "https://xquik.com/api/v1/x/dm/44196397/messages/1893726451029384192?account=myxaccount" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: dm-delete-1893726451029384192" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userId = "44196397"; const messageId = "1893726451029384192"; const url = new URL(`https://xquik.com/api/v1/x/dm/${userId}/messages/${messageId}`); url.searchParams.set("account", "myxaccount"); const response = await fetch(url, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": `dm-delete-${messageId}`, }, }); const action = await response.json(); if (!response.ok) { throw new Error(action.message); } process.stdout.write(`${JSON.stringify(action)}\n`); ``` ## Confirm the delete Xquik confirms the DM is deleted before it reports success. A `200` response means the DM is gone. Its `result` has `type: "state_change"`, the DM `id` and `state: "deleted"`. A `202` response means Xquik has not confirmed the delete yet. Poll `statusUrl` until `terminal` is `true`. You pay nothing while the delete is pending. Deleting the same DM again also succeeds. ## Handle delete DM errors * `400 invalid_message_id` means `messageId` is not a DM ID. Copy it from DM history. * `400 account_required` means the `account` query parameter is missing. * `404 account_not_found` means the account is not connected to Xquik. * `422 x_dm_not_deleted` means X still shows the DM. You pay nothing, and `safeToRetry` is `true`. Every other status follows the write rules below. See [error handling](/guides/error-handling) for each code. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Idempotency-Key` | `string` | Yes | Unique key for this intended delete. Reuse it only for an exact network replay. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | The other person in the conversation. Send a user ID or a username with or without `@`. A URL-encoded profile URL such as `x.com/nasa` also works. See [path IDs](/api-reference/overview#path-ids). | | `messageId` | `string` | Yes | DM ID from DM history. Anything else returns `400 invalid_message_id`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of the connected account that sees the DM. Without it, the route returns `400 account_required`. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "delete_dm", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "delete_dm", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Delete a tweet you own by ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/delete-tweet Remove one owned post by Tweet ID through a connected X account. Save approval evidence, poll the write status, and verify the deleted ID. Costs 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/tweets/{id}` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Use this route to remove 1 owned post by ID. It accepts 1 Tweet ID per request. Select the connected X account that published the tweet. Save approval evidence before sending the request. Send 1 unique `Idempotency-Key` for the intended deletion. Store the returned write action and poll `statusUrl` when needed. Confirm `targetId` matches the requested Tweet ID after terminal success. X also documents an official [Delete Post endpoint](https://docs.x.com/x-api/posts/delete-post). Authenticate with Xquik credentials. Store the write response. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/x/tweets/1895432178065391234 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: tweet-delete-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "elonmusk" }' | jq '{ status, terminal, safe_to_retry: .safeToRetry, write_action_id: .id, request_hash: .request.hash, requested_tweet_id: "1895432178065391234", confirmed_tweet_id: (.result.id // .tweetId // .targetId), charged_credits: .billing.chargedCredits, poll_path: (if .terminal then null else .statusUrl end) }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1895432178065391234"; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "tweet-delete-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "elonmusk", }), }); const result = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(result)); } const deletionRecord = { status: result.status, terminal: result.terminal, safe_to_retry: result.safeToRetry, write_action_id: result.id, request_hash: result.request.hash, requested_tweet_id: tweetId, confirmed_tweet_id: result.result?.id ?? result.tweetId ?? result.targetId ?? null, account: result.account, charged_credits: result.billing.chargedCredits, poll_path: result.terminal ? null : result.statusUrl, }; process.stdout.write(`${JSON.stringify(deletionRecord)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1895432178065391234" response = requests.delete( f"https://xquik.com/api/v1/x/tweets/{tweet_id}", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "tweet-delete-1895432178065391234", }, json={ "account": "elonmusk", }, ) result = response.json() response.raise_for_status() deletion_record = { "status": result["status"], "terminal": result["terminal"], "safe_to_retry": result["safeToRetry"], "write_action_id": result["id"], "request_hash": result["request"]["hash"], "requested_tweet_id": tweet_id, "confirmed_tweet_id": ( (result.get("result") or {}).get("id") or result.get("tweetId") or result.get("targetId") ), "account": result["account"], "charged_credits": result["billing"]["chargedCredits"], "poll_path": None if result["terminal"] else result["statusUrl"], } print(json.dumps(deletion_record)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) type DeleteTweetResponse struct { ID string `json:"id"` Status string `json:"status"` Terminal bool `json:"terminal"` SafeToRetry bool `json:"safeToRetry"` StatusURL string `json:"statusUrl"` TargetID *string `json:"targetId"` TweetID *string `json:"tweetId"` Request struct { Hash string `json:"hash"` } `json:"request"` Account map[string]any `json:"account"` Billing struct { ChargedCredits string `json:"chargedCredits"` } `json:"billing"` Result *struct { ID string `json:"id"` } `json:"result"` } func main() { tweetID := "1895432178065391234" body, err := json.Marshal(map[string]string{ "account": "elonmusk", }) if err != nil { panic(err) } req, err := http.NewRequest( "DELETE", "https://xquik.com/api/v1/x/tweets/"+tweetID, bytes.NewReader(body), ) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "tweet-delete-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() if resp.StatusCode >= 400 { responseBody, _ := io.ReadAll(resp.Body) panic(string(responseBody)) } var result DeleteTweetResponse if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { panic(err) } var confirmedTweetID any if result.Result != nil && result.Result.ID != "" { confirmedTweetID = result.Result.ID } else if result.TweetID != nil { confirmedTweetID = *result.TweetID } else if result.TargetID != nil { confirmedTweetID = *result.TargetID } var pollPath any if !result.Terminal { pollPath = result.StatusURL } deletionRecord := map[string]any{ "status": result.Status, "terminal": result.Terminal, "safe_to_retry": result.SafeToRetry, "write_action_id": result.ID, "request_hash": result.Request.Hash, "requested_tweet_id": tweetID, "confirmed_tweet_id": confirmedTweetID, "account": result.Account, "charged_credits": result.Billing.ChargedCredits, "poll_path": pollPath, } encoded, err := json.Marshal(deletionRecord) if err != nil { panic(err) } fmt.Println(string(encoded)) } ``` ## Delete one owned tweet by ID Send the exact Tweet ID in the path. Send its author account in the request body. The connected account must own the target tweet. You cannot delete another account's tweet with this route. A reply is also a tweet with its own ID. Delete the reply ID without deleting its parent tweet. Use [Get Tweet](/api-reference/x/get-tweet) before deletion. Save the returned author, text, creation time, media, and conversation ID. Create a dedicated idempotency key for each intended deletion. Reuse that key only after an interrupted response. Never reuse a create-tweet key for deletion. ## Authenticate the tweet owner Send an Xquik API key or OAuth 2.1 bearer token. Then identify the connected X account with `account`. The request never accepts an X password or session cookie. Keep API keys on your server, not inside browser or mobile clients. The official X endpoint uses a user access token. Its permissions differ from Xquik authentication. Read X's [Manage Posts guide](https://docs.x.com/x-api/posts/manage-tweets/introduction) for that separate contract. ## Save tweet deletion evidence This API workflow cannot restore a deleted tweet. Show the final tweet text during approval. Keep the approver, approval time, and reason beside the Tweet ID. Store these fields after sending the request. * Store `id` as the write action ID. * Store `request.hash` for exact request matching. * Store `account` for the connected tweet owner. * Store `targetId` for the confirmed Tweet ID. * Store `status`, `terminal`, and `statusUrl` for polling. * Store `billing.chargedCredits` for the deletion charge. * Store `safeToRetry` before considering another request. A replacement tweet receives a different Tweet ID. Keep the deleted ID in the audit record. Join replies, analytics, and moderation records with the deleted ID. ## Run bulk or scheduled tweet cleanup This route deletes 1 tweet per request. It does not provide a bulk-delete operation. Feed approved Tweet IDs through the route individually. Create a unique `Idempotency-Key` for every Tweet ID. Delete tweets from a queue, one at a time. Store every write action. After HTTP `429`, wait for `Retry-After` before continuing. X publishes separate limits for its [Delete Post endpoint](https://docs.x.com/x-api/fundamentals/rate-limits). Those limits do not replace Xquik's response headers. This endpoint does not schedule future deletion. Let your scheduler call it at the approved time. Keep each scheduled Tweet ID and approval reference together. ## Verify tweet deletion A `202` response means the deletion is still running. Poll `statusUrl` until `terminal` becomes `true`. Never submit another deletion while the action is running. After terminal success, accept `targetId`, `tweetId`, or `result.id` as confirmation. Call [Get Tweet](/api-reference/x/get-tweet) with that ID. Store the lookup time and result beside the write action. Save the unavailable lookup beside the successful write action. Before terminal success, an unavailable lookup proves nothing. A missing tweet does not always prove deletion. ## Handle delete tweet errors Never infer failure from a client timeout. Poll the returned action before sending another request. Use [X (Twitter) API error handling](/api-reference/x-write/get-write-action-status) for every lifecycle field and retry rule. * For `400`, fix the Tweet ID or account value. * For `401`, replace invalid Xquik authentication. * For `402`, add credits before another deletion. * For `403`, reconnect the selected X account. * For `409`, keep the original action and payload. * For `422`, review the rejection before retrying. * For `429`, wait for `Retry-After`. * For `500` or `503`, trust `safeToRetry` and `terminal`. ## Choose tweet deletion, unlike, or unretweet Use tweet deletion only when the connected account owns the published post. It removes that post. It does not reverse a like or repost. Use [Unlike Tweet](/api-reference/x-write/unlike) to remove one account's like. Use [Unretweet](/api-reference/x-write/unretweet) to remove one account's repost. Both actions keep the source tweet. | Cleanup intent | API route | What changes | | - | - | - | | Remove an owned post | `DELETE /x/tweets/{id}` | The connected account's tweet becomes unavailable. | | Remove a like | `DELETE /x/tweets/{id}/like` | Xquik removes only that account's like. | | Remove a repost | `DELETE /x/tweets/{id}/retweet` | Xquik removes only that account's repost. | | Remove a reply | `DELETE /x/tweets/{id}` | Xquik deletes the owned reply tweet by its own ID. | Never delete the source tweet when a campaign only needs engagement cleanup. Check the route during approval. Record the intended state. ## X (Twitter) API delete tweet questions ### Can the API delete another user's tweet? No. The connected account must own the target tweet. Use the author's own connected account and exact Tweet ID. ### Can the API delete all tweets at once? No bulk route exists here. Submit 1 approved Tweet ID per request. Store each deletion's key, write action, and terminal result. ### Can I schedule a tweet deletion? Yes, through your own scheduler. Call this endpoint at the approved time. The endpoint itself does not store a future schedule. ### Which libraries can delete a tweet? Any HTTP client can call this REST endpoint. The examples cover cURL, Node.js, Python, and Go. Keep credentials in server-side code. ### How should recurring tweet cleanup work? Select owned Tweet IDs using an approved retention policy. Save a copy of each tweet before deletion. Send 1 deletion, store its action, and verify its terminal result. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token. | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). The connected account must own the post. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID identifying which connected X account owns the tweet. Xquik strips the `@` prefix if included. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "delete_tweet", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "delete_tweet", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "x_rate_limited", "message": "X rate limited this account. Try again in about 15 minutes. Send fewer requests from this account." }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Follow a user by user ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/follow Follow 1 X (Twitter) user by ID from a connected account. Poll the write action, respect the 20 per minute and 400 per day limits, and verify the relationship. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/users/{id}/follow` ## Follow one Twitter user by ID Each request follows 1 target user ID. Each request names 1 connected X account. Verify the target user ID. Approve the acting account before sending the action. Compare X's separate [Follow User endpoint](https://docs.x.com/x-api/users/follow-user). **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). > [!WARNING] > > **Action-specific rate limit.** Follow allows 20 requests per minute and 400 per day per account. The general write tier allows 120 per 60s. Exceeding either limit returns `429 Too Many Requests`. `Retry-After` is the wait until the limit frees. After the daily limit, it is up to 24 hours. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/users/44196397/follow \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: follow-44196397-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxaccount" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/44196397/follow", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "follow-44196397-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxaccount", }), }); const followReceipt = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(followReceipt)); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/x/users/44196397/follow", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "follow-44196397-1895432178065391234", }, json={ "account": "myxaccount", }, ) follow_receipt = response.json() response.raise_for_status() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "account": "myxaccount", }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/x/users/44196397/follow", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "follow-44196397-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var followReceipt map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&followReceipt); err != nil { panic(err) } fmt.Println(followReceipt) } ``` ## Authenticate and approve the follow Send an Xquik API key or OAuth 2.1 bearer token. Never send an X password or session cookie. Show the target user ID, username, profile name, and acting account. ## Verify the X (Twitter) follow API result Store the target ID, acting account, action ID, and request hash. Poll `statusUrl` until `terminal` becomes `true`. Close already-followed results without another request. Use [Check Follower](/api-reference/x/check-follower) when you need current proof. Use [Following](/api-reference/x/following) to read outbound relationships. Use [Unfollow User](/api-reference/x-write/unfollow) to reverse approval. ## Handle X (Twitter) follow API errors Fix the user ID or account after `400`. Replace Xquik authentication after `401`. Reconnect after `403`. Add credits after `402`. Review rejected input after `422`. Honor `Retry-After` after `429`. After `500` or `503`, check `safeToRetry` before retrying. ## X (Twitter) API follow questions ### How do I follow a user programmatically? Approve the target user ID and connected account. Send this POST request. Poll the returned action until terminal. ### Can I follow a protected X account? Protected X (Twitter) profiles may keep follows pending until approval. Verify the relationship before dependent work begins. ### Can I bulk follow X (Twitter) users? No bulk request exists here. Send 1 approved target ID per action and respect both limits above. ### Do I need an X (Twitter) follow SDK? No. Use any HTTP client or the cURL, Node.js, Python, and Go examples. A third-party app still needs an approved connected account. ### How do I check or undo a follow? Use Check Follower for current proof. Use Unfollow User with new approval and a new idempotency key. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User to follow. Send a user ID or a username with or without `@`. A URL-encoded profile URL such as `x.com/nasa` also works. An unknown username returns `422 x_target_not_found`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of your connected account to act as. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "follow", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "follow", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Write action status & errors, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/get-write-action-status Handle X (Twitter) API errors by polling writes. It covers tweets, replies, DMs, follows, likes, reposts, and media. Check results, billing, and safe retries. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/write-actions/{id}` Every X write returns a stored `x_write_action` record. Store its `id` or `writeActionId`. Poll `statusUrl` whenever `terminal` is `false`. ## Handle X (Twitter) API errors Use this endpoint to handle errors after an Xquik write. Xquik stores a write record in addition to the HTTP response code. An error message does not prove that a write failed. A timeout can occur after dispatch. Trust `terminal`, `safeToRetry`, `sendDispatched`, and `nextAction`. Review X's [response codes and errors](https://docs.x.com/x-api/fundamentals/response-codes-and-errors). Xquik's write status record uses different fields. > [!NOTE] > > Trust `terminal`, `safeToRetry`, and `nextAction`. Never infer retry safety > from an HTTP status or error name alone. ## Agent algorithm 1. Generate one unique `Idempotency-Key` for the intended write. 2. Submit the write once. 3. Store `id`, `request.hash`, `account`, `target`, `billing`, and `statusUrl`. 4. When `terminal` is `false`, wait for `Retry-After` or `pollAfterMs`. 5. Poll `statusUrl` until `terminal` is `true`. 6. Record `result` and settled `billing`. 7. Retry only when `safeToRetry` is `true`, using a new key. 8. When `nextAction.type` is `verify_result`, verify the external state first. Reuse the original `Idempotency-Key` only to replay the same account, action, target, and payload. The replay returns the first answer again. It keeps the first status, body, and `Retry-After`, and adds `idempotent: true`. While the first request runs, the replay returns `202` and the action. A replay sends nothing to X and charges nothing. ## Lifecycle | Status | Terminal | Required behavior | | - | - | - | | `accepted` | No | Poll. Dispatch has not completed. | | `dispatching` | No | Poll. Do not submit another write. | | `pending_confirmation` | No | Poll. The write may already exist. | | `success` | Yes | Store the result and settled billing. | | `failed` | Yes | Follow `safeToRetry` and `nextAction`. | | `expired` | Yes | Verify the result when dispatch may have occurred. | Writes X never confirms end `expired`. You pay nothing for them. Their message can read "X did not confirm this action. Check your X account before you retry." A post X never published fails as `x_post_not_sent`. You pay nothing, and `safeToRetry` is `true`. Active actions return `202`, `Location`, and `Retry-After`. Terminal actions return `200` from this endpoint. ## Request ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/write-actions/42 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/write-actions/42", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const action = await response.json(); if (!action.terminal) { const delayMs = action.pollAfterMs ?? 2000; process.stdout.write(JSON.stringify({ delayMs, next: action.statusUrl }) + "\n"); } else if (action.safeToRetry) { process.stdout.write("Ask for approval, then retry with a new key.\n"); } else { process.stdout.write(JSON.stringify(action.result) + "\n"); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/write-actions/42", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) action = response.json() if not action["terminal"]: print({"delay_ms": action["pollAfterMs"], "next": action["statusUrl"]}) elif action["safeToRetry"]: print("Ask for approval, then retry with a new key.") else: print(action["result"]) ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. | | `Authorization` | `string` | No | Send an OAuth 2.1 bearer token instead of `x-api-key`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Action ID returned by the original write. | ## Response > [tab] 200 Terminal > > Polling is complete. Store `result` and settled `billing`. Follow > `safeToRetry` and `nextAction` before any new attempt. > [tab] 202 Active > > Poll `statusUrl` after `Retry-After` or `pollAfterMs`. Never submit another > write while `terminal` is `false`. > [tab] 401 Unauthenticated > > Fix the authentication credentials. Keep the original write record. > [tab] 404 Not found > > Check the action ID and environment. Never resubmit the original write. > [tab] 429 Rate limited > > Wait for `Retry-After`. Poll the same action again. Never resend the write. | Field | Type | Description | | - | - | - | | `object` | `string` | Always `x_write_action`. | | `id` | `string` | Durable action ID. | | `writeActionId` | `string` | This field aliases `id`. | | `action` | `string` | Exact write operation. | | `status` | `string` | Current lifecycle status. | | `terminal` | `boolean` | This field is `true` when polling can stop. | | `retryable` | `boolean` | This field is `true` when a later attempt could succeed. | | `safeToRetry` | `boolean` | This field is `true` when a new attempt is safe. | | `statusUrl` | `string` | Relative polling URL. | | `pollAfterMs` | `number \| null` | Recommended polling delay. | | `charged` | `boolean` | `true` after billing settles as charged. | | `chargedCredits` | `string` | Settled credits charged. | | `billing` | `object` | Planned and settled billing state. | | `request` | `object` | Stable hash and exact sanitized payload. | | `account` | `object` | Connected account selected for this write. | | `target` | `object \| null` | Target type and ID. | | `targetId` | `string \| null` | Target ID alias. | | `result` | `object \| null` | Confirmed result or desired state. | | `nextAction` | `object \| null` | Required poll, retry, or verification step. | | `requestHash` | `string` | Stable request fingerprint. | | `requestId` | `string` | Correlation ID echoed in `X-Request-Id`. | | `idempotent` | `boolean` | `true` when this response answers a retry with the same `Idempotency-Key`. | | `error` | `string` | Machine-readable error code. | | `message` | `string` | Actionable status or error message. | | `sendDispatched` | `boolean` | This field is `true` after dispatch. | | `sendDispatchedAt` | `string` | ISO 8601 dispatch time. | | `createdAt` | `string` | ISO 8601 creation time. | | `updatedAt` | `string` | ISO 8601 latest update time. | | `completedAt` | `string` | ISO 8601 terminal time. | | `expiresAt` | `string` | Nonterminal resolution deadline. | | `confirmedAt` | `string` | ISO 8601 confirmation time. | | `confirmationCheckedAt` | `string` | ISO 8601 latest confirmation check. | | `confirmationAttempts` | `number` | Confirmation attempt count. | | `tweetId` | `string` | Confirmed tweet ID when available. | | `messageId` | `string` | Confirmed direct message ID when available. | | `mediaId` | `string` | Confirmed media ID when available. | | `mediaUrl` | `string` | Public media URL when available. | | `communityId` | `string` | Confirmed community ID when available. | | `communityName` | `string` | Confirmed community name when available. | | `resultId` | `string` | Result ID alias. | | `media` | `object` | Media details when used. | | `details` | `object` | Structured recovery context. | | `success` | `boolean` | This field is `true` when status equals `success`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "42", "writeActionId": "42", "action": "create_tweet", "status": "pending_confirmation", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/42", "pollAfterMs": 2000, "billing": { "status": "pending", "charged": false, "plannedCredits": "30", "chargedCredits": "0" }, "request": { "hash": "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb", "payload": { "text": "Hello" } }, "account": { "id": "8", "username": "agent_account" }, "target": null, "result": null, "nextAction": { "type": "poll", "url": "/api/v1/x/write-actions/42", "afterMs": 2000 }, "sendDispatched": true, "success": false } ``` ## Retry rules * With `retryable: false` and `safeToRetry: false`, do not retry. * With `retryable: true` and `safeToRetry: false`, verify the result first. * With `safeToRetry: true`, request approval and retry using a new key. * With `terminal: false`, keep polling, even when the original HTTP response was an error. Xquik keeps idempotency replay protection for at least 90 days. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "like", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "create_tweet", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` # Join a community by ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/join-community Join an X (Twitter) Community by ID with one connected account. Track API responses, verify membership, and resolve invitation or eligibility failures. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/communities/{id}/join` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/communities/1893726451023847424/join \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: community-join-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/communities/1893726451023847424/join", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "community-join-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxhandle", }), }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/x/communities/1893726451023847424/join", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "community-join-1895432178065391234", }, json={ "account": "myxhandle", }, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "account": "myxhandle", }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/x/communities/1893726451023847424/join", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "community-join-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## How to join a community on Twitter through the API Call `POST /x/communities/{id}/join` with one connected Twitter account and numeric ID. X decides whether that account can join. The route cannot discover, create, or moderate Communities. Approve each pair first. ## Understand open, restricted, and invited membership Open Communities allow direct joins. Restricted Communities may require approval or an invitation. X controls each membership mode. Open the Community page and review its rules. Use the join button for manual membership. Find it at the top of the page. Restricted Communities display Ask to join. A moderator decides that request. No API field selects a mode or accepts an invitation. Use the official [X Communities guide](https://help.x.com/en/using-x/communities) for current interface behavior. ## Find X (Twitter) communities before joining Existing members can open the Community tab on X.com or iOS. Search by name, description, creator, or handle. X warns that some Communities never appear in search results. Use a direct URL for an account's first Community. Ask an owner or moderator for the exact link when search omits it. Confirm the specific Community name, description, rules, moderators, membership mode, and recent posts. Never approve membership from a similar display name. Match the numeric ID with [Community Info](/api-reference/x/community-info). [Community Search](/api-reference/x/community-search) searches posts inside one known Community. It cannot find Community directories or topic-based groups. ## Compare manual and API community joining For manual membership, sign in to X and open the Community URL. Review the Community rules and membership mode. Select Join or Ask to join. Then wait for any required moderator review. For an API workflow, validate the connected Twitter account and numeric ID. Capture approval before submission. Poll the returned action. Verify the complete member roster after the action reaches a terminal state. X (Twitter) handles invitations, rules, and moderator review for both paths. The API cannot click controls, select a membership mode, or bypass moderator approval. ## Review account eligibility and moderator limits Confirm that the X account remains public and connected. Check existing membership and pending requests before submission. Reusing an existing action prevents duplicate membership requests. Admins and moderators enforce each Community's rules. They review restricted requests. A block between the account and a moderator can stop membership. The API cannot override that relationship. X says an admin account must have a verified email address or phone number. This verified-contact requirement applies only to admins. Each X (Twitter) Community covers one shared topic. The contract defines no separate community account. Store the connected account and Community ID as separate fields. ## Choose the correct X relationship * Use Join Community for one approved membership. * Use Follow for one account relationship. * Use Create Tweet for an approved Community post. * Use Community Members to verify the roster. * Use Community Tweets to read the Community timeline. Following, Lists, group messages, and Community Notes cannot change membership. ## Plan post-join reading and publishing Joining adds one connected account to one Community. It does not create posts, invitations, or moderator changes. Read [Community Tweets](/api-reference/x/community-tweets) after confirmation. Store Tweet IDs, replies, reposts, likes, media, and cursors. Use [Community Search](/api-reference/x/community-search) for keyword matches inside the reviewed Community ID. Read recent conversations before drafting a reply or media post. Membership never authorizes publishing. Approve separate Create Tweet actions for members posting after joining. Keep the reviewed rules with each approval. Avoid repetitive promotions and unwanted invitations. Moderators can remove accounts that violate local rules. ## Resolve membership intent Use a numeric Community ID. Record its connected account, membership mode, and approval. Keep enough evidence to explain every membership request. | Approval evidence | Store | Purpose | | - | - | - | | Intended Community | Numeric ID, display name, and direct URL | Prevent membership in a similarly named Community | | Connected account | Username, stable user ID, and connection status | Bind consent to one Twitter account | | Membership review | Mode, rules, and moderator status | Explain an open, pending, or rejected request | | API action | Idempotency key, action ID, status URL, and final status | Prevent duplicate writes and keep the state needed for recovery | ## Join an X (Twitter) community step by step 1. Review the numeric Community ID and connected account. 2. Create one pair-specific `Idempotency-Key`. 3. Submit `POST /x/communities/{id}/join` once. 4. Poll the returned action to a terminal result. 5. Verify the account through Community Members. 6. Store the action, approval, membership mode, and result. An HTTP `202` confirms processing, not membership. If a timeout occurs, keep polling the existing action. A changed account or Community needs new approval. Store the request hash, action ID, status URL, and final membership result. Keep the same `Idempotency-Key` only when every input remains identical. A changed account, Community ID, or approval requires a new key. ## Join communities in controlled batches Assign one `Idempotency-Key` per approved pair. Process retries serially. Record each result, action ID, and approval in one stored row. Pause only the affected account after errors. ## Verify visible membership After a terminal result, call [Community Members](/api-reference/x/community-members). Follow every cursor. Store the Community ID, action status, matched username, and stable user ID. Never resubmit after checking only one page. Anyone with the direct Community URL can see its member list. ## Explain community post visibility Community posts are not private group messages. They can appear on Community pages, profiles, timelines, and search. Review that visibility before approving a post. Anyone on X with the direct Community URL can see the Community's member list. Joining never publishes a post. Use [Create Tweet](/api-reference/x-write/create-tweet) after separate approval. ## X (Twitter) community questions ### How to join an X (Twitter) community with Xquik? Review Community Info. Submit one connected account and numeric ID. Poll the action, then verify Community Members. ### Can I join an invitation-only X (Twitter) community? For an invite-only Community, X still requires an invitation. Confirm you are logged in to your account on X. This endpoint cannot accept invitations. Save any `422` rejection. ### What happens when you join an X (Twitter) community? X adds the membership after approval. Members can reply after X confirms membership. They can connect, share posts, and follow the Community's rules. ### Can people see the communities you join on Twitter? Direct Community URLs expose member lists. Posts can also appear publicly. ### How do I join a community on a phone? Open a shared Community URL. Review its rules and membership mode. Use X for manual membership or Xquik for server workflows. ### Do X (Twitter) communities still exist? Yes. X controls availability, search, membership modes, and moderation. ### Do I need X Premium to join a community? The request has no Premium field. X decides account eligibility. ### Why can't I join an X (Twitter) community? Check the public account, numeric ID, connection, mode, and invitation. Check whether the account and moderators block each other. Read `terminal`, `retryable`, and `safeToRetry` before retrying. ### How do I find active X (Twitter) communities by interest? Search the Communities page by topic or creator after joining once. A first membership needs a shared URL. Community Search cannot find Community directories. ### What are the benefits of joining an X (Twitter) community? Membership opens one topic-focused discussion space. Members can read its timeline and participate under its rules. This endpoint cannot promise followers, engagement, leads, or sales. ### How should a brand participate after joining? Read recent Community posts first. Match the topic and follow moderator rules. Approve each reply, post, and media upload separately. Avoid repetitive promotions and unwanted invitations. ### Is community notes the same as X communities? No. Community Notes adds context to posts. X Communities organize memberships and discussions. Use X to join Community Notes. ### Can this API create, moderate, or grow a community? No. [X stopped accepting new Communities](/api-reference/x-write/create-community) in April 2026. Join Community cannot moderate, invite, or grow members. ## Recover from join failures Fix input after `400`. Replace credentials after `401`. Restore credits after `402`. Reconnect the account after `403`. Check both IDs after `404`. Reuse the same key only for identical input after `409`. Save `422` rejections. Honor `Retry-After` after `429`. Inspect `safeToRetry` after `500` or `503`. If a connection drops after submission, poll the existing action. Never create a replacement action after a network error. Keep the original action after `409`. Store X membership rejections after `422`. Wait for `Retry-After` after `429`. Store the action ID and final membership result. Never infer posting permission from membership. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only when every request field remains unchanged. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the community to join, or its URL-encoded link, such as `x.com/i/communities/1493446837214187523`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | The connected X account to join the community with. Must be a username you have connected to your Xquik account. | ## Response > [tab] 404 Account not found > > Connect the requested account, then submit a newly approved write. ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "join_community", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "join_community", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Leave a community by ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/leave-community Leave an X (Twitter) Community by ID with one connected account. Existing posts stay. Poll the write action, then verify membership removal. Costs 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/communities/{id}/join` ## How to leave a community on Twitter via API Call `DELETE /x/communities/{id}/join` to remove one connected account's membership. Other members keep access to the Community. Xquik tracks the departure as a write action. This route does not delete the Community. It does not delete the connected Twitter account. It also does not remove Community posts or replies. Use [Delete Community](/api-reference/x-write/delete-community) only for an owned Community that should close. Use [Delete Tweet](/api-reference/x-write/delete-tweet) for an owned post that should disappear. **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/x/communities/1893726451023847424/join \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: community-leave-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/communities/1893726451023847424/join", { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "community-leave-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxhandle", }), }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.delete( "https://xquik.com/api/v1/x/communities/1893726451023847424/join", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "community-leave-1895432178065391234", }, json={ "account": "myxhandle", }, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "account": "myxhandle", }) req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/x/communities/1893726451023847424/join", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "community-leave-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## How to leave an X (Twitter) community with Xquik Resolve and review the numeric Community ID. Call [Community Info](/api-reference/x/community-info) to confirm its name, rules, creator, and description. Show the selected connected account beside those details. Keep the Community ID separate from the connected account ID. Check [Community Members](/api-reference/x/community-members) when current membership needs proof. Follow every cursor before declaring the account absent. One partial page proves nothing. Record these values before the write. * Numeric Community ID and verified name. * Connected username and stable account ID. * Departure reason and approval reference. * New idempotency key for this request. * Pre-departure roster time and cursor coverage. Never reuse the earlier join key. Joining and leaving are separate actions. ## Archive community posts before leaving Leaving does not erase earlier Community posts or replies. X says those posts continue to exist after a member leaves. They can remain visible on the Community page, profiles, timelines, and search. Archive required posts before removing membership. Follow every [Community Tweets](/api-reference/x/community-tweets) cursor. Save Tweet IDs, authors, text, timestamps, media URLs, replies, reposts, likes, and cursors. Use [Community Search](/api-reference/x/community-search) for keyword matches inside the known Community. That route cannot archive every post unless the query covers them. Use the unfiltered timeline for a complete export. No request field sends a notification. Notify members through a separate approved workflow when a handoff requires notice. Never claim that this API sends a farewell post, direct message, or moderator alert. ## Leave an X (Twitter) community step by step Create one idempotency key for this departure. Send the Community ID in the path. Send the connected username through `account`. Use this sequence. 1. Verify the Community and connected account. 2. Archive required Community posts and member evidence. 3. Approve one membership-removal request. 4. Submit `DELETE /x/communities/{id}/join` once. 5. Store the returned action ID. 6. Poll until the action reaches a terminal result. 7. Verify the account no longer appears as a member. A `202` response confirms accepted processing. It does not confirm departure. Do not create another key during a timeout. Inspect the existing action first. ## Verify the X (Twitter) community departure Read [Community Members](/api-reference/x/community-members) after terminal success. Follow every cursor required for the account search. Store the final cursor, lookup time, username, and account ID. Keep the write receipt separate from later roster snapshots. The receipt shows the requested action. The roster shows membership observed later. If the account remains, refresh the complete roster once. Pair that result with the returned action ID. Do not submit parallel departures with different keys. | Membership task | Correct route | Expected result | | - | - | - | | Confirm the Community | `GET /x/communities/{id}/info` | Review its name, rules, creator, and policies. | | Confirm membership | `GET /x/communities/{id}/members` | Find the account in a complete roster. | | Leave the Community | `DELETE /x/communities/{id}/join` | Remove one connected account's membership. | | Rejoin later | `POST /x/communities/{id}/join` | Submit a new membership action. | | Delete the Community | `DELETE /x/communities/{id}` | Remove the entire owned Community. | ## Leave an X (Twitter) community on PC or phone For a manual departure, X says to open the Community page. Select the Joined button, then choose Leave the community. X documents that flow for its Community interface. Use the API for software workflows. The request stays the same across server, desktop, iOS, and Android clients. Do not automate screen labels when the REST route fits the workflow. Read the official [X Communities guide](https://help.x.com/en/using-x/communities) for current interface behavior. X can change its buttons without changing Xquik's documented request. ## Community departure questions ### Do my community posts disappear after I leave? No. X says Community posts and replies remain after their author leaves. Use Delete Tweet for an owned post that you want removed. ### Can I rejoin the community later? Yes, when X permits membership. X may accept the original invitation during a later membership request. Restricted Communities may need moderator approval. Rejoining needs another approval and idempotency key. ### Can this API cancel a pending join request? No. This route removes existing membership. The API has no cancel-pending-request field or separate cancellation endpoint. ### Does leaving delete the community? No. Other members, moderators, rules, and Community posts remain. Use Delete Community only to close an owned group. ### Is a Twitter group chat the same as a community? No. Leaving a Community keeps every group direct message unchanged. ### Can an admin transfer ownership before leaving? This request has no ownership-transfer field. Finish any available transfer in X. Verify the new admin before leaving. ### What are the privacy effects of leaving? The departing account stops appearing as a current member after success. Earlier posts can remain public. Saved exports and third-party copies also remain outside this membership action. ### Is community notes the same as X communities? No. Community Notes adds context to eligible posts. Use its separate workflow for Community Notes participation. ### Do X (Twitter) communities still exist? Yes. X still publishes current Communities guidance. X controls interface availability, membership modes, invitations, moderation, and search. ## Recover from leave community failures Fix malformed IDs or bodies after `400`. Replace invalid credentials after `401`. Restore credits after `402`. Reconnect the selected account after `403`. Check both the account and Community after `404`. A missing account differs from a missing Community. Tell the operator which one is missing. For `409`, compare the saved account, Community ID, and request body. Keep the key only for identical inputs. Changed inputs need fresh approval. Save `422` rejection details. Do not delete the Community as a fallback. After `429`, wait for `Retry-After`. Keep the approved inputs unchanged. After `500` or `503`, inspect `safeToRetry` and the existing lifecycle. Never infer failure from a dropped connection. Verify first to avoid a duplicate membership write. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The ID of the community to leave, or its URL-encoded link, such as `x.com/i/communities/1493446837214187523`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | The connected X account to remove from the community. Must be a username you have connected to your Xquik account. | ## Response > [tab] 404 Account not found > > Connect the requested account, then submit a newly approved write. ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "leave_community", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "leave_community", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Like a tweet by tweet ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/like Like one tweet by ID from a connected X account. Store the write action, terminal result, and billed credits. Retry only when safeToRetry is true. 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/tweets/{id}/like` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Each request likes 1 tweet by ID. Each request uses 1 connected X account. Save user approval before sending the request. Create a unique `Idempotency-Key` for the intended like. Store the returned write action and poll `statusUrl` when needed. Confirm the returned target matches the requested Tweet ID. X documents its separate [Like Post endpoint](https://docs.x.com/x-api/users/like-post). X says not to auto-like or bulk-like Tweets in its [Developer Guidelines](https://docs.x.com/developer-guidelines). Keep every like user-initiated. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets/1895432178065391234/like \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: like-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "elonmusk" }' | jq '{ status, terminal, safe_to_retry: .safeToRetry, write_action_id: .id, request_hash: .request.hash, requested_tweet_id: "1895432178065391234", confirmed_tweet_id: (.result.id // .tweetId // .targetId), charged_credits: .billing.chargedCredits, poll_path: (if .terminal then null else .statusUrl end) }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1895432178065391234"; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/like`, { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "like-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "elonmusk", }), }); const result = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(result)); } const likeRecord = { status: result.status, terminal: result.terminal, safe_to_retry: result.safeToRetry, write_action_id: result.id, request_hash: result.request.hash, requested_tweet_id: tweetId, confirmed_tweet_id: result.result?.id ?? result.tweetId ?? result.targetId ?? null, account: result.account, charged_credits: result.billing.chargedCredits, poll_path: result.terminal ? null : result.statusUrl, }; process.stdout.write(`${JSON.stringify(likeRecord)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1895432178065391234" response = requests.post( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/like", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "like-1895432178065391234", }, json={ "account": "elonmusk", }, ) result = response.json() response.raise_for_status() like_record = { "status": result["status"], "terminal": result["terminal"], "safe_to_retry": result["safeToRetry"], "write_action_id": result["id"], "request_hash": result["request"]["hash"], "requested_tweet_id": tweet_id, "confirmed_tweet_id": ( (result.get("result") or {}).get("id") or result.get("tweetId") or result.get("targetId") ), "account": result["account"], "charged_credits": result["billing"]["chargedCredits"], "poll_path": None if result["terminal"] else result["statusUrl"], } print(json.dumps(like_record)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) type LikeTweetResponse struct { ID string `json:"id"` Status string `json:"status"` Terminal bool `json:"terminal"` SafeToRetry bool `json:"safeToRetry"` StatusURL string `json:"statusUrl"` TargetID *string `json:"targetId"` TweetID *string `json:"tweetId"` Request struct { Hash string `json:"hash"` } `json:"request"` Account map[string]any `json:"account"` Billing struct { ChargedCredits string `json:"chargedCredits"` } `json:"billing"` Result *struct { ID string `json:"id"` } `json:"result"` } func main() { tweetID := "1895432178065391234" body, err := json.Marshal(map[string]string{ "account": "elonmusk", }) if err != nil { panic(err) } req, err := http.NewRequest( "POST", "https://xquik.com/api/v1/x/tweets/"+tweetID+"/like", bytes.NewReader(body), ) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "like-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() if resp.StatusCode >= 400 { responseBody, _ := io.ReadAll(resp.Body) panic(string(responseBody)) } var result LikeTweetResponse if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { panic(err) } var confirmedTweetID any if result.Result != nil && result.Result.ID != "" { confirmedTweetID = result.Result.ID } else if result.TweetID != nil { confirmedTweetID = *result.TweetID } else if result.TargetID != nil { confirmedTweetID = *result.TargetID } var pollPath any if !result.Terminal { pollPath = result.StatusURL } likeRecord := map[string]any{ "status": result.Status, "terminal": result.Terminal, "safe_to_retry": result.SafeToRetry, "write_action_id": result.ID, "request_hash": result.Request.Hash, "requested_tweet_id": tweetID, "confirmed_tweet_id": confirmedTweetID, "account": result.Account, "charged_credits": result.Billing.ChargedCredits, "poll_path": pollPath, } encoded, err := json.Marshal(likeRecord) if err != nil { panic(err) } fmt.Println(string(encoded)) } ``` ## Like one tweet by ID Put the exact Tweet ID in the request path. Put the connected account username or ID in the body. That account performs the like. Copy Tweet IDs as strings. JavaScript numbers cannot represent every X identifier exactly. Keep the selected Tweet ID beside the approving user. This endpoint accepts 1 Tweet ID per request. It does not fetch Tweets, create reposts, or publish replies. Use [Get Tweet](/api-reference/x/get-tweet) before showing an approval screen. ## Keep every like user-initiated Require a clear user choice before each like. Show the tweet text, author, and Tweet ID during approval. Store who approved the like and when. Do not build auto-like, bulk-like, or purchased-like workflows. Do not select scraped tweets and like them without user approval. Only send the like that your user picked. A review queue can prepare candidates without performing actions. Your user must choose the exact tweet before this endpoint runs. Keep the approval reference in the action ledger. ## Authenticate the connected X account Send an Xquik API key or OAuth 2.1 bearer token. Then identify the connected X account with `account`. The request never accepts an X password or session cookie. Keep Xquik credentials in server-side code. Do not expose them in mobile apps or browser bundles. Reconnect that X account when you receive `account_needs_reauth`. The official X endpoint uses a user access token. Its authentication differs from the Xquik contract. Read X's [Like Post guide](https://docs.x.com/x-api/users/like-post) for that endpoint. ## Save a like receipt An HTTP response alone does not prove the write. Save the action first. Then update your like record. Keep the request and response identities together. | Like action column | Source | Engagement rule | | - | - | - | | `acting_account` | Request `account` | Keep the connected X account with the engagement. | | `tweet_id` | Path `id` | Use the stable Tweet ID selected by review. | | `approval_reference` | Workflow value | Store the user's approval ID with this like. | | `idempotency_key` | Request header | Generate one key for this account and Tweet ID. | | `write_action_id` | Response `id` | Store the action before polling. | | `status` | Response `status` | Keep queued, completed, and failed likes distinct. | | `terminal` | Response `terminal` | Mark the like complete only when `true`. | | `safe_to_retry` | Response `safeToRetry` | Retry when this value is `true`. | | `requested_at` | Integration timestamp | Record when the user approved this like. | Store these response fields. * Store `id` as the write action ID. * Store `request.hash` for exact request matching. * Store `account` for the connected X account. * Store `targetId` or `result.id` for the liked Tweet ID. * Store `status`, `terminal`, and `statusUrl` for polling. * Store `billing.chargedCredits` for the settled charge. * Store `safeToRetry` before considering another request. ## Poll pending likes and verify completion A `200` response contains a terminal action. A `202` response means the like remains active. Poll `statusUrl` until `terminal` becomes `true`. Do not submit another like while the first action remains active. After success, confirm the result matches the requested Tweet ID. Treat an already-liked terminal result as success. Use [User Likes](/api-reference/x/user-likes) only when current read proof matters. Store the read time separately from the action time. X hides most likes from other accounts. A read may not confirm the like. | Like outcome | Evidence | Ledger update | | - | - | - | | Queued | `terminal: false` | Keep the row pending and poll `statusUrl`. | | Completed | Terminal success | Record the completed like for this account and Tweet ID. | | Already liked | Terminal result that reports an existing like | Complete without submitting another like. | | Retryable failure | `safeToRetry: true` | Keep the receipt. Follow its retry fields. | | Final failure | Terminal failure | Store the error and keep the ledger unchanged. | ## Prevent duplicate tweet likes Create 1 idempotency key for the intended account and Tweet ID. Reuse that key only after an interrupted response. Never reuse it for a different account or tweet. An HTTP `409` means the key already belongs to another payload. Keep the original action and inspect its request hash. Create a new key only for a new user-approved intent. The idempotency key stops duplicate submissions to Xquik. Still check approval, terminal status, and the acting account. ## Handle Twitter like API errors Never infer failure from a client timeout. Poll a returned action before sending another request. Follow `safeToRetry` when the outcome is unclear. * For `400`, correct the Tweet ID or account value. * For `401`, replace invalid Xquik authentication. * For `402`, add credits before another like. * For `403`, reconnect the selected X account. * For `409`, keep the original action and payload. * For `422`, review the X rejection before retrying. * For `429`, wait for `Retry-After`. * For `500` or `503`, follow `safeToRetry` and `terminal`. X publishes separate limits for its [Like Post endpoint](https://docs.x.com/x-api/fundamentals/rate-limits). Those limits do not replace Xquik's response headers. Never increase throughput by creating a bulk-like queue. ## Choose like, unlike, or read likes Use this route only to add a like from one connected account. Use [Unlike Tweet](/api-reference/x-write/unlike) to reverse that account's like. Use read endpoints when no engagement action is needed. | Engagement intent | API route | Result | | - | - | - | | Like one tweet | `POST /x/tweets/{id}/like` | Adds the connected account's like. | | Unlike one tweet | `DELETE /x/tweets/{id}/like` | Removes the connected account's like. | | Read a user's liked tweets | `GET /x/users/{id}/likes` | Returns that user's available liked tweets. | | Read accounts that liked a tweet | `GET /x/tweets/{id}/favoriters` | Returns available liking accounts. | | Repost one tweet | `POST /x/tweets/{id}/retweet` | Creates a separate repost action. | Liking does not create a repost, reply, bookmark, or follow. Approve each action separately. ## Twitter like API questions ### Can an API like a tweet by ID? Yes. Send the Tweet ID in this route's path. Send the connected acting account in the JSON body. Keep the like user-initiated. ### Does this endpoint bulk-like tweets? No. It accepts 1 Tweet ID per request. X prohibits bulk-like and auto-like behavior. Do not loop through candidates without individual user approval. ### How does Twitter like API authentication work? Authenticate to Xquik with an API key or OAuth 2.1 bearer token. Select a previously connected X account with `account`. Never send an X password. ### How should an X (Twitter) API like tweet retry work? Store the action first. Poll while `terminal` is `false`. Retry only when `safeToRetry` is `true`. ### Can the same API like, repost, and reply? Xquik documents separate routes for each action. Use [Retweet](/api-reference/x-write/retweet) for a repost. Use [Create Tweet](/api-reference/x-write/create-tweet) for a reply. ### Which libraries can like a tweet? Any HTTP client can call this REST endpoint. The examples cover cURL, Node.js, Python, and Go. Keep credentials in server-side code. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token. | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of the connected account that likes the tweet. Xquik strips the `@` prefix if included. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "like", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "like", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "x_rate_limited", "message": "X rate limited this account. Try again in about 15 minutes. Send fewer requests from this account." }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Mute a user by user ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/mute Mute 1 X (Twitter) user by ID from a connected account. Store the write action, result and billed credits. Retry only when safeToRetry is true. 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/users/{id}/mute` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Each request mutes 1 user by ID. Each request uses 1 connected X account. X doesn't tell the muted user. Follows stay as they are. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/users/44196397/mute \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: mute-44196397" \ -H "Content-Type: application/json" \ -d '{"account":"myxaccount"}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/44196397/mute", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "mute-44196397", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxaccount" }), }); const result = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(result)); } process.stdout.write( `${JSON.stringify({ id: result.id, status: result.status, terminal: result.terminal })}\n`, ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/x/users/44196397/mute", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "mute-44196397", }, json={"account": "myxaccount"}, ) response.raise_for_status() result = response.json() print(result["id"], result["status"], result["terminal"]) ``` ## Mute one user by ID Put the exact user ID in the request path. Put the connected account username or ID in the body. That account mutes the user. The user's posts leave that account's home timeline. The user can still follow, reply and mention the account. Use [Unmute user](/api-reference/x-write/unmute) to reverse a mute. ## Save a receipt Save the action first. Then update your local record. | Column | Source | Rule | | - | - | - | | `acting_account` | Request `account` | Keep the connected X account with the action. | | `user_id` | Path `id` | Keep the exact user ID. | | `idempotency_key` | Request header | Generate 1 key for this account and user ID. | | `write_action_id` | Response `id` | Store the action before polling. | | `terminal` | Response `terminal` | Change the local record only when `true`. | | `safe_to_retry` | Response `safeToRetry` | Retry only when this value is `true`. | ## Handle errors Never infer failure from a client timeout. Poll a returned action before sending another request. * For `400`, correct the user ID or account value. * For `401`, replace invalid Xquik authentication. * For `402`, add credits before another request. * For `403`, reconnect the selected X account. * For `409`, keep the original action and payload. * For `422`, review the X rejection before retrying. * For `429`, wait for `Retry-After`. * For `500` or `503`, follow `safeToRetry` and `terminal`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token. | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User to mute. Send a user ID or a username with or without `@`. A URL-encoded profile URL such as `x.com/nasa` also works. An unknown username returns `422 x_target_not_found`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID identifying which connected X account acts. Xquik strips the `@` prefix if included. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "mute", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "mute", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Remove a follower by user ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/remove-follower Remove one unwanted follower by X (Twitter) user ID. Approve the connected account, poll the write action, verify the inbound relationship, and handle errors. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/users/{id}/remove-follower` ## How do you remove a Twitter follower? Use this endpoint to remove 1 follower from a connected X account. Put the follower's numeric X (Twitter) user ID in the path. Name the connected account in the JSON body. Then approve, poll, and verify the inbound relationship change. X also documents [manual follower removal](https://help.x.com/en/using-x/following-faqs). Its help page explains that a removed account may follow again. **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). > [!WARNING] > > **Action-specific rate limit.** Remove Follower shares 20 requests per minute and 400 per day with follow actions. The X action bucket also allows 120 requests per minute. A breached limit returns `429 Too Many Requests`. `Retry-After` is the wait until the limit frees. After the daily limit, it is up to 24 hours. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/users/44196397/remove-follower \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: remove-follower-myxaccount-44196397-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxaccount" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/44196397/remove-follower", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "remove-follower-myxaccount-44196397-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxaccount", }), }); const removalReceipt = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(removalReceipt)); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/x/users/44196397/remove-follower", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "remove-follower-myxaccount-44196397-1895432178065391234", }, json={ "account": "myxaccount", }, ) removal_receipt = response.json() response.raise_for_status() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "account": "myxaccount", }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/x/users/44196397/remove-follower", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "remove-follower-myxaccount-44196397-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var removalReceipt map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&removalReceipt); err != nil { panic(err) } fmt.Println(removalReceipt) } ``` ## Resolve the follower and connected account Read [Followers](/api-reference/x/followers) before choosing a target. Resolve the current username to a stable numeric X (Twitter) user ID. Usernames and profile names can change. The numeric ID keeps the moderation record tied to one account. Show the follower ID, username, profile name, and acting account. Also show the moderation reason before approval. The path `{id}` identifies the follower you will remove. The body field `account` identifies whose follower list will change. Never infer spam from a username, avatar, or missing profile field. Choose the unwanted follower with your approved moderation rule. Store the reviewer, reason, and evidence outside this public request. ## Remove followers one request at a time Create 1 idempotency key for each intended removal. Reuse that key only after an interrupted network request. Never reuse it for another follower or connected account. This route accepts 1 follower ID per request. It provides no bulk body for mass follower removal. Queue approved follower IDs as separate write actions. Each row needs its own reason, approval, and idempotency key. A team can review the queue before dispatch. A temporary failure must not erase the record of successful removals. Store each returned action ID beside its target follower ID. ## Poll and verify the removal Store `id`, `request.hash`, `billing`, and `statusUrl` from the response. An HTTP `200` response represents a terminal write action. An HTTP `202` response represents an active write action. Poll the same `statusUrl` while `terminal` remains `false`. Never submit another removal while the first action is active. A second request could add a duplicate job. Keep the original idempotency key for an exact network replay. Read [Followers](/api-reference/x/followers) after the action becomes terminal. You can also call [Check Follower](/api-reference/x/check-follower). Set the removed account as the source relationship participant. Set the connected account as the target participant. Confirm the inbound follower relationship is absent. ## Choose remove follower, unfollow, or block Remove Follower ends one inbound relationship. The selected account stops following your connected X account. It does not make your connected account unfollow the selected account. Use [Unfollow](/api-reference/x-write/unfollow) for that outbound relationship. Keep both actions separate in every moderation workflow. The accounts do not need a mutual follow relationship. Follower removal is also different from blocking. A removed follower can follow your public account again. They can ask to follow your protected account again. Block the account through X when it must not follow again. This endpoint lets you remove a follower without blocking them. ## Review bots, private accounts, and bulk queues This endpoint does not detect bots, spam, or inactive accounts. Check profiles and follower relationships before you approve a removal. Never treat a protected profile as proof of abusive behavior. Private and public accounts use the same Xquik request shape. X controls whether the removed account can follow again. This write does not block the account. Store the terminal result, then verify the live follower relationship. For multiple targets, process one approved queue row at a time. Throttle the queue to every documented rate limit. ## Handle remove follower API errors Fix the follower ID or connected account after `400`. Replace Xquik authentication after `401`. Add credits after `402`. Reconnect the account after `403`. Keep the original action after an idempotency conflict at `409`. Fix rejected input after `422`. Honor `Retry-After` after `429`. After `500` or `503`, inspect `safeToRetry` before retrying. ## Twitter follower removal questions ### How to remove followers on X (Twitter) with an API? Resolve each follower to a numeric ID. Send one approved request per follower, then poll every action. ### How do you remove a follower from Twitter without blocking? Call this endpoint for the inbound relationship. The removed account may still follow the connected account again. ### Can I remove all followers or bot followers at once? No batch body is available. Review suspected bots first, then queue one approved target per request. ### Does X notify a removed follower? No response field tells you whether X sent a notification. Your final check should cover only the follower relationship. ### Can I unfollow accounts with this endpoint? No. Use Unfollow when the connected account follows another account. Use Remove Follower when someone follows you. ### Does this work for mobile, desktop, or private accounts? The REST request works from any HTTP client. It does not depend on X's mobile or desktop interface. ### How do I get an API key? Create an Xquik API key in the dashboard. You can also send an OAuth 2.1 bearer token. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Follower to remove. Send a user ID or a username with or without `@`. A URL-encoded profile URL such as `x.com/nasa` also works. An unknown username returns `422 x_target_not_found`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of your connected account. This is the account whose follower list changes. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "remove_follower", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "remove_follower", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Retweet a tweet by ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/retweet Repost one tweet by ID from a connected X account. Approve the account, send an idempotency key, poll the action, then store billed credits and the result. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/tweets/{id}/retweet` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Each request reposts 1 tweet by ID. Each request names 1 connected X account. Review the source tweet before sending the write. Then store the action and poll `statusUrl` until `terminal` is `true`. Compare X's separate [Repost Post endpoint](https://docs.x.com/x-api/users/repost-post). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets/1895432178065391234/retweet \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: retweet-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "elonmusk" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1895432178065391234"; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/retweet`, { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "retweet-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "elonmusk", }), }); const repostReceipt = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(repostReceipt)); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests tweet_id = "1895432178065391234" response = requests.post( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/retweet", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "retweet-1895432178065391234", }, json={ "account": "elonmusk", }, ) repost_receipt = response.json() response.raise_for_status() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { tweetID := "1895432178065391234" body, _ := json.Marshal(map[string]interface{}{ "account": "elonmusk", }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/x/tweets/"+tweetID+"/retweet", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "retweet-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var repostReceipt map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&repostReceipt); err != nil { panic(err) } fmt.Println(repostReceipt) } ``` ## Authenticate and approve the reposting account Send an Xquik API key or OAuth 2.1 bearer token. Name 1 connected X account in the request body. Connect that account before scheduling or approving a repost. Never send an X password or session cookie. Review the source tweet just before approval. Show its author, text, media, Tweet ID, and current availability. Also show the X account that will publish the repost. Use this review to avoid sharing from the wrong account. Store these approval fields with the request. | Approval field | Source | Purpose | | - | - | - | | Acting account | Request `account` | Identify the account publishing the repost. | | Source Tweet ID | Path `id` | Keep the approved Tweet ID. | | Source author | Tweet lookup | Keep original attribution in the review. | | Approval time | Workflow clock | Record when the user approved distribution. | | Approval owner | Workflow identity | Record who approved the repost. | | Idempotency key | Request header | Bind retries to this exact decision. | ## Publish one repost by tweet ID Resolve the Tweet ID before approval. Show the source tweet, author, media, and acting account. A repost keeps the original tweet and its author. Assign a unique idempotency key to that repost decision. Reuse it only after an interrupted response. Store the action ID with the Tweet ID and acting account. Repost workflows often include these cases. * Amplifying an approved announcement from a partner account. * Reposting a customer reply selected by a support team. * Sharing a monitored tweet after a moderation checkpoint. * Preventing 2 workers from reposting the same tweet. An accepted action may not appear on the account timeline yet. Poll the lifecycle state while the action remains active. | Repost action column | Source | Distribution rule | | - | - | - | | `acting_account` | Request `account` | Keep the connected account with the repost decision. | | `tweet_id` | Path `id` | Use the exact source Tweet ID approved for distribution. | | `source_author_id` | Review context | Store the original tweet author when available. | | `approval_reference` | Workflow value | Link the repost to its campaign or moderation decision. | | `idempotency_key` | Request header | Generate one key for this account and Tweet ID. | | `write_action_id` | Response `id` | Store the repost action before polling. | | `status` | Response `status` | Keep queued, completed, and failed reposts distinct. | | `terminal` | Response `terminal` | Mark distribution complete only when `true`. | | Request time | Integration timestamp | Save when the repost request starts. | | Repost outcome | Evidence | Campaign action | | - | - | - | | Queued | `terminal: false` | Poll `statusUrl`. Do not count the repost yet. | | Completed | Terminal success | Record the account, source Tweet ID, and completion time. | | Already reposted | Terminal result that reports an existing repost | Complete without another repost request. | | Retry allowed | `safeToRetry: true` | Keep the receipt. Follow `nextAction`. | | Final failure | Terminal failure | Store the error and exclude the repost from completed totals. | ## Choose a repost or new tweet Use a repost to share an existing tweet unchanged. The request adds no comment, caption, or reply text. Use [Create Tweet](/api-reference/x-write/create-tweet) for original posts and replies. A reply needs `reply_to_tweet_id`. | Publishing intent | API route | Required content | | - | - | - | | Share an existing tweet unchanged | `POST /x/tweets/{id}/retweet` | Source tweet ID and connected account | | Publish original text | `POST /x/tweets` | New tweet text and connected account | | Reply to a tweet | `POST /x/tweets` | Reply text and `reply_to_tweet_id` | | Remove a repost | `DELETE /x/tweets/{id}/retweet` | Source tweet ID and connected account | Show the source tweet during approval. Store its author, text, media, and Tweet ID. Never replace that ID with a search-result position. ## Reconcile retweet automation Store one receipt per connected account and source tweet. This key prevents 2 workers from counting the same repost as separate campaign results. Keep queued, completed, already-reposted, and failed outcomes distinct. Mark an already-reposted outcome complete. It does not create a second repost. Use [Unretweet](/api-reference/x-write/unretweet) for an approved rollback. The rollback needs a new idempotency key. Store both action IDs. The campaign record then shows the repost and its later removal. ## Schedule retweets without duplicate posts This endpoint starts the repost action when it receives the approved request. Use your scheduler when a repost must run later. Store the Tweet ID, account, time zone, and approval together. Recheck the source tweet before dispatch. Create the idempotency key once the schedule is final. Reuse that key after a network interruption. Never reuse it for another account, Tweet ID, or scheduled time. The endpoint accepts 1 Tweet ID per request. It has no bulk repost body. Queue several approved tweets as separate jobs. Store each action before starting the next job. After `429`, honor `Retry-After`. Do not rotate connected accounts to bypass a limit. Delay the existing job instead of creating a duplicate. ## Verify repost completion and attribution Store `id` as the write action ID. Store `request.hash` with the submitted account and Tweet ID. Keep `status`, `terminal`, `statusUrl`, and `safeToRetry` together. Store `billing.chargedCredits` after billing settles. Treat `202` as active work, not a completed repost. Poll the same `statusUrl` until `terminal` becomes `true`. Never send another repost while the action remains active. After success, compare the returned target with the approved Tweet ID. Mark an already-reposted outcome complete. It does not create another timeline entry. The repost keeps the source tweet's original attribution. Use [Retweeters](/api-reference/x/retweeters) for available account-level evidence. Timeline visibility can lag behind a completed write receipt. Keep read time separate from repost completion time. ## Handle Twitter retweet API errors Keep every error beside the request hash and action ID. Never swap in another Tweet ID as a fallback. * On `400`, correct the Tweet ID or account value. * On `401`, replace invalid Xquik authentication. * On `402`, add credits before another repost request. * On `403`, reconnect the selected X account. * On `409`, keep the action protected by that idempotency key. * On `422`, review X's rejection before another attempt. * On `429`, honor `Retry-After` before polling or retrying. * On `500`, store the failure. Contact support if it persists. * On `503`, check `safeToRetry` before retrying. A client timeout does not prove the repost failed. Check any returned action before sending another write. Use `nextAction` to choose the next step. ## Apply repost bot and campaign controls Require approval for the exact account and source tweet. Use campaign allowlists for authors, topics, or Tweet IDs. Set a per-campaign repost limit before dispatch begins. Keep separate limits for each connected account. Lock the approved tweet list before processing. Record skipped, active, completed, and failed jobs separately. Never count an accepted action as completed. Inspect unavailable tweets instead of substituting new content. Keep deleted or restricted source tweets as distinct outcomes. Do not turn a failed repost into an original tweet in code. Store the approval, request, action, billing, and final result. These records support audits without exposing account credentials. ## Twitter retweet API questions ### How do I automate a retweet through an API? Approve the Tweet ID and connected account. Send this request, then poll the write action until terminal. ### How do I authenticate an X (Twitter) API retweet? Send an Xquik API key or OAuth 2.1 bearer token. Never send an X password or session cookie. ### Can I schedule a retweet? Call this endpoint from your scheduler after approval. The endpoint stores no future schedule. ### What is the retweet API rate limit? After `429`, honor `Retry-After` before another request. X publishes separate [Repost rate limits](https://docs.x.com/x-api/fundamentals/rate-limits). ### Is a retweet the same as a quote tweet? No. This route reposts the existing tweet unchanged. It cannot add a quote comment or new media. ### Can I bulk retweet several tweet IDs? No bulk request exists here. Approve and submit each Tweet ID separately. ### How do I track retweet activity? Poll this write action for completion. Use [Retweeters](/api-reference/x/retweeters) to read available reposting accounts. ### Why can a Twitter retweet API request fail? The account may need reconnection, credits, or a later retry. The source tweet may also be unavailable or rejected by X. ### Does a repost keep the original author? Yes. A repost references the source tweet and its author. This endpoint adds no replacement caption or attribution. ### Can I undo an API retweet? Yes. Call [Unretweet](/api-reference/x-write/unretweet) after new approval. Use a new idempotency key for that removal. ### Can a bot use this retweet API? Yes. Keep credentials server-side and require clear account authorization. Apply approvals, limits, idempotency, and terminal polling to every job. ### Do I need a Twitter retweet SDK? No. Call this REST endpoint with any HTTP client. Use the cURL, Node.js, Python, or Go examples above. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID identifying which connected X account will retweet. Xquik strips the `@` prefix if included. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "retweet", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "retweet", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "x_rate_limited", "message": "X rate limited this account. Try again in about 15 minutes. Send fewer requests from this account." }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Send a DM with text & media, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/send-dm Send text or one media attachment as a direct message from a connected X account. Poll the write action and handle every response. Each send costs 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/dm/{userId}` **10 credits per send** · [Compare plans](https://xquik.com/en) A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). ## Send direct messages with the Twitter DM API Use this route for approved, one-to-one messages. It sends text or one uploaded media attachment. SDKs, support tools, and server jobs can call it. Choose the connected X account and the recipient's numeric user ID. Use [Twitter profile lookup](/api-reference/x/twitter-profile-lookup) when you only know a username. Follow [X's Direct Message rules](https://docs.x.com/x-api/direct-messages/manage/integrate) for every message. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/dm/44196397 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: dm-44196397-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxaccount", "text": "Your requested account update is ready." }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const recipientUserId = "44196397"; const dmResponse = await fetch(`https://xquik.com/api/v1/x/dm/${recipientUserId}`, { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "dm-44196397-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxaccount", text: "Your requested account update is ready.", }), }); const dmAction = await dmResponse.json(); if (!dmResponse.ok) { throw new Error(dmAction.message); } process.stdout.write(`${JSON.stringify(dmAction)}\n`); ``` ## Authenticate and select the recipient Authenticate with an `x-api-key` header or an OAuth bearer token. The connected X account sends the message on the user's behalf. The path `userId` identifies the recipient, not the sender. Send only messages approved by your workflow. Honor recipient privacy, consent, and opt-out decisions. Read [DM history](/api-reference/x/dm-history) only for approved conversation context. ## Send text or one media attachment Provide non-empty `text` for every direct message. Upload media first with [Upload Media](/api-reference/x-write/upload-media). Place its `mediaId` inside a one-item `media_ids` array. The upload costs another 10 credits. Empty or multi-item arrays return `400 invalid_input`. This route also rejects `reply_to_message_id`. It does not send group messages or accept public media URLs. ## Poll and verify the direct message A `200` response contains a terminal write action. A `202` response requires polling through `statusUrl`. Wait for `terminal: true` before closing the send job. Xquik settles a pending DM within 15 minutes of the send. * `success` with `messageId` means X sent it. You pay once. * `failed` with `x_dm_not_sent` means Xquik found no sign of the DM. You pay nothing, and `safeToRetry` is `true`. If you deleted the DM on X (Twitter), check before you send it again. * `expired` means Xquik could not confirm the send. You pay nothing. Check the conversation before you send again. Store `writeActionId`, recipient ID, account, request hash, and `messageId`. [Delete DM](/api-reference/x-write/delete-dm) takes that `messageId` later. If the connection drops, retry with the same idempotency key. Never create another write while the first action remains nonterminal. Each account gets 120 X (Twitter) actions per minute. ## Handle every Twitter DM API response Fix request fields after `400`. Replace authentication after `401`, then add credits after `402`. Reconnect the X account after `403`. Keep the original request after a `409` idempotency conflict. `422 x_dm_not_allowed` means this sender cannot message that person. Try another approved sender or ask the person to allow DMs. Honor `Retry-After` after `429`. `429 x_rate_limited` means X paused DMs from that account. Its DMs then get `429` until X's reset, and Xquik sends nothing to X. You pay nothing. `Retry-After` and `nextAction.afterMs` give the wait. After `500` or `503`, inspect `safeToRetry` before retrying. ## Twitter DM API questions ### Can I automate customer support direct messages? Yes. Queue approved replies and store the exact sent text. Avoid unsolicited bulk messaging and honor every opt-out. ### Can I send images or video through the API? Upload the file first, then send its single `mediaId`. This endpoint accepts one attachment per message. ### Does this endpoint retrieve message history or create webhooks? No. Use [Get DM History](/api-reference/x/dm-history) for prior messages. This send route does not configure incoming-DM notifications. ### Can third-party tools and generated SDKs call this route? Yes. Use the documented REST fields and authentication. Leave `reply_to_message_id` unset when a generated SDK exposes it. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Idempotency-Key` | `string` | Yes | Unique key for this intended send. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | DM recipient. Send a user ID or a username with or without `@`. A URL-encoded profile URL such as `x.com/nasa` also works. An unknown username returns `422 x_target_not_found`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of your connected sender account. | | `text` | `string` | Yes | Non-empty direct message text. | | `media_ids` | `string[]` | No | Optional one-item array containing an uploaded media ID. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "send_dm", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "send_dm", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Unblock a user by user ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/unblock Unblock 1 X (Twitter) user by ID from a connected account. Store the write action, result and billed credits. Retry only when safeToRetry is true. 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/users/{id}/block` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Each request unblocks 1 user by ID. Each request uses 1 connected X account. Follows the block removed stay removed. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/x/users/44196397/block \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: unblock-44196397" \ -H "Content-Type: application/json" \ -d '{"account":"myxaccount"}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/44196397/block", { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "unblock-44196397", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxaccount" }), }); const result = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(result)); } process.stdout.write( `${JSON.stringify({ id: result.id, status: result.status, terminal: result.terminal })}\n`, ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.delete( "https://xquik.com/api/v1/x/users/44196397/block", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "unblock-44196397", }, json={"account": "myxaccount"}, ) response.raise_for_status() result = response.json() print(result["id"], result["status"], result["terminal"]) ``` ## Unblock one user by ID Put the exact user ID in the request path. Put the connected account username or ID in the body. That account unblocks the user. Follow the user again with [Follow user](/api-reference/x-write/follow) if needed. ## Save a receipt Save the action first. Then update your local record. | Column | Source | Rule | | - | - | - | | `acting_account` | Request `account` | Keep the connected X account with the action. | | `user_id` | Path `id` | Keep the exact user ID. | | `idempotency_key` | Request header | Generate 1 key for this account and user ID. | | `write_action_id` | Response `id` | Store the action before polling. | | `terminal` | Response `terminal` | Change the local record only when `true`. | | `safe_to_retry` | Response `safeToRetry` | Retry only when this value is `true`. | ## Handle errors Never infer failure from a client timeout. Poll a returned action before sending another request. * For `400`, correct the user ID or account value. * For `401`, replace invalid Xquik authentication. * For `402`, add credits before another request. * For `403`, reconnect the selected X account. * For `409`, keep the original action and payload. * For `422`, review the X rejection before retrying. * For `429`, wait for `Retry-After`. * For `500` or `503`, follow `safeToRetry` and `terminal`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token. | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User to unblock. Send a user ID or a username with or without `@`. A URL-encoded profile URL such as `x.com/nasa` also works. An unknown username returns `422 x_target_not_found`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID identifying which connected X account acts. Xquik strips the `@` prefix if included. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "unblock", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "unblock", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Remove a tweet bookmark by ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/unbookmark Remove 1 bookmark by Tweet ID from a connected X account. Store the write action, result and billed credits. Retry only when safeToRetry is true. 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/tweets/{id}/bookmark` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Each request removes 1 bookmark by Tweet ID. Each request uses 1 connected X account. It never deletes the tweet or changes another account's bookmarks. Create a unique `Idempotency-Key` for the intended removal. Store the returned write action and poll `statusUrl` when needed. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/x/tweets/1895432178065391234/bookmark \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: unbookmark-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{"account":"elonmusk"}' | jq '{ status, terminal, safe_to_retry: .safeToRetry, write_action_id: .id, requested_tweet_id: "1895432178065391234", confirmed_tweet_id: (.result.id // .targetId), charged_credits: .billing.chargedCredits, poll_path: (if .terminal then null else .statusUrl end) }' ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1895432178065391234"; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/bookmark`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "unbookmark-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "elonmusk" }), }); const result = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(result)); } const removalRecord = { status: result.status, terminal: result.terminal, safe_to_retry: result.safeToRetry, write_action_id: result.id, requested_tweet_id: tweetId, confirmed_tweet_id: result.result?.id ?? result.targetId ?? null, charged_credits: result.billing.chargedCredits, poll_path: result.terminal ? null : result.statusUrl, }; process.stdout.write(`${JSON.stringify(removalRecord)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1895432178065391234" response = requests.delete( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/bookmark", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "unbookmark-1895432178065391234", }, json={"account": "elonmusk"}, ) result = response.json() response.raise_for_status() removal_record = { "status": result["status"], "terminal": result["terminal"], "safe_to_retry": result["safeToRetry"], "write_action_id": result["id"], "requested_tweet_id": tweet_id, "confirmed_tweet_id": (result.get("result") or {}).get("id") or result.get("targetId"), "charged_credits": result["billing"]["chargedCredits"], "poll_path": None if result["terminal"] else result["statusUrl"], } print(json.dumps(removal_record)) ``` ## Remove one bookmark by Tweet ID Put the exact Tweet ID in the request path. Put the connected account username or ID in the body. That account loses the bookmark. This endpoint accepts 1 Tweet ID per request. It never deletes the tweet, likes, or reposts. ## Clear many bookmarks Read the saved posts with [Bookmarks](/api-reference/x/bookmarks). Send 1 request per Tweet ID with its own `Idempotency-Key`. Keep each removal in your ledger before the next request. Show the account owner the posts before the removal starts. Removed bookmarks don't come back unless the account saves them again. ## Save a removal receipt | Removal column | Source | Rule | | - | - | - | | `acting_account` | Request `account` | Match the account that saved the bookmark. | | `tweet_id` | Path `id` | Keep the exact bookmarked Tweet ID. | | `idempotency_key` | Request header | Create a fresh key for each removal. | | `write_action_id` | Response `id` | Store the removal action. | | `terminal` | Response `terminal` | Change the local list only when `true`. | | `safe_to_retry` | Response `safeToRetry` | Retry only when this value is `true`. | ## Twitter remove bookmark API questions ### Can an API remove a bookmark by Tweet ID? Yes. Send the Tweet ID in the path and the connected account in the body. ### How do I remove all bookmarks? Page through [Bookmarks](/api-reference/x/bookmarks), then remove each post with this route. Each removal costs 10 credits. ## Handle errors Never infer failure from a client timeout. Poll a returned action before sending another request. * For `400`, correct the Tweet ID or account value. * For `401`, replace invalid Xquik authentication. * For `402`, add credits before another request. * For `403`, reconnect the selected X account. * For `409`, keep the original action and payload. * For `422`, review the X rejection before retrying. * For `429`, wait for `Retry-After`. * For `500` or `503`, follow `safeToRetry` and `terminal`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token. | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of the connected account removing the bookmark. Xquik strips the `@` prefix if included. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "unbookmark", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "unbookmark", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "x_rate_limited", "message": "X rate limited this account. Try again in about 15 minutes. Send fewer requests from this account." }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Unfollow a user by user ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/unfollow Unfollow 1 X (Twitter) user by ID from a linked account. Poll the write action, respect the 20 per minute and 400 per day limits, and verify the relationship. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/users/{id}/follow` ## Unfollow one Twitter user by ID Each request unfollows 1 target user ID. Each request names 1 connected X account. Verify the target user ID and acting account before approval. Compare X's separate [Unfollow User endpoint](https://docs.x.com/x-api/users/unfollow-user). **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). > [!WARNING] > > **Action-specific rate limit.** Unfollow shares the follow-action limits of 20 requests per minute and 400 per day. The DELETE tier also applies. A breached limit returns `429 Too Many Requests`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/x/users/44196397/follow \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: unfollow-44196397-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxaccount" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/44196397/follow", { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "unfollow-44196397-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxaccount", }), }); const unfollowReceipt = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(unfollowReceipt)); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.delete( "https://xquik.com/api/v1/x/users/44196397/follow", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "unfollow-44196397-1895432178065391234", }, json={ "account": "myxaccount", }, ) unfollow_receipt = response.json() response.raise_for_status() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "account": "myxaccount", }) req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/x/users/44196397/follow", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "unfollow-44196397-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var unfollowReceipt map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&unfollowReceipt); err != nil { panic(err) } fmt.Println(unfollowReceipt) } ``` ## Authenticate and select the relationship Send an Xquik API key or OAuth 2.1 bearer token. Never send an X password or session cookie. The path ID names the profile that the acting account follows. The body names the connected account that will stop following it. Use the stable numeric user ID as the relationship key. Keep the username and profile name as review labels. Show both profiles before a user approves the write action. The profile page and unfollow button are manual X controls. This endpoint does the same from code, after approval. ## Unfollow Twitter accounts one request at a time Create a new idempotency key whenever the relationship changes. Never reuse the key from an earlier follow action. Reuse the unfollow key only after an interrupted network request. Store the returned action ID, request hash, and `statusUrl` from the response. Poll the same action while `terminal` remains `false`. Never submit a second write while the first action is active. The endpoint accepts 1 target user ID per request. It exposes no mass unfollow body or bulk unfollow feature. Queue approved targets separately when you unfollow Twitter accounts in bulk. Each row needs its own target, reason, approval, and idempotency key. With separate rows, one failure does not affect other accounts. A failed row must not erase the record of successful unfollow actions. A team can stage approved rows for later processing. Store each acting account and target ID separately. Respect X's terms of service and every returned rate limit. Unfollow people only after a clear user or workflow decision. ## Select inactive users before unfollowing This write endpoint does not discover inactive users or non-followers. Read [Following](/api-reference/x/following) before selecting cleanup targets. Define inactivity from an approved timestamp or business rule. Never infer inactivity from a missing profile or stale export. Store the selection rule with the target user ID. Review the acting account and target as separate fields. Then send 1 approved unfollow action for each relationship. ## Verify the Twitter unfollow API result Poll `statusUrl` until the action becomes terminal. Store the final status, billing fields, and request identifiers. Use [Check Follower](/api-reference/x/check-follower) when you need current proof. Check Following to confirm the target disappeared from the outbound list. No response field says whether X sent a notification. Do not claim whether X notified the target account. Verify the relationship itself. ## Choose unfollow or remove follower Unfollow stops the connected account from following the target profile. [Remove Follower](/api-reference/x-write/remove-follower) ends one inbound relationship. Use Remove Follower when someone should stop following the connected account. Unretweet removes one repost and changes no follow relationship. Delete Tweet removes one post and changes no follow relationship. Keep these write actions in separate steps. ## Handle X (Twitter) API unfollow errors Fix the target user ID or acting account after `400`. Replace Xquik authentication after `401`. Reconnect after `403`. Add credits after `402`. Review rejected input after `422`. Keep the original action after an idempotency conflict at `409`. Honor `Retry-After` after `429`. After `500` or `503`, check `safeToRetry` before retrying. ## Twitter unfollow API questions ### How do I unfollow someone on Twitter with an API? Approve the target user ID and connected account. Send this DELETE request, then poll the returned action until terminal. ### Can I mass unfollow or schedule unfollow actions? Use your scheduler to queue 1 approved target per request. Throttle the queue to both documented limits above. ### Can I unfollow someone without them knowing? Xquik cannot confirm whether X sends a notification. Confirm only the outbound relationship change. ### Do I need unfollow tools or browser extensions? No. Use any HTTP client or the cURL, Node.js, Python, and Go examples. A third-party service still needs an approved connected account. ### How do I manage several connected accounts? Repeat approval for each acting account. Never reuse one action ID across accounts. ### How do I get an API key? Create an Xquik API key in the dashboard. You can also send an OAuth 2.1 bearer token. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User to unfollow. Send a user ID or a username with or without `@`. A URL-encoded profile URL such as `x.com/nasa` also works. An unknown username returns `422 x_target_not_found`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of your connected account to act as. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "unfollow", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "unfollow", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Unlike a tweet by tweet ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/unlike Unlike one tweet by ID from a connected X account. Store the acting account, write action, terminal result, and billed credits. Each call costs 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/tweets/{id}/like` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Each request unlikes 1 tweet by ID. It changes 1 connected account's like state. It never deletes the tweet, replies, reposts, or another account's likes. Compare X's separate [Unlike Post endpoint](https://docs.x.com/x-api/users/unlike-post). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/x/tweets/1895432178065391234/like \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: unlike-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{"account":"elonmusk"}' | jq ``` ## Remove one Twitter like by ID Put the exact Tweet ID in the path. Put its connected X account in the body. This endpoint accepts 1 Tweet ID per request. Store Tweet IDs as strings to preserve large identifiers. ## Authenticate the Twitter account Send an Xquik API key or OAuth 2.1 bearer token. The request never accepts an X password or session cookie. Keep credentials in server-side code. Reconnect the account after `account_needs_reauth`. ## Approve the exact like removal Show the tweet, author, Tweet ID, and acting account. Store the approver, approval time, and removal reason. Handle missing, private, or deleted tweets separately. Never replace an approved ID with another tweet. ## Save an unlike receipt Save the action before changing your local like record. | Unlike action column | Source | Removal rule | | - | - | - | | `acting_account` | Request `account` | Match the account that owns the original like. | | Tweet ID | Path `id` | Keep the exact liked Tweet ID. | | `removal_reason` | Workflow value | Record why the user removed the like. | | `idempotency_key` | Request header | Create a fresh removal key. | | `write_action_id` | Response `id` | Store the removal action. | | `terminal` | Response `terminal` | Change the local state only when `true`. | ## Confirm like removal A `200` response is terminal. A `202` response still needs polling through `statusUrl`. Never resend an active action. After success, match the returned and requested Tweet IDs. If X (Twitter) reports no existing like, mark the account as unliked. Keep the prior state while `terminal` is `false`. Store the settled `billing` object after completion. Close already-unliked actions without another request. ## Remove X (Twitter) likes in a controlled queue This route has no mass-delete request. Process approved Tweet IDs separately. Give each account and Tweet ID a unique key. Use [User Likes](/api-reference/x/user-likes) to collect candidate IDs. X shows likes only to their owner. That read can return `424 likes_unavailable`. Follow every cursor before approving the list. After `429`, wait for `Retry-After`. Never rotate accounts to bypass limits. Review X's separate [Unlike rate limits](https://docs.x.com/x-api/fundamentals/rate-limits). ## Prevent duplicate unlike requests Create one idempotency key per account and Tweet ID. Reuse it only after an interrupted response. A `409` means that key already belongs to another payload. Create a new key only for a new removal intent. ## Handle remove X (Twitter) likes errors Never infer failure from a client timeout. Poll the returned action before another request. * On `400`, correct the Tweet ID or account. * On `401`, replace invalid Xquik authentication. * On `402`, add credits before another unlike. * On `403`, reconnect the selected X account. * On `409`, keep the original action and payload. * On `422`, review X's rejection. * On `429`, honor `Retry-After` before retrying. * On `500` or `503`, follow `safeToRetry` and `terminal`. ## Choose unlike, delete, or unretweet Use this route only to remove one account's like. Use [Like Tweet](/api-reference/x-write/like) to restore a like. Use [Delete Tweet](/api-reference/x-write/delete-tweet) for an owned tweet. Use [Unretweet](/api-reference/x-write/unretweet) for a repost. Unlike never removes replies, follows, bookmarks, or accounts. ## Remove X (Twitter) likes questions ### How to remove a like on Twitter with an API? Send the Tweet ID and connected account. Poll the write action until it becomes terminal. ### Can I remove all Twitter likes at once? No. Process each approved Tweet ID separately. Store one key and action per removal. ### Can I remove likes for multiple Twitter accounts? Yes. Name one connected account per request. Keep its approval, key, and receipt together. ### What are the risks of third-party like removal tools? Never share your X password or session cookie. Review every account and Tweet ID. ### Can I schedule X (Twitter) like removal? Use your scheduler for approved Tweet IDs. This endpoint stores no future schedule. ### Does unliking delete the original tweet? No. It changes only the connected account's like state. ### Can I restore a removed like? Yes. Call [Like Tweet](/api-reference/x-write/like) after new approval. Use a new key. ### Does removing a like erase every historical record? No. Earlier logs, exports, screenshots, or audits may remain. Do not treat a Twitter archive as proof of the current like state. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token. | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID for the connected account. Xquik removes an included `@` prefix. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "unlike", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "unlike", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "x_rate_limited", "message": "X rate limited this account. Try again in about 15 minutes. Send fewer requests from this account." }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Unmute a user by user ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/unmute Unmute 1 X (Twitter) user by ID from a connected account. Store the write action, result and billed credits. Retry only when safeToRetry is true. 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/users/{id}/mute` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Each request unmutes 1 user by ID. Each request uses 1 connected X account. The user's posts can show in that account's timelines again. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/x/users/44196397/mute \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: unmute-44196397" \ -H "Content-Type: application/json" \ -d '{"account":"myxaccount"}' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/44196397/mute", { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "unmute-44196397", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxaccount" }), }); const result = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(result)); } process.stdout.write( `${JSON.stringify({ id: result.id, status: result.status, terminal: result.terminal })}\n`, ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.delete( "https://xquik.com/api/v1/x/users/44196397/mute", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "unmute-44196397", }, json={"account": "myxaccount"}, ) response.raise_for_status() result = response.json() print(result["id"], result["status"], result["terminal"]) ``` ## Unmute one user by ID Put the exact user ID in the request path. Put the connected account username or ID in the body. That account unmutes the user. ## Save a receipt Save the action first. Then update your local record. | Column | Source | Rule | | - | - | - | | `acting_account` | Request `account` | Keep the connected X account with the action. | | `user_id` | Path `id` | Keep the exact user ID. | | `idempotency_key` | Request header | Generate 1 key for this account and user ID. | | `write_action_id` | Response `id` | Store the action before polling. | | `terminal` | Response `terminal` | Change the local record only when `true`. | | `safe_to_retry` | Response `safeToRetry` | Retry only when this value is `true`. | ## Handle errors Never infer failure from a client timeout. Poll a returned action before sending another request. * For `400`, correct the user ID or account value. * For `401`, replace invalid Xquik authentication. * For `402`, add credits before another request. * For `403`, reconnect the selected X account. * For `409`, keep the original action and payload. * For `422`, review the X rejection before retrying. * For `429`, wait for `Retry-After`. * For `500` or `503`, follow `safeToRetry` and `terminal`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key in this header. Alternatively, send an OAuth 2.1 bearer token. | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User to unmute. Send a user ID or a username with or without `@`. A URL-encoded profile URL such as `x.com/nasa` also works. An unknown username returns `422 x_target_not_found`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID identifying which connected X account acts. Xquik strips the `@` prefix if included. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "unmute", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "unmute", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Undo a retweet by tweet ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/unretweet Undo one retweet by Tweet ID from a connected X account. Poll the write action, verify completion, and handle errors. The source tweet stays. 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `DELETE https://xquik.com/api/v1/x/tweets/{id}/retweet` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Each request removes 1 repost by Tweet ID. Name the connected X account that owns the repost. Then poll `statusUrl` until `terminal` becomes `true`. The route keeps the source tweet and its original author. It does not remove likes, follows, replies, bookmarks, or original tweets. Compare X's separate [Unrepost Post endpoint](https://docs.x.com/x-api/users/unrepost-post). X also publishes a [Retweet management guide](https://docs.x.com/x-api/posts/retweets/quickstart/manage-retweets). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE https://xquik.com/api/v1/x/tweets/1895432178065391234/retweet \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: unretweet-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "elonmusk" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1895432178065391234"; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/retweet`, { method: "DELETE", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "unretweet-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "elonmusk", }), }); const unretweetReceipt = await response.json(); if (!response.ok) { throw new Error(JSON.stringify(unretweetReceipt)); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests tweet_id = "1895432178065391234" response = requests.delete( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/retweet", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "unretweet-1895432178065391234", }, json={ "account": "elonmusk", }, ) unretweet_receipt = response.json() response.raise_for_status() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { tweetID := "1895432178065391234" body, _ := json.Marshal(map[string]interface{}{ "account": "elonmusk", }) req, err := http.NewRequest("DELETE", "https://xquik.com/api/v1/x/tweets/"+tweetID+"/retweet", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "unretweet-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var unretweetReceipt map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&unretweetReceipt); err != nil { panic(err) } fmt.Println(unretweetReceipt) } ``` ## Authenticate and approve the reposting account Send an Xquik API key or OAuth 2.1 bearer token. Name 1 connected X account in the request body. Never send an X password or session cookie. Show the specific tweet and acting account before approval. Include the author, text, media, Tweet ID, and removal reason. ## Remove one repost by tweet ID Resolve the source Tweet ID before approval. Do not use a timeline position or search-result index. Send the ID as a string to keep every digit. Generate a new idempotency key for the removal. Do not reuse the key from the original repost. Reuse the key only after an interrupted response. Store the action ID before starting another removal. Poll `statusUrl` while `terminal` is `false`. ## Choose unretweet, delete tweet, or unlike Use Unretweet for an unchanged repost of someone else's tweet. It removes only the acting account's repost relationship. Use [Delete Tweet](/api-reference/x-write/delete-tweet) for original or quote tweets. Use [Unlike Tweet](/api-reference/x-write/unlike) for likes. X Premium's Undo Post feature is different. It delays publication during a short preview window. Unretweet removes a repost that already exists. ## Verify repost removal and timeline state Store `id` as the write action ID. Poll the same `statusUrl` until `terminal` becomes `true`. Store the account, source Tweet ID, request hash, billing, and both action IDs. Close already-removed actions without another request. Keep the prior repost state after a final failure. A cached timeline can lag behind the write result. X documents that delay in its [repost help](https://help.x.com/en/using-x/how-to-repost). ## Schedule repost cleanup without bulk unretweet Use your scheduler when a repost should end later. The endpoint accepts 1 Tweet ID per request. It has no bulk unretweet body. To delete retweets in a queue, approve each Tweet ID separately. ## Handle Twitter undo retweet errors Fix the ID or account after `400`. Replace Xquik authentication after `401`. Reconnect the account after `403`. Add credits after `402`. Review rejected input after `422`. Honor `Retry-After` after `429`. After `500` or `503`, check `safeToRetry` before retrying. Use `nextAction` to choose the next step. ## Twitter undo retweet questions ### How do I undo a retweet on Twitter with an API? Approve the account and source Tweet ID. Send this DELETE request. Poll until terminal. ### Can I undo recent, old, or several retweets? Submit recent or old removals individually. The X Premium Undo Post window does not limit this endpoint. ### Why can't I undo a retweet on Twitter? Check authentication, credits, account connection, and the source tweet. ### What happens to the tweet, engagement, and notifications? Unretweet keeps the source tweet and author intact. It does not change likes, replies, bookmarks, or source content. The action does not track notification delivery. Cached timelines can lag behind the terminal result. ### Do I use a Twitter archive, retweet icon, or delete button? A Twitter archive can help identify an old source Tweet ID. In X, use the green retweet icon for reposts. Use a delete button to delete tweets you published. Never delete the original source tweet during an unretweet. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send your Xquik API key. Generate one from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Authorization` | `string` | No | Send `Bearer ` instead of `x-api-key` when using OAuth 2.1. | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Source post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID that owns the repost. The `@` prefix is optional. | ## Response ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "unretweet", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "unretweet", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "x_rate_limited", "message": "X rate limited this account. Try again in about 15 minutes. Send fewer requests from this account." }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Update a profile picture, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/update-avatar Update a connected X account's profile picture. Upload a JPEG or PNG file up to 95 MiB. Or send an HTTPS image URL. Poll the write action. Costs 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/x/profile/avatar` This route updates one connected account's avatar. A request accepts a JPEG or PNG file. It can also use a fetchable HTTPS image URL. The maximum image size is 95 MiB. Xquik shrinks larger images under 700 KB for X. X recommends a 400 × 400 pixel profile picture. ## Update a Twitter profile picture through the API Call `PATCH /x/profile/avatar` to replace the square profile image. Use [Update Banner](/api-reference/x-write/update-banner) for the header image. Use [Update Profile](/api-reference/x-write/update-profile) for names and other public text fields. This route never retrieves another user's avatar. **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/x/profile/avatar \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: avatar-update-1895432178065391234" \ -F "account=myxaccount" \ -F "file=@avatar.png" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const fs = require("fs"); const FormData = require("form-data"); const form = new FormData(); form.append("account", "myxaccount"); form.append("file", fs.createReadStream("avatar.png")); const response = await fetch("https://xquik.com/api/v1/x/profile/avatar", { method: "PATCH", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "avatar-update-1895432178065391234", }, body: form, }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests with open("avatar.png", "rb") as f: response = requests.patch( "https://xquik.com/api/v1/x/profile/avatar", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "avatar-update-1895432178065391234", }, files={"file": ("avatar.png", f, "image/png")}, data={"account": "myxaccount"}, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "io" "mime/multipart" "net/http" "os" ) func main() { var buf bytes.Buffer writer := multipart.NewWriter(&buf) writer.WriteField("account", "myxaccount") file, err := os.Open("avatar.png") if err != nil { panic(err) } defer file.Close() part, err := writer.CreateFormFile("file", "avatar.png") if err != nil { panic(err) } io.Copy(part, file) writer.Close() req, err := http.NewRequest("PATCH", "https://xquik.com/api/v1/x/profile/avatar", &buf) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "avatar-update-1895432178065391234") req.Header.Set("Content-Type", writer.FormDataContentType()) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ```bash URL Upload theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/x/profile/avatar \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: avatar-url-update-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxaccount", "url": "https://example.com/avatar.png" }' | jq ``` ## Prepare a Twitter avatar image Choose one direct file or one fetchable HTTPS URL. Never send both sources. Accept only JPEG or PNG images. Reject GIF, WebP, and files above 95 MiB. Review the square crop before approval. Keep faces and important marks near the center. Use only images you own or may publish. Read X's [profile image guidance](https://help.x.com/articles/166743) before uploading. ## Automate a profile picture update Create one idempotency key for the selected account and image. Reuse it only after an exact network interruption. Generate a new key after changing the image or account. A 200 response is terminal. Poll `statusUrl` after 202 until `terminal` becomes true. Never start another avatar update before that result. ## Verify the updated Twitter profile image After a terminal write, use [Twitter Profile Lookup](/api-reference/x/twitter-profile-lookup). Open its `profilePicture` URL. Compare the rendered avatar with the approved source. Review the public square crop. Keep the action ID and verification timestamp. X may return a profile image URL like `https://pbs.twimg.com/profile_images/example.jpg`. | Profile avatar update column | Request or response source | Review rule | | - | - | - | | Acting X account | Request `account` | Confirm the intended profile. | | Uploaded file | Request `file` | Accept JPEG or PNG up to 95 MiB. | | Image URL | Request `url` | Use one fetchable HTTPS source. | | Source choice | `file` or `url` | Send exactly one image source. | | Idempotency key | Request header | Change it after editing the image. | | Write action ID | Response `id` | Poll the matching lifecycle record. | | Profile result | Later profile lookup | Confirm the public avatar URL. | ## Fix X (Twitter) profile picture API errors Fix invalid image fields after 400. Replace authentication after 401. Add credits after 402. Reconnect after 403. Connect a missing account after 404. Keep the original action after 409. Replace rejected media after 422. Honor `Retry-After` after 429. Check `safeToRetry` after 500 or 503. ## Twitter profile picture API questions ### How do I authenticate an avatar update? Send an `x-api-key` header or OAuth bearer token. The `account` field selects the connected profile. Never place credentials inside an image URL. ### Can I update several Twitter profile pictures in one request? No. Each request updates one connected account. Give each request its own idempotency key. Wait for each account's terminal result. ### Can I use usernames or user IDs for avatar updates? Yes. Set `account` to a connected username or numeric user ID. The selected user's profile receives the new image. Verify that identity before uploading. ### Can I update a Twitter profile image with Python or an SDK? Yes. Call the REST API with `import requests`, as shown above. Generated SDKs can send the same multipart file, account, API key, and idempotency key. ### Does this route retrieve Twitter profile pictures? No. It changes one connected account's avatar. Use Twitter Profile Lookup to retrieve a public `profilePicture` URL. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Use `multipart/form-data` for file uploads or `application/json` for URL uploads. Most HTTP clients set the multipart boundary automatically. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of your connected account to act as. | | `file` | `binary` | No | Multipart upload file. Required unless you send `url`. Send a JPEG or PNG up to 95 MiB. Xquik shrinks images over 700 KB. | | `url` | `string` | No | HTTPS image URL. Required unless you send `file`. The URL must use HTTPS and remain directly fetchable. | ## Response > [tab] 404 Account not found > > Connect the requested account, then submit a newly approved write. ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "update_avatar", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "update_avatar", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **413** `{ "error": "media_too_large", "message": "This image stays over X's size limit after shrinking. Send a smaller one." }` * **415** `{ "error": "unsupported_media_type", "message": "Xquik couldn't read this image. Send a valid image file." }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Update a profile banner, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/update-banner Update a connected X account's header image. Upload a JPEG or PNG up to 95 MiB at 1500 × 500 pixels. Or send an HTTPS URL. Poll the write action. 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/x/profile/banner` This route updates one connected account's header image. Upload a JPEG or PNG file, or provide a fetchable HTTPS image URL. The maximum file size is 95 MiB. Xquik shrinks larger files under 2 MB for X. X recommends 1500 × 500 pixels for profile banners. ## Update a Twitter profile banner through the API Call `PATCH /x/profile/banner` to replace the wide header image. Use [Update Avatar](/api-reference/x-write/update-avatar) for the profile picture. Use [Update Profile](/api-reference/x-write/update-profile) for names and other public text fields. This route never retrieves another user's banner. **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/x/profile/banner \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: banner-update-1895432178065391234" \ -F "account=myxaccount" \ -F "file=@banner.png" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const fs = require("fs"); const FormData = require("form-data"); const form = new FormData(); form.append("account", "myxaccount"); form.append("file", fs.createReadStream("banner.png")); const response = await fetch("https://xquik.com/api/v1/x/profile/banner", { method: "PATCH", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "banner-update-1895432178065391234", }, body: form, }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests with open("banner.png", "rb") as f: response = requests.patch( "https://xquik.com/api/v1/x/profile/banner", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "banner-update-1895432178065391234", }, files={"file": ("banner.png", f, "image/png")}, data={"account": "myxaccount"}, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "io" "mime/multipart" "net/http" "os" ) func main() { var buf bytes.Buffer writer := multipart.NewWriter(&buf) writer.WriteField("account", "myxaccount") file, err := os.Open("banner.png") if err != nil { panic(err) } defer file.Close() part, err := writer.CreateFormFile("file", "banner.png") if err != nil { panic(err) } io.Copy(part, file) writer.Close() req, err := http.NewRequest("PATCH", "https://xquik.com/api/v1/x/profile/banner", &buf) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "banner-update-1895432178065391234") req.Header.Set("Content-Type", writer.FormDataContentType()) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ```bash URL Upload theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/x/profile/banner \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: banner-url-update-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxaccount", "url": "https://example.com/banner.png" }' | jq ``` ## Prepare Twitter profile banner dimensions Use a 1500 × 500 pixel canvas. That size has a 3:1 aspect ratio and matches X's recommended header dimensions. Xquik resizes images outside 200x100 to 8192x8192 pixels. Accept only JPEG or PNG images. This route does not support animated GIFs. Review every export before uploading. Read X's [profile banner guidance](https://help.x.com/articles/166743) for current layout recommendations. Preview the banner on desktop and a mobile device. The profile picture can cover the bottom left corner. Keep faces, logos, and text outside that area. Other sizes or crops can hide parts of the artwork. Check the image size before queueing the write. Keep one 1500 × 500 source file for each approved campaign. Export banner images from that source. Do not resize previous uploads. Record the dimensions and final file size with the source. Use approved logos and colors. A banner change does not prove higher engagement. Measure profile visits and follows separately. ## Automate a Twitter banner update Create one idempotency key for the selected account and banner. Reuse it only after an exact network interruption. Generate a new key after changing the image or account. A 200 response is terminal. Poll `statusUrl` after 202 until `terminal` becomes true. ## Verify the updated Twitter banner After a terminal write, use [Twitter Profile Lookup](/api-reference/x/twitter-profile-lookup). Open its `profileBannerUrl` value. Compare the rendered header with the approved source. Check desktop and mobile crops. Store the action ID and verification timestamp. | Profile banner update column | Request or response source | Review rule | | - | - | - | | Acting X account | Request `account` | Confirm the intended profile. | | Uploaded file | Request `file` | Accept JPEG or PNG up to 95 MiB. | | Image URL | Request `url` | Use one fetchable HTTPS source. | | Source choice | `file` or `url` | Send exactly one image source. | | Idempotency key | Request header | Change it after editing the image. | | Write action ID | Response `id` | Poll the matching lifecycle record. | | Profile result | Later profile lookup | Confirm the public banner URL. | ## Fix X (Twitter) profile banner API errors Fix invalid image fields after 400. Replace authentication after 401. Add credits after 402. Reconnect after 403. Connect a missing account after 404. Keep the original action after 409. Replace rejected media after 422. Honor `Retry-After` after 429. Check `safeToRetry` after 500 or 503. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Use `multipart/form-data` for file uploads or `application/json` for URL uploads. Most HTTP clients set the multipart boundary automatically. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of your connected account to act as. | | `file` | `binary` | No | Multipart upload file. Required unless you send `url`. Send a JPEG or PNG up to 95 MiB. Xquik shrinks files over 2 MB. | | `url` | `string` | No | HTTPS image URL. Required unless you send `file`. The URL must use HTTPS and remain directly fetchable. | ## Response > [tab] 404 Account not found > > Connect the requested account, then submit a newly approved write. ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "update_banner", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "update_banner", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **413** `{ "error": "media_too_large", "message": "This image stays over X's size limit after shrinking. Send a smaller one." }` * **415** `{ "error": "unsupported_media_type", "message": "Xquik couldn't read this image. Send a valid image file." }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Update profile name, bio & URL, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/update-profile Update a Twitter profile bio, display name, location, or website through Xquik. Send only changed fields, poll the write action, and handle each response. > For the complete documentation index, see [llms.txt](/llms.txt). `PATCH https://xquik.com/api/v1/x/profile` This route updates public profile text. Change a display name, bio, location, or website in one request. Send only the fields that need new values. Omitted fields remain unchanged. The connected account receives every approved change. This route does not change a username, avatar, banner, or birth date. Use [Update Avatar](/api-reference/x-write/update-avatar) or [Update Banner](/api-reference/x-write/update-banner) for profile images. Read X's [profile customization guide](https://help.x.com/articles/166743) before updating profile text. ## Update Twitter profile text Call `PATCH /x/profile` to update Twitter profile fields from code. Provide the connected account plus at least 1 supported field. The `name` field changes the display name, not the `@username`. The `description` field changes the public bio. The `location` and `url` fields change their matching public labels. **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X PATCH https://xquik.com/api/v1/x/profile \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: profile-update-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{ "account": "myxaccount", "name": "New Display Name", "description": "Building cool things", "location": "San Francisco", "url": "https://example.com" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/profile", { method: "PATCH", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "profile-update-1895432178065391234", "Content-Type": "application/json", }, body: JSON.stringify({ account: "myxaccount", name: "New Display Name", description: "Building cool things", location: "San Francisco", url: "https://example.com", }), }); const data = await response.json(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.patch( "https://xquik.com/api/v1/x/profile", headers={ "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "profile-update-1895432178065391234", }, json={ "account": "myxaccount", "name": "New Display Name", "description": "Building cool things", "location": "San Francisco", "url": "https://example.com", }, ) data = response.json() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "account": "myxaccount", "name": "New Display Name", "description": "Building cool things", "location": "San Francisco", "url": "https://example.com", }) req, err := http.NewRequest("PATCH", "https://xquik.com/api/v1/x/profile", bytes.NewReader(body)) if err != nil { panic(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Idempotency-Key", "profile-update-1895432178065391234") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var data map[string]interface{} if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { panic(err) } fmt.Println(data) } ``` ## Review every profile field Review the exact display name, bio, location, and website before approval. Names allow 1 to 50 characters. Bios allow 160 characters. Locations allow 30 characters. Website values must be valid URLs. Empty `description` or `location` values clear those fields. An empty `name` or invalid URL returns 400. Keep API keys and private notes outside public profiles. | X profile text update column | Request or response source | Review rule | | - | - | - | | Acting X account | Request `account` | Confirm the intended profile. | | Display name | Request `name` | Keep 1 to 50 characters. | | Profile bio | Request `description` | Keep 160 characters or fewer. | | Location | Request `location` | Keep 30 characters or fewer. | | Website | Request `url` | Verify the public destination. | | Changed fields | Exact request keys | Leave unrelated profile fields absent. | | Idempotency key | Request header | Changed field values use another key. | | Write action ID | Response `id` | Poll the matching lifecycle record. | ## Automate a profile update Create one idempotency key for each account and field set. Reuse that key after a network interruption. Workers handling the same update must share it. Change the key after editing any value. A 200 response is terminal. Poll `statusUrl` after 202 until `terminal` becomes true. ## Coordinate updates across connected accounts Send one approved request for each connected X account. Give every request a key for its exact account and field set. Wait for an account's terminal result before starting its next profile change. Other accounts may update in parallel with different keys. Store the account, requested fields, request hash, write action ID, and status. Workers use this record to avoid duplicate profile updates. It also shows which display name, bio, location, or website each action changed. Give different teams their own API keys. Never share credentials between unrelated profile workflows. ## Verify the saved Twitter profile After a terminal write, use [Twitter Profile Lookup](/api-reference/x/twitter-profile-lookup). Compare its name, description, location, and website with the approved request. Profile updates never change posts, tweets, followers, replies, likes, or lists. For a campaign, save earlier values and restore them with a new key. Store the earlier and replacement values with the action ID. Apply the replacement at launch, then verify the public profile. Restore earlier fields with a new idempotency key after the campaign. With that history, you can reverse each temporary profile update. The write action shows the request finished. The later profile lookup shows the public result. Save both timestamps when profile changes need an audit trail. Never store authentication tokens with those public profile values. ## Fix X (Twitter) profile update failures Fix rejected fields after 400. Replace authentication after 401. Add credits after 402. Reconnect after 403. Connect a missing account after 404. Keep the original action after 409. Honor `Retry-After` after 429. Check `safeToRetry` after 500 or 503. Delete fake verification marks or unsafe profile links, then retry. X documents more causes in its [profile save troubleshooting guide](https://help.x.com/en/managing-your-account/cant-save-changes-to-my-account). Do not create a new action after a network error. Check the saved `statusUrl` before creating another action. The same request may reuse its original idempotency key. Change the key after correcting any field. Retry a server error only when `safeToRetry` allows it. ## X (Twitter) API update profile questions ### What endpoint changes a Twitter display name or bio? Send `name` or `description` to `PATCH /x/profile`. The `name` field changes the display name, not the `@username`. An empty `description` clears the bio. ### Can I automate recurring Twitter bio changes? Yes. Approve every replacement value. Use a new key for each scheduled change. Check the action and public profile. Keep the earlier bio for rollback. ### Can this X (Twitter) API change an account username? No. The `name` field changes only the public display name. It never changes the `@username` or numeric account ID. Keep username changes outside this workflow. ### Does a profile update change tweets or follower counts? No. Existing tweets, replies, followers, following, likes, lists, and communities stay unchanged. A later profile lookup may return those counts, but this route cannot edit them. ### Can this endpoint update a profile picture or banner? No. Use the dedicated avatar or banner route. Those endpoints validate image type and size separately. ### Which authentication works with this X (Twitter) API route? Use an `x-api-key` header or an OAuth bearer token. The chosen connected X account supplies the profile identity. Generated SDKs can send the same fields and headers. ### How should I schedule temporary profile changes? Check both values before adding them to the schedule. Use one key for the launch action and a different key for the rollback. Poll each action until terminal, then verify the public profile before continuing. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) username or account ID of your connected account to act as. | | `name` | `string` | No | Display name. Maximum 50 characters. | | `description` | `string` | No | Profile bio. Maximum 160 characters. | | `location` | `string` | No | Profile location. Maximum 30 characters. | | `url` | `string` | No | Website URL. Must be a valid URL. | ## Response > [tab] 404 Account not found > > Connect the requested account, then submit a newly approved write. ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "update_profile", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "update_profile", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Upload media for tweets & DMs, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x-write/upload-media Upload images, GIFs, and MP4 videos from a connected X account. Attach the mediaId to tweets, replies, or 1 direct message within 24 hours. 10 credits. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/media` **10 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. A sign-in that works keeps them, even if X then refuses the write. See [the X sign-in fee](/guides/billing#x-sign-in-fee). Call `POST /x/media`. The route accepts one local file or hosted HTTPS media URL. Each request uses one connected X account. A completed upload returns a media ID and reusable `mediaUrl`. Skip this endpoint when a tweet already has public HTTPS media URLs. Call [Create Tweet](/api-reference/x-write/create-tweet) directly with those URLs. ## Use the X (Twitter) API upload media workflow Send `multipart/form-data` for a file. Send `application/json` for a hosted URL. Authenticate with an API key or OAuth bearer token. Add one `Idempotency-Key` per intended upload. Any HTTP client works. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/media \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: media-upload-1895432178065391234" \ -F "account=myxhandle" \ -F "file=@/path/to/image.png" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const form = new FormData(); form.append("account", "myxhandle"); form.append("file", new Blob([fileBuffer]), "image.png"); const response = await fetch("https://xquik.com/api/v1/x/media", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": "media-upload-1895432178065391234", }, body: form, }); if (!response.ok) { throw new Error(await response.text()); } const { mediaId, mediaUrl } = await response.json(); ``` ### Upload a hosted media URL ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/media \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: media-url-1895432178065391234" \ -H "Content-Type: application/json" \ -d '{"account": "myxhandle", "url": "https://example.com/image.png"}' | jq ``` Both inputs return the same lifecycle record. Poll `statusUrl` after 202. Store `mediaId`, `mediaUrl`, the account, and the idempotency key. ## Handle media types, large videos & multiple images Supported media files include AVIF, GIF, JPEG, PNG, WebP, and MP4. Match the content type to the file. Use a public URL. Xquik rejects private and reserved addresses. The download timeout is 30 seconds. The file limit is 15,728,640 bytes. Xquik shrinks images over 5 MiB to fit X. GIFs and videos go to X unchanged. An unreadable image returns `415 unsupported_media_type`. An image Xquik can't shrink enough returns `413 media_too_large`. Set `is_long_video` to `true` for MP4 files longer than 140 seconds. Xquik handles the chunked upload and media category. Send one request, then poll its lifecycle. For multiple images, call once per file. Collect up to 4 `mediaId` values. Send them together in Create Tweet `media_ids`. DMs accept exactly 1 media ID. Media IDs expire 24 hours after upload. Schedulers that post later store `mediaUrl` until send time. This endpoint does not schedule tweets. ## Store the X (Twitter) API media upload receipt | Output | Next request | Rule | | - | - | - | | `mediaUrl` | Tweet or reply `media` | Send up to 4 image URLs or 1 MP4 URL up to 100 MB. | | `mediaId` | Tweet or reply `media_ids` | Send up to 4 image IDs or 1 video ID within 24 hours. | | `mediaId` | DM `media_ids` | Send exactly 1 media ID. | Store the account, success, source reference, and idempotency key with each receipt. For replies, add `reply_to_tweet_id` in Create Tweet. Send `mediaUrl` values in `media` or `mediaId` values in `media_ids`, never both. Tweet and reply writes cost 30 credits, plus media surcharges. DM writes cost 10 credits. ## Fix X (Twitter) media upload API errors Fix invalid fields or content types after 400. Replace credentials after 401. Add credits after 402. Reconnect the X account after 403. Connect a missing account after 404. Keep the original action after 409. Replace unreachable or private URLs after `422 media_download_failed`. Replace rejected media after other 422 errors. Honor `Retry-After` after 429. Check `safeToRetry` after 500 or 503. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. OAuth bearer authentication is also supported. Generate a key from the [dashboard](https://dashboard.xquik.com/en/api-keys). | | `Idempotency-Key` | `string` | Yes | Unique key for this intended write. Reuse it only for an exact network replay. | | `Content-Type` | `string` | Yes | Use `multipart/form-data` when uploading a file. Use `application/json` when providing a URL. | ## Body | Body parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | A connected X (Twitter) username or account ID. The account performs the upload. | | `file` | `binary` | No | Required without `url`. Accepts AVIF, GIF, JPEG, PNG, WebP, or MP4. | | `url` | `string` | No | Required without `file`. Provide a public HTTPS URL. AI agents and MCP clients can send URLs instead of binary uploads. | | `is_long_video` | `boolean` | No | Multipart MP4 uploads only. Set `true` when the video exceeds 140 seconds. Defaults to `false`. | ## Response > [tab] 404 Account not found > > Connect the requested account, then submit a newly approved write. ## Durable write recovery > [!WARNING] > > Send one unique `Idempotency-Key` per intended write. > Replay the same account, target, payload, and media after a lost response. > Keep the original key for that replay. 1. Store `id`, the nested `hash` in `request`, `billing`, and `statusUrl`. 2. Poll after `Retry-After` or `pollAfterMs` when `terminal` is `false`. 3. Retry only when `safeToRetry` is `true`. 4. Use a new key when `nextAction.requiresNewIdempotencyKey` is `true`. ### 200 terminal or 202 active * After HTTP `200`, store the result and settled billing. * After HTTP `202`, poll the same action. Never submit another write. * After HTTP `400`, fix the named field. Use a new idempotency key. * After HTTP `401`, fix authentication. Do not retry unchanged. * After HTTP `402`, fund the account before another write. * After HTTP `403`, reconnect the account. * After HTTP `409`, keep the original action. Use a new key for new input. * After HTTP `422`, fix the rejected request before retrying. * After HTTP `429`, wait for `Retry-After`. Follow `nextAction`. See [Get Write Action Status](/api-reference/x-write/get-write-action-status) for every lifecycle field and terminal state. That page also lists every billing field and retry rule. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12345", "writeActionId": "12345", "action": "upload_media", "status": "success", "terminal": true, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12345", "pollAfterMs": null } ``` ### 202 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "object": "x_write_action", "id": "12346", "writeActionId": "12346", "action": "upload_media", "status": "dispatching", "terminal": false, "retryable": false, "safeToRetry": false, "statusUrl": "/api/v1/x/write-actions/12346", "pollAfterMs": 2000 } ``` * **400** `{ "error": "missing_idempotency_key", "message": "Idempotency-Key is required. Generate one unique key for this write.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **409** `{ "error": "idempotency_conflict", "message": "Idempotency-Key was already used with a different request.", "charged": false, "chargedCredits": "0", "retryable": false, "safeToRetry": true }` * **413** `{ "error": "media_too_large", "message": "This image stays over X's size limit after shrinking. Send a smaller one." }` * **415** `{ "error": "unsupported_media_type", "message": "Xquik couldn't read this image. Send a valid image file." }` * **422** `{ "error": "x_rejected", "message": "X rejected this request. Check what you sent & the account on x.com before you try again." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **500** `{ "error": "x_write_failed", "message": "Write action failed unexpectedly. Contact support if this persists." }` * **503** `{ "error": "write_tracking_unavailable", "message": "Write tracking unavailable. Try again.", "charged": false, "chargedCredits": "0", "retryable": true, "safeToRetry": true }` # Batch tweet lookup by ID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/batch-tweets Retrieve many tweets by ID or link in one request with full text, authors, media, reply and quote context, engagement metrics, and URLs. 1 credit per tweet. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets` > [!NOTE] > > Repost records include `retweetedAt`, the repost event's UTC ISO 8601 timestamp. It is `null` when > that timestamp is unavailable. The API omits it for original posts. The nested original post keeps > its own creation date. This field does not report every account that reposted a post. [Request > per-account timestamps with Get retweeters.](/api-reference/x/retweeters#retweet-timestamps) ## When to use batch lookup Use this route to look up many tweet IDs at once. It charges only for returned tweets. Use list-tweets when reading a list feed instead. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per tweet returned** · Accepts account credits and guest `paid_reads` ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets?ids=1893456789012345678,1893456789012345679" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const ids = ["1893456789012345678", "1893456789012345679"]; const response = await fetch(`https://xquik.com/api/v1/x/tweets?ids=${ids.join(",")}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const tweetsById = new Map(data.tweets.map((tweet) => [tweet.id, tweet])); const tweetRows = data.tweets.map((tweet) => { const author = tweet.author ?? {}; return { requested_ids: ids, tweet_id: tweet.id, text: tweet.text, author_id: author.id ?? null, author_username: author.username ?? null, author_name: author.name ?? null, author_followers: author.followers ?? null, author_verified: author.verified ?? null, author_profile_picture: author.profilePicture ?? null, created_at: tweet.createdAt ?? null, conversation_id: tweet.conversationId ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, quote_count: tweet.quoteCount ?? null, media_urls: tweet.media?.map((item) => item.mediaUrl).filter(Boolean) ?? [], has_next_page: data.has_next_page, next_cursor: data.next_cursor || null, }; }); const missingIds = ids.filter((id) => !tweetsById.has(id)); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests ids = ["1893456789012345678", "1893456789012345679"] response = requests.get( "https://xquik.com/api/v1/x/tweets", params={"ids": ",".join(ids)}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() tweets_by_id = {tweet["id"]: tweet for tweet in data["tweets"]} tweet_rows = [] for tweet in data["tweets"]: author = tweet.get("author") or {} tweet_rows.append( { "requested_ids": ids, "tweet_id": tweet["id"], "text": tweet["text"], "author_id": author.get("id"), "author_username": author.get("username"), "author_name": author.get("name"), "author_followers": author.get("followers"), "author_verified": author.get("verified"), "author_profile_picture": author.get("profilePicture"), "created_at": tweet.get("createdAt"), "conversation_id": tweet.get("conversationId"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "quote_count": tweet.get("quoteCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], "has_next_page": data["has_next_page"], "next_cursor": data["next_cursor"] or None, } ) missing_ids = [tweet_id for tweet_id in ids if tweet_id not in tweets_by_id] ``` The Node.js and Python snippets build tweet rows. They do not print full response pages. Store `tweetRows` or `tweet_rows` and `missingIds` or `missing_ids` with the original ID list. Retries then request only missing tweets. ## Direct batch tweet handoff Use `GET /x/tweets` when a workflow already has tweet IDs. It can be a CRM, warehouse, newsroom, moderation queue, or agent workflow. One response returns tweet text, authors, metrics, media URLs, and missing-ID handling. Use [Get Tweet](/api-reference/x/get-tweet) for one tweet by ID. Use [Search Tweets](/api-reference/x/search-tweets) to find tweets by query. Store `requested_ids`, `tweet_id`, `text`, `author_id`, `author_username`, `author_name`, `author_followers`, `author_verified`, `author_profile_picture`, `created_at`, and `conversation_id`. Also store engagement counts, media URLs, `has_next_page`, and `next_cursor`. Join returned tweets by `tweet_id`. Do not rely on response order. Send as many IDs as fit in 1 URL. Batch requests always return `has_next_page: false` and `next_cursor: ""`. Zero affordable results return `402 insufficient_credits`. ## Store exact batch lookup results Keep the original request order separately. Join tweets by numeric Tweet ID because unavailable or unaffordable IDs can be absent. | Batch lookup column | Response source | Reconciliation rule | | - | - | - | | `batch_id` | Integration value | Group every requested and returned Tweet ID. | | `requested_tweet_id` | Parsed `ids` input | Keep all requested IDs, including missing ones. | | `tweet_id` | `tweets[].id` | Join a returned tweet to its request row. | | `text` | `tweets[].text` | Keep the returned tweet or Note Tweet text. | | `author_id` | `tweets[].author.id` | Keep a stable author key. | | `author_username` | `tweets[].author.username` | Display the returned author handle. | | `created_at` | `tweets[].createdAt` | Keep the tweet publication time. | | `conversation_id` | `tweets[].conversationId` | Join returned tweets to conversation workflows. | | `media_urls` | `tweets[].media[].mediaUrl` | Keep image and video URLs for returned tweets. | | `lookup_status` | Derived from returned IDs | Set `returned` or `missing` for every requested ID. | | `has_next_page` | Response value | Expect `false` for an exact batch request. | | `next_cursor` | Response value | Expect an empty string. Never paginate an exact batch. | | Input or result condition | Handling | | - | - | | A URL too long to send | Split the IDs into more requests. | | Duplicate Tweet IDs | Deduplicate before sending. Keep source references separately. | | Returned Tweet ID | Store the normalized row under the matching request ID. | | Missing Tweet ID | Keep a missing row for targeted retry or review. | | Low credit balance | Accept a smaller returned set and mark the missing IDs. | | Zero affordable results | Stop on `402 insufficient_credits` and fund the account before retrying. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `ids` | `string` | Yes | Tweets, separated by commas. Each is a tweet ID or a tweet URL, such as `x.com/nasa/status/20`. A tweet named twice is read once. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account API key. Session cookie and OAuth authentication are also supported. | | `Authorization` | `string` | No | Send `Bearer xq_your_guest_key_here` for an active `paid_reads` guest key. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of tweets matching the requested IDs. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if unavailable. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if unavailable. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author handle without `@`. | | `tweets[].author.name` | `string` | Author display name. Omitted if unavailable. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted when the tweet has no media. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Always `false` for batch requests. | | `next_cursor` | `string` | Always empty for batch requests. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Hello world!", "createdAt": "2026-03-27T10:00:00.000Z", "likeCount": 42, "retweetCount": 5, "author": { "id": "9876543210", "username": "username", "name": "Xquik", "followers": 12000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": false, "next_cursor": "" } ``` ### 400 Missing IDs `{ "error": "missing_ids", "message": "ids parameter required" }` ### 400 Invalid tweet ID `{ "error": "invalid_tweet_id", "message": "Send ids as tweet IDs or tweet links, separated by commas." }` An entry of `ids` names no tweet. Send each entry as a tweet ID or a tweet URL. The request costs nothing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Full account keys can receive `no_subscription`, `subscription_inactive`, `no_credits`, or `insufficient_credits` with account payment options. Guest keys receive only the guest top-up action. The failed request creates no checkout. Ask the user to confirm before calling any checkout or top-up route. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Batch Users](/api-reference/x/batch-users) · [Get Tweet](/api-reference/x/get-tweet) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Batch user timeline lookup, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/batch-user-tweets Read the newest tweets of many X (Twitter) users in one request. It returns full text, authors, media, and engagement metrics. 1 credit per tweet returned. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/batch/tweets` > [!NOTE] > > Repost records include `retweetedAt`, the repost event's UTC ISO 8601 timestamp. It is `null` when > that timestamp is unavailable. The API omits it for original posts. The nested original post keeps > its own creation date. This field does not report every account that reposted a post. [Request > per-account timestamps with Get retweeters.](/api-reference/x/retweeters#retweet-timestamps) ## When to use the batch timeline This route reads the newest tweets of many users at once. It charges only for returned tweets. Use [Get user timeline](/api-reference/x/user-tweets) to page through 1 user's older tweets. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per tweet returned** · Accepts account credits and guest `paid_reads` ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/batch/tweets?usernames=nasa,openai&pageSize=5" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const usernames = ["nasa", "openai"]; const params = new URLSearchParams({ usernames: usernames.join(","), pageSize: "5" }); const response = await fetch(`https://xquik.com/api/v1/x/users/batch/tweets?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); if (!response.ok) throw new Error(JSON.stringify(data)); const tweetRows = data.tweets.map((tweet) => ({ tweet_id: tweet.id, text: tweet.text, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? null, is_pinned: tweet.isPinned ?? false, })); const sendAgain = data.unprocessed_ids; const skip = data.unavailable_ids; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests usernames = ["nasa", "openai"] response = requests.get( "https://xquik.com/api/v1/x/users/batch/tweets", params={"usernames": ",".join(usernames), "pageSize": 5}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() if not response.ok: raise RuntimeError(data) tweet_rows = [ { "tweet_id": tweet["id"], "text": tweet["text"], "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "created_at": tweet.get("createdAt"), "like_count": tweet.get("likeCount"), "is_pinned": tweet.get("isPinned", False), } for tweet in data["tweets"] ] send_again = data["unprocessed_ids"] skip = data["unavailable_ids"] ``` The Node.js and Python snippets build tweet rows. They do not print full response pages. Send `unprocessed_ids` again. Skip `unavailable_ids`. ## Several timelines in 1 call Tweets arrive user by user, in the order you named the users. Each user's tweets are newest first, after the pinned tweet. Group rows by `author.id`. A call returns up to 20 tweets per user. Set `pageSize` to return fewer, or up to 300. A batch returns 1 page, so `has_next_page` is `false` & `next_cursor` is empty. | Result | Where it appears | What to do | | - | - | - | | Tweets were read | `tweets` | Store the rows. Each costs 1 credit. | | No account on X | `unavailable_ids` | Skip the user. It costs nothing. | | Protected tweets | `unavailable_ids` | Skip the user. It costs nothing. | | The read failed | `unprocessed_ids` | Send the user again. It costs nothing. | | The call ran out of time | `unprocessed_ids` | Send the user again. It costs nothing. | | Credits ran out | `unprocessed_ids` | Add credits, then send the user again. | A user with no tweets appears in neither list & adds no rows. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `ids` | `string` | No | Comma-separated numeric user IDs. Send `ids` or `usernames`, not both. A user named twice is read once. | | `usernames` | `string` | No | Comma-separated X (Twitter) usernames or profile links such as `x.com/nasa`, in place of `ids`. A username works with or without `@`. A name in another case is the same account. A number is a user ID, up to 19 digits. | | `pageSize` | `integer` | No | Tweets per user. Accepts `1-300`. Defaults to `20`. Also read as `limit`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account API key. Session cookie and OAuth authentication are also supported. | | `Authorization` | `string` | No | Send `Bearer xq_your_guest_key_here` for an active `paid_reads` guest key. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Each user's newest tweets, in the order the users were named. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author handle without `@`. | | `tweets[].author.name` | `string` | Author display name. Omitted if unavailable. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted when the tweet has no media. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Always `false` for batch requests. | | `next_cursor` | `string` | Always empty for batch requests. | | `unavailable_ids` | `string[]` | Users with no account on X or with protected tweets. They cost nothing. Skip them. | | `unprocessed_ids` | `string[]` | Users the call did not read. They cost nothing. Send them again. | Both lists name each user as you sent it, by ID or username. A profile link is named by its username. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Hello world!", "createdAt": "2026-03-27T10:00:00.000Z", "likeCount": 42, "retweetCount": 5, "author": { "id": "9876543210", "username": "username", "name": "Xquik", "followers": 12000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": false, "next_cursor": "", "unavailable_ids": ["1234567890"], "unprocessed_ids": [] } ``` ### 400 Missing IDs `{ "error": "missing_ids", "message": "Send ids or usernames, such as ids=11348282 or usernames=nasa." }` Send `ids` or `usernames`. ### 400 Invalid user IDs `{ "error": "invalid_user_ids", "message": "usernames must contain X usernames or profile links such as x.com/nasa." }` Each `ids` value must be a numeric user ID. Each `usernames` value must be a username or a profile link. Profile links must be on x.com or twitter.com. Sending both `ids` & `usernames` also answers 400. The request costs nothing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Full account keys can receive `no_subscription`, `subscription_inactive`, `no_credits`, or `insufficient_credits` with account payment options. Guest keys receive only the guest top-up action. The failed request creates no checkout. Ask the user to confirm before calling any checkout or top-up route. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 No user could be read No user's tweets could be read. The request costs nothing. Wait for the `Retry-After` header, then send it again. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get user timeline](/api-reference/x/user-tweets) · [Batch Users](/api-reference/x/batch-users) · [Batch Tweets](/api-reference/x/batch-tweets) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Batch user profile lookup, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/batch-users Retrieve many X user profiles by ID, username or link in one request, with bios, verification state, follower counts, and profile media. 1 credit per user. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/batch` See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per user returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/batch?ids=44196397,987654321" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const ids = ["44196397", "987654321"]; const response = await fetch(`https://xquik.com/api/v1/x/users/batch?ids=${ids.join(",")}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const profileRows = data.users.map((user) => ({ user_id: user.id, username: user.username, display_name: user.name, bio: user.description ?? null, follower_count: user.followers ?? null, following_count: user.following ?? null, verified: user.verified ?? false, profile_image_url: user.profilePicture ?? null, })); const retryNow = data.failed_ids; const retryAfterCredits = data.unprocessed_ids; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests ids = ["44196397", "987654321"] response = requests.get( "https://xquik.com/api/v1/x/users/batch", params={"ids": ",".join(ids)}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() profile_rows = [ { "user_id": user["id"], "username": user["username"], "display_name": user["name"], "bio": user.get("description"), "follower_count": user.get("followers"), "following_count": user.get("following"), "verified": user.get("verified", False), "profile_image_url": user.get("profilePicture"), } for user in data["users"] ] retry_now = data["failed_ids"] retry_after_credits = data["unprocessed_ids"] ``` The Node.js and Python snippets build profile rows. They do not print full profile objects. Store `profileRows` or `profile_rows` with the original ID list. Retry `failed_ids` now. Retry `unprocessed_ids` after adding credits. Skip `unavailable_ids`, which have no profile on X. ## Direct batch user handoff Use `GET /x/users/batch` when a workflow already has numeric X user IDs. It can be a CRM, warehouse, enrichment, lead scoring, or agent workflow. One JSON response returns the profile details. Use [Get User](/api-reference/x/twitter-profile-lookup) when you have one ID or username to resolve. Store `requested_ids`, `user_id`, `username`, `display_name`, profile metrics, verification state, `profile_image_url`, `has_next_page`, and `next_cursor`. Join returned users by `user_id`. Do not rely on response order. Send as many IDs as fit in 1 URL. Batch requests always return `has_next_page: false` and `next_cursor: ""`. Zero affordable results return `402 insufficient_credits`. > [card] Known IDs > > Send comma-separated X user IDs in `ids`. Keep the original list as > `requested_ids` for retry and audit rows. > [card] Profile rows > > Store each returned `id` as `user_id`. Store `username`, `name`, > `description`, `followers`, `following`, `verified`, and `verifiedType` > with it. > [card] Missing rows > > Retry `failed_ids` now & `unprocessed_ids` after adding credits. Skip > `unavailable_ids`, which have no profile on X. With `usernames`, these > lists name usernames as sent and profile links by their usernames. > [card] No pagination > > A batch returns one page, with `has_next_page: false` and > `next_cursor: ""`. Do not paginate it. ## Which lookup endpoint? > [card] One profile > > Use [`GET /x/users/{id}`](/api-reference/x/twitter-profile-lookup) for one username or one > user ID. > [card] Many known IDs > > Use `GET /x/users/batch` for many comma-separated user IDs, > usernames, or profile links. Send them in one request. > [card] Name or partial handle > > Use [`GET /x/users/search`](/api-reference/x/search-users) before batch > lookup when you have a name, brand, or handle fragment. > [card] Tweet IDs > > Use [`GET /x/tweets?ids=`](/api-reference/x/batch-tweets) when the input > list contains tweet IDs instead of user IDs. > [card] Audience pages > > Use [`GET /x/users/{id}/followers`](/api-reference/x/followers) or > [`GET /x/users/{id}/following`](/api-reference/x/following) when the job > starts from an account audience. > [card] Saved exports > > Use [`Create extraction`](/api-reference/extractions/create) when the source > is a job instead of an existing ID list. It can be a follower, following, > timeline, media, or search job. ## Enrich a known set of user IDs Use batch lookup after another workflow already identified exact profiles. Examples include follower exports, tweet authors, community members, or CRM records. Prepare one deduplicated ID list. Keep the original source beside each ID. After lookup, map every returned profile back to its source row. These enrichment fields are useful. * Current username and profile name. * Biography, location, and verification state. * Follower and following counts. * Profile image and account creation time. Mark missing IDs as missing. Do not shift remaining profiles into another row's position. Join responses by numeric user ID. Split oversized workloads into supported batches. Save each completed batch before starting the next. A failed enrichment job can then resume from the last saved batch. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `ids` | `string` | No | Comma-separated numeric user IDs. Send `ids` or `usernames`, not both. | | `usernames` | `string` | No | Comma-separated X (Twitter) usernames or profile links such as `x.com/nasa`, in place of `ids`. A username works with or without `@`. A name in another case is the same account. A link & a username for 1 account are read once. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of user profiles matching the requested IDs. | | `users[].id` | `string` | X (Twitter) user ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. | | `users[].followers` | `number` | Follower count. | | `users[].following` | `number` | Following count. | | `users[].verified` | `boolean` | Verified status. | | `users[].profilePicture` | `string` | Profile image URL. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. | | `users[].accountBasedIn` | `object \| null` | Country or region X shows for the account, with `value`, `level` & `observedAt`. X infers it from account access. It states no nationality or exact location. `null` when X shows none. Omitted when it's not available yet. | | `users[].accountBasedInUnavailable` | `boolean` | `true` when `accountBasedIn` is not available yet. Retry later to get it. Omitted otherwise. | | `users[].createdAt` | `string` | Account creation date (ISO 8601). | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].email` | `string` | First email the account publishes on its profile, lowercased. Omitted when it publishes none. | | `users[].contactInfo` | `object` | Emails, phone numbers & links the account publishes on its own profile. Each email has `value`, `domain` & `source`. Each phone has `value` & `source`. Each link has `url`, `network` & `source`. `source` is the profile field that holds it, such as `bio` or `url`. `writtenAs` keeps the account's own spelling of a spelled-out email or number. Omitted when the profile publishes none. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | IDs of pinned tweets. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Always `false` for batch requests. | | `next_cursor` | `string` | Always empty for batch requests. | | `unavailable_ids` | `string[]` | IDs with no profile on X. Skip them. | | `failed_ids` | `string[]` | IDs that failed to load. They cost nothing. Retry them. | | `unprocessed_ids` | `string[]` | IDs skipped for low credits. Retry them after adding credits. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "44196397", "username": "elonmusk", "name": "Elon Musk", "followers": 200000000, "verified": true } ], "has_next_page": false, "next_cursor": "" } ``` ### 400 Missing IDs `{ "error": "missing_ids", "message": "Send ids or usernames, such as ids=11348282 or usernames=nasa." }` ### 400 Invalid usernames `{ "error": "invalid_user_ids", "message": "usernames must contain X usernames or profile links such as x.com/nasa." }` Each `usernames` value must be a username or a profile link. Profile links must be on x.com or twitter.com. A post link, a user ID link, or another site answers 400. So does the text `undefined` or `null`. Send a user ID in `ids`. The request costs nothing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Batch Tweets](/api-reference/x/batch-tweets) · [Get User](/api-reference/x/twitter-profile-lookup) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # List bookmark folders, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/bookmark-folders List X (Twitter) bookmark folders by ID and name. Export each folder's saved tweets with authors, replies, likes, reposts, views, media & cursor checkpoints. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/bookmarks/folders` > [!NOTE] > > List X (Twitter) bookmark folders for one connected account. Each row contains a > folder ID and name for a saved tweet export. [X documents bookmark folders as > private, authenticated-user content.](https://docs.x.com/x-api/posts/bookmarks/introduction) **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit The route reads bookmark folders through your connected X account. Without one, it returns `424 account_required`. Use [Connect X account](/api-reference/x-accounts/connect) to add one. When your connected X accounts are busy, it returns `503`. Retry after the `Retry-After` delay. X shows bookmark folders only to X Premium accounts. For any other account, the route returns `424 bookmark_folders_unavailable`, & a retry returns the same. Upgrade that account on X, or read all saved tweets with [Bookmarks](/api-reference/x/bookmarks) without `folderId`. Use folder IDs from this response with `GET /x/bookmarks?folderId=...` to read a folder's saved tweets. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/bookmarks/folders \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/bookmarks/folders", { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const data = await response.json(); const folderRows = data.folders.map((folder) => ({ folder_id: folder.id, folder_name: folder.name, bookmarks_endpoint: `/x/bookmarks?folderId=${encodeURIComponent(folder.id)}`, has_more_folders: data.has_next_page, })); for (const row of folderRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/x/bookmarks/folders", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) data = response.json() folder_rows = [ { "folder_id": folder["id"], "folder_name": folder["name"], "bookmarks_endpoint": f"/x/bookmarks?folderId={folder['id']}", "has_more_folders": data["has_next_page"], } for folder in data["folders"] ] for row in folder_rows: print(json.dumps(row)) ``` The Node.js and Python snippets build bookmark folder rows. They do not print the full response. Store `folderRows` or `folder_rows`. Then pass `folder_id` into `GET /x/bookmarks?folderId=...`. ## Direct bookmark folder handoff Use `GET /x/bookmarks/folders` for an authenticated X account. It serves a saved-tweet workflow, CRM enrichment job, research queue, or agent. Store `folder_id` and `folder_name` with the connected account ID. The route returns one folder page. `has_next_page` stays `false`, and `next_cursor` stays empty. Use each folder ID with [Bookmarks](/api-reference/x/bookmarks) to fetch its saved tweets. ## Twitter bookmark folder workflow ### 1. Discover existing folders Call the route with the connected account's Xquik API key. It lists that account's private folders. It cannot create, rename, move, or delete folders. An empty `folders` array means the X Premium account has no folders. ### 2. Build a folder index Use `folder_id` as the stable join key. Folder names can change or repeat. Protect folder names like saved tweets. Exclude them from public logs, URLs, and shared filenames. ### 3. Export saved tweets by folder Pass each folder ID to `GET /x/bookmarks?folderId=...`. Saved tweet rows can include text, authors, likes, replies, reposts, views, media, and cursors. Write the folder ID beside every row to keep folder membership. ### 4. Resume and audit the export The folder list has no next page. The bookmarked-tweet route paginates per folder. Store its `next_cursor`, collection time, and connected account ID. ## Export Twitter bookmark folders Every folder list is a snapshot for one account. Compare folder IDs with the preceding snapshot. Match renamed folders by ID. A missing ID only means the current snapshot omitted it. Keep prior exports until verification. ### Store one checkpoint per folder Store the folder ID, bookmark cursor, completion state, and collection time. Retry only the incomplete folder after `424`, `429`, or `502` responses. Upsert rows by account, folder, and tweet IDs. Save every row before advancing the cursor. ### Define folder export records Store `account_id`, `folder_id`, and `folder_name` beside each saved tweet. Keep tweet, author, engagement, media, and timestamp fields. Store `source_cursor` beside each page. Validate IDs before exporting to a spreadsheet, CRM, research queue, or storage system. ## Twitter bookmark folder questions ### Do Twitter bookmarks have folders? Yes, for X Premium accounts. This endpoint lists the named folders visible to the connected account. ### Can this API create or rename bookmark folders? No. This route only reads folder IDs and names. ### Can I access folders from mobile and desktop? Yes. The endpoint works independently of the device. It returns folders available to the connected account. ### How do I back up Twitter bookmark folders? Save the folder index as JSON Lines or CSV. Export each folder's saved tweets. Join both files by `folder_id`. Include the account ID and collection time. ### What errors can stop a folder export? A `401` response means the key cannot access the connected account. A `402` response requires more credits. Respect retry guidance in a `429` response. `424 account_required` means you have no connected X account. `424 bookmark_folders_unavailable` means the account has no X Premium. Retry other `424`, `502` & `503` read failures later. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pass `next_cursor` from the previous page. Omit it for the first page. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `folders` | `object[]` | Array of bookmark folders. | | `folders[].id` | `string` | This value contains the folder ID. | | `folders[].name` | `string` | This value contains the folder name. | | `folders[].media` | `object` | Public folder cover image metadata. Omitted if unavailable. | | `has_next_page` | `boolean` | Always `false` for the bookmark folder route. | | `next_cursor` | `string` | Always an empty string for the bookmark folder route. | > [!NOTE] > > **Related.** [Bookmarks](/api-reference/x/bookmarks) · [Timeline](/api-reference/x/timeline) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "folders": [ { "id": "1234567890", "media": { "originalImageUrl": "https://pbs.twimg.com/media/cover.jpg" }, "name": "Read Later" } ], "has_next_page": false, "next_cursor": "" } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Export saved tweet bookmarks, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/bookmarks Export Twitter bookmarks with tweet text, authors, replies, likes, reposts, views, media, folders, CSV rows & cursor checkpoints from one connected account. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/bookmarks` > [!NOTE] > > Export Twitter bookmarks from one connected account. The route > returns saved tweets, authors, likes, replies, reposts, views, media, and > cursor checkpoints. [The X (Twitter) developer reference defines bookmarks as > private, authenticated-user content.](https://docs.x.com/x-api/posts/bookmarks/introduction) Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit The route reads bookmarks through your connected X account. Without one, it returns `424 account_required`. Use [Connect X account](/api-reference/x-accounts/connect) to add one. When your connected X accounts are busy, it returns `503`. Retry after the `Retry-After` delay. Folder reads need X Premium. For any other account, `folderId` returns `424 bookmark_folders_unavailable`. Omit `folderId` to read all bookmarks. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/bookmarks \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq # Page 2 curl -G https://xquik.com/api/v1/x/bookmarks \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const bookmarkFolderId = ""; // Set to a folder ID to export one folder. const baseUrl = "https://xquik.com/api/v1/x/bookmarks"; let pageCursor = ""; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = new URLSearchParams(); if (bookmarkFolderId !== "") params.set("folderId", bookmarkFolderId); if (pageCursor !== "") params.set("cursor", pageCursor); const query = params.toString(); const response = await fetch(query === "" ? baseUrl : `${baseUrl}?${query}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); const bookmarkRows = page.tweets.map((tweet) => ({ bookmark_source: bookmarkFolderId === "" ? "all_bookmarks" : "folder", folder_id: bookmarkFolderId || null, tweet_id: tweet.id, tweet_url: tweet.url ?? null, text: tweet.text, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, quote_count: tweet.quoteCount ?? null, view_count: tweet.viewCount ?? null, media_urls: (tweet.media ?? []).map((item) => item.mediaUrl).filter(Boolean), page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, })); for (const row of bookmarkRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests bookmark_folder_id = "" # Set to a folder ID to export one folder. page_cursor = "" for page_index in range(3): params = {} if bookmark_folder_id: params["folderId"] = bookmark_folder_id if page_cursor: params["cursor"] = page_cursor response = requests.get( "https://xquik.com/api/v1/x/bookmarks", params=params, headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: bookmark_row = { "bookmark_source": "all_bookmarks" if not bookmark_folder_id else "folder", "folder_id": bookmark_folder_id or None, "tweet_id": tweet["id"], "tweet_url": tweet.get("url"), "text": tweet["text"], "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "author_name": (tweet.get("author") or {}).get("name"), "author_followers": (tweet.get("author") or {}).get("followers"), "author_verified": (tweet.get("author") or {}).get("verified"), "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"), "created_at": tweet.get("createdAt"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "quote_count": tweet.get("quoteCount"), "view_count": tweet.get("viewCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page["next_cursor"], "has_next_page": page["has_next_page"], } print(json.dumps(bookmark_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## Bookmarks handoff Use `GET /x/bookmarks` when a caller needs saved tweets from the authenticated account. The caller can be a reading list, CRM, research queue, or agent. The examples write JSON Lines rows. Each row has bookmark source, folder ID, tweet ID, tweet URL, and text. It also has author ID, username, display name, follower count, and verified state. It also has profile image URL, engagement counts, media URLs, and cursor fields. Store the last saved `next_cursor` per folder. Resume each bookmark export from that checkpoint. > [card] All saved tweets > > Omit `folderId` when the workflow needs every bookmarked tweet visible to > the connected account. > [card] Folder export > > Call [Bookmark Folders](/api-reference/x/bookmark-folders) first, then pass > its `folder_id` as `folderId`. Folders need X Premium. > [card] Cursor checkpoint > > Store `has_next_page` and `next_cursor` per folder. Pass `next_cursor` back > as `cursor` only when `has_next_page` is true. > [card] Account-scoped queue > > Store saved-tweet rows only in systems scoped to that account. ## Twitter bookmark API questions ### How do I export Twitter bookmarks? Run the Node.js or Python example for each cursor page. Both examples create a structured JSON Lines record for every saved tweet. Each row keeps tweet text, authors, likes, replies, reposts, and views. It also keeps media URLs and folder context. Convert the completed rows to a CSV file after collection. Use `tweet_id` as the stable key. Create a bookmarks page in a spreadsheet or research tool. Choose destination columns before sending rows to Notion databases or CRMs. ### How does bookmark authentication work? Connect the X account that owns the saved tweets. Include that account's Xquik API key in every request. The endpoint never accepts another username. X treats bookmarks as private to their owner. ### Can I export another user's bookmarks? No. Bookmarks are private to the connected account. Keep every export scoped to that account. Do not publish saved tweets or private folder names. ### How do bookmark folders work? Call [Get bookmark folders](/api-reference/x/bookmark-folders) first. Pass the returned `folder_id` as `folderId`. Omit `folderId` to request all visible bookmarks from the connected account. Store one `next_cursor` checkpoint per folder. Keep `folder_id` when importing records into Notion databases. ### What limits a bookmark export? You receive the bookmarks that the connected account can view. Low credits may reduce the returned row count. A `429` response includes retry guidance. `424 account_required` means you have no connected X account. Other `424`, `502` & `503` responses are temporary read failures. ### How should I store a bookmark export? Store the connected account ID beside each row. Keep private folder names out of public logs. Delete temporary files after the approved handoff finishes. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `folderId` | `string` | No | Bookmark folder ID. Omit to return all bookmarks. | | `cursor` | `string` | No | Pass the previous response's `next_cursor` to fetch another page. Omit it on the initial request. | | `pageSize` | `integer` | No | Bookmarks per page. Accepts `1-100`. Defaults to `20`. Also read as `limit`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ## Which saved-feed endpoint? > [card] Saved tweets > > Use `GET /x/bookmarks` for bookmarked tweets from the connected account. > [card] Bookmark folders > > Use [`GET /x/bookmarks/folders`](/api-reference/x/bookmark-folders) to find > folder IDs before a folder-specific bookmark export. > [card] Home timeline > > Use [`GET /x/timeline`](/api-reference/x/timeline) for the connected > account's home feed instead of saved tweets. > [card] Notifications > > Use [`GET /x/notifications`](/api-reference/x/notifications) for inbox > activity rows from the connected account. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of bookmarked tweets. | | `tweets[].id` | `string` | This value contains the tweet ID. | | `tweets[].text` | `string` | This value contains the tweet text. | | `tweets[].type` | `string` | This value identifies the tweet type. X may omit it. | | `tweets[].createdAt` | `string` | This value contains the ISO 8601 creation time. X may omit it. | | `tweets[].isNoteTweet` | `boolean` | X sets this flag for long-form Note Tweets. X may omit it. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | This value records the like count. X may omit it. | | `tweets[].retweetCount` | `number` | This value records the repost count. X may omit it. | | `tweets[].replyCount` | `number` | This value records the reply count. X may omit it. | | `tweets[].quoteCount` | `number` | This value records the quote count. X may omit it. | | `tweets[].viewCount` | `number` | This value records the view count. X may omit it. | | `tweets[].bookmarkCount` | `number` | This value records the bookmark count. X may omit it. | | `tweets[].url` | `string` | This value contains the tweet URL. X may omit it. | | `tweets[].lang` | `string` | This value contains the tweet language code. X may omit it. | | `tweets[].isReply` | `boolean` | X sets this flag for replies. X may omit it. | | `tweets[].inReplyToId` | `string` | This value identifies the replied-to tweet. X may omit it. | | `tweets[].inReplyToUserId` | `string` | This value identifies the replied-to user. X may omit it. | | `tweets[].inReplyToUsername` | `string` | This value identifies the replied-to username. X may omit it. | | `tweets[].conversationId` | `string` | This value contains the conversation ID. X may omit it. | | `tweets[].source` | `string` | This value identifies the posting client. X may omit it. | | `tweets[].displayTextRange` | `number[]` | This array contains the rendered text offsets. X may omit it. | | `tweets[].isLimitedReply` | `boolean` | X sets this flag when replies are limited. X may omit it. | | `tweets[].isQuoteStatus` | `boolean` | X sets this flag for quote tweets. X may omit it. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | This object contains parsed tweet entities. X may omit it. | | `tweets[].contentDisclosure` | `object` | This object contains paid partnership and AI media labels. X may omit it. | | `tweets[].author` | `object` | This object contains the tweet author profile. X may omit it. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author X (Twitter) username. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | This value records the follower count. X may omit it. | | `tweets[].author.verified` | `boolean` | X sets this flag for verified authors. X may omit it. | | `tweets[].author.profilePicture` | `string` | This value contains the profile picture URL. X may omit it. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | This array contains media attachments. X may omit it. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | This array contains video URLs, bitrates, and content types. X omits it for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | This object contains the quoted tweet. X may omit it. | | `tweets[].retweeted_tweet` | `object` | This object contains the original repost. X may omit it. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | > [!NOTE] > > **Related.** [Bookmark Folders](/api-reference/x/bookmark-folders) · [Timeline](/api-reference/x/timeline) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "2102761519985332442", "text": "This galaxy is a little extra.\n\nMeet Messier 106, a spiral galaxy with an extra set of arms. These two additional arms are made of gas heated up by jets from the galaxy’s central black hole. The jets’ superheated shockwaves are depicted in royal blue by @chandraxray. https://t.co/421Lzs0r0c", "retweetCount": 1364, "replyCount": 271, "likeCount": 9775 } ], "has_next_page": true, "next_cursor": "DAAHCgABHTK6Vr___-sLAAIAAAATMjEwMTc3MDE4NjE1NjA1Mjk1OQgAAwAAAAIAAA", "filtered_count": 0 } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Brand monitoring with AI, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/brand-monitoring Monitor brand mentions on X with AI. Get each post's relevance, attitude toward your brand, and customer relationship. Costs 2 credits per analyzed post. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/analysis/brand` **2 credits per analyzed post** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) Brand monitoring reads each post with AI and answers 3 questions about your brand. The endpoint is `POST /api/v1/x/analysis/brand`. | Answer | Type | Values | | - | - | - | | `relevance` | Probability | From `0` to `1`, the chance the post discusses your brand | | `sentiment` | Choice | `positive`, `negative`, `mixed`, `neutral`, or `unclear` | | `experience` | Choice | `customer`, `prospect`, `observer`, or `unclear` | Name the brand in `analysis.targets`, with its products and handles as aliases. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/analysis/brand \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "query": "(Sony OR WH-1000XM6) headphones lang:en -filter:nativeretweets", "limit": 50, "analysis": { "targets": [{ "name": "Sony", "aliases": ["WH-1000XM6", "@Sony"] }], "context": "Consumer headphones & customer service." } }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/analysis/brand", { method: "POST", headers: { "x-api-key": "xq_your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ query: "(Sony OR WH-1000XM6) headphones lang:en -filter:nativeretweets", limit: 50, analysis: { targets: [{ name: "Sony", aliases: ["WH-1000XM6", "@Sony"] }], context: "Consumer headphones & customer service.", }, }), }); const data = await response.json(); if (!response.ok) throw new Error(`${data.error}: ${data.message}`); const unhappyCustomers = data.results .filter((result) => result.answers.relevance >= 0.5) .filter((result) => result.answers.sentiment === "negative") .filter((result) => result.answers.experience === "customer") .map((result) => ({ tweet_id: result.tweet.id, text: result.tweet.text })); const brand = data.analysisSummary.targets[0]; process.stdout.write( `${JSON.stringify({ mentions: brand?.mentions, sentiment: brand?.choices.sentiment, unhappyCustomers })}\n`, ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.post( "https://xquik.com/api/v1/x/analysis/brand", headers={"x-api-key": "xq_your_api_key_here"}, json={ "query": "(Sony OR WH-1000XM6) headphones lang:en -filter:nativeretweets", "limit": 50, "analysis": { "targets": [{"name": "Sony", "aliases": ["WH-1000XM6", "@Sony"]}], "context": "Consumer headphones & customer service.", }, }, timeout=120, ) data = response.json() if not response.ok: raise RuntimeError(f"{data['error']}: {data['message']}") unhappy_customers = [ {"tweet_id": result["tweet"]["id"], "text": result["tweet"]["text"]} for result in data["results"] if result["answers"]["relevance"] >= 0.5 and result["answers"]["sentiment"] == "negative" and result["answers"]["experience"] == "customer" ] targets = data["analysisSummary"]["targets"] brand = targets[0] if targets else {} print(json.dumps({ "mentions": brand.get("mentions"), "sentiment": brand.get("choices", {}).get("sentiment"), "unhappy_customers": unhappy_customers, })) ``` The snippets list unhappy customers and print the brand's totals. They do not print the full response. ## Name the brand Put the brand in `analysis.targets`, with product names, handles, and common misspellings as aliases. Add `analysis.context` when the name has other meanings, such as a fruit or city. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "name": "Sony", "aliases": ["WH-1000XM6", "@Sony", "@SonyElectronics"] } ``` `relevance` is low for namesakes. It is also low for posts that only share a word with the brand. Filter rows on `relevance` before you count answers. The snippets keep posts from `0.5`. ## Read the brand answers `results[].answers` holds each decision by question ID. | `sentiment` | Meaning | | - | - | | `positive` | Praise or a positive experience | | `negative` | Dissatisfaction, criticism, or negative sarcasm | | `mixed` | Both positive and negative judgments | | `neutral` | Information without a judgment | | `unclear` | The brand or the attitude cannot be established | `sentiment` judges the attitude toward your brand, not the post's general mood. | `experience` | Meaning | | - | - | | `customer` | Describes their own purchase or service experience | | `prospect` | Considers a purchase or asks for recommendations | | `observer` | Discusses the brand without a personal transaction | | `unclear` | Not enough context | Negative posts from customers are the support queue. Posts from prospects are sales leads. ## Track a brand over time `analysisSummary.targets` holds each target's `mentions`, its `share` of posts, and its `engagement`. It also holds the target's category counts in `choices`. `top` holds the target's most engaged posts per category. Store `analysisSummary.targets` per run to chart a trend. Name each competitor as its own target to compare brands in 1 call. For more posts than 1 call returns, send the same body again. Set `cursor` to `next_cursor` in that body. ## Monitor replies & quotes Send `repliesTo` with a launch post's URL to read the replies to it. Send `quotesOf` to read its quotes. Send `username` to read 1 account's posts, such as a competitor's support account. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "repliesTo": "https://x.com/Sony/status/1893456789012345678", "analysis": { "targets": [{ "name": "Sony" }] } } ``` ## Use another brand preset Set `analysis.preset` to ask other ready questions about your brand, at the same price. Each needs `analysis.targets`. | Preset | Answers | | - | - | | `complaints` | `complaint`, the `issue` category, and `urgency` | | `competitors` | The `event`, such as a launch or a price change, `firsthand`, and `commercial_relevance` | | `purchase_intent` | `intent`, `fit`, and `readiness` to buy | | `product_feedback` | `feedback`, such as a defect or a feature request, `firsthand_use`, and `impact` | ## Pick the posts to analyze Send `tweetIds`, `texts`, a page, or a search, never more than 1. See [pick the posts to analyze](/api-reference/x/tweet-analysis-parameters#pick-the-posts-to-analyze) for each source. ## Compare with an earlier answer Send the `results` of an earlier call as `baseline` to see what changed. The comparison costs nothing extra. See [compare with an earlier answer](/api-reference/x/tweet-analysis-parameters#compare-with-an-earlier-answer) for an example. ## Budget the analysis Each analyzed post costs 2 credits. Each text in `texts` costs the same. Posts in `unanalyzed` cost nothing. See [budget the analysis](/api-reference/x/tweet-analysis-parameters#budget-the-analysis) for each reason. ## Body See [body parameters](/api-reference/x/tweet-analysis-parameters#body-parameters) for every field. Common ones are `tweetIds`, `texts`, `query`, `username`, and `limit`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account API key. An OAuth bearer token also works. | | `Authorization` | `string` | No | Send `Bearer xq_your_guest_key_here` for an active `paid_reads` guest key. | | `Content-Type` | `string` | Yes | Must be `application/json`. The body can be up to 256 KB. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `results` | `object[]` | Each analyzed post with its answers. Each row costs 2 credits. | | `results[].tweet` | `object` | The post, as [Search Tweets](/api-reference/x/search-tweets) returns it. Your own texts have the IDs `text:1`, `text:2`, and so on. | | `results[].answers` | `object` | Each decision by question ID. `sentiment` and `experience` are categories, and `relevance` a probability from `0` to `1`. | | `results[].analysis` | `object` | The answers in full. `status` is `succeeded`. `answers` gives each answer's `value`, `confidence`, and `probabilities`, or a `probability`. `questions` names the ID and version of each question. `contextBytes` and `contextAvailability` say what the AI read beside the post's text. | | `results[].sourceDomains` | `string[]` | Hostnames the post links to, without `t.co`. | | `results[].cashtags` | `string[]` | Cashtags in the post's text, in upper case. | | `results[].monitor` | `object` | The comparison with `baseline`. It holds `status`, `changedQuestionIds`, and `changes` with each `previous` and `current` decision. It also holds the settings' `configurationFingerprint`. | | `unanalyzed` | `object[]` | Each post without an analysis. These cost nothing. | | `unanalyzed[].id` | `string` | Post ID, or `text:1` and so on for your own texts. | | `unanalyzed[].status` | `string` | `skipped` or `failed`. | | `unanalyzed[].reason` | `string` | `post_unavailable`, `missing_text`, `insufficient_credits`, or `context_limit`. Any other reason means the analysis failed. Send the post again. | | `unprocessed_ids` | `string[]` | IDs of the posts or texts the time ran out for. Send them again. They cost nothing. | | `analysisSummary` | `object` | Totals of the answers across the analyzed posts. | | `analysisSummary.schemaVersion` | `integer` | Version of the summary's shape. | | `analysisSummary.rows` | `object` | Posts by outcome, counted in `analyzed`, `failed`, and `skipped`. | | `analysisSummary.engagement` | `integer` | Likes, reposts, replies, and quotes of the analyzed posts. | | `analysisSummary.questions` | `object` | Totals by question ID. `sentiment` and `experience` have `counts`, `shares`, `engagementShares`, and `top` posts per category. `relevance` has `mean`, `yes`, and `no`. | | `analysisSummary.targets` | `object[]` | Each target in `analysis.targets` has `name`, `mentions`, `share`, `engagement`, `choices`, and `top` posts. | | `analysisSummary.cashtags` | `object[]` | Posts and category counts per cashtag, most posts first, up to 20. | | `analysisSummary.sourceDomains` | `object[]` | Posts per linked hostname, most posts first, up to 20. | | `analysisSummary.monitor` | `object` | Posts per `monitor.status` in `statuses`, and up to 50 changed posts in `changedRows`. | | `has_next_page` | `boolean` | Whether the search has more posts. Always `false` for `tweetIds` and `texts`. | | `next_cursor` | `string` | Send it as `cursor` with the same search for the next page. Empty when there is none. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "results": [ { "tweet": { "id": "1893456789012345678", "text": "My WH-1000XM6 stopped pairing after the update. Sony support has not replied in 3 days.", "likeCount": 48, "retweetCount": 6, "replyCount": 11 }, "analysis": { "status": "succeeded", "answers": [ { "questionId": "relevance", "questionVersion": "brand:2", "type": "probability", "probability": 0.98 }, { "questionId": "sentiment", "questionVersion": "brand:2", "type": "choice", "value": "negative", "confidence": 0.95, "probabilities": { "positive": 0.01, "negative": 0.95, "mixed": 0.02, "neutral": 0.01, "unclear": 0.01 } }, { "questionId": "experience", "questionVersion": "brand:2", "type": "choice", "value": "customer", "confidence": 0.93, "probabilities": { "customer": 0.93, "prospect": 0.02, "observer": 0.04, "unclear": 0.01 } } ] }, "answers": { "relevance": 0.98, "sentiment": "negative", "experience": "customer" }, "sourceDomains": [], "cashtags": [] } ], "unanalyzed": [], "analysisSummary": { "schemaVersion": 1, "rows": { "analyzed": 1, "failed": 0, "skipped": 0 }, "engagement": 65, "questions": { "sentiment": { "type": "choice", "counts": { "positive": 0, "negative": 1, "mixed": 0, "neutral": 0, "unclear": 0 } } }, "targets": [ { "name": "Sony", "mentions": 1, "share": 1, "engagement": 65, "choices": { "sentiment": { "negative": 1 }, "experience": { "customer": 1 } }, "top": { "sentiment": { "negative": [{ "tweetId": "1893456789012345678", "engagement": 65 }] } } } ], "cashtags": [], "sourceDomains": [] }, "has_next_page": false, "next_cursor": "" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Send only 1 of tweetIds, texts & a search such as query or username." }` The body names no posts or names more than 1 source. A body with an invalid field gets the same error. The message says what to send instead. The request costs nothing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Full account keys can receive `no_subscription`, `subscription_inactive`, `no_credits`, or `insufficient_credits` with account payment options. Guest keys receive only the guest top-up action. The failed request creates no checkout. Ask the user to confirm before calling any checkout or top-up route. ### 403 Protected account `{ "error": "x_account_protected" }` A search that needs a protected author returns this. Choose a public account. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for the `Retry-After` header, then send the request again. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Brand monitoring API questions ### How do I monitor brand mentions on X? Search the brand's names in `query` and name the brand in `analysis.targets`. Each row in `results` holds the post and its `relevance`, `sentiment`, and `experience` answers. ### How do I find customers who need help? Keep rows whose `sentiment` is `negative` and whose `experience` is `customer`. For the problem and its urgency, set `analysis.preset` to `complaints`. ### Can I compare my brand with competitors? Yes. Name each brand as its own target. `analysisSummary.targets` counts the mentions and sentiment of each one. ### Does it skip posts about namesakes? The AI answers `relevance` for every post. A namesake, such as a person with the brand's name, gets a low `relevance`. Filter on it. ### How much does brand monitoring cost? Each analyzed post costs 2 credits. Posts in `unanalyzed` and refused requests cost nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Sentiment analysis](/api-reference/x/sentiment-analysis) reads the attitude of any post. [Classify posts](/api-reference/x/classify-tweets) asks your own questions. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Check a follow relationship, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/check-follower Check whether one X user follows another in either direction for giveaway eligibility, campaign proof, CRM flags, and relationship audits. 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/followers/check` This route checks one follow relationship in both directions. Supply 2 accounts, each by user ID or username, and store both boolean results. **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call > [!NOTE] > > Check follower verifies one known relationship without exporting a follower > list. Pass the participant as `source`. Pass the required brand, creator, or > partner account as `target`. Both accept a user ID, username, > `@username`, or supported X or Twitter profile URL. Xquik resolves profile URLs > and converts both usernames to lowercase before lookup. The response returns both directions. Use > `isFollowing` for source-to-target proof and `isFollowedBy` for > target-to-source context. ```bash Follow task theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/followers/check \ --data-urlencode "source=participant_handle" \ --data-urlencode "target=brand_handle" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async function buildFollowCheckAudit() { const campaignId = "spring-launch-2026"; const participantHandle = "participant_handle"; const requiredFollowHandle = "brand_handle"; const params = new URLSearchParams({ source: participantHandle, target: requiredFollowHandle, }); const response = await fetch(`https://xquik.com/api/v1/x/followers/check?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); if (!response.ok) { throw new Error(`Follow check failed with status ${response.status}`); } const data = await response.json(); return { campaign_id: campaignId, participant_handle: data.sourceUsername, required_follow_handle: data.targetUsername, proof_endpoint: "GET /api/v1/x/followers/check", participant_follows_required_account: data.isFollowing, required_account_follows_participant: data.isFollowedBy, verification_state: data.isFollowing ? "matched" : "not_matched", }; } const auditEvent = await buildFollowCheckAudit(); // Replace this with your DB, queue, or warehouse write. await saveAuditEvent(auditEvent); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests def build_follow_check_audit(): campaign_id = "spring-launch-2026" participant_handle = "participant_handle" required_follow_handle = "brand_handle" response = requests.get( "https://xquik.com/api/v1/x/followers/check", params={ "source": participant_handle, "target": required_follow_handle, }, headers={"x-api-key": "xq_your_api_key_here"}, ) response.raise_for_status() data = response.json() return { "campaign_id": campaign_id, "participant_handle": data["sourceUsername"], "required_follow_handle": data["targetUsername"], "proof_endpoint": "GET /api/v1/x/followers/check", "participant_follows_required_account": data["isFollowing"], "required_account_follows_participant": data["isFollowedBy"], "verification_state": "matched" if data["isFollowing"] else "not_matched", } audit_event = build_follow_check_audit() # Replace this with your DB, queue, or warehouse write. save_audit_event(audit_event) ``` The Node.js and Python snippets build a campaign audit event. They do not print the raw response page. Store the event with your campaign, entrant, or CRM row. Reviewers can then see the proof endpoint and the 2 handles checked. They can also see the matched or not-matched state. ## Campaign follow-check handoff Use `GET /api/v1/x/followers/check` when a workflow already has both usernames or `@usernames`. Use it when the workflow already has both user IDs or supported profile URLs. It returns one proof for a follow task. Use it for campaign entry validation, giveaway eligibility, and creator partnerships. Use it for CRM qualification and agent review queues. > [card] Single proof > > Store one audit event per participant and required account pair. > [card] Both directions > > Store `isFollowing` as the required proof and `isFollowedBy` as reciprocal > context. > [card] Accepted inputs > > Pass a user ID, a username, `@username`, or supported X or Twitter profile URL. > A number is a user ID. An `x.com/i/user/` link names an account by ID too. > [card] Audit row > > Store campaign ID, participant handle, required follow handle, > endpoint, result booleans, and verification state. > [card] Draw handoff > > Use [Create draw](/api-reference/draws/create) when winner selection also > needs reply, repost, keyword, or unique-author filters. > [card] Stopped audit > > After `402 insufficient_credits`, stop the audit. Resume after > you add credits. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `source` | `string` | Yes | Source user ID, username, `@username`, or supported X or Twitter profile URL. One such URL is `x.com/i/user/11348282`. A number is a user ID. Xquik resolves profile URLs and converts the username to lowercase. In campaign verification, this is usually the participant or entrant. | | `target` | `string` | Yes | Target user ID, username, `@username`, or supported X or Twitter profile URL. One such URL is `x.com/i/user/11348282`. A number is a user ID. Xquik resolves profile URLs and converts the username to lowercase. In campaign verification, this is usually the required brand, creator, or partner account. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which verification endpoint? > [card] Follow task > > Use `GET /x/followers/check` for one participant-account follow proof. > [card] Retweet task > > Use [`GET /x/tweets/{id}/retweeters`](/api-reference/x/retweeters) to page > accounts that reposted one source tweet. > [card] Reply task > > Use [`GET /x/tweets/{id}/replies`](/api-reference/x/tweet-replies) to check > public replies under the source tweet. > [card] Quote task > > Use [`GET /x/tweets/{id}/quotes`](/api-reference/x/tweet-quotes) to inspect > quote-tweet entries. > [card] Follower export > > Use [`GET /x/users/{id}/followers`](/api-reference/x/followers) or a saved > follower export for many followers of one profile. > [card] Giveaway draw > > Use [`POST /draws`](/api-reference/draws/create) when Xquik should apply > follow, repost, reply, keyword, and winner rules together. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `sourceId` | `string` | The source account's user ID, as X gives it. Omitted when X names no account. | | `sourceUsername` | `string` | The source account's username, in lowercase. | | `targetId` | `string` | The target account's user ID, as X gives it. Omitted when X names no account. | | `targetUsername` | `string` | The target account's username, in lowercase. | | `isFollowing` | `boolean` | `true` if the source user follows the target user. | | `isFollowedBy` | `boolean` | `true` if the target user follows the source user. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "sourceId": "11348282", "sourceUsername": "nasa", "targetId": "34743251", "targetUsername": "spacex", "isFollowing": false, "isFollowedBy": true } ``` ### 400 Invalid params `{ "error": "missing_params", "message": "Send both source and target, each a user ID or username.", "required": [ "source", "target" ] }` One or both query parameters are missing. Provide both `source` and `target`. `{ "error": "invalid_username", "message": "Invalid source. Use a user ID, username, @username or X profile URL.", "parameter": "source" }` The named parameter is invalid. Use a user ID, a username, `@username`, or supported X or Twitter profile URL. The API rejects foreign hosts, profile status URLs, credentials, and custom ports. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls receive a direct MPP `WWW-Authenticate: Payment` challenge plus a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Next steps.** See [Campaign verification workflow](/guides/campaign-verification-workflow) > for audit rows and draw handoffs. Or use > [Get User](/api-reference/x/twitter-profile-lookup) to > resolve profile details before checking. Or use [Get Account](/api-reference/account/get) > to check remaining credits. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "missing_params" }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Tweet classification with AI, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/classify-tweets Classify X posts with your own AI questions. Get topics, labels, scores, or yes/no checks, with probabilities and totals. Costs 2 credits per analyzed post. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/analysis/classify` **2 credits per analyzed post** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) Classify posts reads each post with AI. It answers the questions you write. The endpoint is `POST /api/v1/x/analysis/classify`. | Question type | Answers | Use it for | | - | - | - | | `choice` | 1 category of 2 to 255 you name | Topics, intents, labels | | `score` | 1 level of 2 or more, lowest first | Urgency, quality, fit | | `probability` | From `0` to `1`, the chance the answer is yes | Yes/no checks, such as a refund request | Without `analysis.questions`, it answers the [sentiment questions](/api-reference/x/sentiment-analysis). ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/analysis/classify \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "query": "(\"can anyone recommend\" OR \"need help with\") (laptop OR phone) lang:en", "limit": 50, "analysis": { "questions": [ { "id": "request", "type": "choice", "version": "1", "instructions": "What does the author ask for?", "categories": { "support": "Help with a problem.", "recommendation": "Advice on choosing a product.", "other": "Neither request." } }, { "id": "urgency", "type": "score", "version": "1", "instructions": "How soon does the author need an answer?", "levels": ["No rush.", "Within days.", "Right now."] } ] } }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/analysis/classify", { method: "POST", headers: { "x-api-key": "xq_your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ query: '("can anyone recommend" OR "need help with") (laptop OR phone) lang:en', limit: 50, analysis: { questions: [ { id: "request", type: "choice", version: "1", instructions: "What does the author ask for?", categories: { support: "Help with a problem.", recommendation: "Advice on choosing a product.", other: "Neither request.", }, }, { id: "urgency", type: "score", version: "1", instructions: "How soon does the author need an answer?", levels: ["No rush.", "Within days.", "Right now."], }, ], }, }), }); const data = await response.json(); if (!response.ok) throw new Error(`${data.error}: ${data.message}`); const leads = data.results .filter((result) => result.answers.request === "recommendation") .map((result) => ({ tweet_id: result.tweet.id, urgency: result.answers.urgency })); const requests = data.analysisSummary.questions.request.counts; process.stdout.write(`${JSON.stringify({ leads, requests })}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.post( "https://xquik.com/api/v1/x/analysis/classify", headers={"x-api-key": "xq_your_api_key_here"}, json={ "query": '("can anyone recommend" OR "need help with") (laptop OR phone) lang:en', "limit": 50, "analysis": { "questions": [ { "id": "request", "type": "choice", "version": "1", "instructions": "What does the author ask for?", "categories": { "support": "Help with a problem.", "recommendation": "Advice on choosing a product.", "other": "Neither request.", }, }, { "id": "urgency", "type": "score", "version": "1", "instructions": "How soon does the author need an answer?", "levels": ["No rush.", "Within days.", "Right now."], }, ], }, }, timeout=120, ) data = response.json() if not response.ok: raise RuntimeError(f"{data['error']}: {data['message']}") leads = [ {"tweet_id": result["tweet"]["id"], "urgency": result["answers"]["urgency"]} for result in data["results"] if result["answers"]["request"] == "recommendation" ] requests_by_type = data["analysisSummary"]["questions"]["request"]["counts"] print(json.dumps({"leads": leads, "requests": requests_by_type})) ``` The snippets list posts that ask for a recommendation, with their urgency. They also print the count per request type. They do not print the full response. ## Write a question Each question needs an `id`, a `type`, a `version`, and `instructions`. Write the instructions as you would brief a careful reader. * A `choice` adds `categories`. Each name maps to a short description or `null`. Add a category such as `other` or `unclear` for posts that fit none. * A `score` adds `levels`. List 2 to 10 descriptions, lowest first. The answer is the level's index, from `0`. It can have decimals, such as `1.4`. * A `probability` can add `criteria`, with what counts as `yes` and as `no`. Write question IDs and category names in lower case, with digits or underscores. An example is `feature_request`. A name with spaces or capitals returns `400 invalid_input` with the name to fix. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "refund", "type": "probability", "version": "1", "instructions": "Does the author ask for their money back?", "criteria": { "yes": "Asks for a refund.", "no": "Asks for no refund." } } ``` ## Classify topics A topic classifier is 1 `choice` question whose categories are your topics. Add `other` for posts outside them. `analysisSummary.questions..shares` holds each topic's share of posts. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "topic", "type": "choice", "version": "1", "instructions": "Which product area is the post about?", "categories": { "battery": "Charging or battery life.", "camera": "Photos or video.", "display": "The screen.", "other": "Another area or none." } } ``` ## Version your questions `version` is yours. Change it whenever you change a question's instructions, categories, or levels. Each answer carries `questionVersion`, so stored rows show which wording produced them. ## Use a preset Set `analysis.preset` instead of `questions` for a ready set, at the same price. | Preset | Answers | Needs targets | | - | - | - | | `sentiment` | `sentiment`, `intensity`, `sarcasm`, `emotion` | No | | `brand` | `relevance`, `sentiment`, `experience` | Yes | | `news` | `format`, `attribution`, `relevance` | Yes | | `market` | `stance`, `content`, `conviction`, `relevance` | Yes | | `complaints` | `complaint`, `issue`, `urgency` | Yes | | `competitors` | `event`, `firsthand`, `commercial_relevance` | Yes | | `purchase_intent` | `intent`, `fit`, `readiness` | Yes | | `product_feedback` | `feedback`, `firsthand_use`, `impact` | Yes | ## Pick the posts to analyze Send `tweetIds`, `texts`, a page, or a search, never more than 1. See [pick the posts to analyze](/api-reference/x/tweet-analysis-parameters#pick-the-posts-to-analyze) for each source. ## Compare with an earlier answer Send the `results` of an earlier call as `baseline` to see what changed. The comparison costs nothing extra. See [compare with an earlier answer](/api-reference/x/tweet-analysis-parameters#compare-with-an-earlier-answer) for an example. ## Budget the analysis Each analyzed post costs 2 credits. Each text in `texts` costs the same. Posts in `unanalyzed` cost nothing. See [budget the analysis](/api-reference/x/tweet-analysis-parameters#budget-the-analysis) for each reason. ## Body See [body parameters](/api-reference/x/tweet-analysis-parameters#body-parameters) for every field. Common ones are `tweetIds`, `texts`, `query`, `username`, and `limit`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account API key. An OAuth bearer token also works. | | `Authorization` | `string` | No | Send `Bearer xq_your_guest_key_here` for an active `paid_reads` guest key. | | `Content-Type` | `string` | Yes | Must be `application/json`. The body can be up to 256 KB. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `results` | `object[]` | Each analyzed post with its answers. Each row costs 2 credits. | | `results[].tweet` | `object` | The post, as [Search Tweets](/api-reference/x/search-tweets) returns it. Your own texts have the IDs `text:1`, `text:2`, and so on. | | `results[].answers` | `object` | Each decision by question ID. A choice gives its category. A score gives its level from `0`. A probability gives its value from `0` to `1`. | | `results[].analysis` | `object` | The answers in full. `status` is `succeeded`. `answers` gives each answer's `value`, `confidence`, and `probabilities`, or a `probability`. `questions` names the ID and version of each question. `contextBytes` and `contextAvailability` say what the AI read beside the post's text. | | `results[].sourceDomains` | `string[]` | Hostnames the post links to, without `t.co`. | | `results[].cashtags` | `string[]` | Cashtags in the post's text, in upper case. | | `results[].monitor` | `object` | The comparison with `baseline`. It holds `status`, `changedQuestionIds`, and `changes` with each `previous` and `current` decision. It also holds the settings' `configurationFingerprint`. | | `unanalyzed` | `object[]` | Each post without an analysis. These cost nothing. | | `unanalyzed[].id` | `string` | Post ID, or `text:1` and so on for your own texts. | | `unanalyzed[].status` | `string` | `skipped` or `failed`. | | `unanalyzed[].reason` | `string` | `post_unavailable`, `missing_text`, `insufficient_credits`, or `context_limit`. Any other reason means the analysis failed. Send the post again. | | `unprocessed_ids` | `string[]` | IDs of the posts or texts the time ran out for. Send them again. They cost nothing. | | `analysisSummary` | `object` | Totals of the answers across the analyzed posts. | | `analysisSummary.schemaVersion` | `integer` | Version of the summary's shape. | | `analysisSummary.rows` | `object` | Posts by outcome, counted in `analyzed`, `failed`, and `skipped`. | | `analysisSummary.engagement` | `integer` | Likes, reposts, replies, and quotes of the analyzed posts. | | `analysisSummary.questions` | `object` | Totals by question ID. A choice has `counts`, `shares`, `engagementShares`, and `top` posts per category. A score has `mean`, `engagementWeightedMean`, and `levels`. A probability has `mean`, `yes`, and `no`. | | `analysisSummary.targets` | `object[]` | Each target in `analysis.targets` has `name`, `mentions`, `share`, `engagement`, `choices`, and `top` posts. | | `analysisSummary.cashtags` | `object[]` | Posts and category counts per cashtag, most posts first, up to 20. | | `analysisSummary.sourceDomains` | `object[]` | Posts per linked hostname, most posts first, up to 20. | | `analysisSummary.monitor` | `object` | Posts per `monitor.status` in `statuses`, and up to 50 changed posts in `changedRows`. | | `has_next_page` | `boolean` | Whether the search has more posts. Always `false` for `tweetIds` and `texts`. | | `next_cursor` | `string` | Send it as `cursor` with the same search for the next page. Empty when there is none. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "results": [ { "tweet": { "id": "1893456789012345678", "text": "Need help with my laptop. It shuts down at 30% battery and I have a deadline tonight.", "likeCount": 3, "retweetCount": 0, "replyCount": 5 }, "analysis": { "status": "succeeded", "answers": [ { "questionId": "request", "questionVersion": "1", "type": "choice", "value": "support", "confidence": 0.96, "probabilities": { "support": 0.96, "recommendation": 0.03, "other": 0.01 } }, { "questionId": "urgency", "questionVersion": "1", "type": "score", "value": 2, "confidence": 0.84, "probabilities": { "0": 0.02, "1": 0.14, "2": 0.84 }, "levels": ["No rush.", "Within days.", "Right now."] } ] }, "answers": { "request": "support", "urgency": 2 }, "sourceDomains": [], "cashtags": [] } ], "unanalyzed": [], "analysisSummary": { "schemaVersion": 1, "rows": { "analyzed": 1, "failed": 0, "skipped": 0 }, "engagement": 8, "questions": { "request": { "type": "choice", "counts": { "support": 1, "recommendation": 0, "other": 0 }, "shares": { "support": 1, "recommendation": 0, "other": 0 } }, "urgency": { "type": "score", "mean": 2 } }, "targets": [], "cashtags": [], "sourceDomains": [] }, "has_next_page": false, "next_cursor": "" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Rename \"Feature Request\". Write question IDs & category names in lower case without hyphens, such as feature_request." }` The body names no posts or names more than 1 source. A body with an invalid field gets the same error. The message says what to send instead. The request costs nothing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Full account keys can receive `no_subscription`, `subscription_inactive`, `no_credits`, or `insufficient_credits` with account payment options. Guest keys receive only the guest top-up action. The failed request creates no checkout. Ask the user to confirm before calling any checkout or top-up route. ### 403 Protected account `{ "error": "x_account_protected" }` A search that needs a protected author returns this. Choose a public account. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for the `Retry-After` header, then send the request again. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Tweet classification API questions ### How do I classify tweets by topic? Send 1 `choice` question whose categories are your topics, with `other` for the rest. Each row's `answers` holds the topic, and the summary counts posts per topic. ### How many questions and categories can I use? As many questions as fit in 8,000 bytes together. A choice takes 2 to 255 categories, and a score 2 to 10 levels. The price stays 2 credits per post. ### Can I set my own confidence threshold? Yes. `results[].analysis.answers` gives each answer's `confidence` and the probability of every category or level. Keep the rows above your threshold. ### Can I classify my own texts, such as support tickets? Yes. Send your texts in `texts`. Xquik reads nothing from X for them. ### How much does classification cost? Each analyzed post costs 2 credits, whatever the number of questions. Posts in `unanalyzed` and refused requests cost nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Brand mentions](/api-reference/x/brand-monitoring) answers ready brand questions, or [Viral score](/api-reference/x/viral-score) rates how posts read. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Community activity & growth, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-analytics Get an X community's likes, new members, posts, replies & unique posters. Each covers its latest period & shows its change from 1 day earlier. Costs 1 credit. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/{id}/analytics` Use the X community analytics API to see how active a community is. One call returns 5 activity counts for the latest period. Each has its change in percent from 1 day earlier. ## What each call returns * `likes` counts likes on the community's posts. * `newMembers` counts the accounts that joined. * `posts` counts the posts in the community. * `replies` counts the replies to those posts. * `uniquePosters` counts the distinct accounts that posted. Each metric has a `count` and a `changePercent`. A negative `changePercent` means the count fell. `periodEndsAt` gives the end of the period in UTC. ## Track community growth over time Call the endpoint once a day for each community you follow. Store `periodEndsAt` with the 5 counts. A new `periodEndsAt` marks a new period. That lets you chart each metric over time. Compare communities with the same 5 metrics. `uniquePosters` against `posts` shows whether a few accounts write most posts. Each successful call costs 1 credit. A refused ID, a missing community or a failed read costs nothing. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/communities/1493446837214187523/analytics" \ -H "x-api-key: $XQUIK_API_KEY" ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import os import requests response = requests.get( "https://xquik.com/api/v1/x/communities/1493446837214187523/analytics", headers={"x-api-key": os.environ["XQUIK_API_KEY"]}, timeout=30, ) response.raise_for_status() analytics = response.json() print(analytics["periodEndsAt"], analytics["metrics"]["posts"]["count"]) ``` ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | X Community ID, or the URL-encoded Community link, such as `x.com/i/communities/1493446837214187523`. Any other value gets a free 400. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Your API key. Send this header or `Authorization`. | | `Authorization` | `string` | No | `Bearer` followed by your API key or OAuth token. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | The community ID from your request. | | `periodEndsAt` | `string` | ISO 8601 end of the latest period, in UTC. | | `metrics` | `object` | The period's activity. Each metric holds `count` & `changePercent`. | | `metrics.likes` | `object` | Likes on the community's posts. | | `metrics.newMembers` | `object` | Accounts that joined the community. | | `metrics.posts` | `object` | Posts in the community. | | `metrics.replies` | `object` | Replies to the community's posts. | | `metrics.uniquePosters` | `object` | Distinct accounts that posted. | Each metric object has these fields. | Field | Type | Description | | - | - | - | | `count` | `integer` | The total for the period. It is never negative. | | `changePercent` | `number` | The change in percent from the same figure 1 day earlier, unrounded. A fall is negative. | ### 400 Invalid community ID `{ "error": "invalid_community_id" }` The ID is no Community ID or link. Send the community's link or the number in it. The call costs nothing. ### 401 Unauthenticated Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls get a direct MPP `WWW-Authenticate: Payment` challenge. They also get a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 404 Community not found No community has this ID. Check the ID. The call costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 503 Read unavailable The read failed. Retry shortly. The call costs nothing. > [!NOTE] > > **Next steps.** [Community Info](/api-reference/x/community-info) for the community's name & rules, or [Community Tweets](/api-reference/x/community-tweets) to read its posts. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "1493446837214187523", "periodEndsAt": "2026-10-16T23:59:59.999Z", "metrics": { "likes": { "count": 15298, "changePercent": -1.2076202776880853 }, "newMembers": { "count": 557, "changePercent": -1.5901060070671376 }, "posts": { "count": 5108, "changePercent": 0.5907837731390311 }, "replies": { "count": 6851, "changePercent": -0.8251302837290099 }, "uniquePosters": { "count": 1800, "changePercent": -0.33222591362126247 } } } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Find communities by keyword, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-find Find X (Twitter) Communities by keyword. Get each Community's ID, name, member count, topic, banner, and previewed members, then read its posts. 1 credit each. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/find` **1 credit per Community returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/communities/find \ --data-urlencode "q=artificial intelligence" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ q: "artificial intelligence" }); const response = await fetch(`https://xquik.com/api/v1/x/communities/find?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); for (const community of data.communities) { process.stdout.write(`${community.id} ${community.name} ${community.member_count}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/communities/find", params={"q": "artificial intelligence"}, headers={"x-api-key": "xq_your_api_key_here"}, ) for community in response.json()["communities"]: print(community["id"], community["name"], community["member_count"]) ``` Use `GET /x/communities/find` to find the X Communities that match a keyword. Each Community costs 1 credit. A page without Communities costs nothing. To search the posts inside 1 Community, use [Community tweet search](/api-reference/x/community-search). ## Find a Community, then read it 1. Send a keyword as `q`, such as `artificial intelligence`. 2. Pick a Community from the list by its `name` and `member_count`. 3. Pass its `id` to [Community details](/api-reference/x/community-info) for its rules, creator, and admin. 4. Pass the same `id` to [Community tweets](/api-reference/x/community-tweets) or [Community media](/api-reference/x/community-media). Results keep X's order. X may order them differently for each request. Follow `next_cursor` for more Communities. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Keyword to find Communities by, such as `ai`. Also read as `query`. | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit it for the first page. A cursor X refuses or that expired returns a free `400 invalid_cursor`. Start again without it. | | `pageSize` | `integer` | No | Most Communities to return on this page. Your credit balance can return fewer. Also read as `limit`, `count`, or `max_results`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send a full Xquik account API key. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `communities` | `object[]` | Communities that match the keyword, in X's order. | | `communities[].id` | `string` | Community ID. Pass it to the other Community endpoints. | | `communities[].name` | `string` | Community name. | | `communities[].member_count` | `number` | Total member count. | | `communities[].is_nsfw` | `boolean` | Whether X marks the Community sensitive. | | `communities[].primary_topic` | `object` | The topic X files the Community under, with its `name`. | | `communities[].banner_url` | `string` | Banner image URL. Omitted if unavailable. | | `communities[].banner` | `object` | Banner `url`, `width`, `height`, main `colors`, and the `focus` area X keeps in view. Omitted if unavailable. | | `communities[].membersFacepile` | `object[]` | Members X previews beside the member count. Each has its `id`, `profilePicture` and `profilePictureOriginal`, the same picture at full size. | | `has_next_page` | `boolean` | Whether another page of Communities follows. | | `next_cursor` | `string` | Cursor for the next page. Empty at the end. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "communities": [ { "id": "1724390935406981529", "name": "Artificial Intelligence + Tech", "member_count": 17092, "is_nsfw": false, "primary_topic": { "name": "Artificial Intelligence" }, "banner_url": "https://pbs.twimg.com/community_banner_img/example.jpg", "membersFacepile": [ { "id": "133938408", "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } ] } ], "has_next_page": true, "next_cursor": "WzIwNC42OTQ3XQ==" } ``` ### 400 Missing keyword or invalid cursor `{ "error": "missing_query", "message": "Search query required. Use q." }` Send a keyword as `q`. A cursor X can't read returns `invalid_cursor`. `{ "error": "invalid_cursor", "message": "Cursor invalid or expired. Start again without cursor, then use next_cursor." }` Start again without `cursor`. Both answers are free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read failed. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Find X (Twitter) Communities questions ### How do I find X (Twitter) Communities about a topic? Send the topic as `q`, such as `q=web3`. Or list the most popular Communities of a topic with [Popular communities](/api-reference/x/community-popular). ### How is this different from Community tweet search? This endpoint returns Communities. [Community tweet search](/api-reference/x/community-search) returns posts inside 1 Community you already know. ### How much does it cost? Each returned Community costs 1 credit. A page without Communities costs nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Community details](/api-reference/x/community-info) reads a Community's rules, creator, and admin by its `id`. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Community details & rules, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-info Retrieve an X community's name, description, member count, creator, moderators, rules, join policy, banner, and creation time. Costs 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/{id}/info` Use the X communities API to resolve one community. Then read its members, moderators, rules, or tweets. Keep its numeric ID for later requests. ## Validate an X community before extraction Check community details for every numeric community ID. Confirm the community name, description, creator, join policy, rules, and banner. Do this before requesting members or tweets. An export then cannot use the wrong X community. Keep the returned community ID as a string. Store the creator and moderator details separately from the member count. Membership totals can change while the community identity remains stable. Use the rules and join policy to give analysts the correct context. They describe how the X (Twitter) community operates. They do not replace member rows, moderator profiles, or community tweets. After validation, choose the smallest matching route. Fetch member profiles for audience review. Fetch moderators to review who runs the community. Fetch recent tweets to review posts and engagement. Use saved extraction jobs to produce CSV, JSON, or XLSX output. ## Choose the right X (Twitter) community API Start with community details when the numeric ID needs validation. Then choose the route that matches the records you need. > [card] Community details > > Get the name, description, creator, rules, policies, and banner. Keep member and moderator counts with the record. > [card] [Community members](/api-reference/x/community-members) > > Retrieve member profiles with usernames, bios, verification, follower counts, and cursor pagination. > [card] [Community tweets](/api-reference/x/community-tweets) > > Retrieve recent tweets, authors, replies, reposts, likes, quotes, media, and cursor pages. > [card] [Keyword search](/api-reference/x/community-search) > > Search one community for matching tweets. Keep the query and cursor with each page. > [card] [Moderator profiles](/api-reference/x/community-moderators) > > Retrieve the moderator list, which is smaller than the member list. > [card] [Saved exports](/api-reference/extractions/create) > > Run a community extraction to save CSV, JSON, or XLSX output. Use member routes for profile rows. Use tweet routes for posts and engagement counts. Use extraction jobs to save CSV, JSON, or XLSX output. ## When to read community metadata Use this route for community metadata, rules, policies, and counts. It returns one community record, not member profiles or tweet rows. Use member and tweet routes for those collections. **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/communities/1234567890/info \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const communityId = "1234567890"; const response = await fetch(`https://xquik.com/api/v1/x/communities/${communityId}/info`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const community = data.community; const communityRecord = { community_id: community.id, community_name: community.name ?? null, description: community.description ?? null, member_count: community.member_count ?? null, moderator_count: community.moderator_count ?? null, join_policy: community.join_policy ?? null, invites_policy: community.invites_policy ?? null, is_nsfw: community.is_nsfw ?? null, creator_id: community.creator?.id ?? null, creator_username: community.creator?.username ?? null, banner_url: community.banner_url ?? null, created_at: community.created_at ?? null, primary_topic_name: community.primary_topic?.name ?? null, rule_count: community.rules?.length ?? 0, }; process.stdout.write(JSON.stringify(communityRecord, null, 2)); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/x/communities/1234567890/info", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() community = data["community"] community_record = { "community_id": community["id"], "community_name": community.get("name"), "description": community.get("description"), "member_count": community.get("member_count"), "moderator_count": community.get("moderator_count"), "join_policy": community.get("join_policy"), "invites_policy": community.get("invites_policy"), "is_nsfw": community.get("is_nsfw"), "creator_id": (community.get("creator") or {}).get("id"), "creator_username": (community.get("creator") or {}).get("username"), "banner_url": community.get("banner_url"), "created_at": community.get("created_at"), "primary_topic_name": (community.get("primary_topic") or {}).get("name"), "rule_count": len(community.get("rules") or []), } print(json.dumps(community_record, indent=2)) ``` Use `GET /x/communities/{id}/info` when a workflow needs one community profile row. Fetch it before member exports, moderator review, content routing, or CRM enrichment. Store `community_id`, `community_name`, `description`, `member_count`, `moderator_count`, policy fields, creator, `banner_url`, `created_at`, `primary_topic_name`, and `rule_count`. ## Qualify a community before collecting profiles or tweets Read community metadata before starting a member or tweet export. A mistyped community ID would otherwise send results into the wrong project. Confirm `community.id` and `community.name` first. Save both values with the planned member or tweet export. Names can change. The numeric ID stays the same across later member and tweet pages. Review `description` and `primary_topic` for research relevance. Keep this classification separate from tweet text. Community metadata describes the space, while tweet routes return individual posts. Check `join_policy` and `invites_policy` before planning member collection. Do not infer either policy from member counts. Store the returned values exactly, including missing values. Use `member_count` to estimate roster size. Use `moderator_count` only to see how many people moderate. Neither count replaces the paginated member or moderator routes. Review `is_nsfw` before sharing banners, descriptions, or tweets. Follow the receiving system's content rules. Keep API responses unchanged. Capture every community rule with its ID, name, and description. Keep the returned order. Do not merge several rules into one undocumented summary. Finish the qualification record with these decisions. * Continue to member profiles, moderator profiles, tweets, or keyword search. * Stop because the community ID or subject is incorrect. * Require a reviewer before handling sensitive community content. * Refresh metadata later because a required field is unavailable. This route qualifies the community. Collection routes return member profiles and community tweets. ## Create a community qualification manifest Create one manifest before starting member, moderator, or tweet collection. Use the returned community ID as its stable key. Record these community facts. * Record the community name and description. * Record member and moderator counts. * Record join and invitation policies. * Record primary topic and content-sensitivity state. * Record the creator profile and banner URL when returned. * Record every rule ID, name, and description. Add a retrieval timestamp in UTC. Expect community names, counts, rules, and policies to change. The timestamp explains which metadata guided later collection. Keep planned collection work in a separate manifest section. Name the exact routes for members, moderators, unfiltered tweets, or keyword matches. Include the intended page size, search query, and output format when applicable. Keep member profiles and tweets in their own exports. Link those exports by community ID and manifest ID. Stop when the returned community ID differs. Require a review when the name or topic conflicts with the project brief. Record the decision. Do not pick another community without a record. ## Use community metadata to choose the next route The member route returns paginated profile rows. See [Community Members](/api-reference/x/community-members). The member count only estimates the expected roster size. Use [Community Moderators](/api-reference/x/community-moderators) for moderator profiles. The moderator count does not expose those usernames or user IDs. Use [Community Tweets](/api-reference/x/community-tweets) for the unfiltered community timeline. Keep community ID and cursor with every page. Use [Community Search](/api-reference/x/community-search) for matching tweets. Keep the exact keyword expression and sort mode with every result. Keep the creator object to show who owns the community. Export that profile as a member only when the member route returns it. Export it as a moderator only when the moderator route returns it. ## Detect community metadata changes Compare manifests by stable community ID. Never join them by community name. Report name, description, topic, policy, rule, and sensitivity changes separately. A member-count change does not prove a policy change. Track community rules and tweets independently. Store both retrieval times and both returned values. Keep absent fields. Never invent policy or count defaults. Refresh this endpoint before long-running exports. Attach the newest manifest ID to every new collection job. Do not edit earlier manifests. Audits need them. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Community ID, or the URL-encoded Community link, such as `x.com/i/communities/1493446837214187523`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `community` | `object` | Community details. | | `community.id` | `string` | Community ID. | | `community.name` | `string` | Community name. Omitted if unavailable. | | `community.description` | `string` | Community description. Omitted if empty. | | `community.member_count` | `number` | Total member count. Omitted if unavailable. | | `community.moderator_count` | `number` | Total moderators. Omitted if unavailable. | | `community.join_policy` | `string` | Join policy (for example `Open`). Omitted if unavailable. | | `community.invites_policy` | `string` | Invitation policy. Omitted if unavailable. | | `community.is_nsfw` | `boolean` | Whether X marks the community sensitive. Omitted if unavailable. | | `community.creator` | `object` | The creator's public profile. When X sends no profile, it holds the `id`, `username`, and `verified` badge alone. Omitted if unavailable. | | `community.admin` | `object` | The admin's public profile. Omitted if unavailable. | | `community.question` | `string` | What the community asks a user who joins. Omitted if unavailable. | | `community.searchTags` | `string[]` | Tags X finds the community by. Omitted if unavailable. | | `community.membersFacepile` | `object[]` | Public profiles of the members X previews beside the member count. Omitted if unavailable. | | `community.banner_url` | `string` | Banner image URL. Omitted if unavailable. | | `community.banner` | `object` | Banner `url`, `width`, `height`, main `colors`, and the `focus` area. X keeps that area in view when it crops the banner. Omitted if unavailable. | | `community.created_at` | `string` | ISO 8601 creation timestamp. Omitted if unavailable. | | `community.primary_topic` | `object` | Primary topic with `id` and `name` fields. Omitted if unavailable. | | `community.rules` | `object[]` | Community rules, each with `id`, `name`, and `description`. Omitted if unavailable. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "community": { "id": "1234567890", "name": "Web Developers", "description": "A community for web developers", "member_count": 15000, "moderator_count": 5, "join_policy": "Open", "created_at": "2024-01-15T00:00:00.000Z", "primary_topic": { "id": "1", "name": "Technology" }, "rules": [ { "id": "1", "name": "Be respectful", "description": "Treat all members with respect." } ] } } ``` ### 400 Invalid community ID `{ "error": "invalid_community_id" }` The community ID is empty or invalid. ### 401 Unauthenticated Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls get a direct MPP `WWW-Authenticate: Payment` challenge. They also get a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 404 Community not found Xquik could not resolve the community. Check the community ID. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed Opted-in normalized v1 calls return 424 when the read service fails. > [!NOTE] > > **Next steps.** [Community Members](/api-reference/x/community-members) to list members, or [Community Tweets](/api-reference/x/community-tweets) to browse posts. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Community photos & videos, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-media Export the posts on an X (Twitter) Community's Media tab, newest first, with authors, text, counts, photos, and videos. Filter them like posts. 1 credit each. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/{id}/media` See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/communities/1472105760389668865/media \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/communities/1472105760389668865/media", { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); for (const tweet of data.tweets) { const urls = (tweet.media ?? []).map((item) => item.mediaUrl).join(" "); process.stdout.write(`${tweet.id} ${urls}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/communities/1472105760389668865/media", headers={"x-api-key": "xq_your_api_key_here"}, ) for tweet in response.json()["tweets"]: urls = [item["mediaUrl"] for item in tweet.get("media", [])] print(tweet["id"], " ".join(urls)) ``` Use `GET /x/communities/{id}/media` to export the posts on a Community's Media tab. Each post has a photo or a video. Rows come newest first, like the tab on x.com. Each tweet costs 1 credit. Filters run before billing, so filtered-out rows cost nothing. ## Media tab or all posts? | Need | Route | Rows returned | | - | - | - | | Photo & video posts only | `/x/communities/{id}/media` | Media posts, newest first. | | Every post of the Community | `/x/communities/{id}/tweets` | All posts, newest first or Top. | Follow `next_cursor` until `has_next_page` is `false` for the whole tab. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Community ID, or the URL-encoded Community link, such as `x.com/i/communities/1493446837214187523`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `pageSize` | `number` | No | Upper bound for tweets per page, up to `10000`. A larger value gets the largest page. Defaults to `20`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Media tweets of the Community, newest first. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Contains the complete Tweet text. | | `tweets[].type` | `string` | Classifies the Tweet when X returns a type. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Reports the number of likes when available. | | `tweets[].retweetCount` | `number` | Reports the number of reposts when available. | | `tweets[].replyCount` | `number` | Reports the number of replies when available. | | `tweets[].quoteCount` | `number` | Reports the number of quotes when available. | | `tweets[].viewCount` | `number` | Reports the number of views when available. | | `tweets[].bookmarkCount` | `number` | Reports the number of bookmarks when available. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Reports the Tweet language code when available. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | Identifies the replied-to user when available. | | `tweets[].inReplyToUsername` | `string` | Reports the replied-to username when available. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Returns paid-promotion and AI-generated-media labels when available. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia`. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author X (Twitter) username. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Reports the author's follower count when available. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Lists media items attached to the Tweet. Omitted when none exist. | | `tweets[].media[].mediaUrl` | `string` | Provides the direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Lists available video renditions and playback details. Omitted for images. | | `tweets[].media[].type` | `string` | Identifies the attached media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. Pass as the `cursor` query parameter. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Community post content", "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 150, "retweetCount": 42, "replyCount": 10, "viewCount": 12400, "author": { "id": "987654321", "username": "username", "name": "Xquik", "followers": 12400, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Invalid community ID `{ "error": "invalid_community_id" }` The community ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 404 Community not found Xquik could not resolve the Community. Check the Community ID. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. The request costs nothing. ### 429 Rate limit exceeded The request exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The read service was unavailable. Retry after a short delay. ## X Community media questions ### Which posts does the Media tab hold? The Community's posts that carry a photo or a video, newest first. ### Can I filter the media posts? Yes. The tweet filters of Community tweets work here too, such as `minLikes` or `mediaType`. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Community tweets](/api-reference/x/community-tweets) reads every post of the Community. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Search community members, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-member-search Find a Twitter or X Community's members by name or username, each with its role & full profile. Names match from their first letters. 1 credit per member. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/{id}/members/search` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per member returned** · An answer without members is free [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/communities/1493446837214187523/members/search?q=marckohlbrugge" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const communityId = "1493446837214187523"; const params = new URLSearchParams({ q: "marckohlbrugge" }); const response = await fetch( `https://xquik.com/api/v1/x/communities/${communityId}/members/search?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" } }, ); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); const memberRows = page.users.map((user) => ({ community_id: communityId, member_id: user.id, username: user.username, name: user.name, role: user.communityRole ?? null, followers: user.followers ?? null, })); process.stdout.write(JSON.stringify(memberRows, null, 2)); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests community_id = "1493446837214187523" response = requests.get( f"https://xquik.com/api/v1/x/communities/{community_id}/members/search", params={"q": "marckohlbrugge"}, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) member_rows = [ { "community_id": community_id, "member_id": user["id"], "username": user["username"], "name": user["name"], "role": user.get("communityRole"), "followers": user.get("followers"), } for user in page["users"] ] print(json.dumps(member_rows, indent=2)) ``` ## Find members by name Use `GET /x/communities/{id}/members/search` to check whether people belong to a Community. The answer lists members whose name or username starts with `q`, in X's order. It can leave out some matching members. Send the exact username for the best match. Each row is a full profile with its `communityRole` of `Admin`, `Moderator` or `Member`. A name that finds only people outside the Community returns an empty `users` list. That answer is free. Try the exact username when a common name finds no member. All results fit in 1 answer, so `has_next_page` is `false`. To list every member, use [Community members](/api-reference/x/community-members). ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Community ID, such as `1493446837214187523`, or the URL-encoded Community link, such as `x.com/i/communities/1493446837214187523`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Name or username to find members by, such as `marckohlbrugge`. A leading `@` is dropped. Also read as `query`. | ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Members X found for the name, in X's order. Each holds the same profile fields as [Community members](/api-reference/x/community-members). These include `id`, `username`, `name`, `followers` & `verified`. | | `users[].communityRole` | `string` | The member's role in the Community is `Admin`, `Moderator` or `Member`. | | `has_next_page` | `boolean` | Always `false`. X sends all results in 1 answer. | | `next_cursor` | `string` | Always an empty string. | ### 400 Missing name or invalid Community ID `{ "error": "missing_query" }` Send a name or username in `q`. A Community ID must be numeric, or the answer is `invalid_community_id`. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [Community members](/api-reference/x/community-members) · [Community moderators](/api-reference/x/community-moderators) · [Community details](/api-reference/x/community-info) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "641633", "username": "marckohlbrugge", "name": "Marc Köhlbrugge", "communityRole": "Admin", "profilePicture": "https://pbs.twimg.com/profile_images/1857124042433572864/iMivVaYP_normal.jpg" } ], "has_next_page": false, "next_cursor": "" } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # List community members, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-members Scrape X (Twitter) community members into rows with usernames, bios, verification, and follower counts. Export every cursor page for review or CRM imports. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/{id}/members` Scrape X (Twitter) community members into profile rows. Store the community and user IDs with every cursor result. Keep the username, bio, verification, follower count, and cursor. ## X community member scraping questions ### Scrape X (Twitter) community members Call `GET /api/v1/x/communities/{id}/members` with the numeric community ID. Store the community ID and stable user ID. Keep the username, profile name, bio, location, and verification. Record an ISO 8601 collection time before requesting another cursor. Store available follower and following counts. Keep the profile image URL. Store the cursor returned with each profile batch. Save the page before advancing its opaque cursor. Use `has_next_page` as the only pagination guard. Send another request only for the boolean `true`. Reuse the exact `next_cursor`. Deduplicate a resumed page by community ID and user ID. Mark credit-bounded, failed, or interrupted runs as partial. Use the moderators route for role-specific profiles. The members route returns every visible member profile. ### What is the best way to extract data from an X (Twitter) community? First decide which community records the workflow needs. Use the info route for the community name and description. Use the members route for user IDs and profile fields. Use the moderators route for role-specific profiles. Retrieve recent Community posts through the tweets route. Search Community posts for a keyword through Community Search. Keep community profiles and tweets in separate tables. Join them with stable community and user IDs. Save page cursors, collection times, row counts, and completion states. Export JSON for applications. Create CSV or XLSX only when analysts need rows. Do not merge membership, moderator roles, and tweet activity into one record. ### How do I scrape members from an X community? Call `GET /api/v1/x/communities/{id}/members` with the numeric community ID. Store each user ID, username, profile name, bio, and verification state. Add the follower count and page cursor. Stop when `has_next_page` is false. Until then, send `next_cursor` without modification. Save each profile page before advancing its cursor. Deduplicate resumed pages by stable user ID. Write the community ID into every exported profile record. Record the collection time because usernames, bios, verification, and audience counts can change. Do not infer moderator status from membership. Use the dedicated moderators route for that role. Mark an interrupted or credit-bounded export as partial. ### Twitter community API Choose the route that matches the record. The info route returns community details. The members route returns member profiles. The moderators route returns moderator profiles. The tweets route returns recent community posts. Community search returns posts matching a query. For member exports, build one roster row per community ID and user ID. Keep profile fields, source cursor, collection time, and completion state. For tweet exports, store Tweet ID, author ID, text, timestamp, engagement, media, and cursor. Keep those schemas separate. Use stable IDs for joins. Respect API-key scope, credits, page limits, and rate limits. ### How should I compare community member lists? Complete every cursor page before comparing snapshots. Mark interrupted runs as partial. Use community ID plus user ID as the comparison key. Report newly observed and missing members separately. Never assign a reason for an addition or removal. Refresh profiles only when later work requires current follower counts, following counts, or biographies. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Low > credit balances can reduce a page or ID list. If zero results are affordable, > Xquik returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/communities/1234567890/members \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const communityId = "1234567890"; const response = await fetch(`https://xquik.com/api/v1/x/communities/${communityId}/members`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const nextCursor = data.has_next_page ? data.next_cursor : null; const memberRows = data.users.map((user) => ({ community_id: communityId, member_id: user.id, username: user.username, display_name: user.name, bio: user.description ?? null, follower_count: user.followers ?? null, verified: user.verified ?? false, profile_image_url: user.profilePicture ?? null, next_cursor: nextCursor, })); process.stdout.write(JSON.stringify(memberRows, null, 2)); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests community_id = "1234567890" response = requests.get( f"https://xquik.com/api/v1/x/communities/{community_id}/members", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() next_cursor = data["next_cursor"] if data["has_next_page"] else None member_rows = [ { "community_id": community_id, "member_id": user["id"], "username": user["username"], "display_name": user["name"], "bio": user.get("description"), "follower_count": user.get("followers"), "verified": user.get("verified", False), "profile_image_url": user.get("profilePicture"), "next_cursor": next_cursor, } for user in data["users"] ] print(json.dumps(member_rows, indent=2)) ``` Use `GET /x/communities/{id}/members` for member exports, CRM enrichment, audience review, or moderator handoff. It creates one row per community member. Store `community_id`, `member_id`, `username`, `display_name`, `bio`, `follower_count`, `verified`, `profile_image_url`, and `next_cursor`. ## Build a community member export The community member export becomes complete after every cursor page finishes. Save each profile page before advancing its cursor. Mark credit-bounded, failed, and interrupted runs as partial membership snapshots. Mark the export complete only after `has_next_page` is `false`. A member row shows that the account belongs to the community. It does not prove posting activity. Retrieve recent Community posts through [Community Tweets](/api-reference/x/community-tweets). Use [Community Search](/api-reference/x/community-search) to find posts by keyword. Join those posts to member profiles by `manifest_id`, `community_id`, and stable user ID. Use [Community Moderators](/api-reference/x/community-moderators) for role-specific profiles. Verification and follower counts do not prove a moderator role. X (Twitter) Lists use different IDs and membership rules. Review X's official [List Members Lookup](https://docs.x.com/x-api/lists/list-members/quickstart/list-members-lookup) before migrating a List workflow. Store `source_type` and its source ID. Use `community_id` for Community rows and `list_id` for List rows. Join and deduplicate with the source ID plus `member_id`. Use this route to enumerate profiles that belong to one community. Keep the community ID on every exported row. A username alone cannot identify its source community. Choose columns that support the next task. * User ID, username, and profile name. * Biography, location, and verification state. * Follower and following counts. * Store the Community ID and cursor with every page's ISO 8601 collection time. Use this Community member roster for directories, CRM enrichment, or moderator review. Do not label every member as a moderator. Use the moderators route to retrieve only moderator profiles. Use `has_next_page` as the only pagination check. The next request requires the boolean value `true`. Pass `next_cursor` without modification. Store each page before saving its cursor. Deduplicate repeated results by user ID after resuming a job. Profile fields can change after collection. Record an ISO 8601 time for every returned profile. The workflow may require current bios, follower counts, following counts, or avatars. If so, refresh the profile through user lookup. ## Compare community membership snapshots Collect every cursor page before comparing membership. Mark interrupted runs as partial. Use community ID and user ID as the comparison key. Record newly observed and missing members separately. Avoid inferring why a membership changed. Keep the snapshot's page count, row count, first cursor, and completion time. With these values, reviewers can tell a real change from an incomplete export. Store membership notes outside returned profile fields. Never place private moderation notes inside a public username or biography column. When another process adds moderator status, store it in a separate `community_role` column. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Community ID, or the URL-encoded Community link, such as `x.com/i/communities/1493446837214187523`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the initial request. | | `pageSize` | `number` | No | Results per request. Accepts 20-200. Defaults to `20`. | ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of community members. | | `users[].id` | `string` | User ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. | | `users[].followers` | `number` | Reports the profile's follower count. | | `users[].following` | `number` | Following count. | | `users[].verified` | `boolean` | Verified status. | | `users[].profilePicture` | `string` | Profile image URL. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. | | `users[].createdAt` | `string` | Account creation date (ISO 8601). | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | Lists pinned Tweet IDs. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Indicates whether the account protects its Tweets. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next results. Pass as the `cursor` query parameter. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/xquik/photo.jpg" } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Invalid community ID `{ "error": "invalid_community_id" }` The community ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 404 Community not found Xquik could not resolve the community. Check the community ID. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed Send `xquik-api-contract: 2026-04-29` to opt in to HTTP 424. Default v1 returns HTTP 502 with `x_api_unavailable`. > [!NOTE] > > **Next steps.** [Community Info](/api-reference/x/community-info) for community details, or [Community Moderators](/api-reference/x/community-moderators) to list moderators. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Community moderators & admins, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-moderators Retrieve X community moderators with usernames, bios, verification state, profile media, and follower and following counts. Costs 1 credit per result. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/{id}/moderators` Export moderator profiles for one X community. Store stable user IDs for access reviews. Analyze visible profiles or monitor the moderator roster. ## X community moderator API questions ### What does an X community moderator do? X's moderator playbook separates creators, admins, moderators, and members. The creator is also the first admin. Admins can change settings and manage moderator roles. Moderators review reported Community posts, manage members, and enforce Community rules. This route only reads profiles exposed by the visible moderator roster. It cannot assign roles, remove members, return reports, or expose private actions. Read X's official [Communities Moderator Playbook](https://help.x.com/en/using-x/communities-moderator-playbook) for current role responsibilities. Store `communityRole` only when the response supplies it. Never infer admin status from verification, follower counts, biographies, or profile images. ### How do I find X community moderators? Open the Community page when one manual lookup is enough. X says direct Community URLs expose visible member and moderator lists. X documents that public interface in its official [Communities guide](https://help.x.com/en/using-x/communities). Use this API for repeatable collection, pagination, exports, and snapshot review. Start with the numeric Community ID. Store that ID with every moderator ID. A username can change and cannot identify the source Community. Request another page only when `has_next_page` is exactly `true`. Pass the returned cursor string back without editing it. Mark the roster complete only after `has_next_page` is `false`. ### Which tools support X community moderation? Choose each endpoint by the record it returns. * Retrieve visible moderator profiles with this route. * Retrieve rules and counts with [Community Info](/api-reference/x/community-info). * Retrieve recent posts with [Community Tweets](/api-reference/x/community-tweets). * Search Community posts with [Community Search](/api-reference/x/community-search). * Review reports or change roles in X's own moderator interface. The moderator API does not return enforcement logs or reported-post queues. Keep those workflows separate from public profile exports. A profile row alone does not justify a moderation decision. ### Can AI automate community moderation? Do not automate enforcement from a moderator profile snapshot. Verification, follower counts, biographies, and avatars do not prove behavior or permissions. Use automation to normalize rows, compare complete snapshots, and queue human review. An AI model may summarize an approved public change set. Keep private review notes outside the exported profile record. Require a human decision before any account action. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/communities/1234567890/moderators \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const communityId = "1234567890"; const response = await fetch(`https://xquik.com/api/v1/x/communities/${communityId}/moderators`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const nextCursor = data.has_next_page ? data.next_cursor : null; const moderatorRows = data.users.map((user) => ({ community_id: communityId, moderator_id: user.id, username: user.username, display_name: user.name, bio: user.description ?? null, follower_count: user.followers ?? null, verified: user.verified ?? false, profile_image_url: user.profilePicture ?? null, page_size: data.users.length, has_next_page: data.has_next_page, next_cursor: nextCursor, })); process.stdout.write(JSON.stringify(moderatorRows, null, 2)); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests community_id = "1234567890" response = requests.get( f"https://xquik.com/api/v1/x/communities/{community_id}/moderators", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() next_cursor = data["next_cursor"] if data["has_next_page"] else None moderator_rows = [ { "community_id": community_id, "moderator_id": user["id"], "username": user["username"], "display_name": user["name"], "bio": user.get("description"), "follower_count": user.get("followers"), "verified": user.get("verified", False), "profile_image_url": user.get("profilePicture"), "page_size": len(data["users"]), "has_next_page": data["has_next_page"], "next_cursor": next_cursor, } for user in data["users"] ] print(json.dumps(moderator_rows, indent=2)) ``` Use `GET /x/communities/{id}/moderators` for moderator audits, trust and safety queues, or CRM enrichment. It creates one row per community moderator. Store `community_id`, `moderator_id`, `username`, `display_name`, `bio`, `follower_count`, `verified`, `profile_image_url`, and `next_cursor`. Store `page_size` and `has_next_page` with the checkpoint. Do this when you paginate moderator audits or saved review queues. ## Direct moderator handoff Use the first page with no `cursor`. Request the next page only when `has_next_page` is exactly `true`. Pass `next_cursor` back as `cursor` without modification. Requested result counts are upper bounds. Use `page_size` to record the returned moderator count for each page. > [card] Moderator rows > > Store one row per moderator. Include community ID, user ID, username, profile > fields, verification, and follower count. > [card] Next page > > Store each page and its pagination fields before requesting another page. > [card] Default page > > Expect up to the default page size per call. Low credits can return fewer > rows. > [card] Saved export > > Use `community_moderator_explorer` when the workflow needs an extraction > job. Also use it for CSV, JSON, or XLSX output. ## Build a complete moderator roster Save each response page as a checkpoint. Save every profile row before storing its cursor. Resume with the exact saved cursor after an interruption. Create a local `export_manifest_id` for each collection run. Store it with `community_id`, `moderator_id`, page number, cursor, and collection time. The key keeps each collection run separate. Label credit-bounded, failed, and interrupted runs as incomplete moderator exports. Do not compare a partial roster with a completed baseline. A partial comparison can falsely report removed moderators. Deduplicate resumed pages with `community_id` and `moderator_id`. Keep the latest username as a label. Use numeric user IDs to join collection runs. Store these completion fields with the export manifest. * Requested Community ID. * Returned page count and profile count. * First and final cursor values. * Final `has_next_page` value. * Collection start and completion times. * Complete, partial, or failed status. These fields show whether the roster finished. ## Audit a community moderation team Use this route when the role matters more than general membership. Every returned profile represents a moderator visible for the selected community. Keep the community ID and collection time with each profile. Review moderator rows for these fields. * User ID, username, and profile name. * Verification state and public biography. * Follower counts and profile image. * Cursor position and collection time. Compare snapshots by user ID. A changed username does not represent a new moderator. Flag added and removed IDs for review. Do not combine moderator rows with the full member roster without a role column. Other tools could otherwise read ordinary members as moderators. Both `community_id` and your local `export_manifest_id` must match. Then join the moderator roster with [Community Info](/api-reference/x/community-info). Keep rules, member counts, and moderator profiles in separate tables, one per endpoint. Store `communityRole` only when the response provides it. Never expand it into a broader permission. An omitted role cannot prove admin, creator, or member permissions. ## Review moderator coverage Compare complete moderator snapshots by Community ID and user ID. Record added and removed IDs without guessing the reason. Use this review sequence. 1. Confirm both exports ended with `has_next_page` set to `false`. 2. Confirm both exports use the same numeric Community ID. 3. Compare stable moderator IDs, not usernames or display names. 4. Ask a reviewer to inspect added and missing IDs. 5. Store the decision outside the public profile snapshot. Keep one row per visible moderator. The username is a label that can change. Join on the numeric user ID. Send unexpected changes to a human reviewer. Require human approval before any account action. Store each review outcome outside the public profile snapshot. Record the reviewer, decision time, and Community ID in your own system. Refresh a profile only when current biography or counts matter. Keep the original moderator observation. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Community ID, or the URL-encoded Community link, such as `x.com/i/communities/1493446837214187523`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which community endpoint? > [card] Community moderators > > Use `GET /x/communities/{id}/moderators` for governance audits, moderator > review queues, and profile enrichment. > [card] Community members > > Use [`GET /x/communities/{id}/members`](/api-reference/x/community-members) > for the broader member list. > [card] Community info > > Use [`GET /x/communities/{id}/info`](/api-reference/x/community-info) for > member count, moderator count, rules, and join policy. > [card] Community tweets > > Use [`GET /x/communities/{id}/tweets`](/api-reference/x/community-tweets) > for posts inside one community. > [card] Community search > > Use [`GET /x/communities/tweets`](/api-reference/x/community-search) > for keyword search across community tweets. > [card] Saved exports > > Use [`Create extraction`](/api-reference/extractions/create) with > `community_moderator_explorer`, `community_extractor`, or > `community_post_extractor` for queued file exports. ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of community moderators. | | `users[].id` | `string` | User ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. | | `users[].followers` | `number` | Reports the profile's follower count. | | `users[].following` | `number` | Following count. | | `users[].verified` | `boolean` | Verified status. | | `users[].profilePicture` | `string` | Profile image URL. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. | | `users[].createdAt` | `string` | Account creation date (ISO 8601). | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | Lists pinned Tweet IDs. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. Pass as the `cursor` query parameter. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "moduser", "name": "Moderator", "followers": 5000, "verified": true } ], "has_next_page": false, "next_cursor": "" } ``` ### 400 Invalid community ID `{ "error": "invalid_community_id" }` The community ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 404 Community not found Xquik could not resolve the community. Check the community ID. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed Send `xquik-api-contract: 2026-04-29` to opt in to HTTP 424. Default v1 returns HTTP 502 with `x_api_unavailable`. > [!NOTE] > > **Next steps.** [Community Members](/api-reference/x/community-members) for the full member list, or [Community Info](/api-reference/x/community-info) for community details. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Community notes contributor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-notes-contributor Get a Community Notes contributor by alias, with note counts by rating, rating counts, and the deleted notes count. 1 credit per lookup, unknown aliases free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/community-notes/contributors/{alias}` **1 credit per lookup** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/community-notes/contributors/ardent-beach-friarbird" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const alias = "ardent-beach-friarbird"; const response = await fetch(`https://xquik.com/api/v1/x/community-notes/contributors/${alias}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); const { notesCount, ratingsCount } = body.contributor; console.log(`${notesCount.currentlyRatedHelpful} notes rated helpful`); console.log(`${ratingsCount.successful.total} ratings matched the final rating`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests alias = "ardent-beach-friarbird" response = requests.get( f"https://xquik.com/api/v1/x/community-notes/contributors/{alias}", headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) contributor = body["contributor"] print(contributor["notesCount"]["currentlyRatedHelpful"], "notes rated helpful") print(contributor["ratingsCount"]["successful"]["total"], "ratings matched the final rating") ``` ## Who writes a Community Note? X names each Community Notes contributor by an alias, never by their X account. Use `GET /x/community-notes/contributors/{alias}` to read 1 contributor's record. * `notesCount` says how many notes they wrote, by X's current rating. * `ratingsCount` says how their ratings of other notes went. * `deletedNotesCount` counts the notes they deleted. Read what they wrote with [contributor notes](/api-reference/x/community-notes-contributor-notes). Read what they deleted with [deleted notes](/api-reference/x/community-notes-contributor-deleted-notes). ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `alias` | `string` | Yes | Contributor alias, such as `ardent-beach-friarbird`. The URL-encoded contributor URL also works, such as `x.com/i/communitynotes/u/ardent-beach-friarbird`. Any letter case works. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK X leaves out a field it does not send. Only `alias` is always present. | Field | Type | Description | | - | - | - | | `contributor` | `object` | The contributor's record. | | `contributor.alias` | `string` | The alias X gives the contributor. | | `contributor.isTopWriter` | `boolean` | Whether X marks the contributor as a top writer. | | `contributor.isApiContributor` | `boolean` | Whether the contributor writes notes through X's API. | | `contributor.deletedNotesCount` | `number` | Notes the contributor deleted. | | `contributor.notesCount` | `object` | How many notes the contributor wrote, by X's current rating. It holds `awaitingMoreRatings`, `currentlyRatedHelpful`, `currentlyRatedNotHelpful` & `updatedAt`. | | `contributor.ratingsCount` | `object` | How the contributor's ratings of other notes went. It holds `awaitingMoreRatings`, `ratedAfterDecision`, `successful`, `unsuccessful` & `updatedAt`. `successful` counts the ratings that matched the rating X gave the note. | ### 400 Invalid alias The path named no contributor. This answer is free. ### 404 Contributor not found No contributor holds the alias. This answer is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [Contributor notes](/api-reference/x/community-notes-contributor-notes) · [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) · [Get tweet](/api-reference/x/get-tweet) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "contributor": { "alias": "ardent-beach-friarbird", "deletedNotesCount": 0, "isApiContributor": false, "isTopWriter": false, "notesCount": { "awaitingMoreRatings": 18, "currentlyRatedHelpful": 1, "currentlyRatedNotHelpful": 2, "updatedAt": "2026-10-12T22:18:40.096Z" } } } ``` * **400** `{ "error": "invalid_contributor_alias", "message": "Send a Community Notes alias or its x.com/i/communitynotes/u URL." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "contributor_not_found", "message": "Contributor not found. Check the alias on its x.com/i/communitynotes/u page." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Deleted community notes, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-notes-contributor-deleted-notes List the Community Notes a contributor deleted, with each note's ID, time, rating status, rater tags, and scoring model. 1 credit per note, empty lists free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/community-notes/contributors/{alias}/deleted-notes` List the Community Notes 1 contributor deleted, newest first. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. When remaining credits cannot cover the full page, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per note returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/community-notes/contributors/ardent-beach-friarbird/deleted-notes" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const alias = "ardent-beach-friarbird"; const url = `https://xquik.com/api/v1/x/community-notes/contributors/${alias}/deleted-notes`; const response = await fetch(url, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); if (!response.ok) throw new Error(JSON.stringify(data)); const nextCursor = data.has_next_page ? data.next_cursor : null; const noteRows = data.notes.map((note) => ({ contributor_alias: alias, note_id: note.id, created_at: note.createdAt ?? null, rating_status: note.ratingStatus ?? null, next_cursor: nextCursor, })); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests alias = "ardent-beach-friarbird" response = requests.get( f"https://xquik.com/api/v1/x/community-notes/contributors/{alias}/deleted-notes", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() if not response.ok: raise RuntimeError(data) next_cursor = data["next_cursor"] if data["has_next_page"] else None note_rows = [ { "contributor_alias": alias, "note_id": note["id"], "created_at": note.get("createdAt"), "rating_status": note.get("ratingStatus"), "next_cursor": next_cursor, } for note in data["notes"] ] ``` The Node.js and Python snippets build 1 row per note. Store the rows with the cursor before you request the next page. ## What does X keep of a deleted note? X keeps each deleted note's ID, time, rating status, rater tags & scoring model. It shows a notice in place of the note's text. So `text`, `classification` & `post` are left out. `tombstone` holds that notice. A contributor who deleted no note returns an empty list, which is free. [Get notes contributor](/api-reference/x/community-notes-contributor) returns the count in `deletedNotesCount`. ## Page through deleted notes Each page returns `has_next_page` and `next_cursor`. Send `next_cursor` back as `cursor`. Stop when `has_next_page` is `false`. A cursor X never issued returns `400 invalid_cursor`, which is free. Start again without `cursor`, then use `next_cursor`. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `alias` | `string` | Yes | Contributor alias, such as `ardent-beach-friarbird`. The URL-encoded contributor URL also works, such as `x.com/i/communitynotes/u/ardent-beach-friarbird`. Any letter case works. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `pageSize` | `integer` | No | Notes per page, from `1` to `10`. Defaults to `10`. Also read as `limit`, `count`, `max_results`, `maxItems`, `max_items` & `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK X leaves out a field that a note lacks. Only `id` is always present. | Field | Type | Description | | - | - | - | | `notes` | `object[]` | The contributor's deleted notes, newest first. | | `notes[].id` | `string` | Note ID. | | `notes[].createdAt` | `string` | When the contributor wrote the note, as ISO 8601. | | `notes[].ratingStatus` | `string` | X's rating of the note, such as `NeedsMoreRatings` or `CurrentlyRatedNotHelpful`. | | `notes[].helpfulTags` | `string[]` | Why raters called the note helpful. | | `notes[].notHelpfulTags` | `string[]` | Why raters called the note not helpful. | | `notes[].decidedBy` | `string` | The X scoring model that set the rating. | | `notes[].fullyVisibleModel` | `boolean` | Whether X marks that scoring model as fully visible. | | `notes[].abovePcrhThreshold` | `boolean` | Whether the note scores above X's bar for a possible helpful rating. | | `notes[].appealStatus` | `string` | Whether the rating is under appeal. | | `notes[].deleted` | `boolean` | `true` for a deleted note. | | `notes[].tombstone` | `string` | X's notice in place of the note, such as `This note has been deleted`. | | `notes[].isApiAuthor` | `boolean` | Whether the note came through X's API. | | `notes[].isMediaNote` | `boolean` | Whether the note was about a post's media. | | `notes[].mediaNoteMatchCount` | `number` | Other posts X matched a media note to. | | `notes[].isUrlNote` | `boolean` | Whether the note was on a link. | | `has_next_page` | `boolean` | Whether more notes follow. | | `next_cursor` | `string` | Cursor for the next page. Empty at the end of the list. | ### 400 Invalid alias or cursor A cursor X never issued returns `invalid_cursor`. Start again without `cursor`. Both answers are free. ### 404 Contributor not found No contributor holds the alias. This answer is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get notes contributor](/api-reference/x/community-notes-contributor) · [Contributor notes](/api-reference/x/community-notes-contributor-notes) · [Get tweet](/api-reference/x/get-tweet) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "notes": [ { "id": "2078950499982696756", "createdAt": "2026-07-19T21:09:58.885Z", "ratingStatus": "CurrentlyRatedNotHelpful", "notHelpfulTags": ["MissingKeyPoints"], "decidedBy": "CoreModel (v1.1)" } ], "has_next_page": false, "next_cursor": "" } ``` * **400** `{ "error": "invalid_contributor_alias", "message": "Send a Community Notes alias or its x.com/i/communitynotes/u URL." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "contributor_not_found", "message": "Contributor not found. Check the alias on its x.com/i/communitynotes/u page." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Community notes by contributor, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-notes-contributor-notes List every Community Note a contributor wrote, with its text, rating status, rater tags, and the post it is on. Includes notes x.com hides. 1 credit per note. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/community-notes/contributors/{alias}/notes` List the Community Notes 1 contributor wrote, newest first. Each note comes with the post it is on. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. When remaining credits cannot cover the full page, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per note returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/community-notes/contributors/ardent-beach-friarbird/notes" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const alias = "ardent-beach-friarbird"; const url = `https://xquik.com/api/v1/x/community-notes/contributors/${alias}/notes`; const response = await fetch(url, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); if (!response.ok) throw new Error(JSON.stringify(data)); const nextCursor = data.has_next_page ? data.next_cursor : null; const noteRows = data.notes.map((note) => ({ contributor_alias: alias, note_id: note.id, rating_status: note.ratingStatus ?? null, text: note.text ?? null, post_id: note.postId ?? null, post_author: note.post?.author?.username ?? null, next_cursor: nextCursor, })); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests alias = "ardent-beach-friarbird" response = requests.get( f"https://xquik.com/api/v1/x/community-notes/contributors/{alias}/notes", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() if not response.ok: raise RuntimeError(data) next_cursor = data["next_cursor"] if data["has_next_page"] else None note_rows = [ { "contributor_alias": alias, "note_id": note["id"], "rating_status": note.get("ratingStatus"), "text": note.get("text"), "post_id": note.get("postId"), "post_author": ((note.get("post") or {}).get("author") or {}).get("username"), "next_cursor": next_cursor, } for note in data["notes"] ] ``` The Node.js and Python snippets build 1 row per note. Store the rows with the cursor before you request the next page. ## Which notes does it return? It returns every note the contributor wrote, whatever its rating. Only helpful notes show under posts on x.com. So this list also holds the notes x.com hides. * `ratingStatus` says how X rates the note now, such as `NeedsMoreRatings` or `CurrentlyRatedHelpful`. * `helpfulTags` & `notHelpfulTags` say why raters called it helpful or not. * `timeToHelpfulFromNoteMs` says how long the note took to be rated helpful. * `post` is the post the note is on. It has the same fields as [Get tweet](/api-reference/x/get-tweet). For a post X no longer shows, `post` is `null`. `postId` still names it. `postUnavailable.reason` says why when X gives a reason, such as `Suspended`. ## Page through a contributor's notes Each page returns `has_next_page` and `next_cursor`. Send `next_cursor` back as `cursor`. Stop when `has_next_page` is `false`. A cursor X never issued returns `400 invalid_cursor`, which is free. Start again without `cursor`, then use `next_cursor`. Use the note `id` as the key in your store. Overlapping reads then add no duplicates. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `alias` | `string` | Yes | Contributor alias, such as `ardent-beach-friarbird`. The URL-encoded contributor URL also works, such as `x.com/i/communitynotes/u/ardent-beach-friarbird`. Any letter case works. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `pageSize` | `integer` | No | Notes per page, from `1` to `10`. Defaults to `10`. Also read as `limit`, `count`, `max_results`, `maxItems`, `max_items` & `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK X leaves out a field that a note lacks. Only `id` is always present. | Field | Type | Description | | - | - | - | | `notes` | `object[]` | The contributor's notes, newest first. | | `notes[].id` | `string` | Note ID. | | `notes[].createdAt` | `string` | When the contributor wrote the note, as ISO 8601. | | `notes[].language` | `string` | Language code of the note. | | `notes[].classification` | `string` | What the writer says of the post, such as `MisinformedOrPotentiallyMisleading` or `NotMisleading`. | | `notes[].text` | `string` | What the note says. | | `notes[].entities` | `object[]` | Links, tags & accounts inside the text, each with `fromIndex`, `toIndex` & `ref`. | | `notes[].contributor` | `object` | The note's writer, with the counts X sends beside a note. [Get notes contributor](/api-reference/x/community-notes-contributor) returns every count. | | `notes[].ratingStatus` | `string` | X's current rating, such as `NeedsMoreRatings`, `CurrentlyRatedHelpful` or `CurrentlyRatedNotHelpful`. | | `notes[].helpfulTags` | `string[]` | Why raters called the note helpful. | | `notes[].notHelpfulTags` | `string[]` | Why raters called the note not helpful. | | `notes[].decidedBy` | `string` | The X scoring model that set the rating. | | `notes[].fullyVisibleModel` | `boolean` | Whether X marks that scoring model as fully visible. | | `notes[].abovePcrhThreshold` | `boolean` | Whether the note scores above X's bar for a possible helpful rating. | | `notes[].appealStatus` | `string` | Whether the rating is under appeal. | | `notes[].deleted` | `boolean` | Whether the writer deleted the note. | | `notes[].tombstone` | `string` | X's notice in place of a deleted note. | | `notes[].isApiAuthor` | `boolean` | Whether the note came through X's API. | | `notes[].isMediaNote` | `boolean` | Whether the note is about the post's media. | | `notes[].mediaNoteMatchCount` | `number` | Other posts X matched a media note to. | | `notes[].isUrlNote` | `boolean` | Whether the note is on a link. | | `notes[].displayUrl` | `string` | The link a link note is on, as X shows it. | | `notes[].isTranslatable` | `boolean` | Whether X offers a translation of the note. | | `notes[].timeToHelpfulFromNoteMs` | `number` | Milliseconds from the note's creation to its helpful rating. | | `notes[].timeToHelpfulFromPostMs` | `number` | Milliseconds from the post's creation to the note's helpful rating. | | `notes[].impressionCount` | `number` | Views of the note, when X shares them. | | `notes[].postId` | `string` | ID of the post the note is on. | | `notes[].post` | `object \| null` | The post the note is on, or `null` when X no longer shows it. | | `notes[].postUnavailable` | `object` | Why X shows no post, when X says. It holds `reason`. | | `has_next_page` | `boolean` | Whether more notes follow. | | `next_cursor` | `string` | Cursor for the next page. Empty at the end of the list. | ### 400 Invalid alias or cursor A cursor X never issued returns `invalid_cursor`. Start again without `cursor`. Both answers are free. ### 404 Contributor not found No contributor holds the alias. This answer is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get notes contributor](/api-reference/x/community-notes-contributor) · [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) · [Get tweet](/api-reference/x/get-tweet) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "notes": [ { "id": "2026375778254868976", "createdAt": "2026-02-24T19:16:48.435Z", "language": "en", "classification": "MisinformedOrPotentiallyMisleading", "contributor": { "alias": "ardent-beach-friarbird", "notesCount": { "currentlyRatedHelpful": 1, "currentlyRatedNotHelpful": 2 }, "ratingsCount": { "successful": { "total": 49 }, "unsuccessful": { "helpfulCount": 15, "notHelpfulCount": 4 } } } } ], "has_next_page": true, "next_cursor": "-1767098234260" } ``` * **400** `{ "error": "invalid_contributor_alias", "message": "Send a Community Notes alias or its x.com/i/communitynotes/u URL." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "contributor_not_found", "message": "Contributor not found. Check the alias on its x.com/i/communitynotes/u page." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Popular communities by topic, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-popular List the most popular X (Twitter) Communities of a topic, such as Technology or Gaming. Name the topic by ID or name to get each Community. 1 credit each. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/popular` **1 credit per Community returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/communities/popular \ --data-urlencode "topic=Technology" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ topic: "Technology" }); const response = await fetch(`https://xquik.com/api/v1/x/communities/popular?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); for (const community of data.communities) { process.stdout.write(`${community.id} ${community.name} ${community.member_count}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/communities/popular", params={"topic": "Technology"}, headers={"x-api-key": "xq_your_api_key_here"}, ) for community in response.json()["communities"]: print(community["id"], community["name"], community["member_count"]) ``` Use `GET /x/communities/popular` to list the Communities X (Twitter) ranks highest under a topic. Name the topic by `topicId`, or by `topic` name in any case. Subtopics work too, such as `Artificial Intelligence`. Each Community costs 1 credit. ## Pick a topic [Community topics](/api-reference/x/community-topics) lists every topic and subtopic with its ID. Send a name, such as `topic=gaming`, or an ID, such as `topicId=701`. `topicId` wins when you send both. A missing or unknown topic returns `400 invalid_community_topic`. Its `message` lists the topic names to send. It costs nothing. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `topicId` | `string` | No | Topic or subtopic ID from [Community topics](/api-reference/x/community-topics), such as `301`. Wins over `topic`. | | `topic` | `string` | No | Topic or subtopic name in any case, such as `technology`. Send this or `topicId`. | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit it for the first page. A cursor X refuses or that expired returns a free `400 invalid_cursor`. Start again without it. | | `pageSize` | `integer` | No | Most Communities to return on this page. Your credit balance can return fewer. Also read as `limit`, `count`, or `max_results`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send a full Xquik account API key. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `communities` | `object[]` | The topic's most popular Communities, in X's order. | | `communities[].id` | `string` | Community ID. Pass it to the other Community endpoints. | | `communities[].name` | `string` | Community name. | | `communities[].member_count` | `number` | Total member count. | | `communities[].is_nsfw` | `boolean` | Whether X marks the Community sensitive. | | `communities[].primary_topic` | `object` | The topic X files the Community under, with its `name`. | | `communities[].banner_url` | `string` | Banner image URL. Omitted if unavailable. | | `communities[].banner` | `object` | Banner `url`, `width`, `height`, main `colors`, and the `focus` area X keeps in view. Omitted if unavailable. | | `communities[].membersFacepile` | `object[]` | Members X previews beside the member count. Each has its `id`, `profilePicture` and `profilePictureOriginal`, the same picture at full size. | | `has_next_page` | `boolean` | Whether another page of Communities follows. | | `next_cursor` | `string` | Cursor for the next page. Empty at the end. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "communities": [ { "id": "1472105760389668865", "name": "Tech Twitter", "member_count": 121468, "is_nsfw": false, "primary_topic": { "name": "Technology" }, "banner_url": "https://pbs.twimg.com/community_banner_img/example.jpg" } ], "has_next_page": true, "next_cursor": "WzM1LjUxMjQ5N10=" } ``` ### 400 Invalid community topic or cursor `{ "error": "invalid_community_topic", "message": "Unknown topic. Use Sports, Technology, or Art. You can also send a subtopic from GET /x/communities/topics." }` The real message lists every topic name. A cursor X can't read returns `invalid_cursor`. `{ "error": "invalid_cursor", "message": "Cursor invalid or expired. Start again without cursor, then use next_cursor." }` Start again without `cursor`. Both answers are free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read failed. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Popular X Communities questions ### Which topics can I send? Every topic and subtopic that [Community topics](/api-reference/x/community-topics) lists, by name or ID. ### Are the results the same for everyone? X ranks them, so the list can change between requests. ### How much does it cost? Each returned Community costs 1 credit. An unknown topic costs nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Community details](/api-reference/x/community-info) reads a Community's rules, creator, and admin by its `id`. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Community search by keyword, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-search Search posts in one X (Twitter) community or in every community by keyword. Export matching tweets, authors, replies, reposts, likes, media, and cursor pages. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/search` See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | X (Twitter) community search filters posts in one known Community, or across every Community. Run a Twitter search in community posts with a query. Add a numeric Community ID to stay in 1 Community. Store Tweet IDs, authors, engagement counts, media, and cursors for exports. ## Filter one community by query This endpoint requires a search expression. Add `communityId` to filter 1 community, or leave it out to search every community. It does not return the unfiltered feed. Keep the query beside every saved row. | Search decision | Request field | Result boundary | | - | - | - | | Community scope | `communityId` | Search 1 community, or every one when left out. | | Text filter | `q` | Return posts matching the exact search expression. | | Ranking mode | `queryType=Latest` | Build a recent moderation or monitoring queue. | | Ranking mode | `queryType=Top` | Build a relevance-ranked research set. | | Continuation | `cursor` | Resume the same community, query, and ranking mode. | | Saved export | `community_search` extraction | Produce CSV, JSON, or XLSX query results. | Use the community tweets endpoint when no keyword filter is required. ## X (Twitter) community search questions ### Does this endpoint find communities to join? No. This endpoint searches posts, in 1 Community or across every Community. It does not join Communities or change membership. To find Communities by keyword, use [Find communities](/api-reference/x/community-find). To browse Communities by topic, use [Popular communities](/api-reference/x/community-popular). Read the official [X Communities guide](https://help.x.com/en/using-x/communities) for current visibility and membership rules. ### How do I search community posts by keyword? Send `q`, and `communityId` to stay in 1 Community. Omit `communityId` to search every Community. Omit `queryType` to use `Latest`. Set `Top` for relevance-ranked matches. Keep each cursor tied to the same values. Start a new search when the query changes. Store the query beside every returned Tweet ID. ### How do I get a Community's posts for a hashtag? Search it with `q=#tag`, such as `q=#bitcoin`, and the Community's `communityId`. Set `queryType=Latest` for the newest posts first. Follow `next_cursor` for older posts. ### Why does X (Twitter) community search return no results? First, verify the Community ID, query, and read visibility. An empty match set differs from authentication, credit, dependency, rate-limit, or request errors. Use the [Community Tweets API](/api-reference/x/community-tweets) to inspect the visible, unfiltered feed. Zero matches do not prove an inactive Community. ### Can I find active authors in matching tweets? Group matching posts by stable author ID. Count matches, replies, reposts, likes, quotes, and views separately. Store follower counts with collection times when returned. These measures describe captured matches. They do not prove influence, audience reach, Community membership, or total posting activity. > [!NOTE] > > `GET /x/communities/search` and `GET /x/communities/tweets` accept the same > community search parameters. This page documents both supported REST paths. Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/communities/search \ --data-urlencode "communityId=1234567890" \ --data-urlencode "q=web development" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const communityId = "1234567890"; const searchQuery = "web development"; const queryType = "Latest"; const pageSize = "100"; const params = new URLSearchParams({ communityId, q: searchQuery, queryType, pageSize }); const response = await fetch(`https://xquik.com/api/v1/x/communities/search?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const tweetRows = data.tweets.map((tweet) => { const author = tweet.author ?? {}; return { community_id: communityId, search_query: searchQuery, query_type: queryType, tweet_id: tweet.id, text: tweet.text, author_id: author.id ?? null, author_username: author.username ?? null, author_name: author.name ?? null, author_followers: author.followers ?? null, author_verified: author.verified ?? null, author_profile_picture: author.profilePicture ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, media_urls: tweet.media?.map((item) => item.mediaUrl).filter(Boolean) ?? [], }; }); const nextCursor = data.has_next_page ? data.next_cursor : null; for (const row of tweetRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } if (nextCursor !== null) { const checkpoint = { community_id: communityId, search_query: searchQuery, query_type: queryType, page_size: Number(pageSize), next_cursor: nextCursor, }; process.stdout.write(`${JSON.stringify(checkpoint)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests community_id = "1234567890" search_query = "web development" query_type = "Latest" page_size = 100 response = requests.get( "https://xquik.com/api/v1/x/communities/search", params={ "communityId": community_id, "q": search_query, "queryType": query_type, "pageSize": page_size, }, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() tweet_rows = [] for tweet in data["tweets"]: author = tweet.get("author") or {} tweet_rows.append( { "community_id": community_id, "search_query": search_query, "query_type": query_type, "tweet_id": tweet["id"], "text": tweet.get("text"), "author_id": author.get("id"), "author_username": author.get("username"), "author_name": author.get("name"), "author_followers": author.get("followers"), "author_verified": author.get("verified"), "author_profile_picture": author.get("profilePicture"), "created_at": tweet.get("createdAt"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], } ) next_cursor = data["next_cursor"] if data["has_next_page"] else None for row in tweet_rows: print(json.dumps(row)) if next_cursor is not None: print(json.dumps({ "community_id": community_id, "search_query": search_query, "query_type": query_type, "page_size": page_size, "next_cursor": next_cursor, })) ``` The Node.js & Python snippets build one row per matching community tweet. They do not print the full response page. Store the final `next_cursor` row when `has_next_page` is true. Then pass it back as `cursor` with the same `communityId`, `q`, `queryType`, and `pageSize`. ## Plan a community search export Choose this route for repeatable research across one known community. Define the question before choosing the query. A narrow query returns fewer irrelevant tweet rows to review. Start each export with these values. * The numeric community ID. * The exact search expression. * Either `Latest` or `Top`. * A stable page size. * The time when collection started. Keep those values beside every saved cursor. Resume with the same values. Changing the query during pagination starts a different result set. Use `Latest` for incident review, event coverage, and recent topic monitoring. Use `Top` for relevance-ranked discovery. Do not combine both orders inside one export file. Create separate exports when reviewers need both orders. Normalize each tweet into named columns. Useful columns include tweet ID, text, author username, and creation time. They also include likes, replies, reposts, and media URLs. Keep the community ID and query on every row. Those columns keep context after CSV or XLSX handoff. Stop when `has_next_page` becomes false. Store the final checkpoint with the row count. Deduplicate resumed exports by tweet ID. A worker that retries the last completed page then adds no duplicate spreadsheet rows. ## Compare latest and top results without mixing datasets Run `Latest` and `Top` as independent searches when research needs both views. The 2 orders rank different tweets first and may return overlapping tweets. Give each run its own manifest, cursor chain, and output file. Keep the same community ID and query when comparing the 2 modes. Changing another input would invalidate the comparison. Use `Latest` to capture recent discussion. Record when you requested the first page. New tweets can appear while you collect later pages. Use `Top` to capture relevance-ranked discussion. Record the collection time, but do not treat rank as a permanent score. The order can change later. After both runs finish, join rows by tweet ID. Label every tweet as `latest_only`, `top_only`, or `both`. Keep the original engagement counts from each run when collection times differ. Do not append one mode beneath the other without a source column. Analysts could mistake duplicated tweets for extra community activity. Validate each dataset before comparison. * Every row uses the intended community ID. * Every row stores the exact search query. * Every cursor belongs to one sort mode. * Each run removes duplicate tweet IDs. * Partial runs remain labeled. Use the combined view to decide what to research first. Keep the separate exports so others can reproduce and audit the work. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `communityId` | `string` | No | ID or link of the community to search, such as `x.com/i/communities/1493446837214187523`. Leave it out to search every community. | | `q` | `string` | Yes | Search query for community tweets. | | `queryType` | `string` | No | Sort order. `Top` returns most relevant tweets, `Latest` returns most recent. Defaults to `Latest`. | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `pageSize` | `number` | No | Upper bound for tweets per page. Accepts 1-100. Defaults to `20`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which community search route? > [card] Community search route > > Use `GET /x/communities/search` with `q`, and `communityId` for scoped search. > [card] Equivalent scoped route > > Use `GET /x/communities/tweets` when your integration already uses that > path. It accepts the same `communityId`, `q`, `queryType`, `cursor`, and > `pageSize` shape. > [card] Known community posts > > Use [`GET /x/communities/{id}/tweets`](/api-reference/x/community-tweets) > for posts from one known community ID. > [card] Bulk community jobs > > Use [`Create extraction`](/api-reference/extractions/create) with > `community_search` with `targetCommunityId` and `searchQuery` for > a saved filtered export. Use `community_post_extractor` for > all posts from a known community. ## Build a live community review queue Choose either documented path for direct, page-by-page tweet retrieval. Both paths work behind moderation screens, support consoles, and analyst dashboards. Show the active community ID, query, and sort mode above the results. Reviewers should always know why each tweet appeared. Render concrete tweet fields. * Tweet text, Tweet ID, and creation time. * Author name, username, user ID, and verification state. * Reply, repost, like, quote, and view counts when returned. * Attached photo, video, or animated GIF URLs. * A source URL for opening the original tweet. Bind `next_cursor` to the community, query, sort mode, and page size. Stop paging when `has_next_page` is false. An empty page is a valid result, not a missing community. ## Keep decisions across a live moderation queue Key the queue on the community ID, query, and sort mode. Store each decision against `tweet.id`, never a row position. When a page fails, keep its rows and cursor. Retry with the same parameters. `Latest` rows change as new tweets arrive, so deduplicate them by Tweet ID. `Top` ranking changes too, so record each collection time. ## Build a query-specific community review batch Save the exact query before requesting tweets. Give each batch 1 purpose. Store Tweet ID, author ID, text, creation time, engagement, and media for every match. Add the request time and cursor. Keep reviewer fields in a separate table keyed by Tweet ID. Record 1 terminal state. Use completed, capped, credit-bounded, or interrupted. A live search page never proves a complete community archive. ## Separate search matches from community feed coverage Community search returns tweets matching one expression. It does not return every recent post. Use the community feed route for an unfiltered timeline. Keep match counts separate from total community activity. A narrow query can return zero tweets while the community remains active. A broad query can create more review work without improving relevance. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of matching community tweets. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Contains the complete Tweet text. | | `tweets[].type` | `string` | Classifies the Tweet when X returns a type. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Reports the number of likes when available. | | `tweets[].retweetCount` | `number` | Reports the number of reposts when available. | | `tweets[].replyCount` | `number` | Reports the number of replies when available. | | `tweets[].quoteCount` | `number` | Reports the number of quotes when available. | | `tweets[].viewCount` | `number` | Reports the number of views when available. | | `tweets[].bookmarkCount` | `number` | Reports the number of bookmarks when available. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Reports the Tweet language code when available. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | Identifies the replied-to user when available. | | `tweets[].inReplyToUsername` | `string` | Reports the replied-to username when available. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Returns paid-promotion and AI-generated-media labels when available. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia`. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author X (Twitter) username. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Reports the author's follower count when available. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Lists media items attached to the Tweet. Omitted when none exist. | | `tweets[].media[].mediaUrl` | `string` | Provides the direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Lists available video renditions and playback details. Omitted for images. | | `tweets[].media[].type` | `string` | Identifies the attached media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. Pass as the `cursor` query parameter. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Great discussion about web development", "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 75, "retweetCount": 12, "replyCount": 8, "viewCount": 5400, "author": { "id": "987654321", "username": "devuser", "name": "Developer", "followers": 25000, "verified": false, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Missing query `{ "error": "missing_query" }` The `q` query parameter is empty or missing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Next steps.** [Community Info](/api-reference/x/community-info) to look up a community, or [Search Tweets](/api-reference/x/search-tweets) for general tweet search. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Suggested communities to join, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-suggested List the X (Twitter) Communities suggested to join. Each has rules, topic, creator, admin, and member count. X picks them for each request. 1 credit each. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/suggested` **1 credit per Community returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/communities/suggested \ --data-urlencode "limit=10" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ limit: "10" }); const response = await fetch(`https://xquik.com/api/v1/x/communities/suggested?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); for (const community of data.communities) { process.stdout.write(`${community.id} ${community.name} ${community.member_count}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/communities/suggested", params={"limit": 10}, headers={"x-api-key": "xq_your_api_key_here"}, ) for community in response.json()["communities"]: print(community["id"], community["name"], community["member_count"]) ``` Use `GET /x/communities/suggested` to list the Communities X (Twitter) suggests to join. Each suggestion carries the full Community record. That record holds rules, topic, creator, admin, and previewed members. Each Community costs 1 credit. An empty list costs nothing. ## How X picks suggestions X picks the suggestions for each request, so 2 calls can return different Communities. An empty answer means X suggests none right now. For a list based only on your input, use [Find communities](/api-reference/x/community-find) or [Popular communities](/api-reference/x/community-popular). ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Most Communities to return, starting at `1`. Omit it for every suggestion. Your credit balance can return fewer. Also read as `pageSize`, `count`, or `max_results`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send a full Xquik account API key. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `communities` | `object[]` | Suggested Communities, in X's order. Each has the fields of [Community details](/api-reference/x/community-info). | | `communities[].id` | `string` | Community ID. | | `communities[].name` | `string` | Community name. | | `communities[].description` | `string` | Community description. Omitted if empty. | | `communities[].member_count` | `number` | Total member count. | | `communities[].moderator_count` | `number` | Total moderators. Omitted if unavailable. | | `communities[].rules` | `object[]` | Community rules, each with `id`, `name`, and `description`. Omitted if unavailable. | | `communities[].creator` | `object` | The creator's public profile. Omitted if unavailable. | | `communities[].admin` | `object` | The admin's public profile. Omitted if unavailable. | | `communities[].membersFacepile` | `object[]` | Public profiles of the members X previews beside the member count. | | `count` | `number` | Communities returned and charged. | | `message` | `string` | What to do next. Present only when X suggests none. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "communities": [ { "id": "1453877367030484992", "name": "The Design Sphere", "member_count": 668032, "moderator_count": 13, "is_nsfw": false, "join_policy": "Open", "primary_topic": { "id": "202", "name": "Design" }, "rules": [ { "id": "1706049474777268401", "name": "Be Respectful", "description": "Give kind and useful feedback." } ] } ], "count": 1 } ``` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read failed. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Suggested X Communities questions ### Why do 2 calls return different Communities? X picks the suggestions for each request. ### Does the response include my membership? No. It holds only public Community fields. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Community tweets](/api-reference/x/community-tweets) reads a suggested Community's posts by its `id`. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Community topics & subtopics, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-topics List every topic X (Twitter) groups Communities under, with each subtopic and its ID. Pass a topic to the popular Communities API. 1 credit per topic returned. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/topics` **1 credit per topic returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/communities/topics \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/communities/topics", { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); for (const topic of data.topics) { const subtopics = topic.subtopics.map((subtopic) => subtopic.name).join(", "); process.stdout.write(`${topic.id} ${topic.name}: ${subtopics}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/communities/topics", headers={"x-api-key": "xq_your_api_key_here"}, ) for topic in response.json()["topics"]: subtopics = ", ".join(subtopic["name"] for subtopic in topic["subtopics"]) print(topic["id"], topic["name"], subtopics) ``` Use `GET /x/communities/topics` to list the topics X (Twitter) groups Communities under. Each topic carries its subtopics. Pass a topic or subtopic to [Popular communities](/api-reference/x/community-popular) as `topicId` or `topic`. Each top-level topic costs 1 credit, its subtopics included. X changes the list rarely, so store it. An empty list costs nothing. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Most topics to return, starting at `1`. Omit it for every topic. Your credit balance can return fewer. Also read as `pageSize`, `count`, or `max_results`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send a full Xquik account API key. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `topics` | `object[]` | Every topic, in X's order. | | `topics[].id` | `string` | Topic ID. Pass it as `topicId` to Popular communities. | | `topics[].name` | `string` | Topic name. Popular communities also takes it as `topic`. | | `topics[].subtopics` | `object[]` | Narrower topics, each with its own `id` and `name`. | | `count` | `number` | Top-level topics returned. | | `message` | `string` | What to do next. Present only when X (Twitter) lists no topic. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "topics": [ { "id": "301", "name": "Technology", "subtopics": [ { "id": "302", "name": "Artificial Intelligence" }, { "id": "303", "name": "Software" } ] }, { "id": "701", "name": "Gaming", "subtopics": [] } ], "count": 2 } ``` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read failed. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## X Community topics questions ### How much does the topic list cost? 1 credit per top-level topic. Its subtopics come free. Send `limit` for fewer topics. ### Do subtopics work with Popular communities? Yes. Send a subtopic's `id` as `topicId` or its `name` as `topic`. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Popular communities](/api-reference/x/community-popular) lists the top Communities of a topic. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Community tweets timeline, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-tweets Export X community tweets with authors, text, replies, reposts, likes, quotes, and media. Traverse cursor pages or save CSV, JSON, and XLSX exports for reviews. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/{id}/tweets` > [!NOTE] > > Repost records include `retweetedAt`, the repost event's UTC ISO 8601 timestamp. It is `null` when > that timestamp is unavailable. The API omits it for original posts. The nested original post keeps > its own creation date. This field does not report every account that reposted a post. [Request > per-account timestamps with Get retweeters.](/api-reference/x/retweeters#retweet-timestamps) See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | Export X (Twitter) community posts from one known Community timeline. Keep Tweet text, authors, engagement counts, media, and cursor state. Save live pages or CSV, JSON, and XLSX exports. This X (Twitter) community scraping guide builds a community timeline export from cursor pages. ## Archive the unfiltered community feed This endpoint accepts a community ID without a keyword. It keeps the returned feed order for timeline archives, content review, and moderation. | Feed decision | Request or response field | Archive rule | | - | - | - | | Community scope | Path `{id}` | Keep this ID on every exported tweet row. | | Feed coverage | No `q` parameter | Archive posts without text filtering. | | Returned order | Response tweet sequence | Keep the order. Do not re-rank rows. | | Continuation | `has_next_page` and `next_cursor` | Save each page before advancing. | | Duplicate control | Tweet `id` | Deduplicate pages by tweet ID, because new posts shift the feed. | | Saved export | `community_post_extractor` | Produce CSV, JSON, or XLSX timeline files. | Send `queryType=Top` for the Community's Top posts, the ones X ranks highest. Send it again with each `cursor`. The first page opens with the post the Community pinned, as x.com shows it. That post has `isPinned: true`, and later pages leave it out. Choose Community Search for keyword filters. For photo and video posts only, use [Community media](/api-reference/x/community-media). ## X community tweet export questions ### Export community tweets Call `GET /api/v1/x/communities/{id}/tweets` for the recent community feed. Keep the Community ID, Tweet ID, text, author, creation time, and media. Store each returned engagement count and cursor checkpoint. Choose Community Search when the workflow requires a keyword. Feed retrieval returns recent posts. Search returns posts that match a query. Save each page and cursor before requesting another page. Deduplicate by stable Tweet ID when new posts enter the feed. Record Community ID, Tweet ID, author ID, text, and creation time. Store each engagement count with media and collection timestamps. Label interrupted, result-capped, or credit-bounded collections as partial. ### Are X (Twitter) community posts public or private? X says Community posts can appear on the Community page and profiles. X says they can also appear in global search and other timelines. Read the official [Communities guide](https://help.x.com/en/using-x/communities) for current visibility and participation rules. A restricted membership policy does not make every visible Community post private. This endpoint returns posts available to the read service for the requested Community. A missing Tweet does not prove deletion, privacy, or moderation. Store the collection time and observed cursor window with every export. ### Where can I find analytics for X (Twitter) community posts? Use the returned reply, repost, like, quote, view, and bookmark counts when available. Keep each count beside its Tweet ID and collection time. Compare complete snapshots to measure changes without rewriting the original values. Calculate concrete measures from the captured rows. * Unique Tweet IDs and authors. * Earliest and latest creation times. * Replies, reposts, likes, quotes, views, and bookmarks. * Tweets with photos, videos, or animated GIFs. * Repeated Tweet IDs removed after retries. Use these fields to analyze Community engagement. They do not expose unique viewers, link clicks, conversions, or moderation decisions. Never invent a missing metric or replace it with zero. ### Do I need to join a community to export community tweets? This read route never changes membership. It exports Community posts visible to the connected read context. An export never proves membership. Use X's Communities tab to join a Community. ### Can this API schedule or moderate community posts? No. This route reads a Community feed. It cannot publish, schedule, hide, report, or remove posts. Use X's own Community tools for role changes and moderation actions. Use the captured community content to prepare a review queue. Require a human decision before any moderation action. Keep private review notes outside Tweet text, author profiles, and exported engagement fields. ### What does the X (Twitter) community API return? The member route returns community profiles. The tweet route returns community posts and author fields. The info route returns community details. Moderator and search routes return their own records. Choose one route per task. Do not combine profile membership and tweet activity in one row. Join them later with stable user and community IDs. ### How do I build a complete community tweet export? Save every page and cursor before requesting another page. Deduplicate Tweet IDs when new posts change the live feed. Record the first and last observed Tweet timestamps. Use a saved Community extraction for CSV, JSON, or XLSX exports. Keep direct API pages for live ingestion. Mark interrupted or credit-bounded runs as partial. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/communities/1234567890/tweets \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const communityId = "1234567890"; const response = await fetch(`https://xquik.com/api/v1/x/communities/${communityId}/tweets`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const nextCursor = data.has_next_page && data.next_cursor ? data.next_cursor : null; const tweetRows = data.tweets.map((tweet) => ({ community_id: communityId, tweet_id: tweet.id, text: tweet.text, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, media_urls: tweet.media?.map((item) => item.mediaUrl).filter(Boolean) ?? [], has_next_page: data.has_next_page, next_cursor: nextCursor, })); process.stdout.write(JSON.stringify(tweetRows, null, 2)); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests community_id = "1234567890" response = requests.get( f"https://xquik.com/api/v1/x/communities/{community_id}/tweets", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() next_cursor = data.get("next_cursor") if data.get("has_next_page") else None tweet_rows = [ { "community_id": community_id, "tweet_id": tweet["id"], "text": tweet["text"], "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "author_name": (tweet.get("author") or {}).get("name"), "author_followers": (tweet.get("author") or {}).get("followers"), "author_verified": (tweet.get("author") or {}).get("verified"), "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"), "created_at": tweet.get("createdAt"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], "has_next_page": data.get("has_next_page", False), "next_cursor": next_cursor, } for tweet in data["tweets"] ] print(json.dumps(tweet_rows, indent=2)) ``` ## Direct community tweet handoff Use `GET /x/communities/{id}/tweets` for community monitoring, content review, post exports, or moderation queues. It creates one row per community tweet. Store each Tweet ID in its own record. Keep the Community ID, author, text, creation time, engagement counts, media, and cursor checkpoint. > [card] Community tweet rows > > Store one row per post in the community. Keep author fields and engagement > counts with the row for review queues and exports. > [card] Next page > > Keep `has_next_page` beside `next_cursor` for each page. Continue only when > `has_next_page` is `true` and `next_cursor` is present. > [card] Default page > > Request 1 to 100 tweets with `pageSize`. The default is 20. The value > is a maximum because the source or available credits can return fewer. > [card] Saved export > > Use `community_post_extractor` when the workflow needs a saved job. The > job has CSV, JSON, or XLSX output. ## Audit a cursor-based community feed Start each feed run with one numeric community ID. Record the request time and requested `pageSize`. Do not add a keyword to this route. Use community search when the workflow needs text matching. Save every response before advancing its cursor. Record `has_next_page` beside `next_cursor` for each response. Continue only when `has_next_page` is true and `next_cursor` is present. Reuse `next_cursor` without modification. Count returned rows and unique Tweet IDs after each page. A busy community can receive new posts during pagination. Deduplicate repeated Tweet IDs without discarding richer author, engagement, or media fields. Keep the first and last tweet timestamps for every run. They describe the observed feed window. They do not prove a complete historical archive. Label result caps, credit limits, and interrupted cursors on the run. Store a completion record after the final page. Include community ID, page count, unique Tweet count, first timestamp, and last timestamp. Add collection time and the interrupted cursor when applicable. Store a final `has_next_page` value of `false` for a completed cursor chain. ## Keep community tweet authors and media Store each stable Tweet ID in its own record. Keep author ID, username, profile name, and verification when returned. Separate Tweet content from author attributes. Keep replies, reposts, likes, and quotes as measured engagement fields. Store their ISO 8601 collection time. Counts can change after publication. Store each media URL with its owning Tweet ID. Keep media type when available. Do not infer missing images or videos from tweet text. Do not move media URLs into an author profile column. Use JSON when an application needs nested authors or media. Use CSV when analysts need one normalized row. Use XLSX for reviewed spreadsheet handoffs. Document any column flattening beside the exported file. Join later profile snapshots through stable author ID. Usernames and profile names can change. Store Tweet creation times separately from later profile checks. ## Compare community timeline snapshots Create a new snapshot ID for every completed feed run. Keep the same community ID across snapshots. Compare stable Tweet IDs before engagement counts. Report newly observed tweets separately from changed tweet fields. A missing Tweet ID may reflect the observed window. It does not prove deletion from X. Compare authors through stable user IDs. Report username or profile changes as attributes. Do not treat them as new authors. Mark every incomplete run before comparison. Exclude partial snapshots from claims about feed growth or activity. Keep their rows for troubleshooting and cursor recovery. Keep the request time, page count, row count, and completion state. With these fields, another reviewer can repeat the comparison. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Community ID, or the URL-encoded Community link, such as `x.com/i/communities/1493446837214187523`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `pageSize` | `number` | No | Upper bound for tweets per page, up to `10000`. A larger value gets the largest page. Defaults to `20`. | | `queryType` | `string` | No | `Latest` for newest posts first, or `Top` for the posts X ranks highest. Any case. Also read as `ranking` or `sort`, which also take `Recency` and `Relevance`. Another value returns `400 invalid_params`. Send the same value with each `cursor`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which community endpoint? > [card] Community tweets > > Use `GET /x/communities/{id}/tweets` for posts from one known community. > [card] Community tweet search > > Use [`GET /x/communities/tweets`](/api-reference/x/community-search) > with `communityId` and `q` to search within one community. > [card] Community members > > Use [`GET /x/communities/{id}/members`](/api-reference/x/community-members) > for account rows from the same community. > [card] Bulk community jobs > > Use [`Create extraction`](/api-reference/extractions/create) with > `community_post_extractor`, `community_extractor`, or > `community_moderator_explorer` when the workflow needs a saved export. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of community tweets. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Contains the complete Tweet text. | | `tweets[].type` | `string` | Classifies the Tweet when X returns a type. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Reports the number of likes when available. | | `tweets[].retweetCount` | `number` | Reports the number of reposts when available. | | `tweets[].replyCount` | `number` | Reports the number of replies when available. | | `tweets[].quoteCount` | `number` | Reports the number of quotes when available. | | `tweets[].viewCount` | `number` | Reports the number of views when available. | | `tweets[].bookmarkCount` | `number` | Reports the number of bookmarks when available. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Reports the Tweet language code when available. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | Identifies the replied-to user when available. | | `tweets[].inReplyToUsername` | `string` | Reports the replied-to username when available. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Returns paid-promotion and AI-generated-media labels when available. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia`. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author X (Twitter) username. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Reports the author's follower count when available. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Lists media items attached to the Tweet. Omitted when none exist. | | `tweets[].media[].mediaUrl` | `string` | Provides the direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Lists available video renditions and playback details. Omitted for images. | | `tweets[].media[].type` | `string` | Identifies the attached media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. Pass as the `cursor` query parameter. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Community post content", "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 150, "retweetCount": 42, "replyCount": 10, "viewCount": 12400, "author": { "id": "987654321", "username": "username", "name": "Xquik", "followers": 12400, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Invalid community ID `{ "error": "invalid_community_id" }` The community ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 404 Community not found Xquik could not resolve the Community. Check the Community ID. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded The request exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The read service was unavailable. Retry after a short delay. > [!NOTE] > > **Next steps.** [Community Info](/api-reference/x/community-info) for community details, or [Community Members](/api-reference/x/community-members) to list members. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Search tweets in a community, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/community-tweets-search Search tweets in one X (Twitter) Community or every Community by keyword on the communities/tweets path, with the same inputs and pages as Community search. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/communities/tweets` **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/communities/tweets \ --data-urlencode "communityId=1493446837214187523" \ --data-urlencode "q=launch" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ communityId: "1493446837214187523", q: "launch" }); const response = await fetch(`https://xquik.com/api/v1/x/communities/tweets?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const tweet of page.tweets) console.log(tweet.id, tweet.text); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/communities/tweets", params={"communityId": "1493446837214187523", "q": "launch"}, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: print(tweet["id"], tweet["text"]) ``` ## The same search on another path `GET /x/communities/tweets` searches the tweets in one Community, or across every Community without `communityId`. It works exactly as [Community search](/api-reference/x/community-search) does on `GET /x/communities/search`. Both take the same `communityId`, `q`, `queryType`, `cursor`, and `pageSize`. Both answer the same page of tweets. Keep this path when your integration already uses it. New integrations can use either. To get a Community's posts for a hashtag, search with `q=#tag` and its `communityId`. An example is `q=#bitcoin`. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `communityId` | `string` | No | ID or link of the Community to search, such as `x.com/i/communities/1493446837214187523`. Leave it out to search every Community. | | `q` | `string` | Yes | Search query for the Community's tweets. | | `queryType` | `string` | No | Sort order. `Top` returns the most relevant tweets, `Latest` the most recent. Defaults to `Latest`. | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `pageSize` | `number` | No | Upper bound for tweets per page. Accepts 1-100. Defaults to `20`. | ### Tweet filters These filters narrow the search and the rows it returns, as on Community search. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK Returns the same page as [Community search](/api-reference/x/community-search#response), with `tweets`, `has_next_page`, and `next_cursor`. > [!NOTE] > > **Related.** [Community search](/api-reference/x/community-search) · [Community tweets](/api-reference/x/community-tweets) · [Community details](/api-reference/x/community-info) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "2102761519985332442", "text": "This galaxy is a little extra.\n\nMeet Messier 106, a spiral galaxy with an extra set of arms. These two additional arms are made of gas heated up by jets from the galaxy’s central black hole. The jets’ superheated shockwaves are depicted in royal blue by @chandraxray. https://t.co/421Lzs0r0c", "retweetCount": 1364, "replyCount": 271, "likeCount": 9775 } ], "has_next_page": true, "next_cursor": "DAAHCgABHTK6Vr___-sLAAIAAAATMjEwMTc3MDE4NjE1NjA1Mjk1OQgAAwAAAAIAAA", "filtered_count": 0 } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Direct message history, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/dm-history Read Twitter DMs between a connected account and one user. Store private message rows, keep sender and recipient IDs, and resume pages with next_cursor. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/dm/{userId}/history` **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit This route reads the DM history between a connected account and one user. Pass the connected account through `account`. Store message IDs and `next_cursor` in private systems. Keep full message text private. Use [Send DM](/api-reference/x-write/send-dm) when the workflow needs a reply. Compare fields with [X's Direct Messages lookup guide](https://docs.x.com/x-api/direct-messages/lookup/introduction). Xquik returns the normalized message fields listed below. > [!NOTE] > > Requires a connected X account passed via the `account` query parameter. Only a participant can read a conversation. Pass the connected account that belongs to it. > [!NOTE] > > DM history responses can contain private message text. Store them in a > private support, CRM, warehouse, or agent memory system. > Do not write full DM bodies to shared logs or public artifacts. ## Which DM workflow? > [card] Read conversation history > > Use `GET /x/dm/{userId}/history` with `account`, then store > `messages[].id` and `next_cursor` in a private system. > [card] Send text reply > > Use [`POST /x/dm/{userId}`](/api-reference/x-write/send-dm), pass the same > connected `account`, and store the returned `messageId`. > [card] Send one media item > > Use [`POST /x/media`](/api-reference/x-write/upload-media) first. Then pass > the returned media ID as the only `media_ids` item in the DM. > [card] Resolve participant ID > > Use [`GET /x/users/{id}`](/api-reference/x/twitter-profile-lookup) when a workflow starts > from a handle and needs the numeric `userId`. History or send calls use it. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/dm/44196397/history \ --data-urlencode "account=your_handle" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq # Page 2 curl -G https://xquik.com/api/v1/x/dm/44196397/history \ --data-urlencode "account=your_handle" \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userId = "44196397"; const account = "your_handle"; function historyUrl(userId, account, cursor) { const params = new URLSearchParams({ account }); if (cursor) params.set("cursor", cursor); return `https://xquik.com/api/v1/x/dm/${userId}/history?${params}`; } function toDmHistoryRows(page, { account, userId }) { return page.messages.map((message) => ({ record_type: "dm_history", conversation_user_id: userId, sender_account: account, message_id: message.id, sender_id: message.senderId, receiver_id: message.receiverId, message_text: message.text ?? null, created_at: message.createdAt ?? null, media_url: message.mediaUrl ?? null, page_next_cursor: page.has_next_page ? page.next_cursor : null, source_endpoint: `/api/v1/x/dm/${userId}/history`, })); } async function savePrivateDmHistoryRows(rows) { // Replace this with a private CRM, warehouse, or agent memory write. return rows.length; } const response = await fetch(historyUrl(userId, account), { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const data = await response.json(); const historyRows = toDmHistoryRows(data, { account, userId }); await savePrivateDmHistoryRows(historyRows); // Paginate if (data.has_next_page) { const next = await fetch(historyUrl(userId, account, data.next_cursor), { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const nextData = await next.json(); const nextRows = toDmHistoryRows(nextData, { account, userId }); await savePrivateDmHistoryRows(nextRows); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests def to_dm_history_rows(page, account, user_id): return [ { "record_type": "dm_history", "conversation_user_id": user_id, "sender_account": account, "message_id": message["id"], "sender_id": message["senderId"], "receiver_id": message["receiverId"], "message_text": message.get("text"), "created_at": message.get("createdAt"), "media_url": message.get("mediaUrl"), "page_next_cursor": page["next_cursor"] if page["has_next_page"] else None, "source_endpoint": f"/api/v1/x/dm/{user_id}/history", } for message in page["messages"] ] def save_private_dm_history_rows(rows): # Replace this with a private CRM, warehouse, or agent memory write. return len(rows) response = requests.get( "https://xquik.com/api/v1/x/dm/44196397/history", params={"account": "your_handle"}, headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) data = response.json() history_rows = to_dm_history_rows(data, "your_handle", "44196397") save_private_dm_history_rows(history_rows) # Paginate while data["has_next_page"]: data = requests.get( "https://xquik.com/api/v1/x/dm/44196397/history", params={"account": "your_handle", "cursor": data["next_cursor"]}, headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ).json() next_rows = to_dm_history_rows(data, "your_handle", "44196397") save_private_dm_history_rows(next_rows) ``` These examples turn each page into private `dm_history` rows. Store `message_id`, `sender_id`, `receiver_id`, `message_text`, and `created_at`. Also store optional `media_url`, `conversation_user_id`, `sender_account`, and `page_next_cursor` for each page. Keep `message_text` only in private systems. Use IDs, timestamps, media URLs, and job status in shared logs. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `userId` | `string` | Yes | The other person in the conversation. Send a user ID or a username with or without `@`. A URL-encoded profile URL, such as `x.com/nasa`, works too. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `account` | `string` | Yes | X (Twitter) handle of the connected X account used to read the conversation. Send it without the `@` prefix. DM history is participant-scoped. The account must belong to the conversation. Connect an account on the dashboard before calling this endpoint. | | `cursor` | `string` | No | Pagination cursor. Use the previous response's `next_cursor` to fetch older messages. | | `maxId` | `string` | No | Legacy pagination cursor. Use `cursor` for new integrations. When both are present, `cursor` takes precedence. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. You can also authenticate with an OAuth bearer token. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `messages` | `object[]` | Contains direct messages. | | `messages[].id` | `string` | Identifies the message. | | `messages[].text` | `string` | Contains message text when available. | | `messages[].senderId` | `string` | Identifies the sender. | | `messages[].receiverId` | `string` | Identifies the recipient. | | `messages[].createdAt` | `string` | Reports the ISO 8601 timestamp when available. | | `messages[].mediaUrl` | `string` | Links attached media when present. | | `has_next_page` | `boolean` | Reports whether older messages are available. | | `next_cursor` | `string` | Provides the next-page cursor. Returns an empty string after the final page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "messages": [ { "id": "1893456789012345678", "text": "Hey, great tool!", "senderId": "44196397", "receiverId": "987654321", "createdAt": "2026-02-24T10:00:00.000Z" } ], "has_next_page": true, "next_cursor": "1893456789012345677" } ``` ### 400 Invalid user ID The user ID is empty or invalid. ### 400 Account required `{ "error": "account_required", "message": "Provide ?account= for a connected X account. DM history requires a connected participant account." }` The `account` query parameter was missing or empty. Pass the handle of a connected X account that participates in the conversation. ### 401 Unauthenticated Supply a valid API key or OAuth bearer token. ### 402 Insufficient credits Metered access requires enough available credits. Possible error values include `no_subscription`, `subscription_inactive`, `no_credits`, and `insufficient_credits`. ### 403 DM not permitted `{ "error": "dm_not_permitted", "message": "X rejected the DM read. The connected account is not a participant in this conversation, or it needs reauthentication. Reconnect the account on the dashboard and try again." }` X rejected the DM read. Use a participating connected account. If it needs reauthentication, reconnect it before retrying. ### 403 Account restricted `{ "error": "account_restricted" }` The connected X account is suspended, locked, or otherwise restricted. Use a different connected account. ### 403 Account needs reauth `{ "error": "account_needs_reauth" }` Reconnect the connected account from the dashboard. ### 404 Account not found Xquik did not find the requested connected X account. Connect it first or pass another account handle. ### 429 Rate limit exceeded You exceeded your tier's rate limit. Wait for `Retry-After` before retrying. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ### 502 X API unavailable The read service failed. Retry after a short delay. ## Twitter DM API questions ### Can I retrieve DM history? Yes. Call `GET /x/dm/{userId}/history` with a participating connected account. ### Can I send a reply through this endpoint? No. Use [Send DM](/api-reference/x-write/send-dm). This endpoint reads history only. ### Does this endpoint create direct message webhooks? No. It reads participant-scoped history when called. It does not register webhooks. ### How do I authenticate? Send an API key or OAuth bearer token. ### How do I handle a rate limit? Wait for `Retry-After`, then retry the same page. ## History sync handoff Use this endpoint when a caller needs participant-scoped DM context before sending a reply. The caller can be a CRM, support desk, warehouse job, or agent. > [card] Deduplicate imported messages > > Store `messages[].id` as the external DM ID. Use it for CRM notes, support > tickets, warehouse rows, or agent memory. > [card] Keep participants > > Store `messages[].senderId` and `messages[].receiverId` with the connected > `account`. Do this so each private conversation stays tied to the correct > sender. > [card] Resume older pages > > Store `next_cursor` when `has_next_page` is true. Then pass it as `cursor` > on the next sync job. > [card] Keep media context > > Store optional `messages[].mediaUrl` with `messages[].createdAt` for a DM > image, GIF, or video attachment. > [!NOTE] > > **Related.** [Direct Message Workflow](/guides/direct-message-workflow) covers > lookup, participant-scoped history sync, `messageId` storage, and media > handoff. [Get User](/api-reference/x/twitter-profile-lookup) resolves the recipient > `userId`. [Send DM](/api-reference/x-write/send-dm) replies from the > connected account. Use [Upload Media](/api-reference/x-write/upload-media) when > a reply needs one uploaded `mediaId`. > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples * **400** `{ "error": "invalid_user_id" }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "account_not_found", "message": "X account not found. Connect it first at /dashboard/x-accounts." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Download tweet photos & video, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/download-media Download images, videos, and animated GIFs from many tweets. Returns one gallery URL plus cache or bulk counts. Fresh tweets cost 1 credit. Cache hits are free. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/media/download` Send 1 tweet ID or URL, or a list of them. The route downloads media from one tweet or a batch. Each response contains a gallery of photos, videos, and GIFs. **1 credit per fresh tweet processed with media** · cache hits are free [All plans](https://xquik.com/en) from \$0.00012/credit This endpoint creates a saved media gallery from tweet URLs or IDs. The response gives a `galleryUrl` plus cache or bulk counts. It does not return per-file downloads, file metadata, or an uploaded `mediaId`. ```bash cURL (single) theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/media/download \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "tweetInput": "1893456789012345678" }' | jq ``` ```bash cURL (bulk) theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/media/download \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "tweetIds": ["1893456789012345678", "1893456789012345999", "1893456789012346000"] }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const singleTweetId = "1893456789012345678"; // Single tweet const single = await fetch("https://xquik.com/api/v1/x/media/download", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ tweetInput: singleTweetId }), }); const singleResult = await single.json(); const singleRow = { input_mode: "single", requested_tweet_id: singleTweetId, tweet_id: singleResult.tweetId, gallery_url: singleResult.galleryUrl, cache_hit: singleResult.cacheHit, }; process.stdout.write(`${JSON.stringify(singleRow)}\n`); const bulkTweetIds = ["1893456789012345678", "1893456789012345999"]; // Bulk const bulk = await fetch("https://xquik.com/api/v1/x/media/download", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ tweetIds: bulkTweetIds }), }); const bulkResult = await bulk.json(); const bulkRow = { input_mode: "bulk", requested_tweet_ids: bulkTweetIds, gallery_url: bulkResult.galleryUrl, successful_tweet_count: bulkResult.totalTweets, media_item_count: bulkResult.totalMedia, unprocessed_tweet_ids: bulkResult.unprocessedTweetIds ?? [], }; process.stdout.write(`${JSON.stringify(bulkRow)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests single_tweet_id = "1893456789012345678" # Single tweet single = requests.post( "https://xquik.com/api/v1/x/media/download", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={"tweetInput": single_tweet_id}, ) single_result = single.json() single_row = { "input_mode": "single", "requested_tweet_id": single_tweet_id, "tweet_id": single_result["tweetId"], "gallery_url": single_result["galleryUrl"], "cache_hit": single_result["cacheHit"], } print(json.dumps(single_row)) bulk_tweet_ids = ["1893456789012345678", "1893456789012345999"] # Bulk bulk = requests.post( "https://xquik.com/api/v1/x/media/download", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={"tweetIds": bulk_tweet_ids}, ) bulk_result = bulk.json() bulk_row = { "input_mode": "bulk", "requested_tweet_ids": bulk_tweet_ids, "gallery_url": bulk_result["galleryUrl"], "successful_tweet_count": bulk_result["totalTweets"], "media_item_count": bulk_result["totalMedia"], "unprocessed_tweet_ids": bulk_result.get("unprocessedTweetIds", []), } print(json.dumps(bulk_row)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "log" "net/http" ) type MediaDownloadResponse struct { CacheHit bool `json:"cacheHit"` GalleryURL string `json:"galleryUrl"` TweetID string `json:"tweetId"` TotalMedia int `json:"totalMedia"` TotalTweets int `json:"totalTweets"` } type MediaDownloadRow struct { InputMode string `json:"input_mode"` RequestedTweetID string `json:"requested_tweet_id"` TweetID string `json:"tweet_id"` GalleryURL string `json:"gallery_url"` CacheHit bool `json:"cache_hit"` } func main() { // Single tweet tweetID := "1893456789012345678" payload, _ := json.Marshal(map[string]interface{}{ "tweetInput": tweetID, }) req, err := http.NewRequest("POST", "https://xquik.com/api/v1/x/media/download", bytes.NewReader(payload)) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() var result MediaDownloadResponse if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { log.Fatal(err) } row := MediaDownloadRow{ InputMode: "single", RequestedTweetID: tweetID, TweetID: result.TweetID, GalleryURL: result.GalleryURL, CacheHit: result.CacheHit, } output, err := json.Marshal(row) if err != nil { log.Fatal(err) } fmt.Println(string(output)) } ``` ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. You can also authenticate with an OAuth bearer token. | | `Content-Type` | `string` | Yes | Must be `application/json`. | ## Body Use `tweetIds` for bulk downloads. If `tweetIds` holds at least 1 string value, the route uses bulk mode. In bulk mode it ignores single-tweet fields. Otherwise, use `tweetInput`, `tweetId`, or `tweetUrl` for a single tweet. | Body parameter | Type | Required | Description | | - | - | - | - | | `tweetInput` | `string` | No | Tweet URL or numeric tweet ID for a single download. Accepts `x.com` and `twitter.com` URL formats. | | `tweetId` | `string` | No | Numeric tweet ID alias for `tweetInput`. Use it when `tweetInput` is absent. | | `tweetUrl` | `string` | No | Tweet URL alias for `tweetInput`. Use it when both earlier fields are absent. | | `tweetIds` | `string[]` | No | Array of tweet URLs or IDs for bulk download. Send any number. The route skips invalid IDs. It fails only when no valid tweet IDs remain. | | `imageShows` | `string` | No | Save only posts whose photos show this. Send `charts`, `screenshots`, `product_photos`, `memes`, `people` or your own words, such as `a rocket`. AI-powered analysis checks photos X doesn't mark sensitive & keeps scores of 0.5 or more. Each kept post costs 2 credits. Each kept post also pays the save price. The answer adds `imageFilter`. | ## Save only chart posts Send `imageShows` with the posts, & only the posts whose photos show it get saved. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST "https://xquik.com/api/v1/x/media/download" \ -H "x-api-key: $XQUIK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"imageShows": "charts", "tweetIds": ["2118113888486986103", "2118072490119626919", "2117971091146625465"]}' ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "galleryUrl": "https://xquik.com/gallery/def456", "imageFilter": { "imageShows": "charts", "question": "Does a picture attached to this post show a chart or graph that plots data, such as a line, bar, pie or candlestick chart? Judge the pictures in tweet.images.", "cutoff": 0.5, "checked": 3, "kept": 2, "unchecked": [] }, "totalMedia": 2, "totalTweets": 2 } ``` * `imageFilter.unchecked` lists posts without a safe photo & posts X can't find. They cost nothing. * When no photo shows it, nothing is saved & nothing is billed. A single download answers with empty `items`. A bulk download answers with `totalTweets` 0. ## Media download handoff Your agent may need a saved gallery for tweet images, videos, or GIFs. If so, use this endpoint. Write one manifest row per request. Later jobs can then store the gallery link. It is not an uploaded media ID or an individual media file URL. > [card] Gallery URL > > Store `gallery_url` from `galleryUrl` as the link for downloaded media. > [card] Single tweet > > Store `requested_tweet_id`, `tweet_id`, and `cache_hit`. `cacheHit: true` means the single-tweet request used cached media and is free. > [card] Bulk result > > Store `requested_tweet_ids`, `successful_tweet_count` from `totalTweets`, and `media_item_count` from `totalMedia`. `totalTweets` counts successful tweets with media after the route skips invalid or failed IDs. > [card] Input mode > > Send `tweetIds` for bulk. When it contains at least 1 string, bulk mode ignores `tweetInput`, `tweetId`, and `tweetUrl`. > [card] Posts left over > > A long `tweetIds` list saves what fits in the call's time. Send the posts in `unprocessedTweetIds` again. They cost nothing. > [card] Write handoff > > This endpoint creates a gallery download, not an uploaded media ID. Use [Upload Media](/api-reference/x-write/upload-media) before DMs or hosted tweet assets. ## Store a tweet media download manifest Keep one manifest row per single or bulk request. A gallery URL represents the download result. A gallery URL is neither an uploaded media ID nor a direct asset URL. | Manifest column | Response or request source | Reconciliation rule | | - | - | - | | `input_mode` | Presence of non-empty `tweetIds` | Store `single` or `bulk`. | | `requested_tweet_ids` | Normalized request inputs | Keep every valid ID submitted to the download route. | | `tweet_id` | Single response `tweetId` | Store the resolved Tweet ID for single mode. | | `gallery_url` | Response `galleryUrl` | Use as the shareable downloaded-media result. | | `cache_hit` | Single response `cacheHit` | Record whether the single download used free cached media. | | `successful_tweet_count` | Bulk response `totalTweets` | Count only successful tweets that contained media. | | `media_item_count` | Bulk response `totalMedia` | Reconcile the number of downloaded images, videos, and GIFs. | | `unprocessed_tweet_ids` | Bulk response `unprocessedTweetIds` | Send these posts again. They cost nothing. | | `requested_at` | Integration timestamp | Audit when the download request started. | | `completed_at` | Integration timestamp | Record when your integration stores the gallery. | Use these outcomes when reconciling a download request. * `cacheHit: true` confirms a free cached single result. * `cacheHit: false` confirms a fresh single result. * If `totalTweets` is below the valid input count, review skipped Tweet IDs. * A `400 no_media` response means the source tweet has no downloadable media. * Keep rejected inputs while processing valid Tweet IDs. * Send `unprocessedTweetIds` again until the answer has none. Fresh downloads cost 1 credit per tweet processed with media. Cached single downloads return `cacheHit: true` and are free. Bulk responses do not return `freshCount`. Store the request IDs with `totalTweets` and `totalMedia` for reconciliation. ## Response ### 200 OK (single) | Field | Type | Description | | - | - | - | | `tweetId` | `string` | Identifies the resolved tweet. | | `galleryUrl` | `string` | Links the shareable gallery containing all downloaded media. | | `cacheHit` | `boolean` | Shows whether the cache supplied the media. Cached requests consume no credits. | | `items` | `object[]` | The post's files saved to your gallery, at least 1. Each file has its gallery `id` and the `tweetId` it came from. Its `mediaType` is `photo`, `video` or `animated_gif`. `mediaUrl` points to the saved copy. `fileSize` gives its size in bytes, as a string. `createdAt` is when it joined your gallery. Each file also carries the post's `authorUsername`, `authorDisplayName`, `authorAvatar` and `tweetText`. It also holds the post's `likes`, `retweets` and `views` from when it was saved. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweetId": "1893456789012345678", "galleryUrl": "https://xquik.com/gallery/abc123", "cacheHit": false, "items": [ { "id": "42", "tweetId": "1893456789012345678", "mediaType": "photo", "mediaUrl": "https://media.xquik.com/tweet_1893456789012345678/0.jpg", "fileSize": "2097152", "createdAt": "2026-10-16T11:00:00.000Z", "authorUsername": "elonmusk", "authorDisplayName": "Elon Musk", "authorAvatar": null, "tweetText": "Launch day.", "likes": 1200, "retweets": 340, "views": 56000 } ] } ``` ### 200 OK (bulk) | Field | Type | Description | | - | - | - | | `galleryUrl` | `string` | Links the combined gallery containing media from all tweets. | | `totalTweets` | `number` | Counts processed tweets with media. | | `totalMedia` | `number` | Counts downloaded images, videos, and GIFs. | | `imageFilter` | `object` | States the question, the 0.5 cutoff & the checked & kept counts. It also lists posts left unchecked. Sent only with `imageShows`. | | `unprocessedTweetIds` | `string[]` | Lists the posts Xquik had no time to read, at no charge. Send them again. Sent only when time ran out first. | | `noMediaTweetIds` | `string[]` | Lists the posts with no media to save, at no charge. Sent only when some post has none. | | `failedTweetIds` | `string[]` | Lists the posts Xquik couldn't read, at no charge. Send them again. Sent only when some read failed. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "galleryUrl": "https://xquik.com/gallery/def456", "totalTweets": 3, "totalMedia": 7 } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Invalid request body" }` Missing, malformed, or non-JSON request body. Malformed JSON can also return `invalid_json`. ### 400 Invalid tweet ID `{ "error": "invalid_tweet_id", "message": "Tweet ID is empty or invalid" }` Xquik could not resolve the provided tweet ID or URL to a valid ID. ### 400 No media `{ "error": "no_media", "message": "Tweet has no downloadable media" }` The tweet does not contain any images, videos, or GIFs. ### 401 Unauthenticated `{ "error": "unauthenticated", "message": "Missing or invalid API key" }` Supply a valid API key or OAuth bearer token. ### 402 Insufficient credits The available balance cannot cover the download. Top up or subscribe from the [dashboard billing page](https://dashboard.xquik.com/en/account?tab=subscription). ### 404 Tweet not found `{ "error": "tweet_not_found", "message": "Tweet not found" }` The tweet ID is valid. Xquik cannot fetch that tweet, or it no longer exists. ### 429 Rate limit exceeded The API key, user, or plan tier is sending requests too fast. Respect the `Retry-After` header before retrying. ### 502 X API unavailable The read service failed. Retry after a short delay. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## X (Twitter) media downloader questions ### How do I download X (Twitter) media? Copy the tweet link or numeric ID. Send it through `tweetInput`. The gallery can contain Twitter videos and GIFs plus images. ### Can I save Twitter videos or GIFs on a phone? Yes. Open the returned `galleryUrl` in a web browser. The API does not return direct per-file URLs. ### Does this work like a browser extension? No. This is a server-side API. Keep the API key or bearer token server-side. ### Can I download X (Twitter) video files directly? No. This route creates a gallery. It does not expose per-file downloads or resolution controls. ### Can I download media from many tweets? Yes. Send the tweet IDs through `tweetIds`. The response returns one gallery with tweet and media counts. > [!NOTE] > > Xquik meters the first download against your monthly credit allowance. Later requests for the same tweet return cached URLs at no cost (`cacheHit: true`). Xquik saves all downloads to your gallery at `https://xquik.com/gallery`. > [!NOTE] > > This endpoint accepts an API key or OAuth bearer token. Keep either credential server-side. > > **Related.** [Get Tweet](/api-reference/x/get-tweet) to look up tweet details and metrics. For AI agent access, use the `execute` [MCP tool](/mcp/tools#execute). > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` # See who liked a tweet, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/favoriters See who liked a tweet with user profiles, follower counts, and verification fields. Includes cursors, visibility limits & exact X (Twitter) API examples. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/favoriters` Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit This route shows who liked one tweet. It returns the likers your connected X account can see. X shows likers only to the post author. Use [Connect X account](/api-reference/x-accounts/connect) to add the author's account. Callers without a connected X account get `424 account_required`. Guest keys get `403 forbidden`. When your connected X accounts are busy, the route returns `503`. The route is `GET /api/v1/x/tweets/{id}/favoriters`. > [!WARNING] > > X does not expose liker identities for every post. When a post reports likes > without available liker identities, the endpoint returns `424 > favoriters_unavailable`. Do not interpret this error as zero likes. Do not > interpret it as proof that a specific user did not participate. ```bash First page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/tweets/1893456789012345678/favoriters \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```bash Next page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/1893456789012345678/favoriters \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1893456789012345678"; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/favoriters`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); if (!response.ok) throw new Error(JSON.stringify(data)); const nextCursor = data.has_next_page ? data.next_cursor : null; const likerRows = data.users.map((user) => ({ source_tweet_id: tweetId, liker_id: user.id, username: user.username, display_name: user.name, follower_count: user.followers ?? null, following_count: user.following ?? null, verified: user.verified ?? false, verified_type: user.verifiedType ?? null, profile_image_url: user.profilePicture ?? null, })); const checkpoint = { source_tweet_id: tweetId, next_cursor: nextCursor }; for (const row of likerRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } process.stdout.write(`${JSON.stringify({ checkpoint })}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1893456789012345678" response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/favoriters", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() response.raise_for_status() next_cursor = data["next_cursor"] if data["has_next_page"] else None liker_rows = [ { "source_tweet_id": tweet_id, "liker_id": user["id"], "username": user["username"], "display_name": user["name"], "follower_count": user.get("followers"), "following_count": user.get("following"), "verified": user.get("verified", False), "verified_type": user.get("verifiedType"), "profile_image_url": user.get("profilePicture"), } for user in data["users"] ] checkpoint = {"source_tweet_id": tweet_id, "next_cursor": next_cursor} for row in liker_rows: print(json.dumps(row)) print(json.dumps({"checkpoint": checkpoint})) ``` The Node.js and Python snippets write JSON Lines liker rows plus a separate checkpoint. They do not write raw response pages. Store each mapped row and the latest `next_cursor`. An import, giveaway verifier, CRM sync, or agent job can then resume. It can resume from the last completed page without duplicate rows. ## Direct tweet liker handoff Use `GET /api/v1/x/tweets/{id}/favoriters` when a workflow needs one row per visible account. Each row is an account that liked a post. Use these rows for giveaway checks, CRM imports, audience reviews, or follow-up jobs. Store `source_tweet_id`, `liker_id`, `username`, `display_name`, `follower_count`, `following_count`, `verified`, `verified_type`, `profile_image_url`, and `next_cursor`. > [card] Liker rows > > Store `users[]` as the visible profile rows for accounts that liked the > source post. > [card] Stable upserts > > Store `users[].id` as `liker_id` with `source_tweet_id` for idempotent > imports and giveaway checks. > [card] Readable labels > > Store `users[].username` and `users[].name` for handles, labels, and review > queues. > [card] Profile enrichment > > Store `description`, `location`, `url`, and `profilePicture` when returned > for CRM and warehouse enrichment. > [card] Audience signals > > Store `followers`, `following`, `verified`, and `verifiedType` for scoring, > filters, and outreach priority. > [card] Approved contact > > Use DM endpoints only after a user-approved message flow. The write > response tells you whether X delivered the DM. > [card] Next page > > Store `has_next_page` and `next_cursor`. Then pass `next_cursor` back as `cursor` > only when `has_next_page` is true. > [card] Credit-limited pages > > Use `users.length`, not a requested page size, for row counts. Low balances > can return fewer rows. Direct tweet liker reads cost 1 credit per user returned. Low credit balances can return fewer users than a full page. Zero affordable results return `402 insufficient_credits`. ## Tweet liker questions ### How do I see who liked my tweet? Connect the X account that posted the tweet. Pass the tweet's numeric ID. The response lists visible user profiles. Continue pagination only when the response confirms another page. [X documents this read intent as Get Liking Users.](https://docs.x.com/x-api/posts/get-liking-users) ### Why can't I see who liked my tweet? X does not expose every liker set. A tweet can show a like count while its liker profiles remain hidden. `424 favoriters_unavailable` does not mean zero likes. Deleted, protected, blocked, or withheld accounts may not appear. Without a connected X account, the route returns `424 account_required`. ### Does this show an account's private likes? No. This endpoint returns visible users for one source tweet. It does not return an account's Likes tab or private like history. ### How do I export tweet likers? The Node.js and Python examples write one JSON Lines row per visible user. Store the source tweet ID beside each profile. Use `next_cursor` to resume an export. Use `toolType=favoriters` for a saved CSV, JSON, or XLSX job. ### How can I track and analyze tweet likes? Run timestamped snapshots and compare them by numeric user ID. This read endpoint does not send notifications for future likes. A like does not prove endorsement, purchase intent, or affiliation. Report only returned fields. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from `next_cursor` in a previous response. Omit it on the initial request. Pass it only when `has_next_page` is true. | | `pageSize` | `integer` | No | Profiles per page, up to `10000`. A larger value gets the largest page. Defaults to `200`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which tweet engagement endpoint? > [card] Tweet likers > > Use `GET /x/tweets/{id}/favoriters` for user profiles that liked one source > tweet. > [card] Retweeters > > Use [`GET /x/tweets/{id}/retweeters`](/api-reference/x/retweeters) for user > profiles that reposted one source tweet. > [card] Quote tweets > > Use [`GET /x/tweets/{id}/quotes`](/api-reference/x/tweet-quotes) when you > need tweet rows that quote the source tweet. > [card] Tweet replies > > Use [`GET /x/tweets/{id}/replies`](/api-reference/x/tweet-replies) when you > need reply tweet rows under the source tweet. > [card] Saved exports > > Use [`Create extraction`](/api-reference/extractions/create) with > `toolType=favoriters` for a saved job or CSV, JSON, or XLSX > export. > [card] DM handoff > > Use [`Send DM`](/api-reference/x-write/send-dm) only after your workflow has > a user-approved outreach step. ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of visible users who liked the post. | | `users[].id` | `string` | X (Twitter) user ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. | | `users[].followers` | `number` | This value records the follower count. | | `users[].following` | `number` | Following count. | | `users[].verified` | `boolean` | Verified status. | | `users[].profilePicture` | `string` | Profile image URL. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. | | `users[].createdAt` | `string` | Account creation date (ISO 8601). | | `users[].statusesCount` | `number` | This value records the total tweet count. X may omit it. | | `users[].coverPicture` | `string` | This value contains the cover image URL. X may omit it. | | `users[].mediaCount` | `number` | This value records the media tweet count. X may omit it. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].favouritesCount` | `number` | This value records the liked tweet count. X may omit it. | | `users[].hasCustomTimelines` | `boolean` | X sets this flag for accounts with custom timelines. X may omit it. | | `users[].isTranslator` | `boolean` | X sets this flag for translator accounts. X may omit it. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | X sets this flag for sensitive accounts. X may omit it. | | `users[].pinnedTweetIds` | `string[]` | This array contains pinned tweet IDs. Omitted if none. | | `users[].isAutomated` | `boolean` | X sets this flag for automated accounts. X may omit it. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | X sets this flag when it cannot return the account. | | `users[].unavailableReason` | `string` | X may give a reason for a missing account. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Use this object for bio text and linked profile entities. X may omit it. | | `users[].isBlueVerified` | `boolean` | X sets this flag for X Premium verification. X may omit it. | | `users[].isVerified` | `boolean` | Use this field for normalized verification status. X may omit it. | | `users[].profileBannerUrl` | `string` | This value contains the profile banner URL. X may omit it. | | `users[].protected` | `boolean` | X sets this flag for protected accounts. X may omit it. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ### 401 Unauthenticated Missing or invalid API key. ### 402 Payment required Account users can subscribe or add credits. Confirm payment before continuing. > [!NOTE] > > **Related.** [Retweeters](/api-reference/x/retweeters) · [Quote tweets](/api-reference/x/tweet-quotes) · [Tweet replies](/api-reference/x/tweet-replies) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "34743251", "username": "SpaceX", "name": "SpaceX", "followers": 41936873, "following": 127 } ], "has_next_page": false, "next_cursor": "" } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "favoriters_unavailable", "message": "Users who liked this post are unavailable. X shows likers only to the post author. GET /api/v1/x/tweets/1234567890/retweeters lists who retweeted it." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Fake follower checker API for X (Twitter) accounts Source: https://docs.xquik.com/api-reference/x/follower-audit Audit the newest followers of an X (Twitter) account. Get each follower's class, a quality score, signal counts & arrival bands. 1 credit per follower. > For the complete documentation index, see [llms.txt](/llms.txt). **1 credit per follower read**, plus 1 for the engagement A user X doesn't know is free · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/nasa/follower-audit?limit=500" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/nasa/follower-audit?limit=500", { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); const { audit } = body; console.log(`Grade ${audit.quality.grade}, ${audit.coverage.read} followers read`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/users/nasa/follower-audit", params={"limit": 500}, headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) audit = body["audit"] print(f'Grade {audit["quality"]["grade"]}, {audit["coverage"]["read"]} followers read') ``` ## Check an account's followers Use `GET /x/users/{id}/follower-audit` before you pay for a shoutout or a partnership. Name the account by user ID, username, or profile URL. The audit reads the account's newest followers first. It gives each follower 1 class, a score & the signals behind it. Then it adds a quality score, class counts & arrival bands. It also lists join cohorts, languages, places & top followers. The account's own engagement comes from its recent posts. Signals come from public profiles, so a real person can match them. Older followers may differ from the newest ones. A read stops at your `limit` or at what your balance pays for. A very long read returns the followers it finished. `coverage` says how many it read out of the account's total. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Followers to read, newest first, from `1` up. Left out, a read takes up to 200. A low balance reads fewer. `pageSize`, `count`, `max_results`, `maxItems`, `max_items` & `per_page` are accepted aliases. Default `200`. | | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `audit` | `object \| null` | | | `audit.account` | `object` | The audited account's counts & engagement, in the shape [user insights](/api-reference/x/user-engagement-insights) returns. | | `audit.coverage` | `object` | `read` followers out of the account's `total`, & the `percent` that makes. | | `audit.quality` | `object` | A `score` from 0 to 100 & a `grade` from `A` to `F`. A higher score means more followers look real. | | `audit.classes` | `object[]` | How many followers fall in each `class`, with their `count` & `percent`. | | `audit.signals` | `object[]` | Each signal's `id`, its matching followers & the `points` it adds. | | `audit.arrivalBands` | `object[]` | The likely fake share in each slice of the newest-first list. | | `audit.cohorts` | `object[]` | Followers who joined X in the same UTC week, & how many look fake. | | `audit.languages` | `object[]` | Follower counts by profile language. | | `audit.places` | `object[]` | Follower counts by profile location. | | `audit.verified` | `object` | How many followers are verified, & the `percent` that makes. | | `audit.followers` | `object[]` | Every follower read, newest first. Each has its `class`, `score`, `signals`, counts & join date. | | `audit.topFollowers` | `object[]` | Up to 10 followers with the most followers of their own. | ### Follower classes | Class | Meaning | | - | - | | `likelyReal` | Looks like a real, active account | | `inactive` | Looks real but posts little | | `tooNew` | Joined too recently to judge | | `likelyFake` | Matches enough fake signals to look fake | | `automated` | X labels it automated, & `owner` names who runs it | ### 400 Invalid input ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "invalid_user_id" } ``` Send a user ID, a username, or a profile URL. ### 402 Payment required Your balance pays for no follower. Top up, then try again. ### 403 Protected follower list X keeps a protected account's follower list private. Xquik charges nothing. ### 404 User not found ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "user_not_found", "message": "X user not found. Check the username." } ``` A user X doesn't know is free. ### 503 Busy Retry after the `Retry-After` header. > [!NOTE] > > **Related.** [Followers](/api-reference/x/followers) · [User insights](/api-reference/x/user-engagement-insights) · > [Verified followers](/api-reference/x/verified-followers) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "audit": { "account": { "userId": "11348282", "userName": "NASA", "followers": 92376187, "following": 180, "posts": 73919 }, "coverage": { "percent": 0.0002, "read": 200, "total": 92376187 }, "quality": { "grade": "B", "score": 71 }, "classes": [ { "class": "likelyReal", "count": 122, "percent": 61 } ], "signals": [ { "count": 36, "id": "defaultPicture", "percent": 18, "points": 2 } ] } } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Export a user's follower IDs, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/follower-ids Get the user IDs of a Twitter or X account's followers, newest first, up to 5,000 a page. Use them for fast audience syncs and set comparisons. 1 credit per ID. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/follower-ids` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/nasa/follower-ids \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 curl -G https://xquik.com/api/v1/x/users/nasa/follower-ids \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const user = "nasa"; let pageCursor = ""; let position = 0; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch(`https://xquik.com/api/v1/x/users/${user}/follower-ids${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const userId of page.ids) { position += 1; const idRow = { source_user: user, position, user_id: userId, page_cursor: pageCursor }; process.stdout.write(`${JSON.stringify(idRow)}\n`); } if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user = "nasa" page_cursor = "" position = 0 for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user}/follower-ids", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for user_id in page["ids"]: position += 1 id_row = { "source_user": user, "position": position, "user_id": user_id, "page_cursor": page_cursor, } print(json.dumps(id_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## IDs only, 5,000 a page Use `GET /x/users/{id}/follower-ids` for the user IDs of a user's followers. IDs arrive newest first. The response holds no profiles, so a page holds up to 5,000 IDs. Use it for fast audience syncs and set comparisons. Pass the IDs to [`GET /x/users/batch`](/api-reference/x/batch-users) when you need profiles. Stop paging when `has_next_page` is `false`. A protected account returns 403 `x_account_protected`. Xquik charges nothing. ## IDs or profiles? * Use `GET /api/v1/x/users/{id}/follower-ids` when IDs are enough. * Use `GET /api/v1/x/users/{id}/followers` when each row needs a profile. | Need | Route | Rows returned | | - | - | - | | IDs only | `/x/users/{id}/follower-ids` | Up to 5,000 user IDs a page. | | Full profiles | `/x/users/{id}/followers` | Profiles with filters. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | User IDs per page. Accepts `1-5000`. Defaults to `5000`. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `ids` | `string[]` | User IDs, newest first. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "ids": ["9876543210", "44196397"], "has_next_page": true, "next_cursor": "1878079982871151535" } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 403 Protected account `{ "error": "x_account_protected", "message": "This account's follower list is private. Try a public account." }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Profiles on this list](/api-reference/x/followers) · [Batch users](/api-reference/x/batch-users) · [Check follower](/api-reference/x/check-follower) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # X (Twitter) followers API, export by username Source: https://docs.xquik.com/api-reference/x/followers X (Twitter) followers API. Export an account's followers by username or user ID with cursor pagination for CRM and agent workflows. 1 credit per result. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/followers` **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) Get followers returns follower profiles for one X account. Name the account by username or numeric user ID. The endpoint is `GET /api/v1/x/users/{id}/followers`. > [!NOTE] > > Omit `mode` to get the fullest results. The response shape stays the same. > Pass `next_cursor` back unchanged as `cursor`. Keep the same endpoint, target, > query, and filters. Existing unprefixed cursors keep their legacy behavior. `after`, `limit`, and `pageSize` aliases also keep working. Billing still counts only returned rows. Use `mode=standard` only to keep the legacy pagination. A page can be empty or underfilled. Continue while `has_next_page` is `true`. Stop only after the response reports `has_next_page=false`. First-page requests do not support `Idempotency-Key` retries. Repeating a cursorless request starts a separate extraction. Results returned by that extraction incur their normal charges. Save each response before requesting its next page. A cursor sent again within 10 minutes returns the same page at no charge. After 10 minutes, you cannot replay earlier or terminal responses. If automatic coverage is busy, an initial request returns a standard data page. Live coverage cursors remain atomic. A cursor sent again while its page loads returns that page at no charge. Other repeats return `409 coverage_cursor_unavailable` with exact `Retry-After` seconds. Wait, then send the same cursor again. Repeated busy responses never authorize restarting with another cursor. Expired, superseded, or identity-mismatched cursors return `410 coverage_cursor_gone`. So does a cursor sent again after 10 minutes. The response omits `Retry-After`. Restart without a cursor. Keep received results. Deduplicate restarted results by `id`. Malformed cursors return `400 invalid_coverage_cursor`. Restart without them. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # Username follower page curl "https://xquik.com/api/v1/x/users/username/followers?pageSize=200" \ -H "x-api-key: xq_your_api_key_here" | jq # Numeric user ID follower page curl "https://xquik.com/api/v1/x/users/44196397/followers?pageSize=200" \ -H "x-api-key: xq_your_api_key_here" | jq # Resume with next_cursor from the previous page curl -G "https://xquik.com/api/v1/x/users/username/followers" \ --data-urlencode "cursor=DAACCgACGE..." \ --data-urlencode "pageSize=200" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userIdOrUsername = "username"; let pageCursor = ""; const seenCursors = new Set(); for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = new URLSearchParams({ pageSize: "200" }); if (pageCursor !== "") params.set("cursor", pageCursor); const response = await fetch( `https://xquik.com/api/v1/x/users/${userIdOrUsername}/followers?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" } }, ); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); const importRows = page.users.map((user) => ({ source_user_id_or_username: userIdOrUsername, x_user_id: user.id, x_username: user.username, display_name: user.name, description: user.description ?? null, location: user.location ?? null, website_url: user.url ?? null, follower_count: user.followers ?? null, following_count: user.following ?? null, verified: user.verified ?? false, verified_type: user.verifiedType ?? null, profile_picture_url: user.profilePicture ?? null, cover_picture_url: user.coverPicture ?? null, account_created_at: user.createdAt ?? null, statuses_count: user.statusesCount ?? null, page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, })); for (const row of importRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; if (page.next_cursor === pageCursor || seenCursors.has(page.next_cursor)) { throw new Error("pagination cursor repeated"); } seenCursors.add(page.next_cursor); pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user_id_or_username = "44196397" page_cursor = "" seen_cursors = set() for page_index in range(3): params = {"pageSize": "200"} if page_cursor: params["cursor"] = page_cursor response = requests.get( f"https://xquik.com/api/v1/x/users/{user_id_or_username}/followers", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for user in page["users"]: import_row = { "source_user_id_or_username": user_id_or_username, "x_user_id": user["id"], "x_username": user["username"], "display_name": user["name"], "description": user.get("description"), "location": user.get("location"), "website_url": user.get("url"), "follower_count": user.get("followers"), "following_count": user.get("following"), "verified": user.get("verified", False), "verified_type": user.get("verifiedType"), "profile_picture_url": user.get("profilePicture"), "cover_picture_url": user.get("coverPicture"), "account_created_at": user.get("createdAt"), "statuses_count": user.get("statusesCount"), "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page["next_cursor"], "has_next_page": page["has_next_page"], } print(json.dumps(import_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break if page["next_cursor"] == page_cursor or page["next_cursor"] in seen_cursors: raise RuntimeError("pagination cursor repeated") seen_cursors.add(page["next_cursor"]) page_cursor = page["next_cursor"] ``` The Node.js and Python snippets write JSON Lines import rows, not raw follower pages. Store each mapped row and the latest `next_cursor` in your sync job. It can then resume from the last completed page. ## Direct follower handoff Use `GET /api/v1/x/users/{id}/followers` when a CRM, warehouse, audience, or agent workflow needs follower rows. It returns them for one profile now. The examples above write JSON Lines rows for imports or upserts. Each row is keyed by `x_user_id` and holds its page's cursor state. Followers come newest first. ## Choose live API or saved export Use this endpoint for current JSON pages in an app, queue, or agent. It fits when the caller can store `next_cursor` and process `users[]` immediately. Use [`follower_explorer`](/guides/follower-export-crm) for a cost estimate, reusable extraction ID, stored result pages, or files. Its files are CSV, JSON, or XLSX, ready after completion. Automatic `pageSize` accepts 20 to 10,000. Standard mode accepts 20 to 200. Paid calls can return fewer rows. `users.length` is the billable row count. Zero affordable results return `402 insufficient_credits`. For high-volume follower pulls, deduplicate profiles by `id`. Continue through empty pages while the cursor advances. Stop with a partial-result status when `next_cursor` is missing or repeats. ## Build a Twitter follower tracker An [account monitor](/api-reference/monitors/create) tracks followers for you, with no snapshot diff. Select `follower.added` and `follower.removed`. Each event holds the follower's profile, or its ID when X shows none. New followers usually arrive within a minute. Losses take about 15 minutes, or up to 2 hours above 5,000 followers. * `follower.added` holds `followedAt`, X's time of the follow when X gives one. * `follower.removed` holds `reason` when the cause is known. `unfollowed` means the follow ended. `unavailable` means X shows no account for it, as after a suspension. * `followKind` marks a returning follower as `refollow` or `return`. * `profile.followers.changed` reports follower count moves, at most once a minute. Monitors name every lost follower for accounts with up to 100,000 followers. Above that, they name losses among the newest 5,000. An active monitor costs 30 credits per hour. Use this endpoint once for the starting list. Key its rows by `users[].id`, since usernames change. To track without code, open the [Twitter unfollowers tracker](https://xquik.com/en/twitter-unfollowers-tracker). ## Which follower endpoint? * Use `GET /api/v1/x/users/{id}/followers` for one account's live follower page. * Use [`follower_explorer`](/guides/follower-export-crm) when you need a saved job, CSV, JSON, or XLSX export. * Use `GET /api/v1/x/users/{id}/following` for accounts the user follows. * Use `GET /api/v1/x/users/{id}/verified-followers` when you only need verified followers. * Use [Followers You Know](/api-reference/x/followers-you-know) for followers you share with another account. * Use an [account monitor](/api-reference/monitors/create) for each new or lost follower. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pass `next_cursor` back unchanged. New Xquik cursors resume automatic coverage. Existing unprefixed cursors keep legacy behavior. | | `mode` | `string` | No | Optional compatibility override. Omit it to get the fullest list. `standard` keeps the legacy pagination. Use `coverage` for a one-shot diagnostic response without cursor pagination. | | `after` | `string` | No | Legacy cursor alias for `cursor`. When both are present, `cursor` wins. | | `pageSize` | `number` | No | Automatic pages accept `20` through `10000`. Standard pages accept `20` through `200`. The default is `200`. Credits can reduce the returned row count. | | `limit` | `number` | No | With `mode=coverage`, set a one-shot cap from `1` through `10000`. Otherwise, this is a legacy page size alias. `pageSize` wins. | | `enrichProfiles` | `boolean` | No | Set `true` to add each row's full profile, as `GET /x/users/{id}` returns it. Pages take several seconds longer. The price per row stays the same. Later pages can leave it out, & `next_cursor` still works. Default `false`. | ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. | Query parameter | Type | Required | Description | | - | - | - | - | | `maxScan` | `integer` | No | Most profiles 1 request reads, kept or dropped by the filters. The answer then holds the kept profiles, the dropped count & the next cursor. Each request may send its own value. Without it, a filtered read scans at most 100,000 profiles of the list. The limit spans all pages of the read. The page that reaches the limit ends the list & names `scanLimit`. An unfiltered read has no scan limit. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK With `enrichProfiles=true`, each row carries the full profile. The `x-xquik-profile-enrichment` header then counts the rows that have it, as in `enriched=180; requested=200`. A row without it keeps its list fields. | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of follower profiles. | | `users[].id` | `string` | X (Twitter) user ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. Omitted if empty. | | `users[].followers` | `number` | Follower count. | | `users[].following` | `number` | Following count. | | `users[].verified` | `boolean` | Whether the user is verified. | | `users[].profilePicture` | `string` | Profile picture URL. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. Omitted if empty. | | `users[].accountBasedIn` | `object \| null` | Country or region X shows for the account, with `value`, `level` & `observedAt`. X infers it from account access. It states no nationality or exact location. `null` when X shows none. Present with `enrichProfiles=true`, unless it's not available yet. | | `users[].accountBasedInUnavailable` | `boolean` | `true` when this row's `accountBasedIn` is not available yet. Retry later to get it. Omitted otherwise. | | `users[].createdAt` | `string` | ISO 8601 account creation timestamp. | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].email` | `string` | First email the account publishes on its profile, lowercased. Omitted when it publishes none. | | `users[].contactInfo` | `object` | Emails, phone numbers & links the account publishes on its own profile. Each email has `value`, `domain` & `source`. Each phone has `value` & `source`. Each link has `url`, `network` & `source`. `source` is the profile field that holds it, such as `bio` or `url`. `writtenAs` keeps the account's own spelling of a spelled-out email or number. Omitted when the profile publishes none. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | IDs of pinned tweets. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | | `scanLimit` | `object` | Present when a filtered read without `maxScan` scans 100,000 profiles of the list. It is on that read's last page. `limit` is 100000. `rowsRead` counts the profiles read across all pages, kept or dropped. `message` says how to read further. `has_next_page` is false on that page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "following": 500, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/xquik/photo.jpg", "description": "All-in-one X automation platform" } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Mutual followers you know, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/followers-you-know Retrieve mutual X (Twitter) followers between your account and one target user. Use them for warm-intro, CRM, scoring, and agent workflows. 1 credit per result. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/followers-you-know` ## When to read mutual followers Use this route for mutual followers your connected X account can see. It supports warm introductions, CRM scoring, and pre-message checks. Use profile lookup when mutual relationship rows are unnecessary. The route reads through your connected X account. Callers without a connected X account get `424 account_required`. Use [Connect X account](/api-reference/x-accounts/connect) to add one. Guest keys get `403 forbidden`. When your connected X accounts are busy, the route returns `503`. Retry after the `Retry-After` delay. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit Get followers you know returns mutual followers. They follow both your connected X account and one target X user. The endpoint is `GET /api/v1/x/users/{id}/followers-you-know`. ```bash First page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/44196397/followers-you-know \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```bash Next page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/users/44196397/followers-you-know \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userId = "44196397"; const response = await fetch(`https://xquik.com/api/v1/x/users/${userId}/followers-you-know`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const mutualRows = data.users.map((user) => ({ target_user_id: userId, x_user_id: user.id, username: user.username, display_name: user.name, follower_count: user.followers ?? null, verified: user.verified ?? false, verified_type: user.verifiedType ?? null, profile_image_url: user.profilePicture ?? null, })); const nextCursor = data.has_next_page ? data.next_cursor : null; const checkpoint = { target_user_id: userId, next_cursor: nextCursor }; for (const row of mutualRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } process.stdout.write(`${JSON.stringify(checkpoint)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user_id = "44196397" response = requests.get( f"https://xquik.com/api/v1/x/users/{user_id}/followers-you-know", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() mutual_rows = [ { "target_user_id": user_id, "x_user_id": user["id"], "username": user["username"], "display_name": user["name"], "follower_count": user.get("followers"), "verified": user.get("verified", False), "verified_type": user.get("verifiedType"), "profile_image_url": user.get("profilePicture"), } for user in data["users"] ] next_cursor = data["next_cursor"] if data["has_next_page"] else None checkpoint = {"target_user_id": user_id, "next_cursor": next_cursor} for row in mutual_rows: print(json.dumps(row)) print(json.dumps(checkpoint)) ``` The Node.js and Python snippets build mutual follower rows. They do not print the full response page. Store the rows with the checkpoint. A worker can then resume pagination with `next_cursor` without duplicating imported profiles. ## Direct mutual followers handoff For one JSON page of a target user's mutual followers, use `GET /x/users/{id}/followers-you-know`. It suits sales, community, recruiting, support, CRM, or agent workflows. It returns people who follow both your connected X account and the target user. The path `id` is the target numeric X (Twitter) user ID. > [card] Mutual rows > > Store `users[]` as the mutual follower profile rows returned on this page. > [card] Stable upserts > > Store `users[].id` as `x_user_id` for CRM, warehouse, scoring, and agent deduplication. > [card] Warm-intro labels > > Store `users[].username` and `users[].name` for handles, owner review, routing, and handoff labels. > [card] Profile context > > Store `users[].description`, `location`, `url`, `profilePicture`, and `coverPicture` when returned. > [card] Priority signals > > Store `users[].followers`, `users[].following`, `verified`, and `verifiedType` for scoring and queue priority. > [card] Approved contact > > Use DM endpoints only after a user-approved message flow. The write response tells you whether X delivered the DM. > [card] Next page > > Store `has_next_page` and `next_cursor`. Then pass `next_cursor` back as `cursor` only when `has_next_page` is true. Direct mutual followers cost 1 credit per user returned. Low credit balances can return fewer users than a full page. Zero affordable results return `402 insufficient_credits`. ## Explain mutual follower context Use this route to find profiles that connect the acting account with another profile. Keep both account identities with every returned user. Mutual-follower rows can support these uses. * Relationship context during account review. * Introductions through already known profiles. * Trust research around a public conversation. * CRM notes tied to shared followers. Store user ID, username, profile name, verification state, and follower counts. Also store the target profile ID and acting account. Do not describe a mutual follower as an endorsement. The route reports a public relationship, not intent. Avoid inferring consent, employment, or affiliation. Paginate by cursor and deduplicate by user ID. Keep a collection timestamp because follow relationships can change. ## Build a mutual connection brief Keep the target user ID with every mutual follower result. Store each user ID, username, profile summary, and biography. Add verification state, follower count, request time, and cursor. Rank mutual followers for your own review. The API does not declare endorsement, relationship strength, or personal familiarity. Refresh the target profile before a time-sensitive decision. Use stable user IDs when usernames change. Do not merge these results with verified followers without a source column. A mutual follower and a verified follower are different facts. ## Prepare a warm-introduction review Begin with the acting account and target account. Store both stable user IDs. Every returned profile belongs to the mutual-follower context between them. Keep each mutual follower's stable user ID, username, and profile name. Add biography, location, verification, and audience counts. Add the page cursor and collection time. With these fields, reviewers can identify the shared connection. Do not rank profiles from follower count alone. Review biography, location, recent profile context, and the purpose of the outreach. Record the chosen priority outside returned API fields. Never describe a mutual follower as an introduction, endorsement, or consent. The route reports a public relationship. A person must approve any outreach or introduction step. When a reviewer approves outreach, keep the mutual-follower snapshot. Link the later message result through stable user IDs. Keep message content and delivery state outside the relationship row. Refresh time-sensitive profiles before contacting anyone. Usernames, bios, verification, and audience counts can change. Keep the original snapshot for review evidence. ## Compare mutual follower graph snapshots Complete every cursor page before comparing 2 runs. Mark a capped, credit-bounded, failed, or interrupted run as partial. Exclude partial runs from complete graph-change claims. Use acting account ID, target account ID, and mutual user ID as the key. Report newly observed and missing mutual profiles separately. Do not infer why a relationship changed. Username and profile changes are attribute changes. The user ID still identifies the same relationship. Record each snapshot's collection time and page count. Keep mutual followers separate from all followers and verified followers. A source column should name `followers-you-know`. An audience warehouse can then keep the 3 relationship types apart. When the target changes, create a new comparison group. Never reuse cursors or relationship labels across different target user IDs. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from `next_cursor` in a previous response. Omit for the first page. Pass a cursor only when `has_next_page` is true. | | `pageSize` | `integer` | No | Profiles per page, up to `10000`. A larger value gets the largest page. Defaults to `200`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which follower graph endpoint? > [card] Mutual followers > > Use `GET /x/users/{id}/followers-you-know` for people who follow both your > connected X account and the target. > [card] All followers > > Use [`GET /x/users/{id}/followers`](/api-reference/x/followers) for all > followers of one target profile. > [card] Verified followers > > Use [`GET /x/users/{id}/verified-followers`](/api-reference/x/verified-followers) > when you only need verified followers of the target profile. > [card] DM handoff > > Use [`Send DM`](/api-reference/x-write/send-dm) only after your workflow has > a user-approved outreach step. ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of mutual follower profiles. | | `users[].id` | `string` | User ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. Omitted if empty. | | `users[].followers` | `number` | Follower count. Omitted if unavailable. | | `users[].following` | `number` | Following count. Omitted if unavailable. | | `users[].verified` | `boolean` | Whether the user is verified. Omitted if unavailable. | | `users[].profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. Omitted if empty. | | `users[].createdAt` | `string` | ISO 8601 account creation timestamp. Omitted if unavailable. | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | IDs of pinned tweets. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/xquik/photo.jpg" } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id" }` The user ID is empty or invalid. ### 401 Unauthenticated Missing or invalid API key. ### 402 Payment required Account keys get account options. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. Without a connected X account, the route returns `424 account_required`. Connect one, then retry. `{ "error": "account_required", "message": "This read needs your own connected X account. Connect or restore it at dashboard.xquik.com/account, then retry." }` > [!NOTE] > > **Related.** [Direct message workflow](/guides/direct-message-workflow) for user-approved outreach. [Send DM](/api-reference/x-write/send-dm) to send and store `messageId`. [DM history](/api-reference/x/dm-history) to read participant-scoped context. See also [Get followers](/api-reference/x/followers), [Get following](/api-reference/x/following), and [Get verified followers](/api-reference/x/verified-followers). > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Export a user's following, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/following Retrieve the accounts one X user follows by username or numeric user ID with cursor pagination for CRM, warehouse, and agent workflows. 1 credit per result. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/following` ## When to read outbound relationships Use this route for accounts the selected user follows. Use followers for inbound relationships. Use verified followers when you need only verified inbound followers. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit Get following returns the accounts one X profile follows. Pass the profile by username or numeric user ID. The endpoint is `GET /api/v1/x/users/{id}/following`. > [!NOTE] > > Omit `mode` to get the fullest results. The response shape stays the same. > Pass `next_cursor` back unchanged as `cursor`. Keep the same endpoint, target, > query, and filters. Existing unprefixed cursors keep their legacy behavior. `after`, `limit`, and `pageSize` aliases also keep working. Billing still counts only returned rows. Use `mode=standard` only to keep the legacy pagination. A page can be empty or underfilled. Continue while `has_next_page` is `true`. Stop only after the response reports `has_next_page=false`. First-page requests do not support `Idempotency-Key` retries. Repeating a cursorless request starts a separate extraction. Results returned by that extraction incur their normal charges. Save each response before requesting its next page. A cursor sent again within 10 minutes returns the same page at no charge. After 10 minutes, you cannot replay earlier or terminal responses. If automatic coverage is busy, an initial request returns a standard data page. Live coverage cursors remain atomic. A cursor sent again while its page loads returns that page at no charge. Other repeats return `409 coverage_cursor_unavailable` with exact `Retry-After` seconds. Wait, then send the same cursor again. Repeated busy responses never authorize restarting with another cursor. Expired, superseded, or identity-mismatched cursors return `410 coverage_cursor_gone`. So does a cursor sent again after 10 minutes. The response omits `Retry-After`. Restart without a cursor. Keep received results. Deduplicate restarted results by `id`. Malformed cursors return `400 invalid_coverage_cursor`. Restart without them. ```bash Username theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/username/following?pageSize=100" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```bash Numeric user ID theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/44196397/following" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```bash Resume page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G "https://xquik.com/api/v1/x/users/username/following" \ --data-urlencode "cursor=DAACCgACGE..." \ --data-urlencode "pageSize=200" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userIdOrUsername = "44196397"; let pageCursor = ""; const seenCursors = new Set(); for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = new URLSearchParams({ pageSize: "200" }); if (pageCursor !== "") params.set("cursor", pageCursor); const response = await fetch( `https://xquik.com/api/v1/x/users/${userIdOrUsername}/following?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" } }, ); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); const audienceRows = page.users.map((user) => ({ source_user_id_or_username: userIdOrUsername, x_user_id: user.id, x_username: user.username, display_name: user.name, bio: user.description ?? null, follower_count: user.followers ?? null, following_count: user.following ?? null, verified: user.verified ?? false, profile_image_url: user.profilePicture ?? null, page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, })); for (const row of audienceRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; if (page.next_cursor === pageCursor || seenCursors.has(page.next_cursor)) { throw new Error("pagination cursor repeated"); } seenCursors.add(page.next_cursor); pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user_id_or_username = "44196397" page_cursor = "" seen_cursors = set() for page_index in range(3): params = {"pageSize": "200"} if page_cursor: params["cursor"] = page_cursor response = requests.get( f"https://xquik.com/api/v1/x/users/{user_id_or_username}/following", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for user in page["users"]: audience_row = { "source_user_id_or_username": user_id_or_username, "x_user_id": user["id"], "x_username": user["username"], "display_name": user["name"], "bio": user.get("description"), "follower_count": user.get("followers"), "following_count": user.get("following"), "verified": user.get("verified", False), "profile_image_url": user.get("profilePicture"), "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page["next_cursor"], "has_next_page": page["has_next_page"], } print(json.dumps(audience_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break if page["next_cursor"] == page_cursor or page["next_cursor"] in seen_cursors: raise RuntimeError("pagination cursor repeated") seen_cursors.add(page["next_cursor"]) page_cursor = page["next_cursor"] ``` The Node.js and Python snippets write JSON Lines audience rows, not raw following pages. Store each mapped row and the latest `next_cursor` in your sync job. It can then resume from the last completed page. For high-volume following pulls, deduplicate profiles by `id`. Continue through empty pages while the cursor advances. Stop with a partial-result status when `next_cursor` is missing or repeats. ## Direct following handoff For one paginated JSON page of a user's followed accounts now, use `GET /x/users/{id}/following`. It suits a CRM, warehouse, audience, or agent workflow. The endpoint accepts a username or numeric user ID. It returns followed account profile rows with cursor fields. For estimated jobs, saved extractions, or CSV, JSON, or XLSX file export, use [`following_explorer`](/api-reference/extractions/create). > [card] Following rows > > Store `users[]` as the followed account profile rows returned on this page. > [card] Stable upserts > > Store `users[].id` as `x_user_id` for CRM, warehouse, audience, and agent deduplication. > [card] Readable labels > > Store `users[].username` and `users[].name` for handles, labels, segments, and review queues. > [card] Profile enrichment > > Store `users[].description`, `location`, `url`, `profilePicture`, and `coverPicture` when returned. > [card] Next page > > Store `has_next_page` and `next_cursor`. Then pass `next_cursor` back as `cursor` only when `has_next_page` is true. > [card] Page size > > Automatic pages accept 20 to 10,000. Standard pages accept 20 to 200. Direct following calls cost 1 credit per user returned. Low credit balances can return fewer users than a full page. Zero affordable results return `402 insufficient_credits`. ## Track Twitter following changes An [account monitor](/api-reference/monitors/create) reports each change for you. Select `following.added` and `following.removed`. Each event holds the other account's profile, or its ID when X shows none. Add `profile.following.changed` for count moves. Use this endpoint for the starting list. Store every cursor page before advancing. Key rows by user ID, since usernames change. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pass `next_cursor` back unchanged. New Xquik cursors resume automatic coverage. Existing unprefixed cursors keep legacy behavior. | | `mode` | `string` | No | Optional compatibility override. Omit it to get the fullest list. `standard` keeps the legacy pagination. Use `coverage` for a one-shot diagnostic response without cursor pagination. | | `after` | `string` | No | Legacy cursor alias. Use `cursor`. When both are present, `cursor` wins. | | `pageSize` | `number` | No | Automatic pages accept `20` through `10000`. Standard pages accept `20` through `200`. The default is `200`. Credits can reduce the returned row count. | | `limit` | `number` | No | With `mode=coverage`, set a one-shot cap from `1` through `10000`. Otherwise, this is a legacy page size alias. `pageSize` wins. | | `enrichProfiles` | `boolean` | No | Set `true` to add each row's full profile, as `GET /x/users/{id}` returns it. Pages take several seconds longer. The price per row stays the same. Later pages can leave it out, & `next_cursor` still works. Default `false`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which following endpoint? > [card] One user's following > > Use `GET /x/users/{id}/following` for the accounts one profile follows. > [card] One user's followers > > Use [`GET /x/users/{id}/followers`](/api-reference/x/followers) for the > accounts that follow that profile. > [card] Verified followers > > Use [`GET /x/users/{id}/verified-followers`](/api-reference/x/verified-followers) > when you only need verified followers of the profile. > [card] Saved exports > > Use [`following_explorer`](/api-reference/extractions/create) for a saved > following extraction with CSV, JSON, or XLSX download handoff. ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. | Query parameter | Type | Required | Description | | - | - | - | - | | `maxScan` | `integer` | No | Most profiles 1 request reads, kept or dropped by the filters. The answer then holds the kept profiles, the dropped count & the next cursor. Each request may send its own value. Without it, a filtered read scans at most 100,000 profiles of the list. The limit spans all pages of the read. The page that reaches the limit ends the list & names `scanLimit`. An unfiltered read has no scan limit. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK With `enrichProfiles=true`, each row carries the full profile. The `x-xquik-profile-enrichment` header then counts the rows that have it, as in `enriched=180; requested=200`. A row without it keeps its list fields. | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of user profiles being followed. | | `users[].id` | `string` | X (Twitter) user ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. Omitted if empty. | | `users[].followers` | `number` | Follower count. | | `users[].following` | `number` | Following count. | | `users[].verified` | `boolean` | Whether the user is verified. | | `users[].profilePicture` | `string` | Profile picture URL. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. Omitted if empty. | | `users[].accountBasedIn` | `object \| null` | Country or region X shows for the account, with `value`, `level` & `observedAt`. X infers it from account access. It states no nationality or exact location. `null` when X shows none. Present with `enrichProfiles=true`, unless it's not available yet. | | `users[].accountBasedInUnavailable` | `boolean` | `true` when this row's `accountBasedIn` is not available yet. Retry later to get it. Omitted otherwise. | | `users[].createdAt` | `string` | ISO 8601 account creation timestamp. | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].email` | `string` | First email the account publishes on its profile, lowercased. Omitted when it publishes none. | | `users[].contactInfo` | `object` | Emails, phone numbers & links the account publishes on its own profile. Each email has `value`, `domain` & `source`. Each phone has `value` & `source`. Each link has `url`, `network` & `source`. `source` is the profile field that holds it, such as `bio` or `url`. `writtenAs` keeps the account's own spelling of a spelled-out email or number. Omitted when the profile publishes none. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | IDs of pinned tweets. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | | `scanLimit` | `object` | Present when a filtered read without `maxScan` scans 100,000 profiles of the list. It is on that read's last page. `limit` is 100000. `rowsRead` counts the profiles read across all pages, kept or dropped. `message` says how to read further. `has_next_page` is false on that page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "verified": true } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get followers](/api-reference/x/followers) · [Get verified followers](/api-reference/x/verified-followers) · [Get followers you know](/api-reference/x/followers-you-know) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Export a user's following IDs, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/following-ids Get the user IDs of accounts a Twitter or X user follows, newest first, up to 5,000 a page. Use them for fast graph syncs and set comparisons. 1 credit per ID. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/following-ids` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/nasa/following-ids \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 curl -G https://xquik.com/api/v1/x/users/nasa/following-ids \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const user = "nasa"; let pageCursor = ""; let position = 0; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch(`https://xquik.com/api/v1/x/users/${user}/following-ids${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const userId of page.ids) { position += 1; const idRow = { source_user: user, position, user_id: userId, page_cursor: pageCursor }; process.stdout.write(`${JSON.stringify(idRow)}\n`); } if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user = "nasa" page_cursor = "" position = 0 for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user}/following-ids", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for user_id in page["ids"]: position += 1 id_row = { "source_user": user, "position": position, "user_id": user_id, "page_cursor": page_cursor, } print(json.dumps(id_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## IDs only, 5,000 a page Use `GET /x/users/{id}/following-ids` for the user IDs of the accounts a user follows. IDs arrive newest first. The response holds no profiles, so a page holds up to 5,000 IDs. Use it for fast audience syncs and set comparisons. Pass the IDs to [`GET /x/users/batch`](/api-reference/x/batch-users) when you need profiles. Stop paging when `has_next_page` is `false`. A protected account returns 403 `x_account_protected`. Xquik charges nothing. ## IDs or profiles? * Use `GET /api/v1/x/users/{id}/following-ids` when IDs are enough. * Use `GET /api/v1/x/users/{id}/following` when each row needs a profile. | Need | Route | Rows returned | | - | - | - | | IDs only | `/x/users/{id}/following-ids` | Up to 5,000 user IDs a page. | | Full profiles | `/x/users/{id}/following` | Profiles with filters. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | User IDs per page. Accepts `1-5000`. Defaults to `5000`. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `ids` | `string[]` | User IDs, newest first. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "ids": ["9876543210", "44196397"], "has_next_page": true, "next_cursor": "1878079982871151535" } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 403 Protected account `{ "error": "x_account_protected", "message": "This account's following list is private. Try a public account." }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Profiles on this list](/api-reference/x/following) · [Batch users](/api-reference/x/batch-users) · [Check follower](/api-reference/x/check-follower) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Get a long-form article, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/get-article Retrieve one long-form X Article by tweet ID with title, body blocks, cover image, author profile, publication time, and engagement metrics. 5 credits per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/articles/{tweetId}` **5 credits per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00075 per call > [!NOTE] > > Get X Article returns one long-form X Article by wrapper tweet ID. The endpoint is > `GET /api/v1/x/articles/{tweetId}`. ```bash Article tweet ID theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/articles/2033891852621840387 \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "2033891852621840387"; const response = await fetch(`https://xquik.com/api/v1/x/articles/${tweetId}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const contentBlocks = data.article.contents ?? []; const author = data.author ?? {}; const bodyBlocks = contentBlocks.filter((block) => block.text); const mediaBlocks = contentBlocks.filter((block) => block.url); const formattedBlocks = contentBlocks .map((block, index) => ({ index, type: block.type ?? null, inline_style_ranges: block.inlineStyleRanges ?? [], })) .filter((block) => block.inline_style_ranges.length > 0); const handoff = { tweet_id: tweetId, article_title: data.article.title ?? null, preview_text: data.article.previewText ?? null, author_id: author.id ?? null, author_username: author.username ?? null, author_name: author.name ?? null, author_profile_picture: author.profilePicture ?? null, created_at: data.article.createdAt ?? null, cover_image_url: data.article.coverImageUrl ?? null, body_text: bodyBlocks.map((block) => block.text).join("\n\n"), body_markdown: data.article.bodyMarkdown ?? null, block_count: contentBlocks.length, block_types: contentBlocks.map((block) => block.type ?? "unknown"), formatted_blocks: formattedBlocks, media_urls: mediaBlocks.map((block) => block.url), }; process.stdout.write(`${JSON.stringify(handoff)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "2033891852621840387" response = requests.get( f"https://xquik.com/api/v1/x/articles/{tweet_id}", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() content_blocks = data["article"].get("contents", []) body_blocks = [block for block in content_blocks if block.get("text")] media_blocks = [block for block in content_blocks if block.get("url")] formatted_blocks = [ { "index": index, "type": block.get("type"), "inline_style_ranges": block.get("inlineStyleRanges", []), } for index, block in enumerate(content_blocks) if block.get("inlineStyleRanges") ] author = data.get("author") or {} handoff = { "tweet_id": tweet_id, "article_title": data["article"].get("title"), "preview_text": data["article"].get("previewText"), "author_id": author.get("id"), "author_username": author.get("username"), "author_name": author.get("name"), "author_profile_picture": author.get("profilePicture"), "created_at": data["article"].get("createdAt"), "cover_image_url": data["article"].get("coverImageUrl"), "body_text": "\n\n".join(block["text"] for block in body_blocks), "body_markdown": data["article"].get("bodyMarkdown"), "block_count": len(content_blocks), "block_types": [block.get("type") for block in content_blocks], "formatted_blocks": formatted_blocks, "media_urls": [block["url"] for block in media_blocks], } print(json.dumps(handoff)) ``` The examples build article rows, not raw lookup dumps. Use `GET /api/v1/x/articles/{tweetId}` when a workflow needs one long-form post body plus article metadata. Store `tweet_id`, `article_title`, `preview_text`, `author_id`, `author_username`, `author_name`, `author_profile_picture`, `created_at`, `cover_image_url`, `body_text`, and `body_markdown`. Keep these fields with the record you pass on. Your archive, article index, or agent handoff may need block-level completeness and formatting checks. If so, store `block_count`, `block_types`, `formatted_blocks`, and `media_urls`. ## Find candidate articles This endpoint needs the numeric wrapper tweet ID of an X Article. When a workflow starts from a mixed set of tweets, search first. Then store candidate tweet IDs and try the article lookup once per candidate. > [card] Search first > > [`Search tweets`](/api-reference/x/search-tweets) finds candidate > wrapper tweets by author, keyword, URL, or visible tweet text. > [card] Article lookup > > Call `GET /api/v1/x/articles/{tweetId}` with the candidate tweet ID when > the workflow needs the long-form body. > [card] Fallback route > > If you get `article_not_found`, store the terminal result and switch > to [`Get tweet`](/api-reference/x/get-tweet) or > [`Get tweet thread`](/api-reference/x/tweet-thread). > [card] Saved export > > Use `article_extractor` for an extraction job, estimate, > or CSV, JSON, or XLSX export. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "content_job_id": "article-archive-q2", "candidate_source": "GET /api/v1/x/tweets/search", "article_route": "GET /api/v1/x/articles/{tweetId}", "tweet_id": "2033891852621840387", "content_type": "x_article", "article_error": null, "fallback_route": "GET /api/v1/x/tweets/{id}", "saved_fields": ["article_title", "preview_text", "body_text", "cover_image_url"] } ``` ## Direct article handoff Use `GET /api/v1/x/articles/{tweetId}` when you need the article body and have its tweet ID. That ID is the numeric tweet ID of an X Article wrapper tweet. Use the final status ID from an X Article URL. A normal tweet ID can be valid. It can still return `404 article_not_found` when it is not an X Article. > [card] Article row > > Store `article.title`, `previewText`, `coverImageUrl`, `createdAt`, metrics, > and a derived `body_text` field. > [card] Body blocks > > Store `article.contents[]` for headings, lists, quotes, media, > dividers, code blocks, and inline styles. > [card] Author joins > > Store `author.id`, `username`, `name`, and `profilePicture` when returned. > [card] Media assets > > Store `coverImageUrl` and media-block `url` values for article archives and > article review. > [card] Not an article > > `article_not_found` is final for that tweet ID. > Ask for an X Article URL or use a tweet or thread endpoint. > [card] Saved exports > > Use `article_extractor` for a saved extraction job or CSV, JSON, > or XLSX export. ## Store an X article archive Keep the wrapper Tweet ID, article fields, structured content blocks, and author. Keep the cover image and collection time. Keep `article.contents[]` when the archive must reconstruct headings, lists, quotes, media, dividers, or code. | Article archive column | Response source | Archive rule | | - | - | - | | `wrapper_tweet_id` | Requested `tweetId` | Use as the stable article lookup key. | | `article_title` | `article.title` | Keep the returned X Article title. | | `preview_text` | `article.previewText` | Store the short article preview when returned. | | `body_text` | Derived from `article.contents[]` | Build searchable text and keep the structured blocks. | | `content_blocks` | `article.contents[]` | Keep block order, type, text, styles, and media references. | | `cover_image_url` | `article.coverImageUrl` | Keep the article cover asset with its source record. | | `author_id` | `author.id` | Use as the stable article-author key. | | `author_username` | `author.username` | Display the current author handle. | | `created_at` | `article.createdAt` | Keep the article publication time. | | `media_urls` | Media block URLs | Keep inline images or videos with their block positions. | | `collected_at` | Integration timestamp | Audit when you retrieved the article body. | | Article block | Text projection | Structured value to keep | | - | - | - | | Heading | Heading text | Heading level and inline styles | | Paragraph | Paragraph text | Inline links, mentions, and styles | | List | Ordered item text | List type, item order, and nesting | | Quote | Quoted text | Quote attribution when returned | | Media | Alt text or caption | Media URL, type, and position | | Code | Code text | Language and formatting metadata | | Divider | No body text | Block position in the article | Direct article reads cost 5 credits per successful call. For MPP callers, this endpoint bills a fixed charge of USD 0.00075 per call. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `tweetId` | `string` | Yes | X Article post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). A post without an Article returns `article_not_found`. | ## Which article endpoint? > [card] X article body > > Use `GET /x/articles/{tweetId}` for one X Article. It returns the title, > body blocks, cover image, metrics, and author fields. > [card] Single tweet > > Use [`Get tweet`](/api-reference/x/get-tweet) for one tweet's text, media, > author, and engagement metrics. > [card] Tweet thread > > Use [`Get tweet thread`](/api-reference/x/tweet-thread) for conversation > context around the article wrapper tweet. > [card] Search tweets > > Use [`Search tweets`](/api-reference/x/search-tweets) to discover candidate > article tweets by keyword, URL, author, or other filters. > [card] Saved exports > > Use [`Create extraction`](/api-reference/extractions/create) with > `toolType=article_extractor` for a saved job or CSV, JSON, or XLSX > export. > [card] Article-not-found handling > > Do not retry the same ID after `article_not_found`. Switch to tweet lookup > or ask for an X Article URL. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `article` | `object` | The article data. | | `article.articleId` | `string` | X's ID for the article, which differs from its post's ID. | | `article.title` | `string` | Article title. | | `article.previewText` | `string` | Short preview text of the article. | | `article.summaryText` | `string` | X's summary of the article, when X has one. | | `article.coverImageUrl` | `string` | Cover thumbnail image URL. | | `article.coverMedia` | `object` | Public cover media metadata. X defines its fields. | | `article.metadata` | `object` | Public article metadata. X defines its fields. | | `article.lifecycleState` | `object` | Public lifecycle metadata. X defines its fields. | | `article.bodyText` | `string` | Plain text joined from all article content blocks. Omitted if unavailable. | | `article.bodyMarkdown` | `string` | Article body as Markdown, built from the content blocks. Keeps headings, lists, bold, italic, links, images & embedded posts as their x.com URLs. Holds no HTML. Omitted if unavailable. | | `article.contents` | `object[]` | Article body as an array of content blocks. | | `article.contents[].type` | `string` | The block type is `paragraph`, `header-one`, `header-two`, `header-three`, `header-four`, `header-five`, `header-six`, `ordered-list-item`, `unordered-list-item`, `blockquote`, `code-block`, `markdown`, `media`, `tweet`, or `divider`. | | `article.contents[].text` | `string` | Text content for text-based blocks. | | `article.contents[].url` | `string` | Media URL for `media` blocks. | | `article.contents[].previewUrl` | `string` | Preview image URL for `media` blocks. | | `article.contents[].width` | `number` | Width in pixels of an image, or of a video's or GIF's preview. | | `article.contents[].height` | `number` | Height in pixels of an image, or of a video's or GIF's preview. | | `article.contents[].mediaType` | `string` | A `media` block holds an `image`, `video` or `gif`. | | `article.contents[].caption` | `string` | The caption under a `media` block, when the author wrote one. | | `article.contents[].altText` | `string` | An image's alt text, when the author wrote one. | | `article.contents[].durationMs` | `number` | A video's length in milliseconds. | | `article.contents[].variants` | `object[]` | A video's or GIF's files. Each has its `contentType` and `url`, and an MP4 file its `bitrate`. | | `article.contents[].tweetId` | `string` | ID of the post a `tweet` block embeds. | | `article.contents[].links` | `object[]` | Links in the block's text. Each has the `offset` and `length` of the text it covers, and its `url`. | | `article.contents[].inlineStyleRanges` | `object[]` | Inline text formatting. | | `article.contents[].inlineStyleRanges[].offset` | `number` | Character offset where the style starts. | | `article.contents[].inlineStyleRanges[].length` | `number` | Number of characters the style spans. | | `article.contents[].inlineStyleRanges[].style` | `string` | X's name for the style, such as `Bold` or `Italic`. | | `article.createdAt` | `string` | Article creation timestamp. | | `article.likeCount` | `number` | Like count. | | `article.replyCount` | `number` | Reply count. | | `article.retweetCount` | `number` | Reposts of the Article's post. 0 or more. | | `article.quoteCount` | `number` | Quote tweet count. | | `article.bookmarkCount` | `number` | Accounts that bookmarked the Article's post. 0 or more. | | `article.viewCount` | `number` | View count. | | `article.unknownCounts` | `string[]` | Each count X left out of the Article's post, which reads 0. | | `author` | `object` | The article author. Omitted if author data is unavailable. | | `author.id` | `string` | Author user ID. | | `author.username` | `string` | Author X (Twitter) username. | | `author.name` | `string` | Author display name. | | `author.profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `author.description` | `string` | Author bio. Omitted if unavailable. | | `author.location` | `string` | Profile location. Omitted if unavailable. | | `author.url` | `string` | Profile website URL. Omitted if unavailable. | | `author.createdAt` | `string` | Account creation timestamp. Omitted if unavailable. | | `author.followersCount` | `number` | Follower count. Omitted if unavailable. | | `author.followingCount` | `number` | Following count. Omitted if unavailable. | | `author.statusesCount` | `number` | Posted tweet count. Omitted if unavailable. | | `author.mediaCount` | `number` | Media post count. Omitted if unavailable. | | `author.favouritesCount` | `number` | Liked tweet count. Omitted if unavailable. | | `author.profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `author.isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `author.isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `author.isTranslator` | `boolean` | Whether the account is an X translator. Omitted if unavailable. | | `author.protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "article": { "title": "Why Your TikTok & Instagram Videos Aren't Getting Views", "previewText": "Creating organic videos for Instagram Reels and TikTok is one of the most effective ways to attract customers...", "coverImageUrl": "https://pbs.twimg.com/media/HDcia3lXsAASgbQ.jpg", "contents": [ { "type": "paragraph", "text": "Creating organic videos for Instagram Reels and TikTok is one of the most effective ways to attract customers." }, { "type": "header-two", "text": "The problem" }, { "type": "ordered-list-item", "text": "Your account isn't properly set up" }, { "type": "media", "url": "https://pbs.twimg.com/media/HDm1eekbQAAzP9c.png", "previewUrl": "https://pbs.twimg.com/media/HDm1eekbQAAzP9c.png", "width": 640, "height": 804 }, { "type": "paragraph", "text": "What really matters is the hook.", "inlineStyleRanges": [{ "offset": 23, "length": 8, "style": "Bold" }] } ], "bodyMarkdown": "Creating organic videos for Instagram Reels and TikTok is one of the most effective ways to attract customers.\n\n## The problem\n\n1. Your account isn't properly set up\n\n![](https://pbs.twimg.com/media/HDm1eekbQAAzP9c.png)\n\nWhat really matters is **the hook**.", "createdAt": "Tue Mar 17 13:03:00 +0000 2026", "likeCount": 156, "replyCount": 9, "quoteCount": 4, "viewCount": 71303 }, "author": { "id": "1857516996755165184", "username": "cesaralvarezll", "name": "César Álvarez", "profilePicture": "https://pbs.twimg.com/profile_images/1884934857567895553/hHWR_iBg_normal.jpg" } } ``` ### 400 Invalid tweet ID `{ "error": "invalid_tweet_id" }` The provided tweet ID is empty or not a valid format. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls receive a direct MPP `WWW-Authenticate: Payment` challenge plus a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 404 Article not found The tweet is valid but does not contain an X Article. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get tweet](/api-reference/x/get-tweet) · [Get tweet thread](/api-reference/x/tweet-thread) · [Search tweets](/api-reference/x/search-tweets) · [Create extraction](/api-reference/extractions/create) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "article_not_found", "message": "Article not found. Use an X Article tweet ID." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Get a live video broadcast, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/get-broadcast Get one X (Twitter) broadcast, a live video, by ID or URL. See title, state, start and end times, watch counts, video size, and broadcaster. 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/broadcasts/{id}` **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call Get broadcast returns one X (Twitter) broadcast, live or ended. A broadcast is the live video X hosts at `x.com/i/broadcasts`. The endpoint is `GET /api/v1/x/broadcasts/{id}`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/broadcasts/1nGeLMWbkpaKX \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const broadcastId = "1nGeLMWbkpaKX"; const response = await fetch(`https://xquik.com/api/v1/x/broadcasts/${broadcastId}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); if (!response.ok) throw new Error(JSON.stringify(data)); const { broadcast } = data; const broadcastRow = { broadcast_id: broadcast.id, broadcast_title: broadcast.title ?? null, broadcast_state: broadcast.state ?? null, started_at: broadcast.startedAt ?? null, ended_at: broadcast.endedAt ?? null, total_watched: broadcast.totalWatched ?? null, broadcaster_username: broadcast.creator?.username ?? null, }; process.stdout.write(`${JSON.stringify(broadcastRow)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests broadcast_id = "1nGeLMWbkpaKX" response = requests.get( f"https://xquik.com/api/v1/x/broadcasts/{broadcast_id}", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() if not response.ok: raise RuntimeError(data) broadcast = data["broadcast"] broadcast_row = { "broadcast_id": broadcast["id"], "broadcast_title": broadcast.get("title"), "broadcast_state": broadcast.get("state"), "started_at": broadcast.get("startedAt"), "ended_at": broadcast.get("endedAt"), "total_watched": broadcast.get("totalWatched"), "broadcaster_username": (broadcast.get("creator") or {}).get("username"), } print(json.dumps(broadcast_row)) ``` The Node.js and Python snippets build 1 row per broadcast. Each call costs 1 credit. A refused request costs nothing. ## Read a broadcast's state, times, and audience Use `GET /x/broadcasts/{id}` when you hold a broadcast ID or a broadcast URL. A broadcast is an X live video. For an audio Space, use [Get Space](/api-reference/x/get-space). * `state` tells a broadcast that has not started from a running or ended one. * `scheduledStart`, `startedAt`, and `endedAt` give its times. * `totalWatched` counts the accounts that watched, live or after. `totalWatching` is the audience X counts now. * `isAvailableForReplay` says whether X offers a recording. * `width` and `height` give the video size in pixels. * `tweet` is the post that announces the broadcast, with its text, counts, and author. `tweetId` is its ID. * `creator` is the broadcaster's full profile. `periscopeUser` names the same account as X's live video service does. Reading a broadcast adds no view to it. A field X leaves empty is left out. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | X (Twitter) broadcast ID, or the URL-encoded broadcast URL, such as `x.com/i/broadcasts/1nGeLMWbkpaKX`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `broadcast` | `object` | The broadcast. | | `broadcast.id` | `string` | Broadcast ID. | | `broadcast.title` | `string` | Broadcast title. | | `broadcast.isTitleEdited` | `boolean` | Whether the broadcaster edited the title of the replay. | | `broadcast.state` | `string` | State as X names it, such as `NotStarted`, `Running`, or `Ended`. | | `broadcast.scheduledStart` | `string` | When the broadcast was set to start, in UTC. | | `broadcast.startedAt` | `string` | When the broadcast went live, in UTC. | | `broadcast.endedAt` | `string` | When the broadcast ended, in UTC. | | `broadcast.lastPingAt` | `string` | When the video stream last reached X, in UTC. | | `broadcast.totalWatched` | `number` | Accounts that watched, live or after. | | `broadcast.totalWatching` | `number` | Accounts watching, as X counts them. | | `broadcast.isAvailableForReplay` | `boolean` | Whether X offers a recording of the broadcast. | | `broadcast.width` | `number` | Video width in pixels. | | `broadcast.height` | `number` | Video height in pixels. | | `broadcast.cameraRotation` | `number` | Camera rotation in degrees, 0 to 359. | | `broadcast.isHighLatency` | `boolean` | Whether the video stream runs in high-latency mode. | | `broadcast.chatOption` | `number` | X's code for who may chat. | | `broadcast.isPrivateChat` | `boolean` | Whether X marks the chat private. | | `broadcast.source` | `string` | What produced the video stream, as X names it, such as `LiveCms`. | | `broadcast.mediaKey` | `string` | X's media key for the video. | | `broadcast.preLiveSlateUrl` | `string` | Image X shows before the broadcast starts. | | `broadcast.version` | `number` | X's revision number of the broadcast. | | `broadcast.tweetId` | `string` | ID of the post that announces the broadcast. | | `broadcast.tweet` | `object` | The post that announces the broadcast, with the fields of [Get Tweet](/api-reference/x/get-tweet). Present only when X names the post. | | `broadcast.periscopeUser` | `object` | The broadcaster as X's live video service names the account. It has `id`, `username`, `displayName`, `profilePicture`, and `profilePictureOriginal`. | | `broadcast.creator` | `object` | Profile of the broadcaster. It uses the fields of [Get User](/api-reference/x/twitter-profile-lookup). | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "broadcast": { "id": "1nGeLMWbkpaKX", "title": "USSF-259 Mission", "state": "Ended", "startedAt": "2026-09-17T00:54:56.506Z", "endedAt": "2026-09-17T01:17:35.036Z", "totalWatched": 161758, "totalWatching": 21639, "width": 3840, "height": 2160, "creator": { "id": "34743251", "username": "SpaceX", "name": "SpaceX" } } } ``` ### 400 Invalid broadcast ID The path is not a broadcast ID or a broadcast URL. The request costs nothing. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls receive a direct MPP `WWW-Authenticate: Payment` challenge plus a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 404 Broadcast not found X knows no such broadcast. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Twitter broadcast API questions ### How do I get a Twitter broadcast by its link? URL-encode the broadcast link and pass it as `id`. You can also pass the ID from the link. `x.com/i/broadcasts/1nGeLMWbkpaKX` holds the ID `1nGeLMWbkpaKX`. ### How many people watched a broadcast? Read `totalWatched` for everyone who watched, live or after. `totalWatching` is the audience X counts now. ### Does reading a broadcast count as a view? No. Reading a broadcast adds no view, so its counts stay as X shows them. ### What is the difference between a broadcast and a Space? A broadcast is a live video. A Space is a live audio room. Read a Space with [Get Space](/api-reference/x/get-space). ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Get User](/api-reference/x/twitter-profile-lookup) for the broadcaster's latest profile, or [Get Space](/api-reference/x/get-space) for an audio Space. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_broadcast_id", "message": "Send a broadcast ID or URL, such as x.com/i/broadcasts/1nGeLMWbkpaKX." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "broadcast_not_found", "message": "Broadcast not found. Check the broadcast ID or x.com/i/broadcasts URL." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Get a job listing & salary, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/get-job Retrieve 1 public X job listing by ID or URL. Get its full description as text and Markdown, salary, seniority, work type, and apply link. 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/jobs/{id}` Read 1 public job listing on X with its full description. Pass a job ID or a job URL. **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/jobs/1899202395210649861 \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const jobId = "1899202395210649861"; const response = await fetch(`https://xquik.com/api/v1/x/jobs/${jobId}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const { job } = await response.json(); const jobRecord = { job_id: job.id, title: job.title ?? null, job_url: job.url, apply_url: job.applyUrl ?? null, location: job.location ?? null, location_type: job.locationType ?? null, employment_type: job.employmentType ?? null, seniority_level: job.seniorityLevel ?? null, salary: job.formattedSalary ?? null, employer: job.company?.name ?? job.account?.name ?? null, description: job.description ?? null, }; process.stdout.write(JSON.stringify(jobRecord, null, 2)); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests job_id = "1899202395210649861" response = requests.get( f"https://xquik.com/api/v1/x/jobs/{job_id}", headers={"x-api-key": "xq_your_api_key_here"}, ) job = response.json()["job"] job_record = { "job_id": job["id"], "title": job.get("title"), "job_url": job["url"], "apply_url": job.get("applyUrl"), "location": job.get("location"), "location_type": job.get("locationType"), "employment_type": job.get("employmentType"), "seniority_level": job.get("seniorityLevel"), "salary": job.get("formattedSalary"), "employer": (job.get("company") or job.get("account") or {}).get("name"), "description": job.get("description"), } print(json.dumps(job_record, indent=2)) ``` ## Find a job ID Use [job search](/api-reference/x/search-jobs) to find listings by keyword. Each result carries its `id` and its `url` on X. The path also takes a job URL such as `x.com/i/jobs/1899202395210649861`. URL-encode it first. Anything else returns `400 invalid_job_id`. ## Read the description The listing returns its description in 2 forms. `description` is plain text with 1 line per paragraph. `descriptionMarkdown` keeps headings, lists, links, bold, and italics. It holds no HTML. It escapes characters that would read as Markdown, such as `[` and `*`. It also escapes a `-` that starts a line. Use the Markdown form to show the listing. Use the plain text for search indexes and classifiers. ## Handle a closed job X removes a listing when the employer closes it. The lookup then returns `404 job_not_found` and costs nothing. Drop the job from your store, or mark it closed. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Job ID, or URL-encoded job URL such as `x.com/i/jobs/1899202395210649861`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK X leaves out a field that a job lacks. Only `id` and `url` are always present. | Field | Type | Description | | - | - | - | | `job` | `object` | The job listing. | | `job.id` | `string` | Job ID. | | `job.title` | `string` | Job title. | | `job.url` | `string` | The job page on X. | | `job.applyUrl` | `string` | Where applicants apply, off X. | | `job.location` | `string` | Location as the employer wrote it. | | `job.locationType` | `string` | The work happens `onsite`, `remote`, or `hybrid`. | | `job.employmentType` | `string` | The contract type is `full_time`, `full_time_contract`, `part_time`, or `contract_to_hire`. | | `job.seniorityLevel` | `string` | Seniority, from `intern` to `executive`. | | `job.jobFunction` | `string` | Job function, such as `software_engineering`. | | `job.team` | `string` | Team inside the company. | | `job.postedAt` | `string` | When the employer posted the job, in ISO 8601. | | `job.formattedSalary` | `string` | Salary as X shows it, such as `Starting at $225K`. | | `job.salaryMin` | `number` | Lowest salary, in `salaryCurrencyCode` per `salaryInterval`. | | `job.salaryMax` | `number` | Highest salary, in `salaryCurrencyCode` per `salaryInterval`. | | `job.salaryCurrencyCode` | `string` | ISO 4217 currency code of the salary. | | `job.salaryInterval` | `string` | The salary's pay period is `annually` or `hourly`. | | `job.featured` | `boolean` | Whether X features the job. | | `job.shortDescription` | `string` | Short summary of the job, as plain text. | | `job.description` | `string` | Full description as plain text, 1 line per paragraph. | | `job.descriptionMarkdown` | `string` | Full description as Markdown, with headings, lists, links, bold, and italics. | | `job.company` | `object` | Company profile with `id`, `name`, and `logoUrl`. Present on jobs X imported from a job board. | | `job.account` | `object` | The X account that posted the job. It has `id`, `username`, `name`, `verified`, `verifiedType`, `description`, `profilePicture`, `profilePictureOriginal`, and `profileImageShape`. A job has none when X imported it from a job board. It also has none when X no longer shows the account. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "job": { "id": "1899202395210649861", "title": "Engineer", "url": "https://x.com/i/jobs/1899202395210649861", "applyUrl": "https://xquik.com/example", "location": "United States", "locationType": "remote", "employmentType": "full_time", "seniorityLevel": "lead", "jobFunction": "software_engineering", "formattedSalary": "Starting at $225K", "salaryMin": 225000, "salaryCurrencyCode": "USD", "salaryInterval": "annually", "featured": true, "shortDescription": "Commonware is hiring founding engineers.", "description": "What is Commonware? We build open primitives.", "descriptionMarkdown": "# What is Commonware?", "account": { "id": "1812126202804711425", "username": "commonwarexyz", "name": "commonware", "verified": true, "verifiedType": "Business" } } } ``` ### 400 Invalid job ID Send a job ID or a job URL, such as `x.com/i/jobs/123`. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 404 Job not found The job closed or the ID is wrong. This answer is free. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy X failed the job lookup, or Xquik is busy. Wait for `Retry-After`, then retry. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Next steps.** [Search job listings](/api-reference/x/search-jobs) to find more jobs. When the job has an `account`, [get the hiring account's profile](/api-reference/x/twitter-profile-lookup) with the `account.username`. ## Response examples * **400** `{ "error": "invalid_job_id", "message": "Send a job ID or job URL, such as x.com/i/jobs/123." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "job_not_found", "message": "Job not found. Check the job ID or x.com/i/jobs URL." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Get a space's details, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/get-space Get a Twitter or X Space by ID or URL. See title, state, start and end times, listener counts, replay state, hosts, speakers, and listeners. 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/spaces/{id}` **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call Get Space returns one public X Space as X shows it. It can be live, scheduled, or ended. The endpoint is `GET /api/v1/x/spaces/{id}`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/spaces/1OGwblLjnQMKB \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const spaceId = "1OGwblLjnQMKB"; const response = await fetch(`https://xquik.com/api/v1/x/spaces/${spaceId}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); if (!response.ok) throw new Error(JSON.stringify(data)); const { space } = data; const spaceRow = { space_id: space.id, space_title: space.title ?? null, space_state: space.state ?? null, started_at: space.startedAt ?? null, ended_at: space.endedAt ?? null, live_listeners: space.totalLiveListeners ?? null, replay_listeners: space.totalReplayWatched ?? null, host_usernames: space.admins.map((host) => host.username), speaker_usernames: space.speakers.map((speaker) => speaker.username), }; process.stdout.write(`${JSON.stringify(spaceRow)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests space_id = "1OGwblLjnQMKB" response = requests.get( f"https://xquik.com/api/v1/x/spaces/{space_id}", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() if not response.ok: raise RuntimeError(data) space = data["space"] space_row = { "space_id": space["id"], "space_title": space.get("title"), "space_state": space.get("state"), "started_at": space.get("startedAt"), "ended_at": space.get("endedAt"), "live_listeners": space.get("totalLiveListeners"), "replay_listeners": space.get("totalReplayWatched"), "host_usernames": [host["username"] for host in space["admins"]], "speaker_usernames": [speaker["username"] for speaker in space["speakers"]], } print(json.dumps(space_row)) ``` The Node.js and Python snippets build 1 row per Space. Each call costs 1 credit. A refused request costs nothing. ## Read a Space's state, audience, and stage Use `GET /x/spaces/{id}` when you hold a Space ID or a Space URL. Find Space IDs with [Search Spaces](/api-reference/x/search-spaces). * `state` tells a scheduled Space from a live or ended one. * `isAvailableForReplay` says whether X offers a recording. Get it with [Get Space replay](/api-reference/x/space-replay) once the Space is over. * `totalLiveListeners` counts the accounts that listened live. `totalReplayWatched` counts the accounts that played the recording. * `participantCount` is the audience now, while the Space is live. * `admins`, `speakers`, and `listeners` name the accounts. X (Twitter) lists them on the stage and in the audience. * `sharings` lists the posts the hosts and speakers shared in the Space. It says who shared each and when. * `tweet` is the post that announces the Space, with its text, counts, and author. X names a Space's hosts, speakers, and listeners without follower counts. So their rows carry none. Pass a `username` to [Get User](/api-reference/x/twitter-profile-lookup) for the full profile. A field X leaves empty is left out. A Space X (Twitter) limits to subscribers or a community answers 404. A Space is a live audio room. For a live video at `x.com/i/broadcasts`, use [Get broadcast](/api-reference/x/get-broadcast). ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | X Space ID, or the URL-encoded Space URL, such as `x.com/i/spaces/1OGwblLjnQMKB`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `space` | `object` | The Space. | | `space.id` | `string` | Space ID. | | `space.title` | `string` | Space title. | | `space.state` | `string` | `NotStarted` (scheduled), `Running` (live) or `Ended`. Also `Canceled` (scheduled, never started) or `TimedOut` (closed by X, not by its host). | | `space.createdAt` | `string` | When the Space was made. | | `space.scheduledStart` | `string` | When the Space was set to start. | | `space.startedAt` | `string` | When the Space went live. | | `space.endedAt` | `string` | When the Space ended. | | `space.updatedAt` | `string` | When X last changed the Space. | | `space.totalLiveListeners` | `number` | Accounts that listened live. | | `space.totalReplayWatched` | `number` | Accounts that played the recording. | | `space.participantCount` | `number` | Accounts in the Space now, while it is live. | | `space.isAvailableForReplay` | `boolean` | Whether X offers a recording. | | `space.isAvailableForClipping` | `boolean` | Whether listeners may clip the Space. | | `space.isLocked` | `boolean` | Whether the host locked the Space. | | `space.isEmployeeOnly` | `boolean` | Whether only X employees may join. | | `space.disallowJoin` | `boolean` | Whether X lets no more accounts join. | | `space.noIncognito` | `boolean` | Whether anonymous listening is off. | | `space.contentType` | `string` | Audio or video kind, as X names it. | | `space.conversationControls` | `number` | X's code for who may speak. | | `space.maxAdminCapacity` | `number` | Most hosts and co-hosts the Space allows. | | `space.mediaKey` | `string` | X's media key for the Space's audio. | | `space.mentionedUserIds` | `string[]` | IDs of the accounts the host tagged. | | `space.tweetId` | `string` | ID of the post that announces the Space. | | `space.tweet` | `object` | The post that announces the Space, with the fields of [Get Tweet](/api-reference/x/get-tweet). Present only when X names the post. | | `space.creator` | `object` | Profile of the account that made the Space. It uses the fields of [Get User](/api-reference/x/twitter-profile-lookup). | | `space.admins` | `object[]` | Hosts and co-hosts. Each has `id`, `username` and `name`. Each also has `profilePicture`, `profilePictureOriginal`, badge fields and `joinedAt` when X sends them. | | `space.speakers` | `object[]` | Accounts X (Twitter) lists as speakers, with the same fields as `admins`. | | `space.listeners` | `object[]` | Accounts X (Twitter) lists as listeners, with the same fields as `admins`. | | `space.sharings` | `object[]` | Posts the hosts and speakers shared in the Space, in X's order. Present only when X (Twitter) lists them. Each has `id`, X's ID of the sharing, plus `sharedAt` and `updatedAt`. `sharedBy` is the profile that shared it, with the fields of [Get User](/api-reference/x/twitter-profile-lookup). `tweet` is the post, with the fields of [Get Tweet](/api-reference/x/get-tweet). X leaves out `tweet` when it no longer shows the post. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "space": { "id": "1OGwblLjnQMKB", "title": "Extending the Network to the Edge", "state": "Ended", "startedAt": "2026-03-11T17:00:26.227Z", "endedAt": "2026-03-11T17:49:29.190Z", "totalLiveListeners": 841, "totalReplayWatched": 609, "creator": { "id": "951329744804392960", "username": "solana", "name": "Solana" }, "admins": [ { "id": "951329744804392960", "username": "solana", "name": "Solana" } ], "speakers": [], "listeners": [] } } ``` ### 400 Invalid Space ID `{ "error": "invalid_space_id", "message": "Send a Space ID or URL, such as x.com/i/spaces/1OGwblLjnQMKB." }` The path is not a Space ID or a Space URL. The request costs nothing. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls receive a direct MPP `WWW-Authenticate: Payment` challenge plus a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 404 Space not found X (Twitter) has no such Space, or limits it to subscribers or a community. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy X failed to return the Space, or Xquik is busy. Retry after a short delay. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Twitter Spaces API questions ### How do I get an X (Twitter) Space by its link? URL-encode the Space link and pass it as `id`. You can also pass the Space ID from the link. `x.com/i/spaces/1OGwblLjnQMKB` holds the ID `1OGwblLjnQMKB`. ### How many people listened to a Space? Read `totalLiveListeners` for the live audience and `totalReplayWatched` for the recording. While a Space is live, `participantCount` is the audience now. ### Who hosted or spoke in a Space? `admins` holds the hosts and co-hosts. `speakers` holds the accounts X (Twitter) lists as speakers. ### Which posts were shared in a Space? Read `sharings`. Each sharing has the post as `tweet` and the time as `sharedAt`. It also has the account that shared the post as `sharedBy`. ### Why does a Space return 404? X no longer has the Space, or limits it to subscribers or a community. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Get Space replay](/api-reference/x/space-replay) for an ended Space's recording. [Search Spaces](/api-reference/x/search-spaces) to find more Spaces. [Get User](/api-reference/x/twitter-profile-lookup) for a host's full profile. [Get broadcast](/api-reference/x/get-broadcast) for a live video. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Tweet lookup with engagement, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/get-tweet Retrieve one tweet by numeric ID with full text, author profile, media, reply and quote context, likes, reposts, views, and URLs. Costs 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}` > [!NOTE] > > Repost records include `retweetedAt`, the repost event's UTC ISO 8601 timestamp. It is `null` when > that timestamp is unavailable. The API omits it for original posts. The nested original post keeps > its own creation date. This field does not report every account that reposted a post. [Request > per-account timestamps with Get retweeters.](/api-reference/x/retweeters#retweet-timestamps) **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call Get tweet returns one tweet by numeric ID. The endpoint is `GET /api/v1/x/tweets/{id}`. See [Read Data Richness](/guides/tweet-profile-api-fields) for every optional tweet, author, and media field. ```bash Tweet ID theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/tweets/1893456789012345678 \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1893456789012345678"; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const tweet = data.tweet; const author = data.author ?? {}; const media = tweet.media ?? []; const quotedTweet = tweet.quoted_tweet; const handoff = { tweet_id: tweet.id, text: tweet.text, author_id: author.id ?? null, author_username: author.username ?? null, author_followers: author.followers ?? null, author_verified: author.verified ?? null, author_profile_picture: author.profilePicture ?? null, created_at: tweet.createdAt ?? null, conversation_id: tweet.conversationId ?? null, is_reply: tweet.isReply === true, is_quote_status: tweet.isQuoteStatus === true, is_note_tweet: tweet.isNoteTweet === true, tweet_source: tweet.source ?? null, quote_tweet_id: quotedTweet?.id ?? null, metrics: { retweets: tweet.retweetCount ?? 0, replies: tweet.replyCount ?? 0, likes: tweet.likeCount ?? 0, quotes: tweet.quoteCount ?? 0, views: tweet.viewCount ?? 0, bookmarks: tweet.bookmarkCount ?? 0, }, media_urls: media.map((item) => item.mediaUrl), }; process.stdout.write(`${JSON.stringify(handoff)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1893456789012345678" response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() tweet = data["tweet"] author = data.get("author") or {} media = tweet.get("media", []) quoted_tweet = tweet.get("quoted_tweet") or {} handoff = { "tweet_id": tweet["id"], "text": tweet["text"], "author_id": author.get("id"), "author_username": author.get("username"), "author_followers": author.get("followers"), "author_verified": author.get("verified"), "author_profile_picture": author.get("profilePicture"), "created_at": tweet.get("createdAt"), "conversation_id": tweet.get("conversationId"), "is_reply": tweet.get("isReply") is True, "is_quote_status": tweet.get("isQuoteStatus") is True, "is_note_tweet": tweet.get("isNoteTweet") is True, "tweet_source": tweet.get("source"), "quote_tweet_id": quoted_tweet.get("id"), "metrics": { "retweets": tweet.get("retweetCount", 0), "replies": tweet.get("replyCount", 0), "likes": tweet.get("likeCount", 0), "quotes": tweet.get("quoteCount", 0), "views": tweet.get("viewCount", 0), "bookmarks": tweet.get("bookmarkCount", 0), }, "media_urls": [item["mediaUrl"] for item in media], } print(json.dumps(handoff)) ``` The examples build tweet lookup rows, not raw response dumps. Use `GET /api/v1/x/tweets/{id}` when a workflow needs one tweet plus author context. Store `tweet_id`, `text`, `author_id`, `author_username`, `author_followers`, `author_verified`, `author_profile_picture`, `created_at`, `conversation_id`, and `is_reply`. Also store `is_quote_status`, `is_note_tweet`, `tweet_source`, `quote_tweet_id`, `metrics`, and `media_urls`. Keep these fields with the record you pass on. ## Direct tweet handoff Pass a post ID or a URL-encoded post URL in the path. Other input, such as a username, returns `400 invalid_tweet_id`. Use the response when you need 1 record. It has normalized tweet text, optional author data, engagement counts, and quote metadata. It also has conversation context, Note Tweet text, source, and media URLs. ## Store a tweet lookup record Use the numeric Tweet ID as the stable key. Keep text, author, thread, quote, engagement, media, and disclosure fields as separate columns. You cannot search one merged value. | Tweet record column | Response source | Handoff rule | | - | - | - | | `tweet_id` | `tweet.id` | Use as the stable tweet upsert key. | | `tweet_url` | `tweet.url` | Keep the original X permalink when returned. | | `text` | `tweet.text` | Store the complete returned tweet or Note Tweet text. | | `created_at` | `tweet.createdAt` | Keep the tweet publication time. | | `author_id` | `author.id` | Keep a stable author identity when usernames change. | | `author_username` | `author.username` | Display the current author handle. | | `conversation_id` | `tweet.conversationId` | Join the tweet to its conversation thread. | | `in_reply_to_id` | `tweet.inReplyToId` | Join replies to their immediate parent tweet. | | `quote_tweet_id` | `tweet.quoted_tweet.id` | Keep quoted-tweet attribution when present. | | `is_note_tweet` | `tweet.isNoteTweet` | Distinguish long-form Note Tweet text. | | `like_count` | `tweet.likeCount` | Store the observed engagement count with lookup time. | | `reply_count` | `tweet.replyCount` | Send active conversation threads to review. | | `media_urls` | `tweet.media[].mediaUrl` | Keep image, video, or animated GIF URLs. | | `content_disclosure` | `tweet.contentDisclosure` | Keep paid-promotion or AI-media labels when returned. | Direct tweet reads cost 1 credit per successful call. For MPP callers, this endpoint bills a fixed charge of USD 0.00015 per call. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Which tweet endpoint? > [card] One tweet by ID > > Use `GET /x/tweets/{id}` for one tweet. It returns text, author, media, > quote or reply flags, metrics, and Note Tweet text. > [card] Many tweet IDs > > Use [`Get tweets (batch)`](/api-reference/x/batch-tweets) when you already > have multiple numeric IDs. > [card] Keyword or advanced search > > Use [`Search tweets`](/api-reference/x/search-tweets) when you need keyword, > operator, author, date, media, engagement, or verification filters. Also use > it when you need pasted Tweet URL exact lookup. > [card] Thread context > > Use [`Get tweet thread`](/api-reference/x/tweet-thread) when the next action > needs surrounding conversation rows. > [card] Engagement lists > > You may need users or tweets connected to this tweet. If so, use > replies, quote tweets, retweeters, or favoriters pages. > [card] Saved exports > > Use [`Create extraction`](/api-reference/extractions/create) for CSV, JSON, > or XLSX output. Use it with `reply_extractor`, `quote_extractor`, > `repost_extractor`, `thread_extractor`, or `tweet_search_extractor`. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweet` | `object` | The tweet data. | | `tweet.id` | `string` | Tweet ID. | | `tweet.text` | `string` | Tweet text content. For Note Tweets (long-form posts), returns the complete text up to 25,000 characters. | | `tweet.createdAt` | `string` | ISO 8601 creation timestamp. | | `tweet.isNoteTweet` | `boolean` | Whether this is a Note Tweet (long-form post, up to 25,000 characters). Omitted when false. | | `tweet.isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweet.isReply` | `boolean` | Whether this tweet is a reply to another tweet. Omitted when false. | | `tweet.isLimitedReply` | `boolean` | Whether X (Twitter) limits who can reply. Omitted if unavailable. | | `tweet.isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted when false. | | `tweet.isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweet.conversationId` | `string` | ID of the root tweet in the conversation thread. | | `tweet.conversationControl` | `object` | Who can reply. It holds `policy`, `mode`, `allowedCountryCodes`, `inviteViaMention` & `ownerUsername`. Omitted if unavailable. | | `tweet.limitedActions` | `object[]` | Public interaction restrictions. Omitted if unavailable. | | `tweet.unmentionedUserIds` | `string[]` | Users that left this conversation. Omitted if unavailable. | | `tweet.inReplyToId` | `string` | Tweet ID this post replies to. Omitted when not a reply. | | `tweet.inReplyToUserId` | `string` | User ID this post replies to. Omitted when unavailable. | | `tweet.inReplyToUsername` | `string` | Username this post replies to. Omitted when unavailable. | | `tweet.source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweet.type` | `string` | Tweet type. Omitted if unavailable. | | `tweet.url` | `string` | Tweet permalink. Omitted if unavailable. | | `tweet.lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweet.displayTextRange` | `number[]` | Start and end offsets for rendered text. Omitted if unavailable. | | `tweet.entities` | `object` | Parsed entities from the tweet text (URLs, mentions, hashtags, media). | | `tweet.noteTweet` | `object` | Complete Note Tweet content and formatting. `inlineMedia` items contain the text `index` and `mediaId`. Omitted outside Note Tweets. | | `tweet.authorUnavailable` | `object` | Why the tweet has no author. X serves a suspended or deleted account as an unavailable user. It contains `reason`, such as `Suspended` or `NotFound`, and `message` when X sends one. Omitted when the author is available. | | `tweet.unavailableAuthorId` | `string` | The author's ID when X withholds the author's profile. Omitted otherwise. | | `tweet.exclusiveContent` | `object` | Creator whose subscription unlocks a subscriber-only post. Contains `creatorUserName` and, on the preview non-subscribers get, `subscribeUrl`. Omitted on public posts. | | `tweet.contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweet.communityId` | `string` | Community ID. Omitted outside communities. | | `tweet.communityName` | `string` | Community name. Present when X sends it with the post, else omitted. | | `tweet.quotedTweetId` | `string` | Quoted tweet ID. Omitted when unavailable. | | `tweet.quotedTweetPermalink` | `object` | The quoted post's link, kept when X withholds that post. Contains `url`, `expandedUrl`, and `displayUrl`. Omitted if unavailable. | | `tweet.quoted_tweet` | `object` | The quoted tweet object. Present when `isQuoteStatus` is true. | | `tweet.retweeted_tweet` | `object` | The original tweet when this post is a repost. Omitted otherwise. | | `tweet.tombstone` | `object` | Unavailable tweet metadata. Omitted for available tweets. | | `tweet.hasCommunityNotes` | `boolean` | Whether X holds Community Notes on the post, shown or not. Omitted if unavailable. | | `tweet.grokTranslatedPost` | `object` | Grok's translation of the post, as X shows it. X defines its fields. Omitted if unavailable. | | `tweet.retweetCount` | `number` | Retweet count. | | `tweet.replyCount` | `number` | Reply count. | | `tweet.likeCount` | `number` | Like count. | | `tweet.quoteCount` | `number` | Quote tweet count. | | `tweet.viewCount` | `number` | View count. | | `tweet.bookmarkCount` | `number` | Bookmark count. | | `tweet.media` | `object[]` | Attached media items. Omitted when the tweet has no attached media. | | `tweet.media[].mediaUrl` | `string` | Direct media URL (pbs.twimg.com). | | `tweet.media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweet.media[].type` | `string` | The media type is `photo`, `video`, or `animated_gif`. | | `tweet.media[].url` | `string` | Shortened t.co URL from the tweet text. | | `tweet.media[].sourceUser` | `object` | Public profile that first posted copied media. Omitted if unavailable. | | `author` | `object` | The tweet author. Omitted if author data is unavailable. | | `author.id` | `string` | Author user ID. | | `author.username` | `string` | Author handle without `@`. | | `author.name` | `string` | Author display name. | | `author.followers` | `integer` | Follower count. | | `author.verified` | `boolean` | Whether X marks the author as verified. | | `author.profilePicture` | `string` | Author profile image URL. | | `author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweet": { "id": "1893456789012345678", "text": "Introducing our new extraction API. Ship faster.", "createdAt": "2026-02-24T14:30:00.000Z", "isNoteTweet": false, "isReply": false, "isQuoteStatus": true, "conversationId": "1893456789012345678", "source": "Twitter Web App", "contentDisclosure": { "advertising": { "isPaidPromotion": true }, "aiGenerated": { "detectionSource": "GrokSignature", "hasAiGeneratedMedia": true } }, "entities": { "urls": [ { "display_url": "xquik.com/blog/extracti...", "expanded_url": "https://xquik.com/blog/extraction-api", "url": "https://t.co/abc123" } ], "hashtags": [], "user_mentions": [] }, "quoted_tweet": { "id": "1893000000000000000", "text": "What API tools are you shipping this week?", "author": { "id": "111222333", "username": "devtools" } }, "retweetCount": 320, "replyCount": 85, "likeCount": 1400, "quoteCount": 45, "viewCount": 250000, "bookmarkCount": 210, "media": [ { "mediaUrl": "https://pbs.twimg.com/media/example.jpg", "type": "photo", "url": "https://t.co/abc123" } ] }, "author": { "id": "987654321", "username": "username", "followers": 10000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/xquik/photo.jpg" } } ``` ### 400 Invalid tweet ID `{ "error": "invalid_tweet_id" }` The provided tweet ID is empty or not a valid format. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls receive a direct MPP `WWW-Authenticate: Payment` challenge plus a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 404 Tweet not found `{ "error": "tweet_not_found", "reason": "author_suspended", "message": "X suspended this post's author." }` X shows no post with this ID. `reason` says why when X names it. * `deleted` means the author deleted the post. * `author_deactivated` means the post's author deactivated their X account. * `author_suspended` means X (Twitter) suspended the post's author. * `protected` means the author limits who can see the post. Another account may still see it. * `unavailable` means X shows the post as unavailable without saying why. Without `reason`, X named no cause. Check the tweet ID. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Next steps.** [Search Tweets](/api-reference/x/search-tweets) to find tweets by query. [Get User](/api-reference/x/twitter-profile-lookup) to look up the author profile. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # List hashflags & hashtag emoji, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/hashflags List X (Twitter) hashflags, the custom emoji X shows after hashtags. Get each hashtag, image URL, start and end time, and animations. 1 credit per hashflag. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/hashflags` **1 credit per hashflag returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/hashflags \ --data-urlencode "q=football" \ --data-urlencode "limit=20" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ q: "football", limit: "20" }); const response = await fetch(`https://xquik.com/api/v1/x/hashflags?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const hashflagRows = data.hashflags.map((hashflag) => ({ hashtag: hashflag.hashtag, image_url: hashflag.assetUrl, starts_at: hashflag.startsAt, ends_at: hashflag.endsAt, animation_count: hashflag.animations.length, })); for (const row of hashflagRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/x/hashflags", params={"q": "football", "limit": 20}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() hashflag_rows = [ { "hashtag": hashflag["hashtag"], "image_url": hashflag["assetUrl"], "starts_at": hashflag["startsAt"], "ends_at": hashflag["endsAt"], "animation_count": len(hashflag["animations"]), } for hashflag in data["hashflags"] ] for row in hashflag_rows: print(json.dumps(row)) ``` Use `GET /x/hashflags` to list X's hashflags. A hashflag is the custom emoji X shows after a hashtag. It appears for a set time. Each returned hashflag costs 1 credit. Filters and `limit` lower the cost. An empty result costs nothing. ## Track branded hashtags The endpoint lists the hashflags that run now. Send `activeOnly=false` to add ended and upcoming ones. Use `q` to keep hashtags that contain your text. `startsAt` and `endsAt` give the time X shows each emoji. `assetUrl` is the emoji image. `animations` lists the animations X plays, such as on a like. X (Twitter) lists a few hundred hashflags. Send `limit` when you need only some. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | No | Text the hashtag contains, such as `football`. Case insensitive. A leading `#` is ignored. Also read as `query`. | | `activeOnly` | `boolean` | No | Keeps hashflags that run now. Send `false` to add ended and upcoming ones. Default `true`. | | `limit` | `integer` | No | Maximum hashflags to return, starting at `1`. Omit it for every match. Your credit balance can return fewer. Also read as `pageSize`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send a full Xquik account API key. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `hashflags` | `object[]` | Hashflags that match your filters, in X's order. | | `hashflags[].hashtag` | `string` | Hashtag text without `#`. X also lists some plain phrases. | | `hashflags[].assetUrl` | `string` | Image of the emoji. | | `hashflags[].startsAt` | `string` | When X starts showing the emoji, in UTC. | | `hashflags[].endsAt` | `string` | When X stops showing the emoji, in UTC. | | `hashflags[].isHashfettiEnabled` | `boolean` | Whether X marks the hashflag for its hashfetti effect. | | `hashflags[].animations` | `object[]` | Animations X plays for the hashtag. Often empty. Each has `context`, such as `Like`, `assetUrl`, and `priority`. | | `count` | `number` | Hashflags returned and charged. | | `total` | `number` | Hashflags that match the filters, before `limit`. | | `message` | `string` | What to send instead. Present only when no hashflag matches. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "hashflags": [ { "hashtag": "College Football", "assetUrl": "https://abs.twimg.com/hashflags/2026FootballCustomLikeEvergreenv3/2026FootballCustomLikeEvergreenv3.png", "startsAt": "2026-10-02T00:00:00.000Z", "endsAt": "2027-01-10T00:00:00.000Z", "isHashfettiEnabled": false, "animations": [ { "context": "Like", "assetUrl": "https://abs.twimg.com/hashflags/2026FootballCustomLikeEvergreenv3/2026FootballCustomLikeEvergreenv3_sakura_0.json", "priority": 1 } ] } ], "count": 1, "total": 1 } ``` A filter that matches no hashflag returns an empty list and a `message`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "hashflags": [], "count": 0, "total": 0, "message": "No hashflag runs now. Send activeOnly=false to list the rest." } ``` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded The Xquik tier limit blocked the request. Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Twitter hashflags API questions ### What is a Twitter hashflag? A hashflag is a custom emoji X shows after a hashtag. It appears for a set time. Brands and events use them. Some people call them hashmoji. ### How do I list the hashflags that run now? Call `GET /x/hashflags` without parameters. The response lists every hashflag X shows at that moment. ### How do I find the emoji of 1 hashtag? Send `q` with the hashtag text, with or without `#`. Read `assetUrl` from the matching hashflag. ### How much does a hashflags request cost? Each returned hashflag costs 1 credit. An empty result costs nothing. Add `q` or `limit` to return fewer hashflags. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Search tweets](/api-reference/x/search-tweets) finds the posts that use a hashtag. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "unknown_field", "message": "Unknown field asetUrl. Did you mean assetUrl?" }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Job locations & location IDs, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/job-locations Find the places X job search knows by name, such as New York, US. Each place returns the location ID that job search takes. 1 credit per place returned. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/jobs/locations` Find the places X job search knows by name. Pass a place name or its start, such as `new york`. Each match returns its name and the location ID that [job search](/api-reference/x/search-jobs) takes. **1 credit per place returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/jobs/locations?q=new%20york&limit=5" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ q: "new york", limit: "5" }); const response = await fetch(`https://xquik.com/api/v1/x/jobs/locations?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const { locations } = await response.json(); const firstLocationId = locations[0]?.id ?? null; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/jobs/locations", params={"q": "new york", "limit": 5}, headers={"x-api-key": "xq_your_api_key_here"}, ) locations = response.json()["locations"] first_location_id = locations[0]["id"] if locations else None ``` ## Search jobs in an exact place A free-text `location` works for most searches. A location ID pins 1 exact place instead. `New York City, NY` and `West New York, NJ` then stay apart. 1. Look up the place name here. 2. Pick the matching place from `locations`. 3. Send its `id` to [job search](/api-reference/x/search-jobs) as `locationId`. Store the ID with the place name. The same ID works in later searches. ## Control the cost Each returned place costs 1 credit. A broad name such as `york` can match many places. Send `limit` to keep only the best matches. No match returns an empty list and costs nothing. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Place name or its start, such as `new york`. Also read as `query`. | | `limit` | `integer` | No | Most places to return. Without it, every match returns. Also read as `pageSize`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `locations` | `object[]` | Matching places, best match first. | | `locations[].id` | `string` | Location ID, which the job search `locationId` takes. | | `locations[].name` | `string` | Place name with its region or country code. | | `count` | `number` | Places returned, each charged 1 credit. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "locations": [ { "id": "1720462281849397612", "name": "New York, US" }, { "id": "1720462281920696805", "name": "New York City, NY" } ], "count": 2 } ``` ### 400 Missing query Send a place name in `q`. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Next steps.** [Search job listings](/api-reference/x/search-jobs) with the location ID. [Get 1 job listing](/api-reference/x/get-job) for its full description. ## Response examples * **400** `{ "error": "missing_query", "message": "Search query required. Use q." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Get list details & counts, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/list-details Get one public X (Twitter) List as its page shows it, with name, description, member and follower counts, owner, banner and creation time. 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/lists/{id}` **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/lists/4143408 \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/lists/4143408", { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); const { list } = body; console.log( `${list.name} by @${list.owner?.username}: ${list.memberCount} members, ${list.subscriberCount} followers`, ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/lists/4143408", headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) lst = body["list"] print(f'{lst["name"]} by @{lst["owner"]["username"]}: {lst["memberCount"]} members') ``` ## One public List Use `GET /x/lists/{id}` for one public X List as its page on X shows it. You get its name, description, member and follower counts, owner, banner, and creation time. Name the List by its ID or its URL-encoded URL, such as `x.com/i/lists/4143408`. A private List returns 404 `list_not_found`, since only its members see it on X. For the List's people or posts, use [List members](/api-reference/x/list-members), [List followers](/api-reference/x/list-followers), or [List tweets](/api-reference/x/list-tweets). ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | List ID, such as `4143408`, or the URL-encoded List URL. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `list` | `object` | The List. | | `list.id` | `string` | List ID. | | `list.name` | `string` | List name. | | `list.description` | `string` | List description. Omitted if empty. | | `list.memberCount` | `number` | Number of accounts on the List. | | `list.subscriberCount` | `number` | Number of accounts that follow the List. | | `list.owner` | `object` | The owner's public profile, with `id`, `username`, and `name`. | | `list.url` | `string` | The List's page on X. | | `list.createdAt` | `string` | ISO 8601 creation time. | ### 404 List not found `{ "error": "list_not_found" }` The List is private, deleted, or never existed. ### 401 Unauthenticated Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [List members](/api-reference/x/list-members) · [List tweets](/api-reference/x/list-tweets) · [Search lists](/api-reference/x/search-lists) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "list": { "id": "4143408", "name": "NASA Centers", "description": "NASA has 10 centers", "memberCount": 11, "subscriberCount": 859 } } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Export a list's followers, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/list-followers Retrieve X (Twitter) List followers with usernames, bios, locations, images, and verification. It returns follower counts, following counts, and cursor pages. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/lists/{id}/followers` This API returns one List's follower IDs, usernames, bios, and locations. It also returns verification, public counts, profile images, and cursors. > [!NOTE] > > Omit `mode` to get the fullest results. The response shape stays the same. > Pass `next_cursor` back unchanged as `cursor`. Keep the same endpoint, target, > query, and filters. Existing unprefixed cursors keep their legacy behavior. `after`, `limit`, and `pageSize` aliases also keep working. Billing still counts only returned rows. Use `mode=standard` only to keep the legacy pagination. A page can be empty or underfilled. Continue while `has_next_page` is `true`. Stop only after the response reports `has_next_page=false`. First-page requests do not support `Idempotency-Key` retries. Repeating a cursorless request starts a separate extraction. Results returned by that extraction incur their normal charges. Save each response before requesting its next page. A cursor sent again within 10 minutes returns the same page at no charge. After 10 minutes, you cannot replay earlier or terminal responses. If automatic coverage is busy, an initial request returns a standard data page. Live coverage cursors remain atomic. A cursor sent again while its page loads returns that page at no charge. Other repeats return `409 coverage_cursor_unavailable` with exact `Retry-After` seconds. Wait, then send the same cursor again. Repeated busy responses never authorize restarting with another cursor. Expired, superseded, or identity-mismatched cursors return `410 coverage_cursor_gone`. So does a cursor sent again after 10 minutes. The response omits `Retry-After`. Restart without a cursor. Keep received results. Deduplicate restarted results by `id`. Malformed cursors return `400 invalid_coverage_cursor`. Restart without them. ## X (Twitter) list followers questions ### What is an X (Twitter) list follower? A List follower subscribes to one List. A List member is an account selected by the List owner. An account follower follows one profile instead. X says anyone can follow a public List. Only its owner can access a private List. Read X's official [Lists guide](https://help.x.com/en/using-x/x-lists) for current List visibility and follow behavior. ### How do I find who follows a specific X (Twitter) list? Copy the numeric List ID from its X (Twitter) URL. Request the first page without a cursor. Store every returned user row before requesting another page. Xquik returns `has_next_page` and `next_cursor`. Continue only when `has_next_page` is true. Pass `next_cursor` unchanged as the next `cursor`. X also documents a List follower route. Its official [Get List followers](https://docs.x.com/x-api/lists/get-list-followers) guide uses different pagination field names. ### How do I export X (Twitter) list followers? The direct endpoint returns JSON pages with named fields. Convert each profile into one row. Store the List ID, user ID, username, bio, counts, and request time. Use `list_follower_explorer` for a saved X (Twitter) List follower export. The job can produce CSV, JSON, or XLSX files without custom spreadsheet code. ### What can I check in each Twitter profile? Check user IDs, usernames, bios, and public location text. Check when each account began, its verified status, and its public counts. Check automated, protected, and unavailable flags only when the response includes them. These fields do not show age, gender, income, identity, consent, or sentiment. A profile location does not prove where someone lives. ### Can this API add, remove, or buy list followers? No. This read endpoint cannot follow a List or remove a List follower. It cannot create Lists, manage List members, publish posts, or buy followers. Use the [List Members endpoint](/api-reference/x/list-members) for the curated profile roster. That endpoint also reads profiles. It does not edit the List. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/lists/1234567890/followers" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const listId = "1234567890"; const response = await fetch(`https://xquik.com/api/v1/x/lists/${listId}/followers`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const followerRows = data.users.map((user) => ({ list_id: listId, follower_id: user.id, username: user.username, display_name: user.name, bio: user.description ?? null, follower_count: user.followers ?? null, following_count: user.following ?? null, verified: user.verified ?? false, profile_image_url: user.profilePicture ?? null, })); const nextCursor = data.has_next_page ? data.next_cursor : null; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests list_id = "1234567890" response = requests.get( f"https://xquik.com/api/v1/x/lists/{list_id}/followers", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() follower_rows = [ { "list_id": list_id, "follower_id": user["id"], "username": user["username"], "display_name": user["name"], "bio": user.get("description"), "follower_count": user.get("followers"), "following_count": user.get("following"), "verified": user.get("verified", False), "profile_image_url": user.get("profilePicture"), } for user in data["users"] ] next_cursor = data["next_cursor"] if data["has_next_page"] else None ``` ## Direct list follower handoff `GET /x/lists/{id}/followers` examples build one row per List follower. Send saved rows to a CRM, warehouse, audience tool, or agent. Use [`list_follower_explorer`](/api-reference/extractions/create) for a saved job and CSV, JSON, or XLSX export. Store `list_id`, `follower_id`, `username`, and `display_name`. Keep profile counts, verified state, `has_next_page`, and `next_cursor`. > [card] List follower audience > > Page accounts that follow the list. Store the row shape above for CRM, > warehouse, and audience imports. > [card] Next page > > Store `has_next_page` and `next_cursor`. Only request another page when > `has_next_page` is true. > [card] Default page > > Direct calls use the default paid page size. The returned > `users.length` is the row count for this page. > [card] Saved export > > Use `list_follower_explorer` when the workflow needs a saved job. The > job has CSV, JSON, or XLSX output. ## Measure X (Twitter) list follower profiles Use List followers for profiles that chose to follow one List. Keep the List ID with every profile. This keeps follower rows apart from List member rows. Save these fields. * User ID, username, and profile name. * Bio, location, and verified state. * Follower and following counts. * List ID, cursor, and collection time. Compare List follower snapshots by user ID. Record new and missing IDs on separate lines. A new username does not mean a new follower. Use list members when you need the list owner's curated roster. Use account followers when you need the audience of one profile. Each endpoint returns a different relationship. For outreach review, keep source list context. Never infer consent or contact permission from a public follow relationship. ## Track list audience changes Finish both follower snapshots before finding added or missing IDs. Record the List ID, request time, page count, and final row count. Use follower user IDs as stable match keys. Keep usernames as labels. Mark stopped or credit-limited jobs as partial. A snapshot diff shows the List followers seen in each run. It does not show changes to the List's member roster. Report newly observed follower IDs separately from missing IDs. Keep both snapshot completion states beside the comparison. Use snapshot differences to review the audience only. A public follow does not grant outreach rights. It also does not prove interest in every List topic. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | List ID (numeric string). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pass `next_cursor` back unchanged. Xquik cursors resume automatic coverage. Existing unprefixed cursors keep legacy behavior. | | `mode` | `string` | No | Omit `mode` for automatic maximum coverage. Use `standard` for legacy pagination. Use `coverage` for one diagnostic response without cursors. | | `after` | `string` | No | Legacy cursor alias for `cursor`. When both are present, `cursor` wins. | | `pageSize` | `integer` | No | Automatic pages accept `1-10000`. Standard pages accept `1-200`. Defaults to `200`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which list endpoint? > [card] List followers > > Use `GET /x/lists/{id}/followers` for accounts that follow the list. > [card] List members > > Use [`GET /x/lists/{id}/members`](/api-reference/x/list-members) for > accounts the list owner added to the list. > [card] List tweets > > Use [`GET /x/lists/{id}/tweets`](/api-reference/x/list-tweets) for tweets > from accounts in the list. > [card] Bulk list jobs > > Use [`Create extraction`](/api-reference/extractions/create) with > `list_follower_explorer`, `list_member_extractor`, or `list_post_extractor` > when the workflow needs a saved export. ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. | Query parameter | Type | Required | Description | | - | - | - | - | | `maxScan` | `integer` | No | Most profiles 1 request reads, kept or dropped by the filters. The answer then holds the kept profiles, the dropped count & the next cursor. Each request may send its own value. Without it, a filtered read scans at most 100,000 profiles of the list. The limit spans all pages of the read. The page that reaches the limit ends the list & names `scanLimit`. An unfiltered read has no scan limit. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of list followers. | | `users[].id` | `string` | User ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Contains the profile bio. | | `users[].followers` | `number` | Shows how many accounts follow this profile. | | `users[].following` | `number` | Shows how many accounts this profile follows. | | `users[].verified` | `boolean` | Shows if X marks this profile as verified. | | `users[].profilePicture` | `string` | Links to the profile image. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Shows the location written on the profile. | | `users[].createdAt` | `string` | Shows when the account began, in ISO 8601 format. | | `users[].statusesCount` | `number` | Shows the post count if X returns it. | | `users[].coverPicture` | `string` | Links to the cover image if X returns it. | | `users[].mediaCount` | `number` | Shows the media post count if X returns it. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].favouritesCount` | `number` | Shows how many posts this account liked if X returns it. | | `users[].hasCustomTimelines` | `boolean` | Shows custom timelines if X returns this field. | | `users[].isTranslator` | `boolean` | Shows X translator status if X returns it. | | `users[].withheldInCountries` | `string[]` | Lists country codes where X withholds this account. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Shows if X marks the account as sensitive. Omitted if X does not send it. | | `users[].pinnedTweetIds` | `string[]` | Lists pinned Tweet IDs. Omitted if none. | | `users[].isAutomated` | `boolean` | Shows if X marks this account as automated. Omitted if X does not send it. | | `users[].automatedBy` | `string` | Names the operator. Omitted when the account is not automated. | | `users[].unavailable` | `boolean` | Shows if X could not load the account. Omitted when X loads it. | | `users[].unavailableReason` | `string` | Explains why X could not load the account. Omitted when X loads it. | | `users[].verifiedType` | `string` | Shows `Business` or `Government` status. Omitted for blue checks or unverified profiles. | | `users[].profile_bio` | `object` | Adds the structured bio and its tags. Omitted if X does not send it. | | `users[].isBlueVerified` | `boolean` | Shows if X Premium verifies the account. Omitted if X does not send it. | | `users[].isVerified` | `boolean` | Shows the normalized verified state. Omitted if X does not send it. | | `users[].profileBannerUrl` | `string` | Links to the profile banner. Omitted if X does not send it. | | `users[].protected` | `boolean` | Shows if the account protects its posts. Omitted if X does not send it. | | `users[].communityRole` | `string` | Shows a community role only in community results. | | `has_next_page` | `boolean` | Shows if another page exists. | | `next_cursor` | `string` | Gives the next cursor. Pass it as the `cursor` query value. | | `scanLimit` | `object` | Present when a filtered read without `maxScan` scans 100,000 profiles of the list. It is on that read's last page. `limit` is 100000. `rowsRead` counts the profiles read across all pages, kept or dropped. `message` says how to read further. `has_next_page` is false on that page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "verified": true } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Invalid list ID `{ "error": "invalid_list_id", "message": "List ID required" }` The list ID path parameter is empty. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 404 List not found Xquik could not resolve the list. Check the list ID. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier's rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The v1 response can return 424 when the read service fails. > [!NOTE] > > **Related.** [List Members](/api-reference/x/list-members) · [List Tweets](/api-reference/x/list-tweets) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Export a list's members, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/list-members Retrieve X (Twitter) List members with usernames, bios, verification, profile images, and follower counts. Export pages as CSV, JSON, or XLSX for rosters. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/lists/{id}/members` This route reads one X List. It returns the profiles the List owner added. Keep user IDs, usernames, bios, verification, profile images, and public counts. > [!NOTE] > > Omit `mode` to get the fullest results. The response shape stays the same. > Pass `next_cursor` back unchanged as `cursor`. Keep the same endpoint, target, > query, and filters. Existing unprefixed cursors keep their legacy behavior. `after`, `limit`, and `pageSize` aliases also keep working. Billing still counts only returned rows. Use `mode=standard` only to keep the legacy pagination. A page can be empty or underfilled. Continue while `has_next_page` is `true`. Stop only after the response reports `has_next_page=false`. First-page requests do not support `Idempotency-Key` retries. Repeating a cursorless request starts a separate extraction. Results returned by that extraction incur their normal charges. Save each response before requesting its next page. A cursor sent again within 10 minutes returns the same page at no charge. After 10 minutes, you cannot replay earlier or terminal responses. If automatic coverage is busy, an initial request returns a standard data page. Live coverage cursors remain atomic. A cursor sent again while its page loads returns that page at no charge. Other repeats return `409 coverage_cursor_unavailable` with exact `Retry-After` seconds. Wait, then send the same cursor again. Repeated busy responses never authorize restarting with another cursor. Expired, superseded, or identity-mismatched cursors return `410 coverage_cursor_gone`. So does a cursor sent again after 10 minutes. The response omits `Retry-After`. Restart without a cursor. Keep received results. Deduplicate restarted results by `id`. Malformed cursors return `400 invalid_coverage_cursor`. Restart without them. ## X (Twitter) list members questions ### What is an X (Twitter) list member? A List member is an account selected by the List owner. Membership creates the List's curated timeline. It does not mean the account follows that List. An account follower follows one profile instead. X explains these roles in its official [Lists guide](https://help.x.com/en/using-x/x-lists). ### How do I view members of an X (Twitter) list? Copy the numeric List ID from its X (Twitter) URL. Request the first page without a cursor. Store every returned profile before requesting another page. Continue only when `has_next_page` is true. Pass `next_cursor` unchanged as `cursor`. X also documents a [Get List members](https://docs.x.com/x-api/lists/get-list-members) route. Its response and pagination fields differ from Xquik's fields. ### How do I export X (Twitter) list members? The direct endpoint returns JSON pages. Convert each profile into one export row. Store the List ID, member ID, username, bio, counts, and collection time. Follow every cursor before treating the export as complete. Use `list_member_extractor` for a saved job. It can produce CSV, JSON, or XLSX files without custom spreadsheet code. ### Which profile fields can I analyze? Analyze user IDs, usernames, display names, bios, and public location text. Compare follower counts, following counts, verification, and account dates. Use public counts to sort a roster for manual review. Do not call a high count "influence" without a clear method. This endpoint does not calculate reach, engagement, demographics, sentiment, or audience quality. ### How do I compare list member snapshots? Finish both snapshots before comparing their member IDs. Added IDs indicate newly observed members. Missing IDs indicate newly unobserved members. Record both snapshot times and completion states. A renamed username is not a new member. Never report removals from an incomplete later snapshot. ### Can I export members from a private X (Twitter) list? Private Lists return only what X makes public. Never assume a private List is readable. A `404` means the List is unavailable or the List ID is wrong. Do not promise access to private Lists. Public profile fields also do not grant outreach consent. ### Can this endpoint add or remove list members? No. This GET endpoint only reads the current roster. It cannot create Lists, add members, remove members, follow Lists, or publish tweets. Use X's supported write tools for owner-authorized changes. Xquik does not expose those actions through this endpoint. ### How do I find active members or recent tweets? This response describes profiles, not recent activity. Retrieve [List Tweets](/api-reference/x/list-tweets) for posts from the current List timeline. Analyze tweets separately from List membership. A profile count does not prove recent activity. One active account can publish many posts while remaining one List member. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/lists/1234567890/members" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const listId = "1234567890"; const response = await fetch(`https://xquik.com/api/v1/x/lists/${listId}/members`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const memberRows = data.users.map((user) => ({ list_id: listId, member_id: user.id, username: user.username, display_name: user.name, bio: user.description ?? null, follower_count: user.followers ?? null, following_count: user.following ?? null, verified: user.verified ?? false, profile_image_url: user.profilePicture ?? null, })); const nextCursor = data.has_next_page ? data.next_cursor : null; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests list_id = "1234567890" response = requests.get( f"https://xquik.com/api/v1/x/lists/{list_id}/members", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() member_rows = [ { "list_id": list_id, "member_id": user["id"], "username": user["username"], "display_name": user["name"], "bio": user.get("description"), "follower_count": user.get("followers"), "following_count": user.get("following"), "verified": user.get("verified", False), "profile_image_url": user.get("profilePicture"), } for user in data["users"] ] next_cursor = data["next_cursor"] if data["has_next_page"] else None ``` ## Direct list member handoff `GET /x/lists/{id}/members` examples create one row per List member. Send saved rows to a CRM, warehouse, audience tool, or agent. Use [`list_member_extractor`](/api-reference/extractions/create) for a saved job. That job supports CSV, JSON, or XLSX file export. Store `list_id`, `member_id`, `username`, and `display_name`. Keep profile counts, verification, `has_next_page`, and `next_cursor`. > [card] Member roster > > Page accounts the list owner curated as members. Use the row shape above for > CRM, warehouse, and audience imports. > [card] Next page > > Store `has_next_page` and `next_cursor`. Only request another page when > `has_next_page` is true. > [card] Page size > > Automatic pages accept `1-10000`. Standard accepts `1-200`. The returned > `users.length` is the row count for the page. > [card] Saved export > > Use `list_member_extractor` when the workflow needs a saved job. The > job has CSV, JSON, or XLSX output. ## Export a curated list roster Use List members for profiles selected by one List owner. Keep the List ID on every row. Also keep the collection time and snapshot status. These list-member columns are useful. * User ID, username, and profile name. * Biography, location, and verification state. * Follower and following counts. * List ID and collection timestamp. Compare snapshots by user ID. Profile owners can rename their usernames. List membership reflects curation, not audience interest. Use List followers for profiles that follow the List. Use account followers for one profile's audience. For CRM imports, deduplicate by List ID and user ID. The same profile can then appear under several Lists. ## Track list curation changes Create complete snapshots at consistent intervals. Mark added user IDs as newly observed members. Mark missing IDs only after a complete later snapshot. Keep the list name and owner in your snapshot metadata. The endpoint path uses the list ID. Reviewers often recognize the readable name. Use snapshot differences to review curation decisions. Do not call them follower growth. The List owner controls membership. Create one change row for each added or removed user ID. Include the earlier and later snapshot times. Keep the current username only as a display label. Send uncertain comparisons to review. Never publish incomplete comparisons. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | List ID (numeric string). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pass `next_cursor` back unchanged. Xquik cursors resume automatic coverage. Existing unprefixed cursors keep legacy behavior. | | `mode` | `string` | No | Omit `mode` for automatic maximum coverage. Use `standard` for legacy pagination. Use `coverage` for one diagnostic response without cursors. | | `after` | `string` | No | Legacy cursor alias for `cursor`. When both are present, `cursor` wins. | | `pageSize` | `number` | No | Automatic pages accept `1-10000`. Standard pages accept `1-200`. Defaults to `200`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which list endpoint? > [card] List members > > Use `GET /x/lists/{id}/members` for accounts the list owner added to the > list. > [card] List followers > > Use [`GET /x/lists/{id}/followers`](/api-reference/x/list-followers) for > accounts that follow the list. > [card] List tweets > > Use [`GET /x/lists/{id}/tweets`](/api-reference/x/list-tweets) for tweets > from accounts in the list. > [card] Bulk list jobs > > Use [`Create extraction`](/api-reference/extractions/create) with > `list_member_extractor`, `list_follower_explorer`, or `list_post_extractor` > when the workflow needs a saved export. ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. | Query parameter | Type | Required | Description | | - | - | - | - | | `maxScan` | `integer` | No | Most profiles 1 request reads, kept or dropped by the filters. The answer then holds the kept profiles, the dropped count & the next cursor. Each request may send its own value. Without it, a filtered read scans at most 100,000 profiles of the list. The limit spans all pages of the read. The page that reaches the limit ends the list & names `scanLimit`. An unfiltered read has no scan limit. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of list members. | | `users[].id` | `string` | User ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Contains the profile bio. | | `users[].followers` | `number` | Shows how many accounts follow this profile. | | `users[].following` | `number` | Shows how many accounts this profile follows. | | `users[].verified` | `boolean` | Shows if X marks this profile as verified. | | `users[].profilePicture` | `string` | Links to the profile image. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Shows the location written on the profile. | | `users[].createdAt` | `string` | Shows when the account began, in ISO 8601 format. | | `users[].statusesCount` | `number` | Shows the post count if X returns it. | | `users[].coverPicture` | `string` | Links to the cover image if X returns it. | | `users[].mediaCount` | `number` | Shows the media post count if X returns it. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].favouritesCount` | `number` | Shows how many posts this account liked if X returns it. | | `users[].hasCustomTimelines` | `boolean` | Shows custom timelines if X returns this field. | | `users[].isTranslator` | `boolean` | Shows X translator status if X returns it. | | `users[].withheldInCountries` | `string[]` | Lists country codes where X withholds this account. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Shows if X marks the account as sensitive. Omitted if X does not send it. | | `users[].pinnedTweetIds` | `string[]` | Lists pinned Tweet IDs. Omitted if none. | | `users[].isAutomated` | `boolean` | Shows if X marks this account as automated. Omitted if X does not send it. | | `users[].automatedBy` | `string` | Names the operator. Omitted when the account is not automated. | | `users[].unavailable` | `boolean` | Shows if X could not load the account. Omitted when X loads it. | | `users[].unavailableReason` | `string` | Explains why X could not load the account. Omitted when X loads it. | | `users[].verifiedType` | `string` | Shows Business or Government status. Omitted for blue checks or unverified profiles. | | `users[].profile_bio` | `object` | Adds the structured bio and its tags. Omitted if X does not send it. | | `users[].isBlueVerified` | `boolean` | Shows if X Premium verifies the account. Omitted if X does not send it. | | `users[].isVerified` | `boolean` | Shows the normalized verified state. Omitted if X does not send it. | | `users[].profileBannerUrl` | `string` | Links to the profile banner. Omitted if X does not send it. | | `users[].protected` | `boolean` | Shows if the account protects its posts. Omitted if X does not send it. | | `users[].communityRole` | `string` | Shows a community role only in community results. | | `has_next_page` | `boolean` | Shows if another page exists. | | `next_cursor` | `string` | Gives the next cursor. Pass it as the `cursor` query value. | | `scanLimit` | `object` | Present when a filtered read without `maxScan` scans 100,000 profiles of the list. It is on that read's last page. `limit` is 100000. `rowsRead` counts the profiles read across all pages, kept or dropped. `message` says how to read further. `has_next_page` is false on that page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/xquik/photo.jpg" } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Invalid list ID `{ "error": "invalid_list_id", "message": "List ID required" }` The list ID path parameter is empty. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 404 List not found Xquik could not resolve the list. Check the list ID. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier's rate limit. Wait for the `Retry-After` header. ### 424 Dependency failed The v1 response can return 424 when the read service fails. > [!NOTE] > > **Related.** [List Followers](/api-reference/x/list-followers) · [List Tweets](/api-reference/x/list-tweets) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Get a list's tweet timeline, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/list-tweets Retrieve tweets from an X list with authors, text, replies, reposts, likes, quotes, media, timestamps, and cursor-based pagination. 1 credit per tweet. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/lists/{id}/tweets` > [!NOTE] > > Repost records include `retweetedAt`, the repost event's UTC ISO 8601 timestamp. It is `null` when > that timestamp is unavailable. The API omits it for original posts. The nested original post keeps > its own creation date. This field does not report every account that reposted a post. [Request > per-account timestamps with Get retweeters.](/api-reference/x/retweeters#retweet-timestamps) This route retrieves tweets from one curated X List timeline. Export Tweet text, authors, replies, reposts, likes, quotes, media, and cursor pages. Provide the numeric List ID from its X (Twitter) URL. ## X (Twitter) list tweets questions ### What does the Twitter lists API return? The endpoint returns posts from accounts in one X List timeline. Each page can include Tweet text, author profiles, and timestamps. It can also include engagement counts, media, and pagination fields. The response represents one observed timeline window. It does not prove a complete archive or permanent List membership. ### How do I export tweets from an X (Twitter) list? Request the first page with the numeric List ID. Normalize each Tweet into one row. Store `has_next_page` beside `next_cursor` before requesting another page. Use `sinceTime` and `untilTime` for a bounded collection window. Use `list_post_extractor` for a saved CSV, JSON, or XLSX export. ### Why are some X (Twitter) list tweets missing? First, check `includeReplies`. The default excludes replies. Then verify any `sinceTime` and `untilTime` boundaries. Visibility also depends on the connected read context. X says protected posts remain visible only to approved followers. You cannot see private Lists that other accounts own. Read X's official [Help with Lists](https://help.x.com/en/using-x/x-lists-not-working) for current visibility rules. Remaining credits can reduce a paid page. New posts can also shift a moving timeline between requests. A missing Tweet does not prove deletion. ### Can this endpoint create or edit an X (Twitter) list? No. This route only reads List tweets. It cannot create a public List or private List. It cannot add members, remove members, follow Lists, or publish posts. Use X's [Lists guide](https://help.x.com/en/using-x/x-lists) to create and manage Lists. Use the [List Members endpoint](/api-reference/x/list-members) for the current profile roster. ### How do I measure activity in a curated list timeline? Group rows by stable author ID. Count Tweets, replies, reposts, likes, quotes, views, and media items separately. Store every count with its collection time. These measures describe captured List tweets. They do not expose unique viewers, link clicks, conversions, or audience sentiment. ### Does the API keep list tweet order? Keep the returned Tweet sequence in every page. Do not treat that order as permanent. New posts and membership changes can shift later requests. Record collection time, List ID, and cursor with every page. Deduplicate retries by stable Tweet ID without re-ranking the saved rows. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/lists/1234567890/tweets" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const listId = "1234567890"; const response = await fetch(`https://xquik.com/api/v1/x/lists/${listId}/tweets`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const tweetRows = data.tweets.map((tweet) => ({ list_id: listId, tweet_id: tweet.id, text: tweet.text, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, media_urls: tweet.media?.map((item) => item.mediaUrl).filter(Boolean) ?? [], })); const nextCursor = data.has_next_page ? data.next_cursor : null; for (const row of tweetRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } if (nextCursor !== null) { process.stdout.write(`${JSON.stringify({ list_id: listId, next_cursor: nextCursor })}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests list_id = "1234567890" response = requests.get( f"https://xquik.com/api/v1/x/lists/{list_id}/tweets", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() tweet_rows = [ { "list_id": list_id, "tweet_id": tweet["id"], "text": tweet.get("text"), "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "author_name": (tweet.get("author") or {}).get("name"), "author_followers": (tweet.get("author") or {}).get("followers"), "author_verified": (tweet.get("author") or {}).get("verified"), "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"), "created_at": tweet.get("createdAt"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], } for tweet in data["tweets"] ] next_cursor = data["next_cursor"] if data["has_next_page"] else None for row in tweet_rows: print(json.dumps(row)) if next_cursor is not None: print(json.dumps({"list_id": list_id, "next_cursor": next_cursor})) ``` The Node.js & Python snippets build one row per returned list tweet. They do not print the full response page. Store the final `next_cursor` row when `has_next_page` is true. Then pass it back as `cursor` for the next page. ## Direct list tweet handoff Use `GET /x/lists/{id}/tweets` when a caller needs tweets from a curated X List. The caller can be a CRM, warehouse, newsroom, monitoring job, or agent. Store `list_id`, `tweet_id`, `text`, `author_id`, `author_username`, `author_name`, `author_followers`, `author_verified`, and `created_at` for each row. Also store `author_profile_picture`, engagement counts, & `media_urls` for each row. Keep `has_next_page` & `next_cursor` with the export checkpoint. The next run can then resume the list timeline without duplicating earlier rows. Use `sinceTime` & `untilTime` for bounded backfills. Set `includeReplies=true` only when your queue needs reply tweets. > [card] List tweet rows > > Store `tweets[]` as timeline rows from accounts in the list. Use the row > shape above for newsroom, monitoring, CRM, and warehouse imports. > [card] Next page > > Store `has_next_page` and `next_cursor`. Only request another page when > `has_next_page` is true. > [card] Default page > > Direct calls use the default paid tweet page size. The returned > `tweets.length` is the row count for this page. > [card] Time window > > Use `sinceTime` and `untilTime` for bounded backfills or repeat sync jobs. > [card] Reply filter > > Leave `includeReplies` unset to exclude replies. Set > `includeReplies=true` only when your queue needs reply tweets. > [card] Saved export > > Use `list_post_extractor` when the workflow needs a saved job. The > job has CSV, JSON, or XLSX output. ## Build a curated-list tweet feed Use list tweets when a list ID defines the source accounts. Keep the list ID and collection time with every tweet. Save tweet ID, text, author, creation time, engagement counts, media URLs, and cursor. Keep the author ID because list membership can change later. Use this feed for research queues, newsroom monitoring, or account-group review. It represents tweets from curated list members, not tweets mentioning the list. Deduplicate pages by list ID and tweet ID. Store each page before advancing its cursor. New posts can shift the first page between runs. Use list members for the curated profile roster. Use list followers for the list's audience. Use tweet search when keywords should define the result set. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | List ID (numeric string). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `after` | `string` | No | Legacy `cursor` alias on automatic pages. | | `pageSize` | `integer` | No | Tweets per page. Automatic pages accept `1` through `10000`, standard pages `1` through `100`. Defaults to `20`. | | `sinceTime` | `string` | No | Unix timestamp in seconds. Only return tweets after this time. | | `untilTime` | `string` | No | Unix timestamp in seconds. Only return tweets before this time. | | `includeReplies` | `boolean` | No | Include reply tweets. Defaults to `false`. Explicit `replies` takes precedence. | | `mode` | `string` | No | Omit it for resumable maximum coverage. Use `standard` for legacy pagination, or `coverage` for one diagnostic response without a cursor. | ### Tweet filters Search operators such as `cardName` or `near` work on List posts too. You pay only for rows that match your filters. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `cardName` | `string` | No | Keep only Tweets with this card type, such as `poll2choice_text_only`. | | `source` | `string` | No | X search no longer supports `source`. A Tweet search with it answers 424 & charges nothing. | | `excludeSource` | `string` | No | X search no longer supports `excludeSource`. A Tweet search with it answers 424 & charges nothing. | | `geocode` | `string` | No | X search no longer supports `geocode`. A Tweet search with it answers 424 & charges nothing. | | `near` | `string` | No | A place name. A country, such as United States, works like `placeCountry` & keeps Tweets tagged there. A city keeps Tweets about it. | | `within` | `string` | No | X search no longer supports `within`. A Tweet search with it answers 424 & charges nothing. Use `near` alone. | | `safe` | `boolean` | No | When `true`, enable X safe-search filtering. | | `news` | `boolean` | No | X no longer searches `filter:news`, so leave this unset. | | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | | Query parameter | Type | Required | Description | | - | - | - | - | | `keywords` | `string` | No | Words the Tweets must match, in X search syntax. | | `place` | `string` | No | Search within this X place ID. [Search places](/api-reference/x/search-places) finds the ID by name. | | `placeCountry` | `string` | No | Search within this country code. | | `pointRadius` | `string` | No | Geo point radius in X search syntax, such as `-73.99 40.73 25mi`. | | `boundingBox` | `string` | No | Geo bounding box in X search syntax, such as `-74.1 40.6 -73.9 40.8`. | | `advancedQuery` | `string` | No | Raw X search operators appended to the final search query. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which list endpoint? > [card] List tweets > > Use `GET /x/lists/{id}/tweets` for tweets from accounts in the list. > [card] List members > > Use [`GET /x/lists/{id}/members`](/api-reference/x/list-members) for > accounts the list owner added to the list. > [card] List followers > > Use [`GET /x/lists/{id}/followers`](/api-reference/x/list-followers) for > accounts that follow the list. > [card] Bulk list jobs > > Use [`Create extraction`](/api-reference/extractions/create) with > `list_post_extractor`, `list_member_extractor`, or `list_follower_explorer` > when the workflow needs a saved export. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of tweets from the list. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Contains the complete Tweet text. | | `tweets[].type` | `string` | Classifies the Tweet when X returns a type. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Reports the number of likes when available. | | `tweets[].retweetCount` | `number` | Reports the number of reposts when available. | | `tweets[].replyCount` | `number` | Reports the number of replies when available. | | `tweets[].quoteCount` | `number` | Reports the number of quotes when available. | | `tweets[].viewCount` | `number` | Reports the number of views when available. | | `tweets[].bookmarkCount` | `number` | Reports the number of bookmarks when available. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Reports the Tweet language code when available. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | Identifies the replied-to user when available. | | `tweets[].inReplyToUsername` | `string` | Reports the replied-to username when available. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Returns paid-promotion and AI-generated-media labels when available. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia`. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author X (Twitter) username. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Reports the author's follower count when available. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Lists media items attached to the Tweet. Omitted when none exist. | | `tweets[].media[].mediaUrl` | `string` | Provides the direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Lists available video renditions and playback details. Omitted for images. | | `tweets[].media[].type` | `string` | Identifies the attached media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. Pass as the `cursor` query parameter. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Hello from a list!", "createdAt": "2026-03-27T10:00:00.000Z", "likeCount": 42, "retweetCount": 5, "viewCount": 1200, "author": { "id": "987654321", "username": "username", "name": "Xquik", "followers": 12400, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Invalid list ID `{ "error": "invalid_list_id", "message": "List ID required" }` The list ID path parameter is empty. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 404 List not found Xquik could not resolve the list. Check the list ID. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [List Members](/api-reference/x/list-members) · [List Followers](/api-reference/x/list-followers) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Stock & crypto cashtag signals, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/market-signals Read bullish and bearish stock and crypto stances in X posts with AI. Get content type, conviction, relevance, and cashtag totals. 2 credits per analyzed post. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/analysis/market-signals` **2 credits per analyzed post** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) Market signals reads each post with AI and answers 4 questions about an asset. The endpoint is `POST /api/v1/x/analysis/market-signals`. | Answer | Type | Values | | - | - | - | | `stance` | Choice | `bullish`, `bearish`, `neutral`, `mixed`, or `unclear` | | `content` | Choice | `analysis`, `news`, `trade`, `promotion`, `humor`, `question`, or `unclear` | | `conviction` | Score | `0` no stance or hedged, `1` a reasoned view, `2` a firm call | | `relevance` | Probability | From `0` to `1`, the chance the post treats the target as an asset | The summary counts bullish and bearish posts per cashtag. Name the asset in `analysis.targets`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/analysis/market-signals \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "query": "$NVDA lang:en", "limit": 50, "analysis": { "targets": [{ "name": "NVIDIA", "aliases": ["NVDA"] }] } }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/analysis/market-signals", { method: "POST", headers: { "x-api-key": "xq_your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ query: "$NVDA lang:en", limit: 50, analysis: { targets: [{ name: "NVIDIA", aliases: ["NVDA"] }] }, }), }); const data = await response.json(); if (!response.ok) throw new Error(`${data.error}: ${data.message}`); const signalRows = data.results .filter((result) => result.answers.relevance >= 0.5) .filter((result) => result.answers.content !== "promotion") .map((result) => ({ tweet_id: result.tweet.id, stance: result.answers.stance, content: result.answers.content, conviction: result.answers.conviction, cashtags: result.cashtags, })); const cashtagSignals = data.analysisSummary.cashtags.map(({ cashtag, signal }) => ({ cashtag, ...signal, })); process.stdout.write(`${JSON.stringify({ rows: signalRows.length, cashtagSignals })}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.post( "https://xquik.com/api/v1/x/analysis/market-signals", headers={"x-api-key": "xq_your_api_key_here"}, json={ "query": "$NVDA lang:en", "limit": 50, "analysis": {"targets": [{"name": "NVIDIA", "aliases": ["NVDA"]}]}, }, timeout=120, ) data = response.json() if not response.ok: raise RuntimeError(f"{data['error']}: {data['message']}") signal_rows = [ { "tweet_id": result["tweet"]["id"], "stance": result["answers"]["stance"], "content": result["answers"]["content"], "conviction": result["answers"]["conviction"], "cashtags": result["cashtags"], } for result in data["results"] if result["answers"]["relevance"] >= 0.5 and result["answers"]["content"] != "promotion" ] cashtag_signals = [ {"cashtag": entry["cashtag"], **entry.get("signal", {})} for entry in data["analysisSummary"]["cashtags"] ] print(json.dumps({"rows": len(signal_rows), "cashtag_signals": cashtag_signals})) ``` The snippets keep relevant posts that are not promotion. They then print the signal per cashtag. They do not print the full response. ## Name the asset Put the asset in `analysis.targets`, with its ticker and other names as aliases. A post mentions the target when its text contains the name or an alias. Letter case does not matter. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "name": "NVIDIA", "aliases": ["NVDA", "Nvidia"] } ``` `relevance` says whether a post discusses the target as an asset, position, or price. Posts about the wider market, competitors, or suppliers do not count. Neither does a ticker in a list of tags. Filter rows on `relevance` before you count stances. The snippets keep posts from `0.5`. ## Read the market answers `results[].answers` holds each decision by question ID. | `stance` | Meaning | | - | - | | `bullish` | Expects the price or outlook to rise | | `bearish` | Expects the price or outlook to fall | | `neutral` | Discusses the asset without a direction | | `mixed` | Combines rising and falling expectations | | `unclear` | Names no identifiable asset or states no view | `stance` classifies the author's own view, not quoted views or ads. | `content` | Meaning | | - | - | | `analysis` | Reasoning from data, charts, fundamentals, or events | | `news` | Reports an event, filing, or announcement | | `trade` | Describes a position, entry, exit, or trade plan | | `promotion` | Sells a service, signal group, or product, or shills an asset | | `humor` | A joke, meme, or venting without a claim | | `question` | Asks for views or information | | `unclear` | Not enough context | `conviction` judges how firmly the text states the stance, not engagement or follower counts. A post with no stance on the target scores `0`. The score can have decimals. For example, `1.6` is between a reasoned view and a firm call. The answers describe what posts say, not whether claims are true. They are not investment advice. ## Read the signal per cashtag `analysisSummary.cashtags` lists up to 20 cashtags, most posts first. Each entry has `rows`, the category counts in `choices`, and `signal`. `signal` holds `bullish` and `bearish` post counts and a `score` from `-1` to `1`. The score is bullish minus bearish posts, divided by the cashtag's posts. `results[].cashtags` lists the cashtags in each post's text, in upper case. A post with 2 cashtags counts toward both. `analysisSummary.targets` counts the posts that mention each target, with their category counts. ## Pick the posts to analyze Send `tweetIds`, `texts`, a page, or a search, never more than 1. See [pick the posts to analyze](/api-reference/x/tweet-analysis-parameters#pick-the-posts-to-analyze) for each source. `query` takes cashtags and operators, such as `$NVDA lang:en`. Send `username` to read 1 trader's or analyst's posts. ## Compare with an earlier answer Send the `results` of an earlier call as `baseline` to see what changed. The comparison costs nothing extra. See [compare with an earlier answer](/api-reference/x/tweet-analysis-parameters#compare-with-an-earlier-answer) for an example. ## Budget the analysis Each analyzed post costs 2 credits. Each text in `texts` costs the same. Posts in `unanalyzed` cost nothing. See [budget the analysis](/api-reference/x/tweet-analysis-parameters#budget-the-analysis) for each reason. ## Body See [body parameters](/api-reference/x/tweet-analysis-parameters#body-parameters) for every field. Common ones are `tweetIds`, `texts`, `query`, `username`, and `limit`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account API key. An OAuth bearer token also works. | | `Authorization` | `string` | No | Send `Bearer xq_your_guest_key_here` for an active `paid_reads` guest key. | | `Content-Type` | `string` | Yes | Must be `application/json`. The body can be up to 256 KB. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `results` | `object[]` | Each analyzed post with its answers. Each row costs 2 credits. | | `results[].tweet` | `object` | The post, as [Search Tweets](/api-reference/x/search-tweets) returns it. Your own texts have the IDs `text:1`, `text:2`, and so on. | | `results[].answers` | `object` | Each decision by question ID. `stance` and `content` are categories. `conviction` is a level from `0`. `relevance` is a probability from `0` to `1`. | | `results[].analysis` | `object` | The answers in full. `status` is `succeeded`. `answers` gives each answer's `value`, `confidence`, and `probabilities`, or a `probability`. `questions` names the ID and version of each question. `contextBytes` and `contextAvailability` say what the AI read beside the post's text. | | `results[].sourceDomains` | `string[]` | Hostnames the post links to, without `t.co`. | | `results[].cashtags` | `string[]` | Cashtags in the post's text, in upper case. | | `results[].monitor` | `object` | The comparison with `baseline`. It holds `status`, `changedQuestionIds`, and `changes` with each `previous` and `current` decision. It also holds the settings' `configurationFingerprint`. | | `unanalyzed` | `object[]` | Each post without an analysis. These cost nothing. | | `unanalyzed[].id` | `string` | Post ID, or `text:1` and so on for your own texts. | | `unanalyzed[].status` | `string` | `skipped` or `failed`. | | `unanalyzed[].reason` | `string` | `post_unavailable`, `missing_text`, `insufficient_credits`, or `context_limit`. Any other reason means the analysis failed. Send the post again. | | `unprocessed_ids` | `string[]` | IDs of the posts or texts the time ran out for. Send them again. They cost nothing. | | `analysisSummary` | `object` | Totals of the answers across the analyzed posts. | | `analysisSummary.schemaVersion` | `integer` | Version of the summary's shape. | | `analysisSummary.rows` | `object` | Posts by outcome, counted in `analyzed`, `failed`, and `skipped`. | | `analysisSummary.engagement` | `integer` | Likes, reposts, replies, and quotes of the analyzed posts. | | `analysisSummary.questions` | `object` | Totals by question ID. `stance` and `content` have `counts`, `shares`, `engagementShares`, and `top` posts per category. `conviction` has `mean`, `engagementWeightedMean`, and `levels`. `relevance` has `mean`, `yes`, and `no`. | | `analysisSummary.targets` | `object[]` | Each target in `analysis.targets` has `name`, `mentions`, `share`, `engagement`, `choices`, and `top` posts. | | `analysisSummary.cashtags` | `object[]` | Up to 20 cashtags, most posts first. Each has `cashtag`, `rows`, `choices`, and `signal` with `bullish`, `bearish`, and `score`. | | `analysisSummary.sourceDomains` | `object[]` | Posts per linked hostname, most posts first, up to 20. | | `analysisSummary.monitor` | `object` | Posts per `monitor.status` in `statuses`, and up to 50 changed posts in `changedRows`. | | `has_next_page` | `boolean` | Whether the search has more posts. Always `false` for `tweetIds` and `texts`. | | `next_cursor` | `string` | Send it as `cursor` with the same search for the next page. Empty when there is none. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "results": [ { "tweet": { "id": "1893456789012345678", "text": "$NVDA cleared its 50-day average on volume. Adding to my position, target 160.", "likeCount": 212, "retweetCount": 18, "replyCount": 25 }, "analysis": { "status": "succeeded", "answers": [ { "questionId": "stance", "questionVersion": "market:4", "type": "choice", "value": "bullish", "confidence": 0.94, "probabilities": { "bullish": 0.94, "bearish": 0.01, "neutral": 0.02, "mixed": 0.02, "unclear": 0.01 } }, { "questionId": "relevance", "questionVersion": "market:4", "type": "probability", "probability": 0.97 } ] }, "answers": { "stance": "bullish", "content": "trade", "conviction": 2, "relevance": 0.97 }, "sourceDomains": [], "cashtags": ["$NVDA"] } ], "unanalyzed": [], "analysisSummary": { "schemaVersion": 1, "rows": { "analyzed": 1, "failed": 0, "skipped": 0 }, "engagement": 255, "questions": { "stance": { "type": "choice", "counts": { "bullish": 1, "bearish": 0, "neutral": 0, "mixed": 0, "unclear": 0 } } }, "targets": [ { "name": "NVIDIA", "mentions": 1, "share": 1, "engagement": 255, "choices": { "stance": { "bullish": 1 } }, "top": { "stance": { "bullish": [{ "tweetId": "1893456789012345678", "engagement": 255 }] } } } ], "cashtags": [ { "cashtag": "$NVDA", "rows": 1, "choices": { "stance": { "bullish": 1 }, "content": { "trade": 1 } }, "signal": { "bullish": 1, "bearish": 0, "score": 1 } } ], "sourceDomains": [] }, "has_next_page": false, "next_cursor": "" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Send tweetIds, texts, or a search such as query or username." }` The body names no posts or names more than 1 source. A body with an invalid field gets the same error. The message says what to send instead. The request costs nothing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Full account keys can receive `no_subscription`, `subscription_inactive`, `no_credits`, or `insufficient_credits` with account payment options. Guest keys receive only the guest top-up action. The failed request creates no checkout. Ask the user to confirm before calling any checkout or top-up route. ### 403 Protected account `{ "error": "x_account_protected" }` A search that needs a protected author returns this. Choose a public account. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for the `Retry-After` header, then send the request again. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Stock & crypto sentiment API questions ### How do I get the sentiment of a stock or coin on X? Search its cashtag in `query` and name it in `analysis.targets`. Each row in `results` holds the post's `stance`. `analysisSummary.cashtags` counts bullish and bearish posts. ### What does the cashtag score mean? `signal.score` is bullish minus bearish posts, divided by the cashtag's posts. `1` means every post is bullish, and `-1` means every post is bearish. ### How do I drop spam and shilling? Skip rows whose `content` is `promotion`, and keep rows with high `relevance`. That drops signal groups, ads, and tickers used as tags. ### Does it work for crypto? Yes. Name the coin in `analysis.targets`, such as `Bitcoin` with the alias `BTC`. Cashtags like `$BTC` count in `analysisSummary.cashtags`. ### How much do market signals cost? Each analyzed post costs 2 credits. Posts in `unanalyzed` and refused requests cost nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Sentiment analysis](/api-reference/x/sentiment-analysis) reads the general attitude of posts. [Search Tweets](/api-reference/x/search-tweets) previews the posts a query returns. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # News classification with AI, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/news-classification Classify news posts on X with AI as reporting, commentary, or rumor. Get the source attribution and the relevance to your topic. 2 credits per analyzed post. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/analysis/news` **2 credits per analyzed post** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) News classification reads each post with AI and answers 3 questions about your topic. The endpoint is `POST /api/v1/x/analysis/news`. | Answer | Type | Values | | - | - | - | | `format` | Choice | `reporting`, `commentary`, `speculation`, `promotion`, `satire`, `unrelated`, or `unclear` | | `attribution` | Choice | `named`, `linked`, `firsthand`, `absent`, or `unclear` | | `relevance` | Probability | From `0` to `1`, the chance the post concerns your topic | Name the topic in `analysis.targets`. The answers classify what a post says. They do not check whether its claims are true. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/analysis/news \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "query": "(Artemis OR SLS OR Orion) NASA lang:en -filter:nativeretweets", "limit": 50, "analysis": { "targets": [{ "name": "Artemis program", "aliases": ["Artemis II", "SLS", "Orion"] }] } }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/analysis/news", { method: "POST", headers: { "x-api-key": "xq_your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ query: "(Artemis OR SLS OR Orion) NASA lang:en -filter:nativeretweets", limit: 50, analysis: { targets: [{ name: "Artemis program", aliases: ["Artemis II", "SLS", "Orion"] }], }, }), }); const data = await response.json(); if (!response.ok) throw new Error(`${data.error}: ${data.message}`); const sourcedReports = data.results .filter((result) => result.answers.relevance >= 0.5) .filter((result) => result.answers.format === "reporting") .filter((result) => ["named", "linked"].includes(result.answers.attribution)) .map((result) => ({ tweet_id: result.tweet.id, text: result.tweet.text, sources: result.sourceDomains, })); const topSources = data.analysisSummary.sourceDomains.slice(0, 5); process.stdout.write(`${JSON.stringify({ reports: sourcedReports.length, topSources })}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.post( "https://xquik.com/api/v1/x/analysis/news", headers={"x-api-key": "xq_your_api_key_here"}, json={ "query": "(Artemis OR SLS OR Orion) NASA lang:en -filter:nativeretweets", "limit": 50, "analysis": { "targets": [{"name": "Artemis program", "aliases": ["Artemis II", "SLS", "Orion"]}], }, }, timeout=120, ) data = response.json() if not response.ok: raise RuntimeError(f"{data['error']}: {data['message']}") sourced_reports = [ { "tweet_id": result["tweet"]["id"], "text": result["tweet"]["text"], "sources": result["sourceDomains"], } for result in data["results"] if result["answers"]["relevance"] >= 0.5 and result["answers"]["format"] == "reporting" and result["answers"]["attribution"] in ("named", "linked") ] top_sources = data["analysisSummary"]["sourceDomains"][:5] print(json.dumps({"reports": len(sourced_reports), "top_sources": top_sources})) ``` The snippets keep relevant reports that cite a source. They then print the most linked sites. They do not print the full response. ## Name the topic Put the topic in `analysis.targets`, with its other names as aliases. A topic can be an event, company, person, ticker, or product. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "name": "Artemis program", "aliases": ["Artemis II", "SLS", "Orion"] } ``` Only posts naming the topic or reporting an event about it get high `relevance`. Posts about the same industry, competitors, or the wider market do not count. Filter rows on `relevance` before you count answers. ## Read the news answers `results[].answers` holds each decision by question ID. | `format` | Meaning | | - | - | | `reporting` | Reports a specific event or announcement | | `commentary` | Opinion or interpretation of events | | `speculation` | An uncertain prediction or a rumor | | `promotion` | Advertising or promotional content | | `satire` | Parody or satire | | `unrelated` | Not about the topic | | `unclear` | Not enough context | | `attribution` | Meaning | | - | - | | `named` | Names the source, such as an outlet, a report, or a quoted person | | `linked` | Links to a source without naming it | | `firsthand` | The author reports their own observation or announcement | | `absent` | Gives no source for its claims | | `unclear` | Attribution cannot be determined | `attribution` says whether a source is given. It does not rate the source. ## Separate reports from rumors Keep `reporting` with `named` or `linked` attribution for sourced news. Watch `speculation` with `absent` attribution for rumors that spread without a source. `analysisSummary.questions.format.shares` holds each format's share of posts. Store it per run to see when speculation outgrows reporting. ## Track the sources `results[].sourceDomains` lists the sites each post links to. The summary's `sourceDomains` counts posts per site, most posts first, up to 20. For more posts than 1 call returns, send the same body again. Add `cursor` set to `next_cursor`. Add `sinceTime` and `untilTime` to read 1 day or 1 hour. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "query": "Artemis II", "sinceTime": "2026-09-25T00:00:00Z", "untilTime": "2026-09-26T00:00:00Z", "analysis": { "targets": [{ "name": "Artemis program" }] } } ``` ## Pick the posts to analyze Send `tweetIds`, `texts`, a page, or a search, never more than 1. See [pick the posts to analyze](/api-reference/x/tweet-analysis-parameters#pick-the-posts-to-analyze) for each source. ## Compare with an earlier answer Send the `results` of an earlier call as `baseline` to see what changed. The comparison costs nothing extra. See [compare with an earlier answer](/api-reference/x/tweet-analysis-parameters#compare-with-an-earlier-answer) for an example. ## Budget the analysis Each analyzed post costs 2 credits. Each text in `texts` costs the same. Posts in `unanalyzed` cost nothing. See [budget the analysis](/api-reference/x/tweet-analysis-parameters#budget-the-analysis) for each reason. ## Body See [body parameters](/api-reference/x/tweet-analysis-parameters#body-parameters) for every field. Common ones are `tweetIds`, `texts`, `query`, `username`, and `limit`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account API key. An OAuth bearer token also works. | | `Authorization` | `string` | No | Send `Bearer xq_your_guest_key_here` for an active `paid_reads` guest key. | | `Content-Type` | `string` | Yes | Must be `application/json`. The body can be up to 256 KB. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `results` | `object[]` | Each analyzed post with its answers. Each row costs 2 credits. | | `results[].tweet` | `object` | The post, as [Search Tweets](/api-reference/x/search-tweets) returns it. Your own texts have the IDs `text:1`, `text:2`, and so on. | | `results[].answers` | `object` | Each decision by question ID. `format` and `attribution` are categories, and `relevance` a probability from `0` to `1`. | | `results[].analysis` | `object` | The answers in full. `status` is `succeeded`. `answers` gives each answer's `value`, `confidence`, and `probabilities`, or a `probability`. `questions` names the ID and version of each question. `contextBytes` and `contextAvailability` say what the AI read beside the post's text. | | `results[].sourceDomains` | `string[]` | Hostnames the post links to, without `t.co`. | | `results[].cashtags` | `string[]` | Cashtags in the post's text, in upper case. | | `results[].monitor` | `object` | The comparison with `baseline`. It holds `status`, `changedQuestionIds`, and `changes` with each `previous` and `current` decision. It also holds the settings' `configurationFingerprint`. | | `unanalyzed` | `object[]` | Each post without an analysis. These cost nothing. | | `unanalyzed[].id` | `string` | Post ID, or `text:1` and so on for your own texts. | | `unanalyzed[].status` | `string` | `skipped` or `failed`. | | `unanalyzed[].reason` | `string` | `post_unavailable`, `missing_text`, `insufficient_credits`, or `context_limit`. Any other reason means the analysis failed. Send the post again. | | `unprocessed_ids` | `string[]` | IDs of the posts or texts the time ran out for. Send them again. They cost nothing. | | `analysisSummary` | `object` | Totals of the answers across the analyzed posts. | | `analysisSummary.schemaVersion` | `integer` | Version of the summary's shape. | | `analysisSummary.rows` | `object` | Posts by outcome, counted in `analyzed`, `failed`, and `skipped`. | | `analysisSummary.engagement` | `integer` | Likes, reposts, replies, and quotes of the analyzed posts. | | `analysisSummary.questions` | `object` | Totals by question ID. `format` and `attribution` have `counts`, `shares`, `engagementShares`, and `top` posts per category. `relevance` has `mean`, `yes`, and `no`. | | `analysisSummary.targets` | `object[]` | Each target in `analysis.targets` has `name`, `mentions`, `share`, `engagement`, `choices`, and `top` posts. | | `analysisSummary.cashtags` | `object[]` | Posts and category counts per cashtag, most posts first, up to 20. | | `analysisSummary.sourceDomains` | `object[]` | Posts per linked hostname, most posts first, up to 20. | | `analysisSummary.monitor` | `object` | Posts per `monitor.status` in `statuses`, and up to 50 changed posts in `changedRows`. | | `has_next_page` | `boolean` | Whether the search has more posts. Always `false` for `tweetIds` and `texts`. | | `next_cursor` | `string` | Send it as `cursor` with the same search for the next page. Empty when there is none. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "results": [ { "tweet": { "id": "1893456789012345678", "text": "NASA confirms the Artemis II crew will fly in April, per today's briefing. nasa.gov/artemis", "likeCount": 512, "retweetCount": 88, "replyCount": 40 }, "analysis": { "status": "succeeded", "answers": [ { "questionId": "format", "questionVersion": "news:3", "type": "choice", "value": "reporting", "confidence": 0.94, "probabilities": { "reporting": 0.94, "commentary": 0.02, "speculation": 0.02, "promotion": 0.01, "satire": 0, "unrelated": 0, "unclear": 0.01 } }, { "questionId": "attribution", "questionVersion": "news:3", "type": "choice", "value": "named", "confidence": 0.9, "probabilities": { "named": 0.9, "linked": 0.07, "firsthand": 0.01, "absent": 0.01, "unclear": 0.01 } }, { "questionId": "relevance", "questionVersion": "news:3", "type": "probability", "probability": 0.99 } ] }, "answers": { "format": "reporting", "attribution": "named", "relevance": 0.99 }, "sourceDomains": ["nasa.gov"], "cashtags": [] } ], "unanalyzed": [], "analysisSummary": { "schemaVersion": 1, "rows": { "analyzed": 1, "failed": 0, "skipped": 0 }, "engagement": 640, "questions": { "format": { "type": "choice", "counts": { "reporting": 1, "commentary": 0, "speculation": 0, "promotion": 0, "satire": 0, "unrelated": 0, "unclear": 0 } } }, "targets": [ { "name": "Artemis program", "mentions": 1, "share": 1, "engagement": 640, "choices": { "format": { "reporting": 1 }, "attribution": { "named": 1 } }, "top": { "format": { "reporting": [{ "tweetId": "1893456789012345678", "engagement": 640 }] } } } ], "cashtags": [], "sourceDomains": [{ "domain": "nasa.gov", "posts": 1 }] }, "has_next_page": false, "next_cursor": "" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Send tweetIds, texts, or a search such as query or username." }` The body names no posts or names more than 1 source. A body with an invalid field gets the same error. The message says what to send instead. The request costs nothing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Full account keys can receive `no_subscription`, `subscription_inactive`, `no_credits`, or `insufficient_credits` with account payment options. Guest keys receive only the guest top-up action. The failed request creates no checkout. Ask the user to confirm before calling any checkout or top-up route. ### 403 Protected account `{ "error": "x_account_protected" }` A search that needs a protected author returns this. Choose a public account. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for the `Retry-After` header, then send the request again. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## News monitoring API questions ### How do I monitor news about a topic on X? Search the topic in `query` and name it in `analysis.targets`. Each row in `results` holds the post's `format`, `attribution`, and `relevance`. ### Does it check whether a post is true? No. The answers say what kind of post it is. They also say whether the post names a source. They do not verify claims or rate the source. ### How do I find rumors? Keep rows whose `format` is `speculation`. Rows with `absent` attribution give no source for their claims. ### Can I follow 1 outlet or reporter? Yes. Send their handle in `username`, and name your topic in `analysis.targets`. ### How much does news classification cost? Each analyzed post costs 2 credits. Posts in `unanalyzed` and refused requests cost nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Market signals](/api-reference/x/market-signals) reads stock and crypto stances, or [Classify posts](/api-reference/x/classify-tweets) asks your own questions. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Every version of a news story, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/news-versions Get every version X wrote of a news story from Explore, with its time, headline and text, oldest first. 1 credit per request, and unknown stories are free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/news/{id}/versions` **1 credit per request** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/news/2110209733533598095/versions" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const storyId = "2110209733533598095"; const response = await fetch(`https://xquik.com/api/v1/x/news/${storyId}/versions`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); for (const version of body.versions) { console.log(`${version.createdAt} ${version.headline}`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests story_id = "2110209733533598095" response = requests.get( f"https://xquik.com/api/v1/x/news/{story_id}/versions", headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) for version in body["versions"]: print(version["createdAt"], version["headline"]) ``` ## How did an X news story change? X writes a news story for each topic under Explore and News. X rewrites the story as the topic moves. Use `GET /x/news/{id}/versions` to read every version of 1 story, oldest first. * `headline` is the story's headline in that version. * `text` is the story's text in that version. * `createdAt` is when X wrote the version, in UTC. X (Twitter) lists every version at once, so 1 request returns the whole history. A story from 2 hours ago may have 1 version. A story that ran all day may have 8 or more. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Story ID, such as `2110209733533598095`. The URL-encoded story link also works, such as `x.com/i/trending/2110209733533598095`. Open a story on x.com to copy its link. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | The story ID the request named. | | `count` | `number` | Versions returned. | | `versions` | `object[]` | The story's versions, oldest first. | | `versions[].id` | `string` | The version's ID. | | `versions[].createdAt` | `string` | When X wrote the version, in UTC. Xquik reads it from the version's ID. | | `versions[].headline` | `string` | The story's headline in this version. | | `versions[].text` | `string` | The story's text in this version. It carries no local time line. `createdAt` gives the UTC time. | ### 400 Invalid story ID The path named no story. This answer is free. ### 404 Story not found X (Twitter) lists no version for the ID. This answer is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [Get X (Twitter) trends](/api-reference/x/trends) · [Get trends history](/api-reference/x/trends-history) · [Search tweets](/api-reference/x/search-tweets) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "2110209733533598095", "count": 1, "versions": [ { "id": "2110211669641105725", "createdAt": "2026-10-14T03:30:42.536Z", "headline": "Elon Musk Pushes Starlink for India's Remote Areas Amid Regulatory Hurdles", "text": "Musk has accused Reliance Industries' Mukesh Ambani of blocking Starlink's entry to protect local telecom giants like Jio, while India's government insists on equal treatment for all applicants, including ongoing security reviews. In Vietnam, Starlink already provides free internet to isolated spots for tourism and disaster response, highlighting its potential for hard-to-reach areas. Yet challengers note India's cheap mobile data from Jio and Airtel covers most needs, raising questions on pricing and national security as Starlink seeks final clearances." } ] } ``` * **400** `{ "error": "invalid_news_id", "message": "Send a story ID or link, such as x.com/i/trending/2110209733533598095." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "news_not_found", "message": "Story not found. Copy its ID from its x.com/i/trending link." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Notifications & mentions feed, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/notifications Retrieve a connected X account's notifications. Filter mentions or verified activity, store triage rows, and page older rows with next_cursor. 1 credit each. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/notifications` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit The route reads notifications through your connected X account. Without one, it returns `424 account_required`. Use [Connect X account](/api-reference/x-accounts/connect) to add one. When your connected X accounts are busy, it returns `503`. Retry after the `Retry-After` delay. Get notifications reads the connected account inbox. Use `type=Mentions` for mention triage or `type=Verified` for verified-account activity. Or omit `type` for all notification rows. Store `next_cursor` only when `has_next_page` is true. ```bash Mentions theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/notifications \ --data-urlencode "type=Mentions" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq # Page 2 curl -G https://xquik.com/api/v1/x/notifications \ --data-urlencode "type=Mentions" \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} function notificationsUrl({ cursor, type = "Mentions" }) { const params = new URLSearchParams({ type }); if (cursor) params.set("cursor", cursor); return `https://xquik.com/api/v1/x/notifications?${params}`; } function toNotificationRows(page, { inboxType }) { return page.notifications.map((notification) => ({ record_type: "notification", inbox_type: inboxType, notification_id: notification.id, notification_type: notification.type ?? null, message_preview: notification.message ?? null, created_at: notification.timestamp ?? null, source_endpoint: "GET /api/v1/x/notifications", page_next_cursor: page.has_next_page ? page.next_cursor : null, })); } async function saveNotificationRows(rows) { // Replace this with a private support inbox, CRM, queue, or agent memory write. return rows.length; } const inboxType = "Mentions"; const response = await fetch(notificationsUrl({ type: inboxType }), { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const data = await response.json(); const rows = toNotificationRows(data, { inboxType }); await saveNotificationRows(rows); // Paginate if (data.has_next_page) { const next = await fetch(notificationsUrl({ type: inboxType, cursor: data.next_cursor }), { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const nextRows = toNotificationRows(await next.json(), { inboxType }); await saveNotificationRows(nextRows); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests def to_notification_rows(page, inbox_type): return [ { "record_type": "notification", "inbox_type": inbox_type, "notification_id": notification["id"], "notification_type": notification.get("type"), "message_preview": notification.get("message"), "created_at": notification.get("timestamp"), "source_endpoint": "GET /api/v1/x/notifications", "page_next_cursor": page["next_cursor"] if page["has_next_page"] else None, } for notification in page["notifications"] ] def save_notification_rows(rows): # Replace this with a private support inbox, CRM, queue, or agent memory write. return len(rows) inbox_type = "Mentions" response = requests.get( "https://xquik.com/api/v1/x/notifications", params={"type": inbox_type}, headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) data = response.json() save_notification_rows(to_notification_rows(data, inbox_type)) # Paginate while data["has_next_page"]: data = requests.get( "https://xquik.com/api/v1/x/notifications", params={"type": inbox_type, "cursor": data["next_cursor"]}, headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ).json() save_notification_rows(to_notification_rows(data, inbox_type)) ``` The Node.js and Python snippets normalize each page for notification triage. Keep full message text in private systems. Use `notification_id`, `notification_type`, `created_at`, `inbox_type`, and `page_next_cursor`. Use them for private support dashboards, CRM queues, and agent workflows. ## Notification triage handoff Use `GET /api/v1/x/notifications` when a caller needs account-level activity for a connected X account. The caller can be a support inbox, CRM workflow, or agent queue. The endpoint returns notification IDs, types, message previews, and timestamps. It omits full tweet and direct-message payloads. > [card] Mention queue > > Use `type=Mentions` for replies and mentions that need a support or brand > review queue. > [card] Verified activity > > Use `type=Verified` when you route verified-account activity ahead of the > general inbox. > [card] All inbox > > Omit `type` or pass `All` for every notification row > visible to the connected account. > [card] Stable upserts > > Store `notifications[].id` as `notification_id` for deduplication and replay-safe > imports. > [card] Private text > > Keep `notifications[].message` in private support, CRM, or agent memory > systems. > [card] Next page > > Store `has_next_page` and `next_cursor`. Then pass `next_cursor` back as `cursor` > only when `has_next_page` is true. ## Poll Twitter notifications with the API Call `GET /x/notifications` with a connected account's Xquik API key. Omit `type` to read all notification categories. Use `type=Mentions` for a mention queue or `type=Verified` for verified-account activity. Each row can contain a notification ID, type, message, and timestamp. The route does not return full tweet, profile, or direct-message objects. Keep message text in a private support inbox, CRM, or agent queue. ### Build an X (Twitter) API mentions queue Store `notifications[].id` as the stable notification key. Record the connected account ID beside every row. Upsert repeated notification IDs instead of creating duplicate support tasks. Route mention rows by `notification_type`, `message`, and `timestamp`. If an agent needs the complete public tweet, follow the related [user mentions endpoint](/api-reference/x/user-mentions). [X documents its user mentions timeline as paginated posts that mention one user.](https://docs.x.com/x-api/posts/timelines/introduction) ### Resume notification pages Every response is one inbox page. Store `next_cursor` only when `has_next_page` equals `true`. Save the page's notification rows before updating the saved cursor. When the destination supports transactions, save the page and cursor together. Otherwise, upsert by notification ID. Update the cursor after the destination writes the full page. Keep the preceding cursor until validating its replacement. ### Choose polling or webhook delivery This endpoint uses polling. The notification delay includes the worker's polling interval. Run each new request from the latest confirmed cursor. Stop when `has_next_page` is false. Use [Xquik webhooks](/webhooks/overview) when a monitor should push captured events to your HTTPS endpoint. X also offers a separate Account Activity API for real-time account events. [Its documentation lists mentions, replies, reposts, likes, follows, and direct messages.](https://docs.x.com/x-api/account-activity/introduction) ## Twitter notification API questions ### Why are X (Twitter) API notifications delayed? A polling worker sees notifications only when its next request runs. Shorten the polling interval within your rate limits. Store every cursor. A later page can otherwise look like missing notifications. ### Can I delete or clear notifications with this route? No. This route only reads notifications. Deleting a local triage row does not remove the notification from X. Another connected client also keeps the notification. ### What happens when a notification request fails? `401` means the connected account needs a valid key. `402` means the account needs more credits. Wait for `Retry-After` after `429`. `424 account_required` means you have no connected X account. Resume from the saved cursor after other `424`, `502` or `503` responses. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `type` | `string` | No | Notification filter. `All` (default), `Verified`, or `Mentions`. Unrecognized values fall back to `All`. | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | ## Which inbox endpoint? > [card] Account notifications > > Use `GET /x/notifications` for connected-account notification rows with > `All`, `Verified`, or `Mentions` filters. > [card] Home timeline > > Use [`GET /x/timeline`](/api-reference/x/timeline) for the connected > account's home timeline tweets. > [card] Participant DMs > > Use [`GET /x/dm/{userId}/history`](/api-reference/x/dm-history) when the > workflow needs private direct-message conversation rows. > [card] Public mentions > > Use [`GET /x/users/{id}/mentions`](/api-reference/x/user-mentions) when you > need public mention timeline rows for a user. > [card] Account monitor events > > Use [`List events`](/api-reference/events/list) after account or keyword > monitors have captured replayable webhook events. > [card] Webhook delivery > > Use [`Webhooks`](/webhooks/overview) when notification-like activity should > push to your system without a poll. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. Session cookie authentication is also supported. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `notifications` | `object[]` | Array of notification objects. | | `notifications[].id` | `string` | Notification ID. | | `notifications[].type` | `string` | Notification type (for example mention, like, retweet). Omitted if unavailable. | | `notifications[].message` | `string` | Notification message text. Omitted if unavailable. | | `notifications[].timestamp` | `string` | ISO 8601 timestamp. Omitted if unavailable. | | `has_next_page` | `boolean` | Whether more notifications are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | > [!NOTE] > > **Related.** [Timeline](/api-reference/x/timeline), [DM History](/api-reference/x/dm-history), [User Mentions](/api-reference/x/user-mentions), and [Webhooks](/webhooks/overview). > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "notifications": [ { "id": "1234567890", "type": "like", "message": "elonmusk liked your tweet", "timestamp": "2025-01-15T12:00:00Z" } ], "has_next_page": true, "next_cursor": "DAACCgACGRElMJcAAA" } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Resolve t.co short links, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/resolve-links Resolve every t.co link you send in 1 call. Get the URL each X short link leads to, in the order sent. Pay 1 credit per resolved link. Unknown links are free. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/links/resolve` **1 credit per resolved link** · [All plans](https://xquik.com/en) from \$0.00012/credit Resolve links returns the URL each t.co link leads to. Send as many links in 1 call as the URL holds. The endpoint is `GET /api/v1/x/links/resolve`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/links/resolve \ --data-urlencode "urls=https://t.co/Xe1nm2pkSX,https://t.co/QQGjcE6KKq" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ urls: ["https://t.co/Xe1nm2pkSX", "https://t.co/QQGjcE6KKq"].join(","), }); const response = await fetch(`https://xquik.com/api/v1/x/links/resolve?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const { links, unprocessedUrls } = await response.json(); const targets = Object.fromEntries(links.map((link) => [link.url, link.resolvedUrl ?? null])); process.stdout.write(`${JSON.stringify({ targets, unprocessedUrls })}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/x/links/resolve", params={"urls": "https://t.co/Xe1nm2pkSX,https://t.co/QQGjcE6KKq"}, headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() targets = {link["url"]: link.get("resolvedUrl") for link in body["links"]} print(json.dumps({"targets": targets, "unprocessed_urls": body["unprocessedUrls"]})) ``` Use `GET /x/links/resolve` when you hold t.co links and need their targets. X shortens every link in a post to a t.co link. Xquik reads where each link points and never opens the target page. ## Resolve links in bulk Collect the t.co links from tweet text, bios, or your own logs. Send up to 100 in 1 call, separated by commas. `links` comes back in the order sent, with each link once. A link t.co does not have comes back without `resolvedUrl`. It costs nothing. Each resolved link costs 1 credit. A link X does not answer for in time comes back in `unprocessedUrls`. It costs nothing. Send it again in your next call. `resolvedUrl` is the address the link's author set. Xquik does not check it. Check a target before you open it. Tweets already carry their links' targets in `entities.urls[].expanded_url`. Read them with [Get tweet](/api-reference/x/get-tweet) when you hold the tweet ID. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `urls` | `string` | Yes | Links of the form `https://t.co/Xe1nm2pkSX`, separated by commas. Any other link returns `400 invalid_input`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `links` | `object[]` | Resolved links in the order sent. | | `links[].url` | `string` | The t.co link, as `https://t.co/`. | | `links[].resolvedUrl` | `string` | Target URL, as the link's author set it. Absent for a link t.co does not have. | | `unprocessedUrls` | `string[]` | Links not read, in the order sent. X did not answer for them in time, or available credits ran out. Send them again. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "links": [ { "url": "https://t.co/Xe1nm2pkSX", "resolvedUrl": "https://go.nasa.gov/3VcvAQn" }, { "url": "https://t.co/QQGjcE6KKq", "resolvedUrl": "https://twitter.com/NASA/status/2102882545427714266/photo/1" } ], "unprocessedUrls": [] } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Send urls as links of the form https://t.co/Xe1nm2pkSX, separated by commas." }` `urls` is missing, holds over 100 links, or holds a link in another form. Send each link as `https://t.co/` and its code. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy X answered none of the links in time, or Xquik is busy. Wait for the `Retry-After` header, then send the same links again. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## t.co link resolver API questions ### How do I resolve a t.co link with an API? Call `GET /x/links/resolve` with the link in `urls`. The response holds the target in `links[0].resolvedUrl`. ### How many t.co links can I resolve in 1 call? Send links separated by commas. Repeated links count once. ### Which link forms does the endpoint accept? Only `https://t.co/` followed by the link's code. Other sites, `http://` links, and links without `https://` return `400 invalid_input`. ### How much does resolving a t.co link cost? Each resolved link costs 1 credit. A link t.co does not have costs nothing. A link X does not answer for costs nothing. A refused or failed request costs nothing. ### What happens when X does not answer for a link? The call still returns the links that resolved. The unanswered links come back in `unprocessedUrls`. Send them again. ### Does Xquik visit the target page? No. Xquik reads where the t.co link points and stops there. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Get tweet](/api-reference/x/get-tweet) reads a tweet with its links' targets. [Search Tweets](/api-reference/x/search-tweets) finds tweets that share a link. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Export retweeter IDs, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/retweeter-ids Get the user IDs of the accounts that reposted a Twitter or X post, page by page, in X's order. Use them for fast syncs and set comparisons. 1 credit per ID. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/retweeter-ids` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per ID returned** · A post nobody reposted is free [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/tweets/2106061652617568263/retweeter-ids \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "2106061652617568263"; let pageCursor = ""; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch( `https://xquik.com/api/v1/x/tweets/${tweetId}/retweeter-ids${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }, ); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const userId of page.ids) { process.stdout.write(`${JSON.stringify({ tweet_id: tweetId, user_id: userId })}\n`); } if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "2106061652617568263" page_cursor = "" for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/retweeter-ids", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for user_id in page["ids"]: print(json.dumps({"tweet_id": tweet_id, "user_id": user_id})) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## IDs of a post's reposters Use `GET /x/tweets/{id}/retweeter-ids` for the user IDs of the accounts that reposted a post. IDs arrive in the order & pages of [Get retweeters](/api-reference/x/retweeters), without profiles. Pass the IDs to [`GET /x/users/batch`](/api-reference/x/batch-users) when you need profiles. Stop paging when `has_next_page` is `false`. A post nobody reposted returns an empty list for free. A deleted post returns 404, also free. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Tweet ID or URL-encoded post URL. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | User IDs per page, up to `10000`. A larger value gets the largest page. Defaults to `200`. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `ids` | `string[]` | User IDs of the reposters, in X's order. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ### 400 Invalid input The post ID is empty or invalid. A cursor X cannot read returns `invalid_cursor`. Start again without it. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. > [!NOTE] > > **Related.** [Get retweeters](/api-reference/x/retweeters) · [Check repost](/api-reference/x/tweet-repost-check) · [Batch users](/api-reference/x/batch-users) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "ids": ["9876543210"], "has_next_page": true, "next_cursor": "1878079982871151535" } ``` * **400** `{ "error": "invalid_tweet_id", "message": "Send a tweet ID or tweet URL, such as x.com/nasa/status/20." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # See who retweeted a tweet, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/retweeters See who retweeted a tweet with user profiles, follower counts, and verification fields. Includes cursors & exact X (Twitter) API examples for giveaway checks. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/retweeters` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) This route shows who retweeted one public tweet. The response returns one user profile per visible reposting account. The route is `GET /api/v1/x/tweets/{id}/retweeters`. A post X does not have returns `404 tweet_not_found`, as [Get tweet](/api-reference/x/get-tweet) does. Deleted, suspended-account & protected posts count as missing. A post without reposts returns an empty page. A 404 costs no credits. ```bash First page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/1893456789012345678/retweeters" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```bash Next page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/1893456789012345678/retweeters \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1893456789012345678"; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/retweeters`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const retweeterRows = data.users.map((user) => ({ source_tweet_id: tweetId, retweeter_id: user.id, username: user.username, display_name: user.name, follower_count: user.followers ?? null, following_count: user.following ?? null, verified: user.verified ?? false, verified_type: user.verifiedType ?? null, profile_image_url: user.profilePicture ?? null, })); const nextCursor = data.has_next_page ? data.next_cursor : null; const checkpoint = { source_tweet_id: tweetId, next_cursor: nextCursor }; for (const row of retweeterRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } process.stdout.write(`${JSON.stringify({ checkpoint })}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1893456789012345678" response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/retweeters", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() next_cursor = data["next_cursor"] if data["has_next_page"] else None retweeter_rows = [ { "source_tweet_id": tweet_id, "retweeter_id": user["id"], "username": user["username"], "display_name": user["name"], "follower_count": user.get("followers"), "following_count": user.get("following"), "verified": user.get("verified", False), "verified_type": user.get("verifiedType"), "profile_image_url": user.get("profilePicture"), } for user in data["users"] ] checkpoint = {"source_tweet_id": tweet_id, "next_cursor": next_cursor} for row in retweeter_rows: print(json.dumps(row)) print(json.dumps({"checkpoint": checkpoint})) ``` The Node.js and Python snippets write JSON Lines retweeter rows plus a separate checkpoint. They do not write raw response pages. Store each mapped row and the latest `next_cursor`. An import, giveaway verifier, CRM sync, or agent job can then resume. It can resume from the last completed page without duplicate rows. ## Retweet timestamps Set `includeRetweetTimestamp=true` to add each repost's time. The option makes the call take longer. ```bash Retweet timestamps theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/1893456789012345678/retweeters \ --data-urlencode "includeRetweetTimestamp=true" \ -H "x-api-key: xq_your_api_key_here" ``` Read `users[].retweetedAt` as a UTC ISO 8601 timestamp or `null`. `null` means the lookup could not establish the matching repost time. The profile remains in the response when that lookup fails or expires. Neither the account creation date nor the original post date replaces it. `createdAt` continues to describe the account's creation date. The option defaults to `false`. Ordinary retweeter responses omit `retweetedAt`. Keep it enabled on later pages when exporting timestamps. The Engagement Scraper accepts the same option for `retweeters` results. Its dataset rows use `retweetedAt`. ## Direct retweeter handoff Use `GET /api/v1/x/tweets/{id}/retweeters` when a workflow needs one row per account. Each row is an account that retweeted or reposted a tweet. Use these rows for giveaway checks, CRM imports, audience reviews, or follow-up jobs. Store `source_tweet_id`, `retweeter_id`, `username`, `display_name`, `follower_count`, `following_count`, `verified`, `verified_type`, and `profile_image_url`. Store `next_cursor` as a separate checkpoint. > [card] Retweeter rows > > Store `users[]` as the profile rows for accounts that reposted the source > tweet. > [card] Stable upserts > > Store `users[].id` as `retweeter_id` with `source_tweet_id` for idempotent > imports and giveaway checks. > [card] Readable labels > > Store `users[].username` and `users[].name` for handles, labels, and review > queues. > [card] Profile enrichment > > Store `description`, `location`, `url`, and `profilePicture` when returned > for CRM and warehouse enrichment. > [card] Audience signals > > Store `followers`, `following`, `verified`, and `verifiedType` for reach > scoring, filters, and outreach priority. > [card] Approved contact > > Use DM endpoints only after a user-approved message flow. The write > response tells you whether X delivered the DM. > [card] Next page > > Store `has_next_page` and `next_cursor`. Then pass `next_cursor` back as `cursor` > only when `has_next_page` is true. > [card] Credit-limited pages > > Use `users.length`, not a requested page size, for row counts. Low balances > can return fewer rows. Direct retweeter reads cost 1 credit per user returned. Low credit balances can return fewer users than a full page. Zero affordable results return `402 insufficient_credits`. ## Retweeter questions ### Can I see who retweeted my tweet? Yes, for profiles visible to this endpoint. Pass the tweet's numeric ID. The response lists handles, names, follower counts, and verification fields. Continue pagination only when the response confirms another page. [X documents this read intent as Get Reposted by.](https://docs.x.com/x-api/posts/get-reposted-by) ### Why can't I see every retweeter? X controls which profiles each request exposes. Deleted, protected, blocked, or withheld accounts may not appear. X may also omit accounts it cannot return. Pagination and credit limits can shorten one page. A missing profile cannot confirm zero repost activity. ### Do retweeters include quote tweets? No. A standard repost shares the source tweet without added commentary. [The quote-tweets endpoint returns added commentary.](/api-reference/x/tweet-quotes) [Use the tweet-replies endpoint to read the conversation.](/api-reference/x/tweet-replies) ### How do I export retweeters? The Node.js and Python examples write one JSON Lines row per user. Store the source tweet ID beside each profile. Use `next_cursor` to resume an interrupted export. Use `toolType=repost_extractor` for a saved CSV, JSON, or XLSX job. ### How can I analyze retweeters? Compare complete snapshots with numeric user IDs. Record the collection time beside follower and verification fields. A repost does not prove endorsement or a business relationship. Report only returned profile attributes. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from `next_cursor` in a previous response. Omit it on the initial request. Pass it only when `has_next_page` is true. A cursor X refuses or that expired returns a free `400 invalid_cursor`. Start again without it. | | `pageSize` | `integer` | No | Profiles per page, up to `10000`. A larger value gets the largest page. Defaults to `200`. | | `includeRetweetTimestamp` | `boolean` | No | Add each repost's time as `retweetedAt`, a UTC timestamp or `null`. The call takes longer. Unavailable timestamps do not remove profile rows. Default `false`. | | `enrichProfiles` | `boolean` | No | Set `true` to add each row's full profile, as `GET /x/users/{id}` returns it. Pages take several seconds longer. The price per row stays the same. Default `false`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which tweet engagement endpoint? > [card] Retweeters > > Use `GET /x/tweets/{id}/retweeters` for user profiles that reposted one > source tweet. > [card] Tweet likers > > Use [`GET /x/tweets/{id}/favoriters`](/api-reference/x/favoriters) for user > profiles that liked one source tweet. > [card] Quote tweets > > Use [`GET /x/tweets/{id}/quotes`](/api-reference/x/tweet-quotes) when you > need tweet rows that quote the source tweet. > [card] Tweet replies > > Use [`GET /x/tweets/{id}/replies`](/api-reference/x/tweet-replies) when you > need reply tweet rows under the source tweet. > [card] Saved exports > > Use [`Create extraction`](/api-reference/extractions/create) with > `toolType=repost_extractor` for a saved job or CSV, JSON, or XLSX > export. > [card] DM handoff > > Use [`Send DM`](/api-reference/x-write/send-dm) only after your workflow has > a user-approved outreach step. ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK With `enrichProfiles=true`, each row carries the full profile. The `x-xquik-profile-enrichment` header then counts the rows that have it, as in `enriched=180; requested=200`. A row without it keeps its list fields. | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of users who retweeted. | | `users[].id` | `string` | X (Twitter) user ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. | | `users[].followers` | `number` | This value records the follower count. | | `users[].following` | `number` | Following count. | | `users[].verified` | `boolean` | Verified status. | | `users[].profilePicture` | `string` | Profile image URL. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. | | `users[].accountBasedIn` | `object \| null` | Country or region X shows for the account, with `value`, `level` & `observedAt`. X infers it from account access. It states no nationality or exact location. `null` when X shows none. Present with `enrichProfiles=true`, unless it's not available yet. | | `users[].accountBasedInUnavailable` | `boolean` | `true` when this row's `accountBasedIn` is not available yet. Retry later to get it. Omitted otherwise. | | `users[].createdAt` | `string` | Account creation date (ISO 8601). | | `users[].statusesCount` | `number` | This value records the total tweet count. X may omit it. | | `users[].coverPicture` | `string` | This value contains the cover image URL. X may omit it. | | `users[].mediaCount` | `number` | This value records the media tweet count. X may omit it. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].email` | `string` | First email the account publishes on its profile, lowercased. Omitted when it publishes none. | | `users[].contactInfo` | `object` | Emails, phone numbers & links the account publishes on its own profile. Each email has `value`, `domain` & `source`. Each phone has `value` & `source`. Each link has `url`, `network` & `source`. `source` is the profile field that holds it, such as `bio` or `url`. `writtenAs` keeps the account's own spelling of a spelled-out email or number. Omitted when the profile publishes none. | | `users[].favouritesCount` | `number` | This value records the liked tweet count. X may omit it. | | `users[].hasCustomTimelines` | `boolean` | X sets this flag for accounts with custom timelines. X may omit it. | | `users[].isTranslator` | `boolean` | X sets this flag for translator accounts. X may omit it. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | X sets this flag for sensitive accounts. X may omit it. | | `users[].pinnedTweetIds` | `string[]` | This array contains pinned tweet IDs. Omitted if none. | | `users[].isAutomated` | `boolean` | X sets this flag for automated accounts. X may omit it. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | X sets this flag when it cannot return the account. | | `users[].unavailableReason` | `string` | X may give a reason for a missing account. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Use this object for bio text and linked profile entities. X may omit it. | | `users[].isBlueVerified` | `boolean` | X sets this flag for X Premium verification. X may omit it. | | `users[].isVerified` | `boolean` | Use this field for normalized verification status. X may omit it. | | `users[].profileBannerUrl` | `string` | This value contains the profile banner URL. X may omit it. | | `users[].protected` | `boolean` | X sets this flag for protected accounts. X may omit it. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | ### 400 Invalid input or cursor `{ "error": "invalid_cursor", "message": "Cursor invalid or expired. Start again without cursor, then use next_cursor." }` A cursor X can't read returns `invalid_cursor`. Start again without `cursor`, then use `next_cursor`. Other invalid input returns `invalid_input`. Both answers are free. ### 401 Unauthenticated Anonymous requests receive `WWW-Authenticate: Bearer`. This is not a Payment challenge. ### 402 Payment required Account keys receive account options. A guest wallet receives a checkout option. Confirm any payment action. > [!NOTE] > > **Related.** [Tweet favoriters](/api-reference/x/favoriters) · [Quote tweets](/api-reference/x/tweet-quotes) · [Tweet replies](/api-reference/x/tweet-replies) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "34743251", "username": "SpaceX", "name": "SpaceX", "followers": 41936873, "following": 127 } ], "has_next_page": false, "next_cursor": "" } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Search typeahead suggestions, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/search-autocomplete Get the accounts, topics, hashtags, and cashtags X suggests for a partial search query. Build typeahead, keyword research, and ticker lookup. 1 credit each. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/search/autocomplete` > [!NOTE] > > `limit` is an upper bound for paid authenticated calls. When remaining credits cannot cover every suggestion, Xquik returns fewer. If zero suggestions are affordable, it returns `402 insufficient_credits`. **1 credit per suggestion returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/search/autocomplete \ --data-urlencode "q=nasa" \ --data-urlencode "limit=10" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const query = "nasa"; const params = new URLSearchParams({ q: query, limit: "10" }); const response = await fetch(`https://xquik.com/api/v1/x/search/autocomplete?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const suggestionRows = [ ...data.users.map((user) => ({ type: "user", text: `@${user.username}`, label: user.name })), ...data.topics.map((topic) => ({ type: "topic", text: topic.topic, label: topic.topic })), ...data.hashtags.map((tag) => ({ type: "hashtag", text: tag.hashtag, label: tag.hashtag })), ...data.cashtags.map((asset) => ({ type: "cashtag", text: `$${asset.ticker}`, label: asset.name ?? asset.ticker, })), ].map((row, index) => ({ search_query: data.query, result_rank: index + 1, ...row })); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests query = "nasa" response = requests.get( "https://xquik.com/api/v1/x/search/autocomplete", params={"q": query, "limit": 10}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() suggestions = ( [("user", f"@{user['username']}", user["name"]) for user in data["users"]] + [("topic", topic["topic"], topic["topic"]) for topic in data["topics"]] + [("hashtag", tag["hashtag"], tag["hashtag"]) for tag in data["hashtags"]] + [ ("cashtag", f"${asset['ticker']}", asset.get("name", asset["ticker"])) for asset in data["cashtags"] ] ) suggestion_rows = [ { "search_query": data["query"], "result_rank": index + 1, "type": kind, "text": text, "label": label, } for index, (kind, text, label) in enumerate(suggestions) ] ``` The Node.js and Python snippets build one row per suggestion. Each row keeps the query, suggestion type, search text, and display label. Store `suggestionRows` or `suggestion_rows` beside the query that produced them. ## Build a search box or keyword list Use `GET /x/search/autocomplete` to read what X suggests while someone types. One call returns one answer. This route has no cursor and no next page. > [card] Typeahead > > Send the text typed so far as `q`. Show `users`, `topics`, `hashtags`, > and `cashtags` as separate groups. > [card] Accounts only > > Set `types=users` to resolve a partial name or handle. Follow up with > [Get user](/api-reference/x/twitter-profile-lookup) for the full profile. > [card] Hashtags > > Start `q` with `#`, or set `types=hashtags`. Each suggestion keeps its > `#`. > [card] Stocks and tokens > > Start `q` with `$`, or set `types=cashtags`. Each cashtag carries `price`, > `marketCap`, and `dailyChangePercent`. > [card] Keyword research > > Store `topics` for each seed term. Pass a topic to > [Search tweets](/api-reference/x/search-tweets) to read matching posts. > [card] Credit control > > Set `limit` to cap the suggestions you pay for. A query with no > suggestions costs 0 credits. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Text typed so far. Start it with `#` for hashtags or `$` for cashtags. A `#` query returns hashtags & the accounts X (Twitter) suggests for it. Also read as `query`. | | `types` | `string` | No | Comma-separated suggestion types. Use `users`, `topics`, `hashtags`, or `cashtags`. Omit it for all 4. With only `hashtags` or only `cashtags`, you can leave out the `#` or `$`. | | `limit` | `integer` | No | Most suggestions to return, from `1` to `100`. Default `20`. Accounts fill the limit first, then topics, hashtags, and cashtags. Also read as `pageSize`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK Every list keeps the order X returns. X may rank suggestions differently per request, so 2 calls can differ. A list is empty when X suggests nothing of its type. It is also empty when `types` leaves it out. | Field | Type | Description | | - | - | - | | `query` | `string` | The query you sent, trimmed. | | `users` | `object[]` | Suggested accounts. | | `users[].id` | `string` | X (Twitter) user ID. | | `users[].username` | `string` | X (Twitter) username without the `@`. | | `users[].name` | `string` | Display name. | | `users[].verified` | `boolean` | Whether X shows any verification badge. | | `users[].isBlueVerified` | `boolean` | Whether X shows a blue verification badge. | | `users[].isVerified` | `boolean` | Whether the account holds X's legacy verification. | | `users[].verifiedType` | `string` | Verification category, such as `Government` or `Business`. Omitted when X names none. | | `users[].protected` | `boolean` | Whether the account protects its posts. | | `users[].location` | `string` | Public profile location. Omitted when empty. | | `users[].profilePicture` | `string` | Profile image URL. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].badges` | `object[]` | Affiliation badges X shows beside the name. | | `users[].badges[].badgeType` | `string` | Kind of badge, such as `BusinessLabel`. | | `users[].badges[].badgeUrl` | `string` | Badge image URL. | | `users[].badges[].description` | `string` | Name of the affiliated account. | | `users[].isPersonaMediaGenable` | `boolean` | X's flag for whether media can be generated from this account's persona. | | `users[].score` | `number` | X's rounded relevance score for the suggestion. | | `users[].tokens` | `string[]` | Normalized text tokens X matches the suggestion by. | | `users[].inline` | `boolean` | X's inline flag for the suggestion. | | `topics` | `object[]` | Suggested search phrases that are not hashtags. Each has `score`, `tokens`, and `inline`, as described for users. | | `topics[].topic` | `string` | Suggested search phrase. | | `hashtags` | `object[]` | Suggested hashtags. Each has `score`, `tokens`, and `inline`, as described for users. | | `hashtags[].hashtag` | `string` | Suggested hashtag, with its `#`. | | `cashtags` | `object[]` | Suggested stocks and crypto tokens. | | `cashtags[].ticker` | `string` | Ticker symbol without the `$`. | | `cashtags[].name` | `string` | Company or token name. | | `cashtags[].smartTag` | `string` | X's tag for the asset. `$TICKER` for a stock, `chain:contract` for a token. | | `cashtags[].currency` | `string` | Currency of `price` and `marketCap`. | | `cashtags[].price` | `string` | Latest price as decimal text, which keeps every digit. | | `cashtags[].marketCap` | `string` | Market capitalization as decimal text. | | `cashtags[].dailyChangePercent` | `number` | Price change over the last 24 hours, in percent. | | `cashtags[].logoUrl` | `string` | Logo image URL. | | `cashtags[].exchangeShortName` | `string` | Stock exchange. Stocks only. | | `cashtags[].contractAddress` | `string` | Token contract address. Tokens only. | | `cashtags[].chainLogoUrl` | `string` | Logo of the token's chain. Tokens only. | | `count` | `number` | Suggestions returned across all 4 lists. Each costs 1 credit. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "query": "$tsla", "users": [], "topics": [{ "topic": "$tsla", "score": 0, "tokens": [], "inline": false }], "hashtags": [], "cashtags": [ { "ticker": "TSLA", "name": "Tesla Inc", "smartTag": "$TSLA", "currency": "USD", "price": "370.589999999", "marketCap": "1463662787286.778808593", "dailyChangePercent": 4.6539, "logoUrl": "https://abs.twimg.com/finance/v1/stock/TSLA.png", "exchangeShortName": "NASDAQ" } ], "count": 2 } ``` Example values are illustrative. Live responses reflect current X (Twitter) data. ### 400 Invalid request `q` is missing or blank. Send the text typed so far. `{ "error": "invalid_params", "message": "Send types as users, topics, hashtags or cashtags, separated by commas.", "parameter": "types" }` `types` names an unknown suggestion type. Use `users`, `topics`, `hashtags`, or `cashtags`. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Search autocomplete API questions ### How do I get Twitter search suggestions programmatically? Call `GET /x/search/autocomplete` with the text typed so far in `q`. Read `users`, `topics`, `hashtags`, and `cashtags` from the response. ### How do I get hashtag suggestions? Start `q` with `#`, such as `#nas`. You can also send `types=hashtags` with a plain word. Each suggestion in `hashtags` keeps its `#`. ### How do I look up a stock or crypto ticker? Start `q` with `$`, such as `$tsla`, and read `cashtags`. Use `smartTag` to tell a stock from tokens that share its ticker. ### How much does a search autocomplete request cost? Each returned suggestion costs 1 credit. `count` states the total. A query with no suggestions costs 0 credits. Errors cost 0 credits. ### Does the response depend on my X account? No. The response holds public suggestion data only. It needs no connected X account. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Search users](/api-reference/x/search-users) for full profiles with filters. [Search tweets](/api-reference/x/search-tweets) to read posts for a suggestion. [Get trends](/api-reference/x/trends) for trending topics by region. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "missing_query", "message": "Search query required. Use q." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Search job listings & salary, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/search-jobs Search public X job listings by keyword, location, seniority, work type, and company. Each job returns its title, salary, and apply link. 1 credit per job. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/jobs/search` Search the public job listings on X by keyword. Narrow them by location, work type, seniority, employment type, or company. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. When remaining credits cannot cover the full page, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per job returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/jobs/search?q=engineer&locationType=remote&seniority=senior" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const query = "engineer"; const params = new URLSearchParams({ q: query, locationType: "remote", seniority: "senior,lead", }); const response = await fetch(`https://xquik.com/api/v1/x/jobs/search?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const nextCursor = data.has_next_page ? data.next_cursor : null; const jobRows = data.jobs.map((job) => ({ search_query: query, job_id: job.id, title: job.title ?? null, job_url: job.url, apply_url: job.applyUrl ?? null, location: job.location ?? null, salary: job.formattedSalary ?? null, employer: job.company?.name ?? job.account?.name ?? null, next_cursor: nextCursor, })); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests query = "engineer" response = requests.get( "https://xquik.com/api/v1/x/jobs/search", params={"q": query, "locationType": "remote", "seniority": "senior,lead"}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() next_cursor = data["next_cursor"] if data["has_next_page"] else None job_rows = [ { "search_query": query, "job_id": job["id"], "title": job.get("title"), "job_url": job["url"], "apply_url": job.get("applyUrl"), "location": job.get("location"), "salary": job.get("formattedSalary"), "employer": (job.get("company") or job.get("account") or {}).get("name"), "next_cursor": next_cursor, } for job in data["jobs"] ] ``` The Node.js and Python snippets build 1 row per job. Store the rows with the cursor before you request the next page. ## Narrow a job search Start with a keyword in `q`, such as a job title or a skill. Add 1 filter at a time and check the results after each change. * `location` takes a city, region, or country as text. * `locationId` takes an exact place from [job locations](/api-reference/x/job-locations). * `locationType` keeps onsite, remote, or hybrid jobs. * `seniority` keeps levels from intern to executive. * `employmentType` keeps full-time, part-time, or contract jobs. * `company` keeps the jobs of 1 employer. The 3 list filters take comma lists. They ignore case and accept spaces, hyphens, or underscores between words. `Full Time`, `full-time`, and `full_time` all work. An unknown value returns `400 invalid_job_filter`. Its message names the values the filter takes. ## Page through job listings Each page returns `has_next_page` and `next_cursor`. Send `next_cursor` back as `cursor` with the same query and filters. Stop when `has_next_page` is `false`. A cursor X refuses or that expired returns `400 invalid_cursor`, which is free. Start again without `cursor`, then use `next_cursor`. A job that closed is left out of the page and costs nothing. A page can therefore hold fewer jobs than `pageSize`. Use the job `id` as the key in your store. Overlapping searches then add no duplicates. ## Get the full description Search returns the listing summary. Send a job's `id` to [get 1 job listing](/api-reference/x/get-job). That listing adds the full description, work type, seniority, and team. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Keyword, such as a job title or skill. Also read as `query`. | | `location` | `string` | No | City, region, or country as text, such as `Berlin`. | | `locationId` | `string` | No | Location ID from [job locations](/api-reference/x/job-locations). It replaces `location` when you send both. | | `locationType` | `string` | No | Where the work happens. Comma list of `onsite`, `remote`, and `hybrid`. | | `seniority` | `string` | No | Comma list of `intern`, `entry_level`, `junior`, `mid_level`, `senior`, `lead`, `manager`, and `executive`. | | `employmentType` | `string` | No | Comma list of `full_time`, `full_time_contract`, `part_time`, and `contract_to_hire`. | | `company` | `string` | No | Company name to match. | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `pageSize` | `integer` | No | Jobs per page. Accepts `1-100`. Defaults to `20`. Also read as `limit`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK X leaves out a field that a job lacks. Only `id` and `url` are always present. | Field | Type | Description | | - | - | - | | `jobs` | `object[]` | Array of matching job listings. | | `jobs[].id` | `string` | Job ID. | | `jobs[].title` | `string` | Job title. | | `jobs[].url` | `string` | The job page on X. | | `jobs[].applyUrl` | `string` | Where applicants apply, off X. | | `jobs[].location` | `string` | Location as the employer wrote it. | | `jobs[].formattedSalary` | `string` | Salary as X shows it, such as `Starting at $225K`. | | `jobs[].salaryMin` | `number` | Lowest salary, in `salaryCurrencyCode` per `salaryInterval`. | | `jobs[].salaryMax` | `number` | Highest salary, in `salaryCurrencyCode` per `salaryInterval`. | | `jobs[].salaryCurrencyCode` | `string` | ISO 4217 currency code of the salary. | | `jobs[].salaryInterval` | `string` | The salary's pay period is `annually` or `hourly`. | | `jobs[].company` | `object` | Company profile with `id`, `name`, and `logoUrl`. Present on jobs X imported from a job board. | | `jobs[].account` | `object` | The X account that posted the job. It has `id`, `username`, `name`, `verified`, `verifiedType`, `profilePicture`, `profilePictureOriginal`, and `profileImageShape`. A job has none when X imported it from a job board. It also has none when X no longer shows the account. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "jobs": [ { "id": "1899202395210649861", "title": "Engineer", "url": "https://x.com/i/jobs/1899202395210649861", "applyUrl": "https://xquik.com/example", "location": "United States", "formattedSalary": "Starting at $225K", "salaryMin": 225000, "salaryCurrencyCode": "USD", "salaryInterval": "annually", "account": { "id": "1812126202804711425", "username": "commonwarexyz", "name": "commonware", "verified": true, "verifiedType": "Business" } } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Missing query, unknown filter, or invalid cursor A request without `q` returns `missing_query`. A cursor X cannot read returns `invalid_cursor`. `{ "error": "invalid_cursor", "message": "Cursor invalid or expired. Start again without cursor, then use next_cursor." }` Start again without `cursor`. All 3 answers are free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Next steps.** [Get 1 job listing](/api-reference/x/get-job) for the full description. [Search users](/api-reference/x/search-users) to find the hiring accounts. ## Response examples * **400** `{ "error": "invalid_job_filter", "message": "Unknown locationType \"moon\". Use onsite, remote or hybrid." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Search lists by keyword, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/search-lists Find public X (Twitter) Lists by keyword. Get each List's name, description, member and follower counts, banner, and owner profile. 1 credit per List. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/lists/search` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. When remaining credits cannot cover the full page, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per List returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/lists/search \ --data-urlencode "q=space news" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const query = "space news"; const params = new URLSearchParams({ q: query }); const response = await fetch(`https://xquik.com/api/v1/x/lists/search?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const nextCursor = data.has_next_page ? data.next_cursor : null; const listRows = data.lists.map((list, index) => ({ search_query: query, result_rank: index + 1, list_id: list.id, list_name: list.name, member_count: list.memberCount ?? null, follower_count: list.subscriberCount ?? null, owner_username: list.owner?.username ?? null, list_url: list.url ?? null, next_cursor: nextCursor, })); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests query = "space news" response = requests.get( "https://xquik.com/api/v1/x/lists/search", params={"q": query}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() next_cursor = data["next_cursor"] if data["has_next_page"] else None list_rows = [ { "search_query": query, "result_rank": index + 1, "list_id": item["id"], "list_name": item["name"], "member_count": item.get("memberCount"), "follower_count": item.get("subscriberCount"), "owner_username": (item.get("owner") or {}).get("username"), "list_url": item.get("url"), "next_cursor": next_cursor, } for index, item in enumerate(data["lists"]) ] ``` The Node.js and Python snippets build 1 row per List. Store `listRows` or `list_rows` with `nextCursor` or `next_cursor` before requesting the next page. ## Find Lists before you read them Use `GET /x/lists/search` when you know a topic but not a List ID. It returns the public Lists X finds for your keywords, in X's order. X may rank the Lists differently per request. Each List carries the `id` that [List members](/api-reference/x/list-members), [List followers](/api-reference/x/list-followers) and [List tweets](/api-reference/x/list-tweets) take. Compare `memberCount`, `subscriberCount` and the owner profile to pick a List. A List with many followers is often a well-kept source. Store the List `id`, since a List name can change. An empty `lists` with `has_next_page: false` means X has no more Lists for your keywords. It costs nothing. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Keywords to find Lists by, such as a topic or a List name. Also read as `query`. | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `pageSize` | `integer` | No | Lists per page. Accepts `1-100`. Defaults to `20`. Also read as `limit`, `count`, or `max_results`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `lists` | `object[]` | Public Lists that match your keywords. | | `lists[].id` | `string` | Numeric List ID. | | `lists[].name` | `string` | List name. | | `lists[].description` | `string` | List description. Empty when the owner wrote none. | | `lists[].memberCount` | `number` | Accounts on the List. | | `lists[].subscriberCount` | `number` | Accounts that follow the List. | | `lists[].owner` | `object` | Public profile of the List's owner, with the fields of [Get User](/api-reference/x/twitter-profile-lookup). | | `lists[].url` | `string` | List page on x.com. | | `lists[].createdAt` | `string` | When the owner made the List (ISO 8601). | | `lists[].bannerUrl` | `string` | URL of the banner the owner uploaded. Omitted when the owner uploaded none. | | `lists[].customBanner` | `object` | Banner the owner uploaded, with `url`, `width`, `height`, `salientRect`, `mediaId` & `mediaKey`. Its dominant colors are in `palette`. `customBanner` is omitted when there is none. | | `lists[].defaultBanner` | `object` | Banner X shows when the owner uploaded none, with `url`, `width`, `height` & `salientRect`. 2 calls can return different default banners. | | `lists[].facepileUrls` | `string[]` | Avatar URLs of a few List members, which X may pick per request. | | `lists[].membersContext` | `string` | Member count as X words it, such as `35 members`. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "lists": [ { "id": "1284239399492833280", "name": "#Mars2020 Science & Tech", "description": "Official accounts on the Perseverance Mars rover mission.", "memberCount": 35, "subscriberCount": 76, "owner": { "id": "1232783237623119872", "username": "NASAPersevere", "name": "NASA's Perseverance Mars Rover", "followers": 2887286, "verified": true }, "url": "https://x.com/i/lists/1284239399492833280", "createdAt": "2020-07-17T21:31:47.000Z", "membersContext": "35 members" } ], "has_next_page": true, "next_cursor": "DAAHCgABHTwHK3H..." } ``` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded The Xquik tier limit blocked the request. Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## X (Twitter) List search questions ### How do I search X (Twitter) Lists by keyword? Call `GET /x/lists/search` with your keywords in `q`. Each result is a public List with its ID, counts and owner. ### How much does a List search cost? Each returned List costs 1 credit. An empty page costs nothing. Lower `pageSize` to return fewer Lists. ### Does List search return private Lists? No. It returns only public Lists. Private Lists stay out of every answer. ### Why do 2 searches return Lists in another order? X may rank the Lists differently per request. Store each List `id` and dedupe by it when you merge pages or runs. ### How do I get the members of a List I found? Pass the List `id` to [List members](/api-reference/x/list-members). Use [List tweets](/api-reference/x/list-tweets) for its timeline. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [List members](/api-reference/x/list-members) reads who is on a List, and [List tweets](/api-reference/x/list-tweets) reads its timeline. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "missing_query", "message": "Search query required. Use q." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Search places & place IDs, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/search-places Find Twitter or X places by name. Get each place ID, full name, country, type, center, and outline, then filter tweet search by place. 1 credit per place. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/places/search` **1 credit per place returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/places/search \ --data-urlencode "q=istanbul" \ --data-urlencode "limit=5" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ q: "istanbul", limit: "5" }); const response = await fetch(`https://xquik.com/api/v1/x/places/search?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const placeRows = data.places.map((place) => ({ place_id: place.id, name: place.name, full_name: place.fullName, country_code: place.countryCode, place_type: place.placeType, })); for (const row of placeRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/x/places/search", params={"q": "istanbul", "limit": 5}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() place_rows = [ { "place_id": place["id"], "name": place["name"], "full_name": place["fullName"], "country_code": place["countryCode"], "place_type": place["placeType"], } for place in data["places"] ] for row in place_rows: print(json.dumps(row)) ``` Use `GET /x/places/search` to find places on X by name. Each place carries the `id` that [Search tweets](/api-reference/x/search-tweets) takes as `place`. Each returned place costs 1 credit. `limit` lowers the cost. An empty result costs nothing. ## Search tweets from a place Search for the place by name, then read `id` from the place you want. Send that `id` as `place` to `GET /x/tweets/search` to get posts tagged there. `fullName`, `country`, and `placeType` tell places with the same name apart. `containedWithin` lists the larger places around each place. X ranks the places. Their order can differ between requests. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Place name to search for, such as `istanbul`. Also read as `query`. | | `limit` | `integer` | No | Maximum places to return, starting at `1`. Omit it for every place X finds. Your credit balance can return fewer. Also read as `pageSize`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send a full Xquik account API key. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `places` | `object[]` | Places X found for the name, in X's order. | | `places[].id` | `string` | Place ID. Pass it as `place` to `GET /x/tweets/search`. | | `places[].name` | `string` | Short name of the place. | | `places[].fullName` | `string \| null` | Name with the region or country around the place. | | `places[].country` | `string \| null` | Country the place lies in. | | `places[].countryCode` | `string \| null` | 2-letter code of that country. | | `places[].placeType` | `string \| null` | X's kind of place, such as `city`, `admin`, `neighborhood`, `poi`, or `country`. | | `places[].url` | `string \| null` | X's own reference URL for the place. | | `places[].centroid` | `number[] \| null` | Center of the place. Longitude, then latitude. | | `places[].boundingBox` | `object \| null` | Outline of the place as GeoJSON, with `type` and `coordinates`. Each point holds longitude, then latitude. | | `places[].attributes` | `object` | Extra details X attaches to some places. Often empty. | | `places[].containedWithin` | `object[]` | Larger places this place lies in. Each has the same fields, without `containedWithin`. | | `count` | `number` | Places returned and charged. | | `total` | `number` | Places X found, before `limit`. | | `message` | `string` | What to send instead. Present only when X finds no place. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "places": [ { "id": "5e02a0f0d91c76d2", "name": "İstanbul", "fullName": "İstanbul, Türkiye", "country": "Turkey", "countryCode": "TR", "placeType": "city", "url": "https://api.twitter.com/1.1/geo/id/5e02a0f0d91c76d2.json", "centroid": [28.84318392941324, 41.054196399999995], "boundingBox": { "type": "Polygon", "coordinates": [ [ [28.6321043, 40.8027337], [28.6321043, 41.2399073], [29.3783413, 41.2399073], [29.3783413, 40.8027337] ] ] }, "attributes": {}, "containedWithin": [] } ], "count": 1, "total": 1 } ``` A name X finds no place for returns an empty list and a `message`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "places": [], "count": 0, "total": 0, "message": "X found no place for that text. Try a city or country name." } ``` ### 400 Missing query Send the place name as `q`. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded The Xquik tier limit blocked the request. Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Twitter place search API questions ### How do I find a Twitter place ID? Call `GET /x/places/search` with the place name as `q`. Read `id` from the place you want. ### How do I search tweets from a place? Send the place `id` as `place` to `GET /x/tweets/search`. Add `q` to keep only posts that match your words. ### How much does a place search cost? Each returned place costs 1 credit. An empty result costs nothing. Add `limit` to return fewer places. ### Why does the order of places change? X ranks the places for each request. Match on `id`, not on position. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Search tweets](/api-reference/x/search-tweets) takes a place `id` as `place`. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "missing_query", "message": "Search query required. Use q." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Search spaces by keyword, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/search-spaces Find public X (Twitter) Spaces by keyword, host, or topic. Get each Space's title, state, times, listener counts, hosts, and speakers. 1 credit per Space. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/spaces/search` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. When remaining credits cannot cover the full page, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per Space returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/spaces/search \ --data-urlencode "q=from:solana" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const query = "from:solana"; const params = new URLSearchParams({ q: query }); const response = await fetch(`https://xquik.com/api/v1/x/spaces/search?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const nextCursor = data.has_next_page ? data.next_cursor : null; const spaceRows = data.spaces.map((space, index) => ({ search_query: query, result_rank: index + 1, space_id: space.id, space_title: space.title ?? null, space_state: space.state ?? null, started_at: space.startedAt ?? null, live_listeners: space.totalLiveListeners ?? null, host_usernames: space.admins.map((host) => host.username), next_cursor: nextCursor, })); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests query = "from:solana" response = requests.get( "https://xquik.com/api/v1/x/spaces/search", params={"q": query}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() next_cursor = data["next_cursor"] if data["has_next_page"] else None space_rows = [ { "search_query": query, "result_rank": index + 1, "space_id": item["id"], "space_title": item.get("title"), "space_state": item.get("state"), "started_at": item.get("startedAt"), "live_listeners": item.get("totalLiveListeners"), "host_usernames": [host["username"] for host in item["admins"]], "next_cursor": next_cursor, } for index, item in enumerate(data["spaces"]) ] ``` The Node.js and Python snippets build 1 row per Space. Store `spaceRows` or `space_rows` with `nextCursor` or `next_cursor` before requesting the next page. ## Find Spaces by keyword, host, or topic Use `GET /x/spaces/search` when you know a topic or host but not a Space ID. `queryType` picks how it finds Spaces. * `Latest` and `Top` return public Spaces about your query. A Space can be live, scheduled, or ended. * `Live` lists Spaces on air now and `Upcoming` lists scheduled ones. Both match words in Space titles. For `Latest` and `Top`, each page returns up to `pageSize` Spaces, 20 by default. A page can hold fewer Spaces than `pageSize`. Send `pageSize=100` to finish a search fastest. For `Live` and `Upcoming`, each page returns up to `pageSize` Spaces, in X's order. Every row is the same full Space that Get Space returns. Follow `next_cursor` while `has_next_page` is `true`. Each Space carries the `id` that [Get Space](/api-reference/x/get-space) takes. Store the `id`, since a title can change. Use `state` to tell a live Space from a scheduled or ended one. Results leave out a Space X (Twitter) limits to subscribers or a community. An empty `spaces` with `has_next_page: false` means X has no more Spaces for your query. It costs nothing. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Words, hashtags, or X (Twitter) search operators, such as `from:solana`. `Live` and `Upcoming` match title words only, without operators. Also accepted as `query`. | | `queryType` | `string` | No | `Latest` finds Spaces in the newest posts. `Top` finds them in the most engaging posts. `Live` lists Spaces on air now. `Upcoming` lists scheduled ones. Any case works. Also read as `result_type`, `sort_order`, `type`, `search_type`, `product`, `category` or `section`. | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `pageSize` | `integer` | No | The most Spaces a page returns, 20 by default. Accepts `1-100`. For `Latest` and `Top`, a page often holds fewer Spaces. Send `100` to finish a search fastest. Also accepted as `limit`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. Default `20`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `spaces` | `object[]` | Public Spaces that match your query. | | `spaces[].id` | `string` | Space ID. | | `spaces[].title` | `string` | Space title. | | `spaces[].state` | `string` | `NotStarted` (scheduled), `Running` (live) or `Ended`. Also `Canceled` (scheduled, never started) or `TimedOut` (closed by X, not by its host). | | `spaces[].createdAt` | `string` | When the Space was made. | | `spaces[].scheduledStart` | `string` | When the Space was set to start. | | `spaces[].startedAt` | `string` | When the Space went live. | | `spaces[].endedAt` | `string` | When the Space ended. | | `spaces[].updatedAt` | `string` | When X last changed the Space. | | `spaces[].totalLiveListeners` | `number` | Accounts that listened live. | | `spaces[].totalReplayWatched` | `number` | Accounts that played the recording. | | `spaces[].participantCount` | `number` | Accounts in the Space now, while it is live. | | `spaces[].isAvailableForReplay` | `boolean` | Whether X offers a recording. | | `spaces[].isAvailableForClipping` | `boolean` | Whether listeners may clip the Space. | | `spaces[].isLocked` | `boolean` | Whether the host locked the Space. | | `spaces[].isEmployeeOnly` | `boolean` | Whether only X employees may join. | | `spaces[].disallowJoin` | `boolean` | Whether X lets no more accounts join. | | `spaces[].noIncognito` | `boolean` | Whether anonymous listening is off. | | `spaces[].contentType` | `string` | Audio or video kind, as X names it. | | `spaces[].conversationControls` | `number` | X's code for who may speak. | | `spaces[].maxAdminCapacity` | `number` | Most hosts and co-hosts the Space allows. | | `spaces[].mediaKey` | `string` | X's media key for the Space's audio. | | `spaces[].mentionedUserIds` | `string[]` | IDs of the accounts the host tagged. | | `spaces[].tweetId` | `string` | ID of the post that announces the Space. | | `spaces[].tweet` | `object` | The post that announces the Space, with the fields of [Get Tweet](/api-reference/x/get-tweet). Present only when X names the post. | | `spaces[].creator` | `object` | Profile of the account that made the Space. It uses the fields of [Get User](/api-reference/x/twitter-profile-lookup). | | `spaces[].admins` | `object[]` | Hosts and co-hosts. Each has `id`, `username` and `name`. Each also has `profilePicture`, `profilePictureOriginal`, badge fields and `joinedAt` when X sends them. | | `spaces[].speakers` | `object[]` | Accounts X (Twitter) lists as speakers, with the same fields as `admins`. | | `spaces[].listeners` | `object[]` | Accounts X (Twitter) lists as listeners, with the same fields as `admins`. | | `spaces[].sharings` | `object[]` | Posts the hosts and speakers shared in the Space, in X's order. Present only when X (Twitter) lists them. Each has `id`, X's ID of the sharing, plus `sharedAt` and `updatedAt`. `sharedBy` is the profile that shared it, with the fields of [Get User](/api-reference/x/twitter-profile-lookup). `tweet` is the post, with the fields of [Get Tweet](/api-reference/x/get-tweet). X leaves out `tweet` when it no longer shows the post. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "spaces": [ { "id": "1OGwblLjnQMKB", "title": "Extending the Network to the Edge", "state": "Ended", "startedAt": "2026-03-11T17:00:26.227Z", "endedAt": "2026-03-11T17:49:29.190Z", "totalLiveListeners": 841, "totalReplayWatched": 609, "admins": [ { "id": "951329744804392960", "username": "solana", "name": "Solana" } ], "speakers": [], "listeners": [] } ], "has_next_page": true, "next_cursor": "DAACCgACGRElMJcAAA" } ``` ### 400 Missing query `{ "error": "missing_query", "message": "Search query required. Use q." }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy, or X failed to return 1 of the page's Spaces. The call costs nothing. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded The Xquik tier limit blocked the request. Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Twitter Spaces search questions ### How do I search X (Twitter) Spaces by keyword? Call `GET /x/spaces/search` with your words in `q`. Each result is a public Space with its ID, title, state, times, and hosts. ### How do I find the Spaces 1 account hosted or shared? Send `q=from:username`. The search returns the Spaces that account's posts share. ### How much does a Space search cost? Each returned Space costs 1 credit. An empty page costs nothing. ### Does Space search return live Spaces only? No. It returns live, scheduled, and ended Spaces. Read `state` to tell them apart. ### Why does a page hold fewer Spaces than `pageSize`? Limited Spaces stay out, so a page can hold fewer rows. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** Pass a Space `id` to [Get Space](/api-reference/x/get-space) to read that Space again. For example, read it when the Space goes live or ends. For a live video, use [Get broadcast](/api-reference/x/get-broadcast). > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Tweet search & export, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/search-tweets Tweet search API for X (Twitter). Search tweets by keyword, ID, or URL, then export text, authors, replies, metrics, media, and cursors. 1 credit per tweet. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/search` > [!NOTE] > > Repost records include `retweetedAt`, the repost event's UTC ISO 8601 timestamp. It is `null` when > that timestamp is unavailable. The API omits it for original posts. The nested original post keeps > its own creation date. This field does not report every account that reposted a post. [Request > per-account timestamps with Get retweeters.](/api-reference/x/retweeters#retweet-timestamps) Search Tweets accepts keywords, hashtags, operators, dates, authors, media, and engagement filters. For exact lookup, send a Tweet ID or X status URL in `q`. Send it with no time params. To search one user's tweets as a plain timeline, call [Search user tweets](/api-reference/x/user-tweets) (`GET /x/users/{id}/tweets`). Date params limit results to that window, as in `q=from:username&sinceTime=2026-05-01&untilTime=2026-05-02`. Cursor requests return an empty final page for exact IDs. **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit With 0 affordable results, it returns `402 insufficient_credits`. > [!NOTE] > > Omit `mode` to get the fullest results. The response shape stays the same. > Pass `next_cursor` back unchanged as `cursor`. Keep the same endpoint, target, > query, and filters. Existing unprefixed cursors keep their legacy behavior. `after`, `limit`, and `pageSize` aliases also keep working. Billing still counts only returned rows. Use `mode=standard` only to keep the legacy pagination. A page can be empty or underfilled. Continue while `has_next_page` is `true`. Stop only after the response reports `has_next_page=false`. First-page requests do not support `Idempotency-Key` retries. Repeating a cursorless request starts a separate extraction. Results returned by that extraction incur their normal charges. Save each response before requesting its next page. A cursor sent again within 10 minutes returns the same page at no charge. After 10 minutes, you cannot replay earlier or terminal responses. If automatic coverage is busy, an initial request returns a standard data page. Live coverage cursors remain atomic. A cursor sent again while its page loads returns that page at no charge. Other repeats return `409 coverage_cursor_unavailable` with exact `Retry-After` seconds. Wait, then send the same cursor again. Repeated busy responses never authorize restarting with another cursor. Expired, superseded, or identity-mismatched cursors return `410 coverage_cursor_gone`. So does a cursor sent again after 10 minutes. The response omits `Retry-After`. Restart without a cursor. Keep received results. Deduplicate restarted results by `id`. Malformed cursors return `400 invalid_coverage_cursor`. Restart without them. A search with no results ends with `has_next_page=false`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/search \ --data-urlencode "q=giveaway" \ --data-urlencode "fromUser=username" \ --data-urlencode "mediaType=media" \ --data-urlencode "verifiedOnly=true" \ --data-urlencode "queryType=Latest" \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 - pass next_cursor from the previous response curl -G https://xquik.com/api/v1/x/tweets/search \ --data-urlencode "q=giveaway" \ --data-urlencode "fromUser=username" \ --data-urlencode "mediaType=media" \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ q: "giveaway", fromUser: "username", mediaType: "media", }); const response = await fetch(`https://xquik.com/api/v1/x/tweets/search?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const firstPage = await response.json(); if (!response.ok) throw new Error(JSON.stringify(firstPage)); let page = firstPage; let pageCursor = ""; const seenCursors = new Set(); for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const searchRows = page.tweets.map((tweet) => ({ tweet_id: tweet.id, text: tweet.text, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? null, media_urls: (tweet.media ?? []).map((item) => item.mediaUrl).filter(Boolean), page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, })); for (const row of searchRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; if (page.next_cursor === pageCursor || seenCursors.has(page.next_cursor)) { throw new Error("pagination cursor repeated"); } seenCursors.add(page.next_cursor); pageCursor = page.next_cursor; const nextParams = new URLSearchParams(params); nextParams.set("cursor", pageCursor); const nextResponse = await fetch(`https://xquik.com/api/v1/x/tweets/search?${nextParams}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); page = await nextResponse.json(); if (!nextResponse.ok) throw new Error(JSON.stringify(page)); } ``` ## Direct API handoff Use `GET /x/tweets/search` for live JSON. Store IDs and `next_cursor` to resume. Use [`tweet_search_extractor`](/guides/tweet-scraper-csv-export) for estimates, saved pages, or downloadable CSV, JSON, and XLSX files. `limit` bounds unique matching tweets after filtering. Keep `q`, filters, `queryType`, and `limit` unchanged when resuming with `cursor=next_cursor`. Explicit `mode=coverage` returns retained rows when its request window expires. Check `diagnostic.deadlineReached` and `diagnostic.complete`. Partial coverage does not mean the source ran out of tweets. For account date windows, `sinceTime` and `untilTime` limit results to that window. Inline `since_time:` and `until_time:` intersect. The start is inclusive. The end is exclusive. Days are UTC. `q=from:username&sinceTime=2026-05-01&untilTime=2026-05-02` behaves like `from:username since:2026-05-01 until:2026-05-02`. Use `queryType=Latest` for backfills or keywords for ranked search. Bounds apply to every returned page. Coverage continues past rejected rows. `-filter:nativeretweets` drops button reposts but keeps quotes & manual RT text. `include:nativeretweets` adds button reposts to author searches. `-filter:retweets` also drops manual RT text. Xquik keeps the operator you send. Account searches return all of the account's posts & reposts in the window. Continue when the response includes `next_cursor`. `mode=standard` keeps the legacy behavior for old integrations. A search that needs a protected author returns `403` with `x_account_protected` and no charge. Choose a public account. Searches across several authors are unaffected. ## Advanced Twitter search patterns | Search intent | Request pattern | | - | - | | Twitter keyword search | `q=product%20launch` | | Exact hyphenated phrase | `q=battery&exactPhrase=sodium-sulfur%20batteries` | | Search tweets from one user | `q=from:username` | | Twitter search by date | `q=launch&sinceTime=2026-05-01&untilTime=2026-05-02` | | Search hashtag tweets | `q=%23Example` | | Search tweets with media | `q=launch&mediaType=media` | | Search verified authors | `q=launch&verifiedOnly=true` | ## Keep only posts about a topic A word like rust or jaguar matches many meanings. Send `topic` to name the one you want. AI-powered analysis asks `Is this post about ?` of each post the search reads. Posts scoring 0.5 or more come back, each with its `topicScore`. The check reads the post text & photos X doesn't mark sensitive. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G "https://xquik.com/api/v1/x/tweets/search" \ -H "x-api-key: $XQUIK_API_KEY" \ --data-urlencode "q=rust lang:en -filter:replies" \ --data-urlencode "topic=the Rust programming language" \ --data-urlencode "limit=30" ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "2118059163251323266", "text": "Rust is just a cool language", "topicScore": 0.91 } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF...", "topicFilter": { "topic": "the Rust programming language", "question": "Is this post about the Rust programming language?", "cutoff": 0.5, "checked": 30, "kept": 14, "unchecked": [] } } ``` * Follow `next_cursor` with the same `topic` to check the next posts. ## Matched text ranges Each row says where its `text` matches the search, in `textHighlights`. Use the ranges to bold the matched words or cut a snippet around them. * `startIndex` is the first code point of a match. `endIndex` is the first one after it. * JavaScript counts some characters, such as most emoji, as 2 units. Split the text by code point first. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const characters = [...tweet.text]; const matches = tweet.textHighlights.map(({ startIndex, endIndex }) => characters.slice(startIndex, endIndex).join(""), ); ``` ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Send the caller's query, Tweet ID, or status URL. `query` is an alias. Quotes match phrases. Hyphens negate terms. Use `exactPhrase` for literals. X (Twitter) searches up to 512 characters. A longer query can answer 424. | | `queryType` | `string` | No | `Latest` lists posts newest first. `Top` ranks posts by engagement within each page. A later page can hold a higher ranked post. Use `Latest` for posts in time order. Any case works. `result_type` and `sort_order` are accepted aliases, as are `type`, `search_type`, `product`, `category` & `section`. `recency` maps to `Latest`. `relevancy` maps to `Top`. `Photos`, `Videos` & `Media` return posts with that media type, unless you set `mediaType`. `People` & `Lists` answer 400 & point to `/x/users/search` & `/x/lists/search`. | | `mode` | `string` | No | Optional compatibility override. Omit it to get the fullest results. `standard` keeps the legacy pagination. Use `coverage` for a one-shot diagnostic response without cursor pagination. | | `cursor` | `string` | No | Pass `next_cursor` back unchanged. New Xquik cursors resume automatic coverage. Existing unprefixed cursors keep legacy behavior. | | `sinceTime` | `string` | No | Inclusive lower bound. Intersects with inline bounds. | | `untilTime` | `string` | No | Exclusive upper bound. Intersects with inline bounds. | | `limit` | `integer` | No | Maximum Tweets per automatic page, from `1` through `10000`. `count` and `max_results` are accepted aliases. So are `pageSize`, `maxItems`, `max_items` & `per_page`. Keep the value on cursor requests. | ### Structured filters See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `cardName` | `string` | No | Keep only Tweets with this card type, such as `poll2choice_text_only`. | | `source` | `string` | No | X search no longer supports `source`. A Tweet search with it answers 424 & charges nothing. | | `excludeSource` | `string` | No | X search no longer supports `excludeSource`. A Tweet search with it answers 424 & charges nothing. | | `geocode` | `string` | No | X search no longer supports `geocode`. A Tweet search with it answers 424 & charges nothing. | | `near` | `string` | No | A place name. A country, such as United States, works like `placeCountry` & keeps Tweets tagged there. A city keeps Tweets about it. | | `within` | `string` | No | X search no longer supports `within`. A Tweet search with it answers 424 & charges nothing. Use `near` alone. | | `safe` | `boolean` | No | When `true`, enable X safe-search filtering. | | `news` | `boolean` | No | X no longer searches `filter:news`, so leave this unset. | | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | ### Search-only operators These query parameters apply only to `GET /x/tweets/search`. That is because they map to search operators before the request runs. Use `advancedQuery` only when you have trusted raw X (Twitter) search operators to append. | Query parameter | Type | Required | Description | | - | - | - | - | | `keywords` | `string` | No | Words the Tweets must match, in X search syntax. | | `place` | `string` | No | Search within this X place ID. [Search places](/api-reference/x/search-places) finds the ID by name. | | `placeCountry` | `string` | No | Search within this country code. | | `pointRadius` | `string` | No | Geo point radius in X search syntax, such as `-73.99 40.73 25mi`. | | `boundingBox` | `string` | No | Geo bounding box in X search syntax, such as `-74.1 40.6 -73.9 40.8`. | | `advancedQuery` | `string` | No | Raw X search operators appended to the final search query. | | Query parameter | Type | Required | Description | | - | - | - | - | | `listId` | `string` | No | Search within this X List ID. | | Query parameter | Type | Required | Description | | - | - | - | - | | `textOnlyTerms` | `string` | No | Keep a post only when 1 of these words is in its text. Links, cards and quoted posts count as text. The author's name and username don't count. Quote a phrase to match it whole. | ### Keep posts by topic or photo Send 1 of these to keep only the posts you want. AI-powered analysis checks each post the page reads. Posts scoring 0.5 or more come back, each with its score. Each kept post costs 2 credits instead of 1. A dropped post costs nothing. The page size counts checked posts. Posts the check can't answer cost nothing & stay out. They need an Xquik API key, since each kept post bills Xquik credits. RapidAPI & pay-per-request calls with them get 400 `invalid_input`. | Query parameter | Type | Required | Description | | - | - | - | - | | `topic` | `string` | No | Keep only posts about this topic, such as `the Rust programming language`. Kept posts carry `topicScore`, & `topicFilter` states the 0.5 cutoff & counts. Up to 200 characters. | | `imageShows` | `string` | No | Keep only posts whose photos show this. Send `charts`, `screenshots`, `product_photos`, `memes` or `people`. You can also describe it in words, such as `a rocket`. Only photos X doesn't mark sensitive get checked. Posts without such a photo stay out at no charge. Kept posts carry `imageScore`, & `imageFilter` states the 0.5 cutoff & counts. Up to 200 characters. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of matching tweets. **Tweet object fields.** The API omits fields absent from a source tweet. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text. | | `tweets[].type` | `string` | Tweet type. | | `tweets[].createdAt` | `string` | ISO 8601 creation time. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. | | `tweets[].retweetCount` | `number` | Repost count. | | `tweets[].replyCount` | `number` | Reply count. | | `tweets[].quoteCount` | `number` | Quote count. | | `tweets[].viewCount` | `number` | View count. | | `tweets[].bookmarkCount` | `number` | Bookmark count. | | `tweets[].url` | `string` | Tweet URL. | | `tweets[].lang` | `string` | Tweet language code. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if not a reply. | | `tweets[].conversationId` | `string` | Conversation thread ID. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Rendered text offsets. | | `tweets[].textHighlights` | `object[]` | Where `text` matches the search. Each item has `startIndex` & `endIndex`, counted in code points of `text`. Empty when X marks nothing in the post. X marks matches only in a post's first 280 characters. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. | | `tweets[].contentDisclosure` | `object` | Disclosure labels. | | `tweets[].author` | `object` | Tweet author profile. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author X (Twitter) username. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Follower count. | | `tweets[].author.following` | `number` | Following count. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. | | `tweets[].author.profilePicture` | `string` | Profile image URL. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].author.coverPicture` | `string` | Cover image URL. | | `tweets[].author.description` | `string` | Profile bio. | | `tweets[].author.location` | `string` | Profile location. | | `tweets[].author.createdAt` | `string` | Account creation date. | | `tweets[].author.statusesCount` | `number` | Total tweet count. | | `tweets[].media` | `object[]` | Attached media items. Omitted when the tweet has no attached media. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL (pbs.twimg.com). | | `tweets[].media[].videoVariants` | `object[]` | Video variants. Omit for images. | | `tweets[].media[].type` | `string` | The media type is `photo`, `video`, or `animated_gif`. | | `tweets[].media[].url` | `string` | Shortened t.co URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet (same shape as tweet object). Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet (same shape as tweet object). Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. Pass `next_cursor` to fetch the next page. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | | `hiddenTimeline` | `boolean` | Present on an empty last page when X shows this account's timeline to nobody. A retry returns the same page. | | `searchedQuery` | `string` | The normalized form of `q`. Present only when it differs from `q`. | | `readBackTo` | `string` | How far back a filtered `Latest` search has read, in UTC. Every newer post was checked, so an empty page still moves this time back. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Tweet content here", "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 150, "retweetCount": 42, "replyCount": 10, "quoteCount": 5, "viewCount": 12400, "bookmarkCount": 8, "url": "https://x.com/example_user/status/1893456789012345678", "lang": "en", "author": { "id": "987654321", "username": "example_user", "name": "Xquik", "followers": 10000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/xquik/photo.jpg" }, "media": [ { "mediaUrl": "https://pbs.twimg.com/media/example.jpg", "type": "photo", "url": "https://t.co/abc123" } ] } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Missing query The `q` query parameter is empty or missing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 404 Missing user or tweet `user_not_found` means a required user lookup failed. Check the username. `tweet_not_found` means an exact tweet lookup failed. Check the tweet ID or URL. Neither means a search completed with no matching tweets. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Search unavailable `{ "error": "search_unavailable" }` X fails this query on every read, so a retry fails too. Follow its message to fix the search. The normalized v1 contract also returns 424 `x_api_unavailable`. > [!NOTE] > > **Next steps.** [Tweet Search Export Workflow](/guides/tweet-scraper-csv-export) when you need saved CSV, JSON, or XLSX files. [Get Tweet](/api-reference/x/get-tweet) to fetch full details for a specific tweet. [Get User](/api-reference/x/twitter-profile-lookup) to look up an author profile. ## Response examples * **400** `{ "error": "missing_query", "message": "Search query required. Use q." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Search users by keyword, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/search-users Search X (Twitter) users by name or username. Return matching profiles, biographies, follower counts, verification status, and pagination. 1 credit per result. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/search` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/search?q=xquik" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const query = "xquik"; const params = new URLSearchParams({ q: query }); const response = await fetch(`https://xquik.com/api/v1/x/users/search?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const nextCursor = data.has_next_page ? data.next_cursor : null; const searchRows = data.users.map((user, index) => ({ search_query: query, result_rank: index + 1, user_id: user.id, username: user.username, display_name: user.name, bio: user.description ?? null, follower_count: user.followers ?? null, following_count: user.following ?? null, verified: user.verified ?? false, profile_image_url: user.profilePicture ?? null, next_cursor: nextCursor, })); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests query = "xquik" response = requests.get( "https://xquik.com/api/v1/x/users/search", params={"q": query}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() next_cursor = data["next_cursor"] if data["has_next_page"] else None search_rows = [ { "search_query": query, "result_rank": index + 1, "user_id": user["id"], "username": user["username"], "display_name": user["name"], "bio": user.get("description"), "follower_count": user.get("followers"), "following_count": user.get("following"), "verified": user.get("verified", False), "profile_image_url": user.get("profilePicture"), "next_cursor": next_cursor, } for index, user in enumerate(data["users"]) ] ``` The Node.js and Python snippets build search-result rows. They do not print full profile pages. Store `searchRows` or `search_rows` with `nextCursor` or `next_cursor` before requesting the next page. ## Direct user search handoff Use `GET /x/users/search` when a workflow has a name, brand, or handle fragment. It can be a CRM, enrichment, creator discovery, support, or agent workflow. The endpoint returns matching X (Twitter) profiles. Use [Get User](/api-reference/x/twitter-profile-lookup) when you have one exact ID or username. Use [Get Users (Batch)](/api-reference/x/batch-users) when you already have numeric user IDs. Store `search_query`, `result_rank`, `user_id`, `username`, `display_name`, profile metrics, verification state, `profile_image_url`, `has_next_page`, and `next_cursor`. Treat `next_cursor` as opaque. And pass it back as `cursor` only when `has_next_page` is true. Zero affordable results return `402 insufficient_credits`. ## Resolve the intended X profile Use user search when a workflow starts with a name or username fragment. Inspect several candidates before choosing a numeric user ID. Similar profile names can represent unrelated people or organizations. Show reviewers these fields. * Username and profile name. * Biography and location. * Verification state. * Follower and following counts. * Profile image and numeric user ID. Store the chosen user ID for later requests. Usernames can change. Numeric IDs are the safer key for followers, following, timelines, and profile lookups. An empty search result is not an API failure. Separate no matches from invalid authentication, rate limits, and insufficient credits. Do not use a result row number as identity. Ranking can change between searches. Always pass the selected user ID into the next workflow. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `q` | `string` | Yes | Search query string. | | `cursor` | `string` | No | Pagination cursor from a previous response. Omit for the first page. | | `pageSize` | `integer` | No | Profiles per page. Defaults to `20`. Follow `next_cursor` for more. | | `enrichProfiles` | `boolean` | No | Set `true` to add each row's full profile, as `GET /x/users/{id}` returns it. Pages take several seconds longer. The price per row stays the same. Default `false`. | ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK With `enrichProfiles=true`, each row carries the full profile. The `x-xquik-profile-enrichment` header then counts the rows that have it, as in `enriched=180; requested=200`. A row without it keeps its list fields. | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of matching user profiles. | | `users[].id` | `string` | X (Twitter) user ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. | | `users[].followers` | `number` | Follower count. | | `users[].following` | `number` | Following count. | | `users[].verified` | `boolean` | Verified status. | | `users[].profilePicture` | `string` | Profile image URL. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. | | `users[].accountBasedIn` | `object \| null` | Country or region X shows for the account, with `value`, `level` & `observedAt`. X infers it from account access. It states no nationality or exact location. `null` when X shows none. Present with `enrichProfiles=true`, unless it's not available yet. | | `users[].accountBasedInUnavailable` | `boolean` | `true` when this row's `accountBasedIn` is not available yet. Retry later to get it. Omitted otherwise. | | `users[].createdAt` | `string` | Account creation date (ISO 8601). | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].email` | `string` | First email the account publishes on its profile, lowercased. Omitted when it publishes none. | | `users[].contactInfo` | `object` | Emails, phone numbers & links the account publishes on its own profile. Each email has `value`, `domain` & `source`. Each phone has `value` & `source`. Each link has `url`, `network` & `source`. `source` is the profile field that holds it, such as `bio` or `url`. `writtenAs` keeps the account's own spelling of a spelled-out email or number. Omitted when the profile publishes none. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | IDs of pinned tweets. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "verified": true, "description": "All-in-one X automation platform" } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Missing query `{ "error": "missing_query" }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Next steps.** [Get User](/api-reference/x/twitter-profile-lookup) to fetch full details, or [Search Tweets](/api-reference/x/search-tweets) to find tweets by query. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Sentiment analysis with AI, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/sentiment-analysis Analyze the sentiment of X posts, searches, or drafts with AI. Get each post's attitude, intensity, sarcasm, and emotion. 2 credits per analyzed post. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/analysis/sentiment` **2 credits per analyzed post** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) Sentiment analysis reads each post with AI and answers 4 questions about it. The endpoint is `POST /api/v1/x/analysis/sentiment`. | Answer | Type | Values | | - | - | - | | `sentiment` | Choice | `positive`, `negative`, `mixed`, `neutral`, or `unclear` | | `intensity` | Score | `0` no attitude, `1` measured, `2` emphatic | | `sarcasm` | Probability | From `0` to `1`, the chance the wording means otherwise | | `emotion` | Choice | `joy`, `anger`, `sadness`, `fear`, `surprise`, `disgust`, or `none` | ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/analysis/sentiment \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "query": "Sony WH-1000XM6 lang:en", "limit": 20, "analysis": { "targets": [{ "name": "Sony", "aliases": ["WH-1000XM6"] }] } }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/analysis/sentiment", { method: "POST", headers: { "x-api-key": "xq_your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ query: "Sony WH-1000XM6 lang:en", limit: 20, analysis: { targets: [{ name: "Sony", aliases: ["WH-1000XM6"] }] }, }), }); const data = await response.json(); if (!response.ok) throw new Error(`${data.error}: ${data.message}`); const sentimentRows = data.results.map((result) => ({ tweet_id: result.tweet.id, text: result.tweet.text, sentiment: result.answers.sentiment, intensity: result.answers.intensity, sarcasm: result.answers.sarcasm, })); const shares = data.analysisSummary.questions.sentiment.shares; const retryIds = data.unanalyzed.filter((post) => post.status === "failed").map((post) => post.id); process.stdout.write(`${JSON.stringify({ rows: sentimentRows.length, shares, retryIds })}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.post( "https://xquik.com/api/v1/x/analysis/sentiment", headers={"x-api-key": "xq_your_api_key_here"}, json={ "query": "Sony WH-1000XM6 lang:en", "limit": 20, "analysis": {"targets": [{"name": "Sony", "aliases": ["WH-1000XM6"]}]}, }, timeout=120, ) data = response.json() if not response.ok: raise RuntimeError(f"{data['error']}: {data['message']}") sentiment_rows = [ { "tweet_id": result["tweet"]["id"], "text": result["tweet"]["text"], "sentiment": result["answers"]["sentiment"], "intensity": result["answers"]["intensity"], "sarcasm": result["answers"]["sarcasm"], } for result in data["results"] ] shares = data["analysisSummary"]["questions"]["sentiment"]["shares"] retry_ids = [post["id"] for post in data["unanalyzed"] if post["status"] == "failed"] print(json.dumps({"rows": len(sentiment_rows), "shares": shares, "retry_ids": retry_ids})) ``` The snippets build 1 row per analyzed post and print the totals. They do not print the full response. ## Pick the posts to analyze Send `tweetIds`, `texts`, a page, or a search, never more than 1. See [pick the posts to analyze](/api-reference/x/tweet-analysis-parameters#pick-the-posts-to-analyze) for each source. Your own texts come back with the IDs `text:1`, `text:2`, and so on. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "texts": ["We shipped dark mode today. Tell us what breaks."] } ``` ## Read the sentiment answers `results[].answers` holds each decision by question ID. Store it beside the post. | `sentiment` | Meaning | | - | - | | `positive` | Praise, satisfaction, excitement, or support | | `negative` | Criticism, frustration, disappointment, or hostility | | `mixed` | Both positive and negative judgments | | `neutral` | Information, listings, deals, or questions without a verdict | | `unclear` | The subject or attitude cannot be established | Upbeat deals, ads, and giveaways that state no opinion count as `neutral`. `intensity` judges wording, emphasis, and emoji, not engagement counts. It can have decimals, such as `1.4` between measured and emphatic. `sarcasm` is high when the literal wording contradicts the intended attitude. `emotion` names the main emotion the author expresses. Quoted people's emotions don't count. It is `none` when the post states facts or asks a question without emotion. `analysisSummary.questions.emotion` counts each emotion across the page. `results[].analysis.answers` adds the `confidence` of each answer. It also adds the probability of each category or level. Use it to set your own thresholds. ## Judge the attitude toward a brand Name the brand, person, or product in `analysis.targets`, with its aliases. The AI then judges the attitude toward that target. Without targets, it judges the attitude toward the post's main subject. `analysisSummary.targets` counts each target's mentions and sentiment categories. It also lists the most engaged posts per category. ## Track sentiment over time `analysisSummary.questions.sentiment` counts posts per category. `shares` holds each category's share of posts, and `engagementShares` its share of engagement. Store both per run to chart a trend. To read 1 day, send `sinceTime` and `untilTime` with the search. Send `username` to follow 1 account's posts. ## Compare with an earlier answer Send the `results` of an earlier call as `baseline` to see what changed. The comparison costs nothing extra. See [compare with an earlier answer](/api-reference/x/tweet-analysis-parameters#compare-with-an-earlier-answer) for an example. ## Budget the analysis Each analyzed post costs 2 credits. Each text in `texts` costs the same. Posts in `unanalyzed` cost nothing. See [budget the analysis](/api-reference/x/tweet-analysis-parameters#budget-the-analysis) for each reason. ## Ask your own questions Send `analysis.questions` to ask questions of your own. They replace the 3 sentiment questions, and the price stays the same. A choice picks 1 category, and a score picks 1 level. A probability answers yes or no. Write question IDs and category names in lower case without hyphens, such as `feature_request`. ## Body See [body parameters](/api-reference/x/tweet-analysis-parameters#body-parameters) for every field. Common ones are `tweetIds`, `texts`, `query`, `username`, and `limit`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account API key. An OAuth bearer token also works. | | `Authorization` | `string` | No | Send `Bearer xq_your_guest_key_here` for an active `paid_reads` guest key. | | `Content-Type` | `string` | Yes | Must be `application/json`. The body can be up to 256 KB. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `results` | `object[]` | Each analyzed post with its answers. Each row costs 2 credits. | | `results[].tweet` | `object` | The post, as [Search Tweets](/api-reference/x/search-tweets) returns it. Your own texts have the IDs `text:1`, `text:2`, and so on. | | `results[].answers` | `object` | Each decision by question ID. `sentiment` is a category. `intensity` is a level from `0`. `sarcasm` is a probability from `0` to `1`. | | `results[].analysis` | `object` | The answers in full. `status` is `succeeded`. `answers` gives each answer's `value`, `confidence`, and `probabilities`, or a `probability`. `questions` names the ID and version of each question. `contextBytes` and `contextAvailability` say what the AI read beside the post's text. | | `results[].sourceDomains` | `string[]` | Hostnames the post links to, without `t.co`. | | `results[].cashtags` | `string[]` | Cashtags in the post's text, in upper case. | | `results[].monitor` | `object` | The comparison with `baseline`. It holds `status`, `changedQuestionIds`, and `changes` with each `previous` and `current` decision. It also holds the settings' `configurationFingerprint`. | | `unanalyzed` | `object[]` | Each post without an analysis. These cost nothing. | | `unanalyzed[].id` | `string` | Post ID, or `text:1` and so on for your own texts. | | `unanalyzed[].status` | `string` | `skipped` or `failed`. | | `unanalyzed[].reason` | `string` | `post_unavailable`, `missing_text`, `insufficient_credits`, or `context_limit`. Any other reason means the analysis failed. Send the post again. | | `unprocessed_ids` | `string[]` | IDs of the posts or texts the time ran out for. Send them again. They cost nothing. | | `analysisSummary` | `object` | Totals of the answers across the analyzed posts. | | `analysisSummary.schemaVersion` | `integer` | Version of the summary's shape. | | `analysisSummary.rows` | `object` | Posts by outcome, counted in `analyzed`, `failed`, and `skipped`. | | `analysisSummary.engagement` | `integer` | Likes, reposts, replies, and quotes of the analyzed posts. | | `analysisSummary.questions` | `object` | Totals by question ID. `sentiment` has `counts`, `shares`, `engagementShares`, and `top` posts per category. `intensity` has `mean`, `engagementWeightedMean`, and `levels`. `sarcasm` has `mean`, `yes`, and `no`. | | `analysisSummary.targets` | `object[]` | Each target in `analysis.targets` has `name`, `mentions`, `share`, `engagement`, `choices`, and `top` posts. | | `analysisSummary.cashtags` | `object[]` | Posts and category counts per cashtag, most posts first, up to 20. | | `analysisSummary.sourceDomains` | `object[]` | Posts per linked hostname, most posts first, up to 20. | | `analysisSummary.monitor` | `object` | Posts per `monitor.status` in `statuses`, and up to 50 changed posts in `changedRows`. | | `has_next_page` | `boolean` | Whether the search has more posts. Always `false` for `tweetIds` and `texts`. | | `next_cursor` | `string` | Send it as `cursor` with the same search for the next page. Empty when there is none. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "results": [ { "tweet": { "id": "1893456789012345678", "text": "The new headphones sound great. The app keeps crashing.", "likeCount": 31, "retweetCount": 4, "replyCount": 2 }, "analysis": { "status": "succeeded", "answers": [ { "questionId": "sentiment", "questionVersion": "sentiment:3", "type": "choice", "value": "mixed", "confidence": 0.88, "probabilities": { "positive": 0.06, "negative": 0.04, "mixed": 0.88, "neutral": 0.01, "unclear": 0.01 } }, { "questionId": "intensity", "questionVersion": "sentiment:3", "type": "score", "value": 1, "confidence": 0.81 }, { "questionId": "sarcasm", "questionVersion": "sentiment:3", "type": "probability", "probability": 0.03 }, { "questionId": "emotion", "questionVersion": "sentiment:3", "type": "choice", "value": "none", "confidence": 0.71 } ] }, "answers": { "sentiment": "mixed", "intensity": 1, "sarcasm": 0.03, "emotion": "none" }, "sourceDomains": [], "cashtags": [] } ], "unanalyzed": [ { "id": "1893456789012345679", "status": "skipped", "reason": "post_unavailable" } ], "analysisSummary": { "schemaVersion": 1, "rows": { "analyzed": 1, "failed": 0, "skipped": 0 }, "engagement": 37, "questions": { "sentiment": { "type": "choice", "counts": { "positive": 0, "negative": 0, "mixed": 1, "neutral": 0, "unclear": 0 }, "shares": { "positive": 0, "negative": 0, "mixed": 1, "neutral": 0, "unclear": 0 } } }, "targets": [], "cashtags": [], "sourceDomains": [] }, "has_next_page": false, "next_cursor": "" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Send only 1 of tweetIds, texts & a search such as query or username." }` The body names no posts or names more than 1 source. A body with an invalid field gets the same error. The message says what to send instead. The request costs nothing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Full account keys can receive `no_subscription`, `subscription_inactive`, `no_credits`, or `insufficient_credits` with account payment options. Guest keys receive only the guest top-up action. The failed request creates no checkout. Ask the user to confirm before calling any checkout or top-up route. ### 403 Protected account `{ "error": "x_account_protected" }` A search that needs a protected author returns this. Choose a public account. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for the `Retry-After` header, then send the request again. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Twitter sentiment analysis API questions ### How do I analyze the sentiment of tweets? Send a search in `query`, or post IDs in `tweetIds`, to this endpoint. Each row in `results` holds the post and its `sentiment`, `intensity`, and `sarcasm` answers. ### Can I measure the sentiment toward my brand? Yes. Name the brand in `analysis.targets`, with its product names as aliases. The AI judges the attitude toward the brand, and `analysisSummary.targets` counts its mentions. ### Does it detect sarcasm? Yes. `sarcasm` is the probability that the literal wording contradicts the intended attitude. It runs from `0` to `1`. Read it beside `sentiment` before you act on a post. ### Can I check a draft before I post it? Yes. Send the draft in `texts`. Xquik reads nothing from X, and each text costs 2 credits. ### How much does sentiment analysis cost? Each analyzed post costs 2 credits. Posts in `unanalyzed` and refused requests cost nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Market signals](/api-reference/x/market-signals) reads stock and crypto stances. [Search Tweets](/api-reference/x/search-tweets) previews the posts a query returns. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Get a space replay recording, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/space-replay Get the replay of an ended Twitter or X Space as an HLS playback URL, by Space ID or URL. Live and scheduled Spaces answer 409. Costs 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/spaces/{id}/replay` **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call Get Space replay returns the recording X plays back once a Space is over. The endpoint is `GET /api/v1/x/spaces/{id}/replay`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/spaces/1OGwblLjnQMKB/replay \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const spaceId = "1OGwblLjnQMKB"; const response = await fetch(`https://xquik.com/api/v1/x/spaces/${spaceId}/replay`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); if (!response.ok) throw new Error(JSON.stringify(data)); const replayRow = { space_id: spaceId, replay_url: data.replay.url, stream_type: data.replay.streamType ?? null, stream_status: data.replay.status ?? null, }; process.stdout.write(`${JSON.stringify(replayRow)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests space_id = "1OGwblLjnQMKB" response = requests.get( f"https://xquik.com/api/v1/x/spaces/{space_id}/replay", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() if not response.ok: raise RuntimeError(data) replay = data["replay"] replay_row = { "space_id": space_id, "replay_url": replay["url"], "stream_type": replay.get("streamType"), "stream_status": replay.get("status"), } print(json.dumps(replay_row)) ``` Each call costs 1 credit. A refused request costs nothing. ## Get the recording of an ended Space Use `GET /x/spaces/{id}/replay` once a Space is over, in state `Ended` or `TimedOut`. Check `state` and `isAvailableForReplay` with [Get Space](/api-reference/x/get-space) first. * An ended Space with a recording returns its HLS playlist in `replay.url`. * A live or scheduled Space answers 409 `space_not_ended`. Its replay is ready after it ends. * A Space whose host kept no recording answers 404 `replay_unavailable`. * A Space cancelled before it started answers 404 `space_canceled`. `replay.url` is an HLS playlist. Play it in a player that reads HLS. Or pass it to a tool that saves HLS streams. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | X Space ID, or the URL-encoded Space URL, such as `x.com/i/spaces/1OGwblLjnQMKB`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `replay` | `object` | Recording of an ended Space. | | `replay.url` | `string` | HLS playlist of the recording. | | `replay.streamType` | `string` | Stream format, as X names it. | | `replay.status` | `string` | Stream status, as X names it. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "replay": { "url": "https://prod-fastly-us-east-1.video.pscp.tv/Transcoding/v1/hls/example/audio-space/playlist.m3u8?type=replay", "streamType": "HLS", "status": "LIVE_PUBLIC" } } ``` ### 400 Invalid Space ID `{ "error": "invalid_space_id", "message": "Send a Space ID or URL, such as x.com/i/spaces/1OGwblLjnQMKB." }` The path is not a Space ID or a Space URL. The request costs nothing. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls receive a direct MPP `WWW-Authenticate: Payment` challenge plus a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 404 No replay `{ "error": "replay_unavailable", "message": "This Space has no replay. Its host kept no recording." }` The host kept no recording. The request costs nothing. ### 404 Space cancelled `{ "error": "space_canceled", "message": "This Space was canceled before it started. It has no replay." }` The host cancelled the Space before it started, so there is nothing to replay. The request costs nothing. ### 404 Space not found X (Twitter) has no such Space, or limits it to subscribers or a community. The request costs nothing. ### 409 Space not ended The Space is live or scheduled. Call again after it ends. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy X returned no playback URL, or Xquik is busy. Wait for `Retry-After`, then retry. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Twitter Spaces replay questions ### How do I get the recording of an X (Twitter) Space? Call `GET /x/spaces/{id}/replay` with the Space ID or its URL. An ended Space with a recording returns its HLS playlist in `replay.url`. ### Can I get the stream of a live Space? No. A live or scheduled Space answers 409 `space_not_ended`. Call again after it ends. ### Why does an ended Space have no replay? Its host kept no recording. Check `isAvailableForReplay` with [Get Space](/api-reference/x/get-space) before you call. ### How much does a replay lookup cost? Each replay returned costs 1 credit. A refused request costs nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Get Space](/api-reference/x/get-space) for the Space's state & listener counts. [Search Spaces](/api-reference/x/search-spaces) to find more Spaces. [Get broadcast](/api-reference/x/get-broadcast) for a live video. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **409** `{ "error": "space_not_ended", "message": "This Space has not ended. Its replay is ready after it ends." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # NFL & college football scores, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/sports-game Get 1 NFL or college football game's live scoreboard from X, with the score by quarter, clock, down & distance, venue & latest play. 1 credit per request. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/sports/{league}/games/{id}` **1 credit per request** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/sports/nfl/games/2055084502741811200" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const gameId = "2055084502741811200"; const response = await fetch(`https://xquik.com/api/v1/x/sports/nfl/games/${gameId}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const game = await response.json(); if (!response.ok) throw new Error(JSON.stringify(game)); const home = game.teams[game.home.teamId]?.abbreviation; const away = game.teams[game.away.teamId]?.abbreviation; console.log(`${away} ${game.away.points} at ${home} ${game.home.points}, ${game.status}`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests game_id = "2055084502741811200" response = requests.get( f"https://xquik.com/api/v1/x/sports/nfl/games/{game_id}", headers={"x-api-key": "xq_your_api_key_here"}, ) game = response.json() if not response.ok: raise RuntimeError(game) home = game["teams"].get(game["home"]["teamId"], {}).get("abbreviation") away = game["teams"].get(game["away"]["teamId"], {}).get("abbreviation") print(away, game["away"]["points"], "at", home, game["home"]["points"], game["status"]) ``` ## Read a football game's live score Use `GET /x/sports/{league}/games/{id}` for 1 game's score, clock & situation. Find the game ID with [List football games](/api-reference/x/sports-games). Call it again to follow a live game. * `home` & `away` hold each team's `teamId`, `points` & `timeoutsLeft`. * `periods` lists the points of each period, in order. * `situation` has the down, the yards to go & the team with the ball. * `lastPlay` is the latest play, with the fields [Get football plays](/api-reference/x/sports-game-plays) returns. * `teams` & `players` hold each team & player once, keyed by ID. `situation` & `lastPlay` are null before kickoff. Fields such as `teamId` & `playerId` are keys of `teams` & `players`. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `league` | `string` | Yes | `nfl` for the NFL or `ncaafb` for college football, in any case. Another value gets a free `400 invalid_league`. | | `id` | `string` | Yes | Game ID, a number up to 19 digits, such as `2055084502741811200`. [List football games](/api-reference/x/sports-games) returns it as `id`. Another value gets a free `400 invalid_game_id`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | The game ID from your request. | | `league` | `string` | The league from your request, `nfl` or `ncaafb`. | | `seasonId` | `string` | X's ID for the season. NFL games have one. | | `seasonType` | `string` | The part of the season, such as `RegularSeason`. X stopped sending it with a game on 2026-10-24, so it is null. | | `week` | `number` | The week of the season. X stopped sending it with a game on 2026-10-24, so it is null. [List football games](/api-reference/x/sports-games) still has each game's week. | | `startsAt` | `string` | The kickoff time in UTC. Null when X sends a time Xquik cannot read. | | `venue` | `string` | The stadium. | | `status` | `string` | X's game status, such as `Scheduled`, `InProgress` or `Closed`. | | `clock` | `string` | The game clock, as X writes it. | | `quarter` | `number` | The current or last quarter. | | `situation` | `object` | Down & distance now, or null before kickoff. | | `situation.down` | `number` | The down, from 1 to 4. | | `situation.yardsToGo` | `number` | The yards needed for a first down. | | `situation.yardline` | `number` | The yard line of the ball. | | `situation.yardlineTeamId` | `string` | The team whose half the ball is in, a key of `teams`. | | `situation.possessionTeamId` | `string` | The team with the ball, a key of `teams`. | | `home` | `object` | The home team's `teamId`, a key of `teams`, its `points` & its `timeoutsLeft`. | | `away` | `object` | The away team's `teamId`, a key of `teams`, its `points` & its `timeoutsLeft`. | | `periods` | `object[]` | Points by period, in order. Each has `type`, such as `Quarter`, `number`, `sequence` from 1, `homePoints` & `awayPoints`. | | `lastPlay` | `object` | The latest play, or null before kickoff. It has the play fields of [Get football plays](/api-reference/x/sports-game-plays). Each step names its players. A step's players stay empty until known. | | `teams` | `object` | The teams this answer names, keyed by team ID. | | `players` | `object` | The players this answer names, keyed by player ID. | Each value in `teams` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The team ID that games & players refer to. | | `name` | `string` | The team's full name, such as `San Francisco 49ers`. | | `shortName` | `string` | The team's short name. | | `abbreviation` | `string` | The team's abbreviation, such as `SF`. | | `alternateId` | `string` | Another ID X keeps for the team. College plays & drives name a side by it. | | `location` | `string` | The school or place the team plays for. College schedules & a game's audience send it. | | `colors` | `object[]` | The team's colors. Each has `r`, `g` & `b`, from 0 to 255. | | `logos` | `object` | The team's logo links. `default` is the one X shows. `light` & `dark` suit light or dark backgrounds. | | `xUserId` | `string` | The user ID of the team's X account. Pass it to [Get user](/api-reference/x/twitter-profile-lookup). | | `record` | `object` | The team's `wins`, `losses` & `ties` this season. X sends it only in college football games. | | `recentGames` | `object[]` | The team's recent games, newest first. Games without a kickoff time come last. Each has `id`, `startsAt`, `venue`, `status`, `clock`, `quarter`, `home` & `away`. `home` & `away` hold `teamId` & `points`. X sends them only with the teams of a college football game. The list is empty elsewhere. | Each value in `players` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The player ID that plays & stats refer to. | | `teamId` | `string` | The player's team, a key of `teams`. | | `name` | `string` | The player's full name. | | `shortName` | `string` | The name play descriptions use, such as `B.Purdy`. | | `jersey` | `string` | The jersey number, as text. | | `position` | `string` | The position, such as `QB` or `DE`. | | `college` | `string` | The college the player came from. | | `birthPlace` | `string` | Where the player was born. X sends it only for NFL players. | | `birthDate` | `string` | The birth date, as `YYYY-MM-DD`. | | `headshots` | `object` | Photo links in `original`, `large`, `medium` & `small`. Any of them can be null. | | `xUser` | `object` | The player's X account, with `id`, `username` & `blueVerified`. Null when the player has none. Rosters also fill `protected`, `superFollowEligible` & the highlighted `labelType`, such as `BusinessLabel`. Other answers send them as null. | ### 400 Invalid game ID `{ "error": "invalid_game_id", "message": "Send a numeric game ID, such as 2055084502741811200." }` The game ID is not a number. A league other than `nfl` or `ncaafb` gets `invalid_league`. Both answers are free. ### 404 Game not found `{ "error": "game_not_found", "message": "Game not found. Find game IDs with GET /x/sports/nfl/games." }` X knows no game with this ID in the league. This answer is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [List football games](/api-reference/x/sports-games) · [Get football plays](/api-reference/x/sports-game-plays) · [Get football box score](/api-reference/x/sports-game-box-score) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "2055084502741811200", "league": "nfl", "seasonId": "2039131233582546945", "seasonType": null, "week": null, "startsAt": "2026-10-20T00:15:00.000Z", "venue": "Levi's Stadium", "status": "Closed", "clock": "00:00:00", "quarter": 4 } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Football game audience & picks, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/sports-game-audience Get 1 NFL or college football game's audience on X, with live viewers, fan picks per team, the game chat's state & each team's location. 1 credit per request. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/sports/{league}/games/{id}/audience` **1 credit per request** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/sports/nfl/games/2055084502741811200/audience" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const gameId = "2055084502741811200"; const response = await fetch(`https://xquik.com/api/v1/x/sports/nfl/games/${gameId}/audience`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const audience = await response.json(); if (!response.ok) throw new Error(JSON.stringify(audience)); console.log(`${audience.viewers?.count ?? 0} watching`); for (const { teamId, count } of audience.teamPicks.teams) { console.log(`${audience.teams[teamId]?.name}: ${count} fans`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests game_id = "2055084502741811200" response = requests.get( f"https://xquik.com/api/v1/x/sports/nfl/games/{game_id}/audience", headers={"x-api-key": "xq_your_api_key_here"}, ) audience = response.json() if not response.ok: raise RuntimeError(audience) print((audience["viewers"] or {}).get("count", 0), "watching") for pick in audience["teamPicks"]["teams"]: print(audience["teams"].get(pick["teamId"], {}).get("name"), pick["count"], "fans") ``` ## Read who follows a football game Use `GET /x/sports/{league}/games/{id}/audience` for the crowd around 1 game on X. Find the game ID with [List football games](/api-reference/x/sports-games). Call it again to follow a live game. * `viewers` has how many people watched the game on X & when X counted them. * `teamPicks` has how many people picked each team to root for. * `chat` says whether the game chat is open, or how long until it opens. * `teams` holds each team once, keyed by ID, with its location. `viewers` is null until X counts any viewers, as before kickoff. Each `teamId` is a key of `teams`. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `league` | `string` | Yes | `nfl` for the NFL or `ncaafb` for college football, in any case. Another value gets a free `400 invalid_league`. | | `id` | `string` | Yes | Game ID, a number up to 19 digits, such as `2055084502741811200`. [List football games](/api-reference/x/sports-games) returns it as `id`. Another value gets a free `400 invalid_game_id`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | The game ID from your request. | | `league` | `string` | The league from your request, `nfl` or `ncaafb`. | | `viewers` | `object` | People watching the game on X at X's last count. Null before X counts any. | | `viewers.count` | `number` | How many people watched the game on X. | | `viewers.asOf` | `string` | When X counted them, as an ISO 8601 time. | | `teamPicks` | `object` | How many people on X picked a team to root for. | | `teamPicks.total` | `number` | Picks for every team in the game. | | `teamPicks.teams` | `object[]` | Picks per team. Each has `teamId`, a key of `teams`, & `count`. | | `chat` | `object` | The game's live chat on X. | | `chat.available` | `boolean` | Whether the chat is open now. | | `chat.broadcastId` | `string` | X's ID for the game's chat room, such as `nfl-2055084502741811200`. | | `chat.opensIn` | `object` | Time left until the chat opens, as `days`, `hours` & `minutes`. Null while it is open & after the game. | | `teams` | `object` | The game's teams, keyed by team ID. X sends no short name, alternate ID or X account here. So those are null. [Get football scoreboard](/api-reference/x/sports-game) has them. | Each value in `teams` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The team ID that games & players refer to. | | `name` | `string` | The team's full name, such as `San Francisco 49ers`. | | `shortName` | `string` | The team's short name. | | `abbreviation` | `string` | The team's abbreviation, such as `SF`. | | `alternateId` | `string` | Another ID X keeps for the team. College plays & drives name a side by it. | | `location` | `string` | The school or place the team plays for. College schedules & a game's audience send it. | | `colors` | `object[]` | The team's colors. Each has `r`, `g` & `b`, from 0 to 255. | | `logos` | `object` | The team's logo links. `default` is the one X shows. `light` & `dark` suit light or dark backgrounds. | | `xUserId` | `string` | The user ID of the team's X account. Pass it to [Get user](/api-reference/x/twitter-profile-lookup). | | `record` | `object` | The team's `wins`, `losses` & `ties` this season. X sends it only in college football games. | | `recentGames` | `object[]` | The team's recent games, newest first. Games without a kickoff time come last. Each has `id`, `startsAt`, `venue`, `status`, `clock`, `quarter`, `home` & `away`. `home` & `away` hold `teamId` & `points`. X sends them only with the teams of a college football game. The list is empty elsewhere. | ### 400 Invalid game ID `{ "error": "invalid_game_id", "message": "Send a numeric game ID, such as 2055084502741811200." }` The game ID is not a number. A league other than `nfl` or `ncaafb` gets `invalid_league`. Both answers are free. ### 404 Game not found `{ "error": "game_not_found", "message": "Game not found. Find game IDs with GET /x/sports/nfl/games." }` X knows no game with this ID in the league. This answer is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [Get football scoreboard](/api-reference/x/sports-game) · [List football games](/api-reference/x/sports-games) · [Get football plays](/api-reference/x/sports-game-plays) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "2055084502741811200", "league": "nfl", "viewers": { "count": 155, "asOf": "2026-10-20T06:19:50.000Z" }, "teamPicks": { "total": 7976, "teams": [ { "teamId": "689566294702555136", "count": 4998 } ] }, "chat": { "available": false, "broadcastId": "nfl-2055084502741811200", "opensIn": null }, "teams": {} } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Football box score & stats, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/sports-game-box-score Get 1 NFL or college football game's box score from X, with team totals & each player's passing, rushing, receiving, defense & kicking stats. 1 credit. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/sports/{league}/games/{id}/box-score` **1 credit per request** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/sports/nfl/games/2055084502741811200/box-score" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const gameId = "2055084502741811200"; const response = await fetch(`https://xquik.com/api/v1/x/sports/nfl/games/${gameId}/box-score`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const game = await response.json(); if (!response.ok) throw new Error(JSON.stringify(game)); for (const side of [game.home, game.away]) { for (const entry of side.players) { if (entry.passing === undefined) continue; const player = game.players[entry.playerId]; console.log(`${player?.name} ${entry.passing.completions}/${entry.passing.attempts}`); } } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests game_id = "2055084502741811200" response = requests.get( f"https://xquik.com/api/v1/x/sports/nfl/games/{game_id}/box-score", headers={"x-api-key": "xq_your_api_key_here"}, ) game = response.json() if not response.ok: raise RuntimeError(game) for side in (game["home"], game["away"]): for entry in side["players"]: passing = entry.get("passing") if passing is None: continue player = game["players"].get(entry["playerId"], {}) print(player.get("name"), f"{passing['completions']}/{passing['attempts']}") ``` ## Read team totals & player stats Use `GET /x/sports/{league}/games/{id}/box-score` for a game's stats. Find the game ID with [List football games](/api-reference/x/sports-games). * `home` & `away` hold each team's `totals` & a `players` list. * `totals` has first downs, third downs, passing, rushing, penalties, turnovers & time of possession. * Each `players` entry has a `playerId` & the stat groups X sent for that player. * The top-level `players` holds each player once, keyed by ID, with name, position & photos. Stat groups X did not send are absent, so a kicker has no `passing`. A game that has not started has no stats yet, so `totals` is null. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `league` | `string` | Yes | `nfl` for the NFL or `ncaafb` for college football, in any case. Another value gets a free `400 invalid_league`. | | `id` | `string` | Yes | Game ID, a number up to 19 digits, such as `2055084502741811200`. [List football games](/api-reference/x/sports-games) returns it as `id`. Another value gets a free `400 invalid_game_id`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | The game ID from your request. | | `league` | `string` | The league from your request, `nfl` or `ncaafb`. | | `home` | `object` | The home team's totals & player stats. | | `home.teamId` | `string` | The team, a key of `teams`. | | `home.totals` | `object` | The team's totals, or null before kickoff. | | `home.totals.firstDowns` | `number` | First downs. | | `home.totals.thirdDowns` | `object` | Third downs tried in `attempts` & converted in `successes`. | | `home.totals.fumbles` | `object` | The team's fumbles, with the fields of a player's `fumbles`. | | `home.totals.passing` | `object` | The team's passing, with the fields of a player's `passing`. | | `home.totals.penalties` | `object` | Penalties against the team, as `count` & `yards`. | | `home.totals.rushing` | `object` | The team's rushing, with the fields of a player's `rushing`. | | `home.totals.timeOfPossessionSeconds` | `number` | Time with the ball, in seconds. | | `home.totals.totalYards` | `number` | Total yards. | | `home.totals.turnovers` | `number` | Turnovers. | | `home.players` | `object[]` | Each player with stats, 1 entry per player. Only the stat groups X sent are present. | | `home.players[].playerId` | `string` | The player, a key of `players`. | | `home.players[].passing` | `object` | `attempts`, `completions`, `yards`, `netYards` after sacks, `avgYards`, `touchdowns`, `interceptions`, `sacks`, `sackYards` & the passer `rating`. | | `home.players[].rushing` | `object` | `attempts`, `yards`, `avgYards`, `longest` & `touchdowns`. | | `home.players[].receiving` | `object` | `targets`, `receptions`, `yards`, `avgYards` per catch, `longest` & `touchdowns`. | | `home.players[].defense` | `object` | `tackles` solo, `combined` solo & assisted, `tacklesForLoss` and `sacks` with a shared sack as 0.5. Also `interceptions`, `passesDefended` & `forcedFumbles`. | | `home.players[].fumbles` | `object` | `lost` to the other team, `ownRecoveryTouchdowns` & `opponentRecoveryTouchdowns`. | | `home.players[].kickReturns` | `object` | `returns`, `yards`, `avgYards`, `longest` & `touchdowns`. | | `home.players[].puntReturns` | `object` | Punt returns, with the fields of `kickReturns`. | | `home.players[].interceptionReturns` | `object` | Interception returns, with the fields of `kickReturns`. | | `home.players[].punts` | `object` | `attempts`, `yards`, `avgYards`, `avgNetYards` after returns, `inside20` & `longest`. | | `home.players[].fieldGoals` | `object` | `attempts`, `made` & the `longest` made, in yards. | | `home.players[].extraPoints` | `object` | Extra point kicks, as `attempts` & `made`. | | `home.players[].conversions` | `object` | 2-point conversions by `passSuccesses`, `rushSuccesses`, `turnoverSuccesses` & `defenseSuccesses`. | | `away` | `object` | The away team's totals & player stats, with the fields of `home`. | | `teams` | `object` | The teams this answer names, keyed by team ID. | | `players` | `object` | The players this answer names, keyed by player ID. | Each value in `teams` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The team ID that games & players refer to. | | `name` | `string` | The team's full name, such as `San Francisco 49ers`. | | `shortName` | `string` | The team's short name. | | `abbreviation` | `string` | The team's abbreviation, such as `SF`. | | `alternateId` | `string` | Another ID X keeps for the team. College plays & drives name a side by it. | | `location` | `string` | The school or place the team plays for. College schedules & a game's audience send it. | | `colors` | `object[]` | The team's colors. Each has `r`, `g` & `b`, from 0 to 255. | | `logos` | `object` | The team's logo links. `default` is the one X shows. `light` & `dark` suit light or dark backgrounds. | | `xUserId` | `string` | The user ID of the team's X account. Pass it to [Get user](/api-reference/x/twitter-profile-lookup). | | `record` | `object` | The team's `wins`, `losses` & `ties` this season. X sends it only in college football games. | | `recentGames` | `object[]` | The team's recent games, newest first. Games without a kickoff time come last. Each has `id`, `startsAt`, `venue`, `status`, `clock`, `quarter`, `home` & `away`. `home` & `away` hold `teamId` & `points`. X sends them only with the teams of a college football game. The list is empty elsewhere. | Each value in `players` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The player ID that plays & stats refer to. | | `teamId` | `string` | The player's team, a key of `teams`. | | `name` | `string` | The player's full name. | | `shortName` | `string` | The name play descriptions use, such as `B.Purdy`. | | `jersey` | `string` | The jersey number, as text. | | `position` | `string` | The position, such as `QB` or `DE`. | | `college` | `string` | The college the player came from. | | `birthPlace` | `string` | Where the player was born. X sends it only for NFL players. | | `birthDate` | `string` | The birth date, as `YYYY-MM-DD`. | | `headshots` | `object` | Photo links in `original`, `large`, `medium` & `small`. Any of them can be null. | | `xUser` | `object` | The player's X account, with `id`, `username` & `blueVerified`. Null when the player has none. Rosters also fill `protected`, `superFollowEligible` & the highlighted `labelType`, such as `BusinessLabel`. Other answers send them as null. | ### 400 Invalid game ID `{ "error": "invalid_game_id", "message": "Send a numeric game ID, such as 2055084502741811200." }` The game ID is not a number. A league other than `nfl` or `ncaafb` gets `invalid_league`. Both answers are free. ### 404 Game not found `{ "error": "game_not_found", "message": "Game not found. Find game IDs with GET /x/sports/nfl/games." }` X knows no game with this ID in the league. This answer is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [List football games](/api-reference/x/sports-games) · [Get football scoreboard](/api-reference/x/sports-game) · [Get football plays](/api-reference/x/sports-game-plays) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "2055084502741811200", "league": "nfl", "home": { "teamId": "689566294702555136", "totals": null, "players": [] }, "away": { "teamId": "689566304366292992", "totals": null, "players": [] }, "teams": {}, "players": {} } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # NFL player props & odds, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/sports-game-player-props Get the player prop lines & American odds X shows for 1 NFL game, such as passing yards & anytime touchdown scorers, with each player's team. 1 credit. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/sports/{league}/games/{id}/player-props` **1 credit per request** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/sports/nfl/games/2055084502741929984/player-props" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const gameId = "2055084502741929984"; const response = await fetch(`https://xquik.com/api/v1/x/sports/nfl/games/${gameId}/player-props`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const game = await response.json(); if (!response.ok) throw new Error(JSON.stringify(game)); for (const category of game.categories) { for (const prop of category.props) { const player = game.players[prop.playerId]; console.log(`${category.name}: ${player?.name} ${prop.line ?? ""} ${prop.odds}`); } } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests game_id = "2055084502741929984" response = requests.get( f"https://xquik.com/api/v1/x/sports/nfl/games/{game_id}/player-props", headers={"x-api-key": "xq_your_api_key_here"}, ) game = response.json() if not response.ok: raise RuntimeError(game) for category in game["categories"]: for prop in category["props"]: player = game["players"].get(prop["playerId"], {}) print(category["name"], player.get("name"), prop["line"], prop["odds"]) ``` ## Read player props Use `GET /x/sports/{league}/games/{id}/player-props` for the prop lines X shows. Find the game ID with [List football games](/api-reference/x/sports-games). * `categories` holds each kind of prop, such as passing yards, in X's order. * Each prop has a `playerId`, the `line`, `odds` & `alternateOdds` in American odds, and `openForBetting`. * `players` holds each player once, keyed by ID, with name, jersey & team. X (Twitter) lists props before & during a game. A finished game or a game X does not know returns no categories. Some props have no line, such as the first touchdown scorer. Their `line` is null. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `league` | `string` | Yes | `nfl`, in any case. X has no college props, so `ncaafb` gets a free `400 unsupported_league`. Another value gets a free `400 invalid_league`. | | `id` | `string` | Yes | Game ID, a number up to 19 digits, such as `2055084502741929984`. [List football games](/api-reference/x/sports-games) returns it as `id`. Another value gets a free `400 invalid_game_id`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | The game ID from your request. | | `league` | `string` | Always `nfl`. | | `sportsbookUrl` | `string` | The sportsbook page X links for these props. Null without props. | | `categories` | `object[]` | Each kind of prop, in X's order. | | `categories[].key` | `string` | X's key for the prop, such as `passing_yards`. | | `categories[].name` | `string` | The name X shows, such as `Passing Yards`. | | `categories[].rank` | `number` | The category's place in X's order, from 1. | | `categories[].props` | `object[]` | Each player's line, in X's order. | | `categories[].props[].playerId` | `string` | The player, a key of `players`. | | `categories[].props[].rank` | `number` | The line's place in its category, from 1. | | `categories[].props[].line` | `number` | The line the odds price, such as `248.5` yards. Null when the prop has no line. | | `categories[].props[].odds` | `number` | The American odds X shows first, such as `-115` or `240`. | | `categories[].props[].alternateOdds` | `number` | The American odds X shows second. Null for a prop with 1 price. | | `categories[].props[].openForBetting` | `boolean` | Whether the sportsbook takes bets on the line. | | `players` | `object` | The players these props name, keyed by player ID. X sends each player's name, jersey & team, so other fields are null. | Each value in `players` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The player ID that plays & stats refer to. | | `teamId` | `string` | The player's team, a key of `teams`. | | `name` | `string` | The player's full name. | | `shortName` | `string` | The name play descriptions use, such as `B.Purdy`. | | `jersey` | `string` | The jersey number, as text. | | `position` | `string` | The position, such as `QB` or `DE`. | | `college` | `string` | The college the player came from. | | `birthPlace` | `string` | Where the player was born. X sends it only for NFL players. | | `birthDate` | `string` | The birth date, as `YYYY-MM-DD`. | | `headshots` | `object` | Photo links in `original`, `large`, `medium` & `small`. Any of them can be null. | | `xUser` | `object` | The player's X account, with `id`, `username` & `blueVerified`. Null when the player has none. Rosters also fill `protected`, `superFollowEligible` & the highlighted `labelType`, such as `BusinessLabel`. Other answers send them as null. | ### 400 Unsupported league `{ "error": "unsupported_league", "message": "Rosters & player props cover nfl only. Send nfl as the league." }` Send `nfl` as the league. A game ID that is not a number gets `invalid_game_id`. Both answers are free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [List football games](/api-reference/x/sports-games) · [Get football > scoreboard](/api-reference/x/sports-game) · [Get NFL game > rosters](/api-reference/x/sports-game-roster) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "2055084502741929984", "league": "nfl", "sportsbookUrl": null, "categories": [], "players": {} } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Football play-by-play feed, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/sports-game-plays Get every drive & play of 1 NFL or college football game from X, with each down & distance, players, penalties & linked video posts. 1 credit per request. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/sports/{league}/games/{id}/plays` **1 credit per request** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/sports/nfl/games/2055084502741811200/plays" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const gameId = "2055084502741811200"; const response = await fetch(`https://xquik.com/api/v1/x/sports/nfl/games/${gameId}/plays`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const game = await response.json(); if (!response.ok) throw new Error(JSON.stringify(game)); for (const quarter of game.quarters) { for (const drive of quarter.drives) { for (const play of drive.plays) { console.log(`Q${quarter.number} ${play.clock} ${play.description}`); } } } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests game_id = "2055084502741811200" response = requests.get( f"https://xquik.com/api/v1/x/sports/nfl/games/{game_id}/plays", headers={"x-api-key": "xq_your_api_key_here"}, ) game = response.json() if not response.ok: raise RuntimeError(game) for quarter in game["quarters"]: for drive in quarter["drives"]: for play in drive["plays"]: print(f"Q{quarter['number']}", play["clock"], play["description"]) ``` ## Read every drive & play of a game Use `GET /x/sports/{league}/games/{id}/plays` for a game's full play-by-play. Find the game ID with [List football games](/api-reference/x/sports-games). * `quarters` lists each quarter in order. Each quarter lists its `drives`, and each drive its `plays`. * A drive has its clock, first downs & net yards. It also says how it started & ended. * A play has its clock, down & distance, description & the score after it. * `details` lists each step of a play, with its players, yards & any penalty. * `post` is the post X links to the play. `videoPostId` & `videoReplyPostId` point to its video. Each player appears once in `players`, keyed by ID. Steps name players by `playerId`, with a `playerRole` such as `Pass` or `Tackle`. Pass a post ID to [Get tweet](/api-reference/x/get-tweet) to read it. A whole game fits 1 response, so there are no pages. `quarters` is empty before kickoff. NFL games name a side as `Home` or `Away` in `offense`, `defense`, `possession` & `yardlineSide`. College games name it by the team's `alternateId` from `teams`. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `league` | `string` | Yes | `nfl` for the NFL or `ncaafb` for college football, in any case. Another value gets a free `400 invalid_league`. | | `id` | `string` | Yes | Game ID, a number up to 19 digits, such as `2055084502741811200`. [List football games](/api-reference/x/sports-games) returns it as `id`. Another value gets a free `400 invalid_game_id`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | The game ID from your request. | | `league` | `string` | The league from your request, `nfl` or `ncaafb`. | | `homeTeamId` | `string` | The home team, a key of `teams`. | | `awayTeamId` | `string` | The away team, a key of `teams`. | | `quarters` | `object[]` | The game's quarters, in order. Empty before kickoff. | | `quarters[].id` | `string` | X's ID for the quarter within the game. | | `quarters[].number` | `number` | The quarter's number. | | `quarters[].sequence` | `number` | The quarter's place in the game, from 1. | | `quarters[].drives` | `object[]` | The quarter's drives, in order. | | `quarters[].drives[].id` | `string` | X's ID for the drive within the game. | | `quarters[].drives[].sequence` | `number` | The drive's place in the game, from 1. | | `quarters[].drives[].offense` | `string` | The team with the ball. `Home` or `Away` in NFL games, the team's `alternateId` in college games. | | `quarters[].drives[].defense` | `string` | The team on defense. X stopped sending it on 2026-10-24, so it is null. | | `quarters[].drives[].startClock` | `string` | The game clock when the drive started, as `HH:MM:SS`. | | `quarters[].drives[].endClock` | `string` | The game clock when the drive ended, as `HH:MM:SS`. | | `quarters[].drives[].startReason` | `string` | How the drive started, such as `Kickoff` or `Punt`. X stopped sending it on 2026-10-24, so it is null. | | `quarters[].drives[].endReason` | `string` | How the drive ended, such as `Touchdown` or `Punt`. | | `quarters[].drives[].playCount` | `number` | The drive's plays. | | `quarters[].drives[].firstDowns` | `number` | The first downs the drive gained. X stopped sending it on 2026-10-24, so it is null. | | `quarters[].drives[].netYards` | `number` | The yards the drive gained. | | `quarters[].drives[].scoring` | `boolean` | Whether the drive scored. X stopped sending it on 2026-10-24, so it is null. Each play still says whether it scored. | | `quarters[].drives[].plays` | `object[]` | The drive's plays, in order. | | `teams` | `object` | The teams this answer names, keyed by team ID. | | `players` | `object` | The players this answer names, keyed by player ID. | Each item in `quarters[].drives[].plays` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | X's ID for the play within the game. | | `sequence` | `string` | The play's place in its drive, as X writes it. | | `clock` | `string` | The game clock when the play started, as `HH:MM:SS`. | | `type` | `string` | X's kind of play, such as `Pass`, `Rush`, `Punt` or `Conversion`. | | `direction` | `string` | Where the play went, such as `Left` or `Middle`. | | `description` | `string` | The play as the official play-by-play writes it. | | `scoring` | `boolean` | Whether the play scored points. | | `homePoints` | `number` | The home team's points after the play. | | `awayPoints` | `number` | The away team's points after the play. | | `score` | `object` | For a scoring play, its `points` & the `homePoints` & `awayPoints` after it. Null otherwise. | | `start` | `object` | Down & distance when the play started, or null. | | `start.down` | `number` | The down, from 1 to 4. | | `start.yardsToGo` | `number` | The yards needed for a first down. | | `start.yardline` | `number` | The yard line of the ball. | | `start.yardlineSide` | `string` | Whose half the ball was in. `Home` or `Away` in NFL games, the team's `alternateId` in college games. | | `start.possession` | `string` | The team with the ball. `Home` or `Away` in NFL games, the team's `alternateId` in college games. | | `onField` | `object` | Flags X shows on the field, or null. `calledBack` means a penalty called the play back. `penaltyOnField` means a flag was thrown. `timeout` means a timeout followed. `underReview` means officials were reviewing the play. | | `details` | `object[]` | The play's steps, in order, such as a pass, a tackle or a penalty. | | `details[].sequence` | `number` | The step's place in the play, from 1. | | `details[].category` | `string` | X's kind of step, such as `Pass`, `Tackle` or `Penalty`. | | `details[].description` | `string` | What happened in the step. | | `details[].direction` | `string` | The direction X gives for the step. | | `details[].yards` | `number` | The yards the step gained or lost. | | `details[].players` | `object[]` | The players in the step. Each has `playerId`, a key of `players`, & `playerRole`, such as `Pass`, `Receive` or `Tackle`. | | `details[].penalty` | `object` | The penalty this step called, or null. It has `description`, `nextDown`, `result`, `yards` & `teamId`, the penalized team. | | `post` | `object` | The post X links to the play, with `id` & the author's `username`. Null when X links none. | | `videoPostId` | `string` | The ID of a post with the play's video. | | `videoReplyPostId` | `string` | The ID of a reply with the play's video. | Each value in `teams` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The team ID that games & players refer to. | | `name` | `string` | The team's full name, such as `San Francisco 49ers`. | | `shortName` | `string` | The team's short name. | | `abbreviation` | `string` | The team's abbreviation, such as `SF`. | | `alternateId` | `string` | Another ID X keeps for the team. College plays & drives name a side by it. | | `location` | `string` | The school or place the team plays for. College schedules & a game's audience send it. | | `colors` | `object[]` | The team's colors. Each has `r`, `g` & `b`, from 0 to 255. | | `logos` | `object` | The team's logo links. `default` is the one X shows. `light` & `dark` suit light or dark backgrounds. | | `xUserId` | `string` | The user ID of the team's X account. Pass it to [Get user](/api-reference/x/twitter-profile-lookup). | | `record` | `object` | The team's `wins`, `losses` & `ties` this season. X sends it only in college football games. | | `recentGames` | `object[]` | The team's recent games, newest first. Games without a kickoff time come last. Each has `id`, `startsAt`, `venue`, `status`, `clock`, `quarter`, `home` & `away`. `home` & `away` hold `teamId` & `points`. X sends them only with the teams of a college football game. The list is empty elsewhere. | Each value in `players` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The player ID that plays & stats refer to. | | `teamId` | `string` | The player's team, a key of `teams`. | | `name` | `string` | The player's full name. | | `shortName` | `string` | The name play descriptions use, such as `B.Purdy`. | | `jersey` | `string` | The jersey number, as text. | | `position` | `string` | The position, such as `QB` or `DE`. | | `college` | `string` | The college the player came from. | | `birthPlace` | `string` | Where the player was born. X sends it only for NFL players. | | `birthDate` | `string` | The birth date, as `YYYY-MM-DD`. | | `headshots` | `object` | Photo links in `original`, `large`, `medium` & `small`. Any of them can be null. | | `xUser` | `object` | The player's X account, with `id`, `username` & `blueVerified`. Null when the player has none. Rosters also fill `protected`, `superFollowEligible` & the highlighted `labelType`, such as `BusinessLabel`. Other answers send them as null. | ### 400 Invalid game ID `{ "error": "invalid_game_id", "message": "Send a numeric game ID, such as 2055084502741811200." }` The game ID is not a number. A league other than `nfl` or `ncaafb` gets `invalid_league`. Both answers are free. ### 404 Game not found `{ "error": "game_not_found", "message": "Game not found. Find game IDs with GET /x/sports/nfl/games." }` X knows no game with this ID in the league. This answer is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [List football games](/api-reference/x/sports-games) · [Get football scoreboard](/api-reference/x/sports-game) · [Get football box score](/api-reference/x/sports-game-box-score) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "2055084502741811200", "league": "nfl", "homeTeamId": "689566294702555136", "awayTeamId": "689566304366292992", "quarters": [ { "id": "quarter-1", "number": 1, "sequence": 1, "drives": [] } ], "teams": {}, "players": {} } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Football game tweet feed, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/sports-game-posts Get top or latest X (Twitter) posts about 1 NFL or college football game. Read them before, during or after it, with the search behind them. 1 credit per post. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/sports/{league}/games/{id}/posts` **1 credit per post** · Up to 20 posts per page [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/sports/nfl/games/2055084502741811200/posts?queryType=Top" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const gameId = "2055084502741811200"; const response = await fetch( `https://xquik.com/api/v1/x/sports/nfl/games/${gameId}/posts?queryType=Top`, { headers: { "x-api-key": "xq_your_api_key_here" } }, ); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const tweet of page.tweets) { console.log(`@${tweet.author.username}: ${tweet.likeCount} likes`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests game_id = "2055084502741811200" response = requests.get( f"https://xquik.com/api/v1/x/sports/nfl/games/{game_id}/posts", params={"queryType": "Top"}, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: print(f"@{tweet['author']['username']}: {tweet['likeCount']} likes") ``` ## Read what X shows about a game Use `GET /x/sports/{league}/games/{id}/posts` for the posts on a game's page on X. Find the game ID with [List football games](/api-reference/x/sports-games). * `queryType=Top` returns the posts X ranks highest. `queryType=Latest` returns the newest first. * Each post has the same fields as [Search tweets](/api-reference/x/search-tweets) returns. * `query` is the X (Twitter) search that finds the posts. X builds it from the teams, hashtags, team accounts & star players. X adds the game's time window. Pass `query` to [Search tweets](/api-reference/x/search-tweets) to add filters like language, media or minimum likes. A game has posts before kickoff, during the game & after it. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `league` | `string` | Yes | `nfl` for the NFL or `ncaafb` for college football, in any case. Another value gets a free `400 invalid_league`. | | `id` | `string` | Yes | Game ID, a number up to 19 digits, such as `2055084502741811200`. [List football games](/api-reference/x/sports-games) returns it as `id`. Another value gets a free `400 invalid_game_id`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `queryType` | `string` | No | `Top` for the posts X ranks highest or `Latest` for the newest. Any case works. `Relevance` & `Recency` work too, & so do the names `order` & `sort`. Send the same value with each cursor. | | `cursor` | `string` | No | `next_cursor` from the previous page. | | `pageSize` | `number` | No | Posts per page, up to `10000`. A larger value gets the largest page. The source or your credits can return fewer. Default `20`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | The posts in X's order, as [Search tweets](/api-reference/x/search-tweets) returns them. Each has its author, text, media & metrics. | | `has_next_page` | `boolean` | `true` while more posts follow. | | `next_cursor` | `string` | Pass it as `cursor` for the next page. Empty on the last page. | | `query` | `string \| null` | The X (Twitter) search that finds this game's posts for your order. It's `null` when X sends a timeline Xquik cannot read. | ### 400 Invalid input `{ "error": "invalid_params", "message": "Unknown queryType. Use Latest or Top." }` `queryType` is not `Top`, `Latest`, `Relevance` or `Recency`. A league other than `nfl` or `ncaafb` gets `invalid_league`. A game ID that is not a number gets `invalid_game_id`. These answers are free. ### 404 Game not found `{ "error": "game_not_found", "message": "Game not found. Find game IDs with GET /x/sports/nfl/games." }` X knows no game with this ID. This answer is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy, or X sent an answer Xquik cannot read. Wait for the `Retry-After` header, then send the request again. The request costs nothing. > [!NOTE] > > **Related.** [List football games](/api-reference/x/sports-games) · [Get football scoreboard](/api-reference/x/sports-game) · [Search tweets](/api-reference/x/search-tweets) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "2102761519985332442", "text": "This galaxy is a little extra.\n\nMeet Messier 106, a spiral galaxy with an extra set of arms. These two additional arms are made of gas heated up by jets from the galaxy’s central black hole. The jets’ superheated shockwaves are depicted in royal blue by @chandraxray. https://t.co/421Lzs0r0c", "retweetCount": 1364, "replyCount": 271, "likeCount": 9775 } ], "has_next_page": true, "next_cursor": "DAACCgACHVOxUHMAJxAKAAMdU7FQcv_Y8AgABAAAAAILAAUAAADwRW1QQzZ3QUFBZlEvZ0dKTjB2R3AvQUFBQUJRZFVMTzZONXZBcWgxUTBKTlBXeERDSFZDN3g5QVd3SThkVVhQNHN0ZXdKaDFRcGJ5Zm1uQnpIVkNuT040YnNIVWRVTUcxMUZaaGVSMVJTek56VnVBbEhWQzR5NEFhNGVZZFVMTDVZOXNCckIxUXJmN0NtMUZCSFZDeCt2ZWFNTEFkVUtSRkF4b2dsaDFRbVJETUY3QmNIVkNJNGpjV0lLa2RVVW15QTFkUlh4MVJHclhDVjJIdEhWQ3lGeWthUU1FZFVMSmlFOW9BVEIxUmxiS1gxdEZCCAAGAAAAAAgABwAAAAAMAAgKAAEdUIjiNxYgqQAAAA", "query": "(#WASvsSF OR #WASatSF OR \"San Francisco 49ers\" OR \"Washington Commanders\" OR @49ers OR @Commanders) since_time:1792455300 until_time:1792541700 -filter:nativeretweets" } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # NFL game rosters & accounts, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/sports-game-roster Get both teams' rosters for 1 NFL game from X, with each player's jersey, position, headshot & X account, plus each team's name, colors & logos. 1 credit. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/sports/{league}/games/{id}/roster` **1 credit per request** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/sports/nfl/games/2055084502741811200/roster" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const gameId = "2055084502741811200"; const response = await fetch(`https://xquik.com/api/v1/x/sports/nfl/games/${gameId}/roster`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const game = await response.json(); if (!response.ok) throw new Error(JSON.stringify(game)); for (const roster of game.rosters) { console.log(game.teams[roster.teamId]?.name); for (const playerId of roster.playerIds) { const player = game.players[playerId]; console.log(`#${player?.jersey} ${player?.name} ${player?.position}`); } } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests game_id = "2055084502741811200" response = requests.get( f"https://xquik.com/api/v1/x/sports/nfl/games/{game_id}/roster", headers={"x-api-key": "xq_your_api_key_here"}, ) game = response.json() if not response.ok: raise RuntimeError(game) for roster in game["rosters"]: print(game["teams"].get(roster["teamId"], {}).get("name")) for player_id in roster["playerIds"]: player = game["players"].get(player_id, {}) print(f"#{player.get('jersey')}", player.get("name"), player.get("position")) ``` ## Read both rosters Use `GET /x/sports/{league}/games/{id}/roster` for the players of both teams. Find the game ID with [List football games](/api-reference/x/sports-games). * `rosters` holds each team's `teamId` & its `playerIds`, in X's order. * `players` holds each player once, keyed by ID, with jersey, position, headshot & X account. * A player's `xUser` also says whether the account is `protected`. It also says whether the account can offer subscriptions & has a highlighted label. Rosters carry no college, birth details or large photos, so those fields are null. The [box score](/api-reference/x/sports-game-box-score) has them for players who recorded stats. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `league` | `string` | Yes | `nfl`, in any case. X has no college rosters, so `ncaafb` gets a free `400 unsupported_league`. Another value gets a free `400 invalid_league`. | | `id` | `string` | Yes | Game ID, a number up to 19 digits, such as `2055084502741811200`. [List football games](/api-reference/x/sports-games) returns it as `id`. Another value gets a free `400 invalid_game_id`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | The game ID from your request. | | `league` | `string` | Always `nfl`. | | `rosters` | `object[]` | Each team's roster, in X's order. | | `rosters[].teamId` | `string` | The team, a key of `teams`. | | `rosters[].playerIds` | `string[]` | The team's players in X's order, keys of `players`. | | `teams` | `object` | The 2 teams, keyed by team ID. | | `players` | `object` | Every rostered player, keyed by player ID. | Each value in `teams` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The team ID that games & players refer to. | | `name` | `string` | The team's full name, such as `San Francisco 49ers`. | | `shortName` | `string` | The team's short name. | | `abbreviation` | `string` | The team's abbreviation, such as `SF`. | | `alternateId` | `string` | Another ID X keeps for the team. College plays & drives name a side by it. | | `location` | `string` | The school or place the team plays for. College schedules & a game's audience send it. | | `colors` | `object[]` | The team's colors. Each has `r`, `g` & `b`, from 0 to 255. | | `logos` | `object` | The team's logo links. `default` is the one X shows. `light` & `dark` suit light or dark backgrounds. | | `xUserId` | `string` | The user ID of the team's X account. Pass it to [Get user](/api-reference/x/twitter-profile-lookup). | | `record` | `object` | The team's `wins`, `losses` & `ties` this season. X sends it only in college football games. | | `recentGames` | `object[]` | The team's recent games, newest first. Games without a kickoff time come last. Each has `id`, `startsAt`, `venue`, `status`, `clock`, `quarter`, `home` & `away`. `home` & `away` hold `teamId` & `points`. X sends them only with the teams of a college football game. The list is empty elsewhere. | Each value in `players` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The player ID that plays & stats refer to. | | `teamId` | `string` | The player's team, a key of `teams`. | | `name` | `string` | The player's full name. | | `shortName` | `string` | The name play descriptions use, such as `B.Purdy`. | | `jersey` | `string` | The jersey number, as text. | | `position` | `string` | The position, such as `QB` or `DE`. | | `college` | `string` | The college the player came from. | | `birthPlace` | `string` | Where the player was born. X sends it only for NFL players. | | `birthDate` | `string` | The birth date, as `YYYY-MM-DD`. | | `headshots` | `object` | Photo links in `original`, `large`, `medium` & `small`. Any of them can be null. | | `xUser` | `object` | The player's X account, with `id`, `username` & `blueVerified`. Null when the player has none. Rosters also fill `protected`, `superFollowEligible` & the highlighted `labelType`, such as `BusinessLabel`. Other answers send them as null. | ### 400 Unsupported league `{ "error": "unsupported_league", "message": "Rosters & player props cover nfl only. Send nfl as the league." }` Send `nfl` as the league. A game ID that is not a number gets `invalid_game_id`. Both answers are free. ### 404 Game not found `{ "error": "game_not_found", "message": "Game not found. Find game IDs with GET /x/sports/nfl/games." }` X knows no NFL game with this ID. This answer is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [List football games](/api-reference/x/sports-games) · [Get football box > score](/api-reference/x/sports-game-box-score) · [Get NFL player > props](/api-reference/x/sports-game-player-props) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "2055084502741811200", "league": "nfl", "rosters": [ { "teamId": "689566294702555136", "playerIds": ["1520565710329499648"] } ], "teams": {}, "players": {} } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Resource not found." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Football game schedule & IDs, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/sports-games List NFL or college football games in a time window, with teams, kickoff times, live scores & the game IDs X's sports pages use. 1 credit per request. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/sports/{league}/games` **1 credit per request** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G "https://xquik.com/api/v1/x/sports/nfl/games" \ --data-urlencode "from=2026-10-15" \ --data-urlencode "to=2026-10-22" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ from: "2026-10-15", to: "2026-10-22" }); const response = await fetch(`https://xquik.com/api/v1/x/sports/nfl/games?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); for (const game of body.games) { const home = body.teams[game.home.teamId]?.abbreviation; const away = body.teams[game.away.teamId]?.abbreviation; console.log(`${game.id} ${away} ${game.away.points} at ${home} ${game.home.points}`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/sports/nfl/games", params={"from": "2026-10-15", "to": "2026-10-22"}, headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) for game in body["games"]: home = body["teams"].get(game["home"]["teamId"], {}).get("abbreviation") away = body["teams"].get(game["away"]["teamId"], {}).get("abbreviation") print(game["id"], away, game["away"]["points"], "at", home, game["home"]["points"]) ``` ## Find NFL & college football games Use `GET /x/sports/{league}/games` to list a league's games & find their IDs. Send `nfl` for the NFL or `ncaafb` for college football. * `id` is the game ID that the scoreboard, plays & box score routes take. * `home` & `away` name each team by `teamId`, with its points so far. * `teams` holds each team once, by team ID, with its name, colors & logos. * `status` tells games apart, such as `Scheduled`, `InProgress` or `Closed`. Games come earliest first. Without `from` or `to`, X picks about 5 weeks around today. Send 1 of them & the window spans 7 days from it. To follow 1 team, send its ID in `team`. Copy the ID from `teamIds` of any game. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `league` | `string` | Yes | `nfl` for the NFL or `ncaafb` for college football, in any case. Another value gets a free `400 invalid_league`. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `from` | `string` | No | Start of the window. Send an ISO 8601 date or time, such as `2026-10-01`, or Unix seconds. A time without a zone reads as UTC. Defaults to 7 days before `to`. Also read as `sinceTime`. | | `to` | `string` | No | End of the window, in the forms `from` takes. Defaults to 7 days after `from`. Also read as `untilTime`. | | `team` | `string` | No | Keeps 1 team's games, by team ID. For example, `689566294702555136` is the San Francisco 49ers. Each game lists its `teamIds`. Also read as `teamId` or `team_id`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `league` | `string` | The league from your request, `nfl` or `ncaafb`. | | `games` | `object[]` | The league's games in the window, earliest first. | | `games[].id` | `string` | The game ID that [Get football scoreboard](/api-reference/x/sports-game) and the other game routes take. | | `games[].seasonType` | `string` | The part of the season, such as `RegularSeason`. | | `games[].week` | `number` | The week of the season. | | `games[].startsAt` | `string` | The kickoff time in UTC. Null when X sends a time Xquik cannot read. | | `games[].status` | `string` | X's game status, such as `Scheduled`, `InProgress` or `Closed`. | | `games[].clock` | `string` | The game clock, as X writes it. | | `games[].quarter` | `number` | The current or last quarter. | | `games[].home` | `object` | The home team's `teamId`, a key of `teams`, & its `points` so far. | | `games[].away` | `object` | The away team's `teamId`, a key of `teams`, & its `points` so far. | | `games[].teamIds` | `string[]` | The game's teams, keys of `teams`. | | `games[].periods` | `object[]` | The periods played so far. Each has `type`, such as `Quarter`. The scoreboard adds each period's points. | | `games[].odds` | `object` | Betting odds for `home` & `away`, or null when X has none. Each side has `moneyLine`, `spread` & `total`, as X writes them. X sends `moneyLine` for the away team only. | | `teams` | `object` | The teams the games name, keyed by team ID. | Each value in `teams` has these fields. | Field | Type | Description | | - | - | - | | `id` | `string` | The team ID that games & players refer to. | | `name` | `string` | The team's full name, such as `San Francisco 49ers`. | | `shortName` | `string` | The team's short name. | | `abbreviation` | `string` | The team's abbreviation, such as `SF`. | | `alternateId` | `string` | Another ID X keeps for the team. College plays & drives name a side by it. | | `location` | `string` | The school or place the team plays for. College schedules & a game's audience send it. | | `colors` | `object[]` | The team's colors. Each has `r`, `g` & `b`, from 0 to 255. | | `logos` | `object` | The team's logo links. `default` is the one X shows. `light` & `dark` suit light or dark backgrounds. | | `xUserId` | `string` | The user ID of the team's X account. Pass it to [Get user](/api-reference/x/twitter-profile-lookup). | | `record` | `object` | The team's `wins`, `losses` & `ties` this season. X sends it only in college football games. | | `recentGames` | `object[]` | The team's recent games, newest first. Games without a kickoff time come last. Each has `id`, `startsAt`, `venue`, `status`, `clock`, `quarter`, `home` & `away`. `home` & `away` hold `teamId` & `points`. X sends them only with the teams of a college football game. The list is empty elsewhere. | ### 400 Invalid input `{ "error": "invalid_league", "message": "Send nfl or ncaafb as the league, such as /x/sports/nfl/games." }` The league is not `nfl` or `ncaafb`. This answer is free. A `from`, `to` or `team` Xquik cannot read gets `invalid_input`. Its message says what to send. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Next steps.** Pass a game `id` to [Get football scoreboard](/api-reference/x/sports-game). The same `id` works with [Get football plays](/api-reference/x/sports-game-plays) and [Get football box score](/api-reference/x/sports-game-box-score). ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "league": "nfl", "games": [ { "id": "2055084502741811200", "seasonType": "RegularSeason", "week": 6, "startsAt": "2026-10-20T00:15:00.000Z", "status": "Closed" } ], "teams": {} } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Home timeline tweets & media, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/timeline Get a connected X account's home feed. Paginate tweets with authors, replies, reposts, likes, views, media, and cursors. Costs 1 credit per tweet returned. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/timeline` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit The route reads the home timeline of 1 of your connected X accounts. Without one, it returns `424 account_required`. Use [Connect X account](/api-reference/x-accounts/connect) to add one. When your connected X accounts are busy, it returns `503`. Retry after the `Retry-After` delay. Each `next_cursor` reads the next page from the same X account. If that account can no longer read, the route returns `410 cursor_account_unavailable`. Start again without the cursor. An account that follows no one returns no tweets and `has_next_page: false`. Results exclude X ads. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/timeline \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq # Page 2 curl -G https://xquik.com/api/v1/x/timeline \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const baseUrl = "https://xquik.com/api/v1/x/timeline"; const seenTweetIds = new Set(); let pageCursor = ""; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = new URLSearchParams(); if (pageCursor !== "") params.set("cursor", pageCursor); if (seenTweetIds.size > 0) { params.set("seenTweetIds", Array.from(seenTweetIds).join(",")); } const query = params.toString(); const response = await fetch(query === "" ? baseUrl : `${baseUrl}?${query}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); const timelineRows = page.tweets.map((tweet) => { seenTweetIds.add(tweet.id); return { timeline_source: "home", tweet_id: tweet.id, tweet_url: tweet.url ?? null, text: tweet.text, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, created_at: tweet.createdAt ?? null, is_reply: tweet.isReply ?? false, in_reply_to_id: tweet.inReplyToId ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, quote_count: tweet.quoteCount ?? null, view_count: tweet.viewCount ?? null, media_urls: (tweet.media ?? []).map((item) => item.mediaUrl).filter(Boolean), page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, }; }); for (const row of timelineRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests seen_tweet_ids = set() page_cursor = "" for page_index in range(3): params = {} if page_cursor: params["cursor"] = page_cursor if seen_tweet_ids: params["seenTweetIds"] = ",".join(sorted(seen_tweet_ids)) response = requests.get( "https://xquik.com/api/v1/x/timeline", params=params, headers={"x-api-key": "xq_YOUR_KEY_HERE"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: seen_tweet_ids.add(tweet["id"]) timeline_row = { "timeline_source": "home", "tweet_id": tweet["id"], "tweet_url": tweet.get("url"), "text": tweet["text"], "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "author_name": (tweet.get("author") or {}).get("name"), "author_followers": (tweet.get("author") or {}).get("followers"), "author_verified": (tweet.get("author") or {}).get("verified"), "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"), "created_at": tweet.get("createdAt"), "is_reply": tweet.get("isReply", False), "in_reply_to_id": tweet.get("inReplyToId"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "quote_count": tweet.get("quoteCount"), "view_count": tweet.get("viewCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page["next_cursor"], "has_next_page": page["has_next_page"], } print(json.dumps(timeline_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## Home timeline handoff Use `GET /x/timeline` for the authenticated account's home feed. The examples write JSON Lines rows. They include author ID, username, display name, and tweet text. Rows include follower count, verified state, profile image URL, `seenTweetIds`, and cursor fields. Store processed tweet IDs. Then pass them as `seenTweetIds` with the last saved `next_cursor`. Use the home timeline for inboxes, CRM routing, and approved monitoring. Store the connected account ID and collection time with each page. Keep tweet IDs, authors, text, engagement counts, replies, media, and cursors. X controls ranking and source availability. The response is not a complete public archive. X explains the feed model in its [home and user timeline documentation](https://docs.x.com/x-api/posts/timelines/introduction). > [card] Home feed rows > > Store one row per `tweets[]` item with `timeline_source: "home"` for the > connected account. > [card] Seen tweet deduplication > > Add processed tweet IDs to `seenTweetIds` before requesting the next page. > [card] Cursor checkpoint > > Store `has_next_page` and `next_cursor`. Pass `next_cursor` back as `cursor` > only when `has_next_page` is true. > [card] Account-scoped sync > > Keep home timeline rows in account-scoped inbox, CRM, monitor seed, or agent > memory systems. | Home timeline column | Response source | Feed use | | - | - | - | | `tweet_id` | `tweets[].id` | Deduplicate rows and build tweet URLs. | | `author_id` | `tweets[].author.id` | Keep stable author identity when usernames change. | | `page_cursor` | Request `cursor` | Trace the page that produced each row. | | `next_cursor` | Response `next_cursor` | Resume after storing the current page. | ## Twitter API timeline pagination Process one home-feed page at a time. Use each returned tweet ID to deduplicate timeline tweets. Save each page before advancing its cursor. Keep the prior cursor until validating its replacement. Send the last `next_cursor` as `cursor` after storing the full page. Pass processed tweet IDs through `seenTweetIds` to reduce repeat rows. Stop when `has_next_page` is false or `next_cursor` is empty. Respect the `Retry-After` header after a 429 or 503 response. After a 424 `account_required` response, connect an X account first. After a 410 `cursor_account_unavailable` response, start again without the cursor. After other 424 or 502 responses, retry the stored cursor. Never advance a checkpoint after a failed destination write. ## Route home timeline tweets | Routing rule | Concrete match | Destination | | - | - | - | | Support reply | Approved account or keyword | Support review queue | | Campaign mention | Campaign phrase in `text` | Campaign verification queue | | Media review | Non-empty `media` | Image or video review | | High engagement | Approved likes, replies, reposts, or views | Priority research queue | | No rule match | No approved condition matches | Store without generating a notification | Keep each rule name beside its tweet ID. Keep the original tweet text. Reprocess a tweet only after its routing rule changes. ## Twitter timeline API questions ### How do you authenticate timeline requests? Send an Xquik API key through the `x-api-key` header. Keep keys server-side. Never expose a key in a browser, mobile bundle, or public repository. ### Can you filter home timeline tweets by hashtag? No. `GET /x/timeline` returns the connected account's ranked home feed. Use [tweet search](/api-reference/x/search-tweets) for keyword, author, date, or media filters. ### Can you display timeline tweets in an app? Yes. Render `tweets[]` with the returned text, author, media, and tweet URL. Store tweet IDs for deduplication. Refresh from the last confirmed cursor. ### How should timeline API errors be retried? Fix authentication after a 401 response. Add credits after a 402 response. Connect an X account after `424 account_required`. Start again without the cursor after `410 cursor_account_unavailable`. Respect `Retry-After` after 429 or 503. Resume from the stored cursor after other 424 or 502 responses. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. The next page comes from the same connected X account. | | `seenTweetIds` | `string` | No | Comma-separated tweet IDs to exclude from results. Ignore empty entries. Use this to skip tweets the user has already seen. | | `pageSize` | `integer` | No | Tweets per page. Accepts `1-100`. Defaults to `20`. Also read as `limit`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ## Which timeline endpoint? > [card] Home timeline > > Use `GET /x/timeline` for the connected account's home feed. > [card] Profile timeline > > Use [`GET /x/users/{id}/tweets`](/api-reference/x/user-tweets) for one > public profile's timeline. > [card] Mentions timeline > > Use [`GET /x/users/{id}/mentions`](/api-reference/x/user-mentions) for > public mentions of one account. > [card] Saved tweets > > Use [`GET /x/bookmarks`](/api-reference/x/bookmarks) for tweets the > connected account saved. > [card] Notifications > > Use [`GET /x/notifications`](/api-reference/x/notifications) for compact > inbox activity rows. > [card] Monitor events > > Use [`List events`](/api-reference/events/list) after account or keyword > monitors have captured replayable webhook events. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | Yes | Your API key. You can also authenticate with an OAuth bearer token. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of timeline tweets. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Contains the tweet text. | | `tweets[].type` | `string` | Returns the tweet type when available. | | `tweets[].createdAt` | `string` | Returns an ISO 8601 timestamp when available. | | `tweets[].isNoteTweet` | `boolean` | Marks long-form Note Tweets when available. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Counts likes when available. | | `tweets[].retweetCount` | `number` | Counts reposts when available. | | `tweets[].replyCount` | `number` | Counts replies when available. | | `tweets[].quoteCount` | `number` | Counts quote tweets when available. | | `tweets[].viewCount` | `number` | Counts views when available. | | `tweets[].bookmarkCount` | `number` | Counts bookmarks when available. | | `tweets[].url` | `string` | Links to the tweet on X when available. | | `tweets[].lang` | `string` | Identifies the tweet language when available. | | `tweets[].isReply` | `boolean` | Marks replies when available. | | `tweets[].inReplyToId` | `string` | Identifies the parent tweet for a reply. | | `tweets[].inReplyToUserId` | `string` | Identifies the replied-to user. | | `tweets[].inReplyToUsername` | `string` | Identifies the replied-to username. | | `tweets[].conversationId` | `string` | Identifies the conversation when available. | | `tweets[].source` | `string` | Identifies the posting client when available. | | `tweets[].displayTextRange` | `number[]` | Provides rendered text offsets when available. | | `tweets[].isLimitedReply` | `boolean` | Shows whether X (Twitter) limits replies. | | `tweets[].isQuoteStatus` | `boolean` | Marks quote tweets when available. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Returns parsed entities when available. | | `tweets[].contentDisclosure` | `object` | Describes paid partnerships and AI-generated media. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. | | `tweets[].author` | `object` | Returns the tweet author when available. | | `tweets[].author.id` | `string` | Identifies the author. | | `tweets[].author.username` | `string` | Returns the current X (Twitter) username. | | `tweets[].author.name` | `string` | Returns the display name. | | `tweets[].author.followers` | `number` | Counts the author's followers. | | `tweets[].author.verified` | `boolean` | Shows whether X marks the author as verified. | | `tweets[].author.profilePicture` | `string` | Returns the profile image URL when available. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Lists attached images, GIFs, or videos when available. | | `tweets[].media[].mediaUrl` | `string` | Returns the direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Lists video renditions with bitrates, content types, and URLs. | | `tweets[].media[].type` | `string` | Identifies the media type. | | `tweets[].media[].url` | `string` | Returns the shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embeds the quoted tweet when present. | | `tweets[].retweeted_tweet` | `object` | Embeds the original repost when present. | | `has_next_page` | `boolean` | Shows whether more tweets remain. | | `next_cursor` | `string` | Provides the next page cursor. Empty after the final page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Timeline tweet content", "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 200, "retweetCount": 50, "replyCount": 15, "url": "https://x.com/user/status/1893456789012345678", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk", "followers": 150000000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 401 Unauthenticated Missing or invalid API key. ### 402 Insufficient credits Metered access requires enough available credits. Possible error values include `no_subscription`, `subscription_inactive`, `no_credits`, and `insufficient_credits`. ### 410 Cursor account unavailable The X account that returned the cursor can no longer read. Request the first page again without `cursor`. ### 429 Rate limit exceeded The API key, user, or plan tier is sending requests too fast. Respect the `Retry-After` header before retrying. ### 502 X API unavailable The read service failed. Retry after a short delay. ### 424 Dependency failed The opt-in normalized v1 contract returns `424` when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns `502`. Without a connected X account, the route returns `424 account_required`. This status needs no contract header. `{ "error": "account_required", "message": "This read needs your own connected X account. Connect or restore it at dashboard.xquik.com/account, then retry." }` > [!NOTE] > > **Related.** [Notifications](/api-reference/x/notifications) · [Bookmarks](/api-reference/x/bookmarks) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **410** `{ "error": "cursor_account_unavailable", "message": "The X account for this cursor is unavailable. Start again without the cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Top tweets by likes & views, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/top-tweets Get the top Twitter and X tweets by likes, replies, quotes, bookmarks, shares, or views for a day, week, or month, worldwide or by country. 1 credit per tweet. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/top` **1 credit per tweet** · Up to 100 tweets per list [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --get "https://xquik.com/api/v1/x/tweets/top" \ --data-urlencode "metric=views" \ --data-urlencode "window=week" \ --data-urlencode "country=US" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ metric: "views", window: "week", country: "US" }); const response = await fetch(`https://xquik.com/api/v1/x/tweets/top?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); for (const tweet of body.tweets) { console.log(`@${tweet.author.username}: ${tweet.viewCount} views`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/tweets/top", params={"metric": "views", "window": "week", "country": "US"}, headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) for tweet in body["tweets"]: print(f'@{tweet["author"]["username"]}: {tweet.get("viewCount")} views') ``` ## The tweets X ranks highest Use `GET /x/tweets/top` to list the tweets X ranks highest by one metric. Pick the metric and how far back to look. Narrow it to one country or one language. Leave both out to cover all of X. Pages hold up to 20 tweets. Pass `next_cursor` as `cursor` for the next page. The list ends at 100 tweets. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `metric` | `string` | No | What to rank tweets by. Use `likes`, `replies`, `quotes`, `bookmarks`, `shares`, or `views`. Singular names work too, such as `like`. | | `window` | `string` | No | How far back to look. Use `day`, `week`, or `month`. Also takes `24h`, `7d`, `30d`, `daily`, `weekly`, and `monthly`. | | `country` | `string` | No | Only tweets from one country. Send a 2- or 3-letter ISO 3166 code, such as `US` or `USA`. Send `country` or `language`, not both. | | `language` | `string` | No | Only tweets in one language, as a 2-letter code, such as `en`. Send `country` or `language`, not both. | | `cursor` | `string` | No | `next_cursor` from the previous page. | | `pageSize` | `number` | No | Tweets per page, from 1 to 100. Your credits can return fewer. Default `20`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | The tweets in X's order. Each has its author, text, media, and metrics, as [Search tweets](/api-reference/x/search-tweets) returns them. | | `has_next_page` | `boolean` | `true` while more tweets follow, up to 100. | | `next_cursor` | `string` | Pass it as `cursor` for the next page. Empty on the last page. | ### 400 Invalid input `{ "error": "invalid_input", "message": "Send country or language, not both." }` The message says which parameter to fix. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [Search tweets](/api-reference/x/search-tweets) · [Trends](/api-reference/x/trends) · [Get tweet](/api-reference/x/get-tweet) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "2102761519985332442", "text": "This galaxy is a little extra.\n\nMeet Messier 106, a spiral galaxy with an extra set of arms. These two additional arms are made of gas heated up by jets from the galaxy’s central black hole. The jets’ superheated shockwaves are depicted in royal blue by @chandraxray. https://t.co/421Lzs0r0c", "retweetCount": 1364, "replyCount": 271, "likeCount": 9775 } ], "has_next_page": true, "next_cursor": "DAAHCgABHTK6Vr___-sLAAIAAAATMjEwMTc3MDE4NjE1NjA1Mjk1OQgAAwAAAAIAAA", "filtered_count": 0 } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Trend locations & WOEID list, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/trend-locations List the places X offers trends for. Get each WOEID, name, country, country code, and place type, then send a WOEID to the trends API. 1 credit per location. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/trends/locations` **1 credit per location returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/trends/locations \ --data-urlencode "country=TR" \ --data-urlencode "placeType=town" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ country: "TR", placeType: "town" }); const response = await fetch(`https://xquik.com/api/v1/x/trends/locations?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const locationRows = data.locations.map((location) => ({ woeid: location.woeid, name: location.name, country_code: location.countryCode, place_type: location.placeType, })); for (const row of locationRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/x/trends/locations", params={"country": "TR", "placeType": "town"}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() location_rows = [ { "woeid": location["woeid"], "name": location["name"], "country_code": location["countryCode"], "place_type": location["placeType"], } for location in data["locations"] ] for row in location_rows: print(json.dumps(row)) ``` Use `GET /x/trends/locations` to list the places X offers trends for. Each location carries the `woeid` that [Get X trends](/api-reference/x/trends) takes. Each returned location costs 1 credit. Filters and `limit` lower the cost. An empty result costs nothing. ## Find a WOEID before you read trends Call this endpoint once and store the list. X changes it rarely. Filter by `country` to get a country and its towns in 1 call. Filter by `placeType` to get only countries or only towns. Use `q` when you know part of a place name. Pass the `woeid` of a location to `GET /x/trends` as `woeid`. You can also pass its `name` as `location`, or a country as `country`. Worldwide has `woeid` 1, with no country and no parent. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `country` | `string` | No | Country name or 2-letter code, such as `Turkey` or `TR`. Case insensitive. Returns the country and its towns. | | `placeType` | `string` | No | Kind of place. Use `country`, `town`, `worldwide`, or `unknown`. Case insensitive. X labels a few towns `unknown`. | | `q` | `string` | No | Text the location name contains, such as `york`. Case insensitive. Also read as `query`. | | `limit` | `integer` | No | Maximum locations to return, starting at `1`. Omit it for every match. Your credit balance can return fewer. Also read as `pageSize`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send a full Xquik account API key. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `locations` | `object[]` | Locations that match your filters, in X's order. | | `locations[].woeid` | `number` | Location ID. Pass it as `woeid` to `GET /x/trends`. | | `locations[].name` | `string` | Place name. | | `locations[].country` | `string \| null` | Country name. Null for Worldwide. | | `locations[].countryCode` | `string \| null` | 2-letter country code. Null for Worldwide. | | `locations[].placeType` | `string \| null` | X's kind of place is `Town`, `Country`, `Supername` for Worldwide, or `Unknown`. | | `locations[].placeTypeCode` | `number \| null` | X's numeric code for the kind of place. | | `locations[].parentWoeid` | `number \| null` | WOEID of the country or region above it. Null for Worldwide. | | `locations[].url` | `string \| null` | X's legacy Yahoo GeoPlanet reference. It may not resolve. | | `count` | `number` | Locations returned and charged. | | `total` | `number` | Locations that match the filters, before `limit`. | | `message` | `string` | What to send instead. Present only when no location matches. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "locations": [ { "woeid": 2344116, "name": "Istanbul", "country": "Turkey", "countryCode": "TR", "placeType": "Town", "placeTypeCode": 7, "parentWoeid": 23424969, "url": "http://where.yahooapis.com/v1/place/2344116" } ], "count": 1, "total": 1 } ``` A filter value that matches no location returns an empty list and a `message`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "locations": [], "count": 0, "total": 0, "message": "Unknown placeType. Use country, town, worldwide or unknown." } ``` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded The Xquik tier limit blocked the request. Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Twitter trend locations API questions ### How do I get a list of Twitter trend locations? Call `GET /x/trends/locations` without filters. The response lists every place X offers trends for, with its WOEID. ### How do I find the WOEID of a city or country? Send `q` with part of the name. You can also send `country` with a name or 2-letter code. Read `woeid` from the matching location. ### How much does a trend locations request cost? Each returned location costs 1 credit. An empty result costs nothing. Add `limit` or a filter to return fewer locations. ### What does an unknown filter value return? It returns an empty `locations` list and a `message` that says what to send. The request costs nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Get X trends](/api-reference/x/trends) reads a location's trends by its `woeid` or its name. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "unknown_field", "message": "Unknown field asetUrl. Did you mean assetUrl?" }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Trends by region or WOEID, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/trends Get X (Twitter) trends for a country, town, or WOEID. Return ranked topics, hashtags, search queries, descriptions, and tweet volume. 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/trends` **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/trends \ --data-urlencode "woeid=23424977" \ --data-urlencode "count=10" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ woeid: "23424977", count: "10" }); const response = await fetch(`https://xquik.com/api/v1/x/trends?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const detectedAt = new Date().toISOString(); const trendRows = data.trends.map((trend) => ({ trend_name: trend.name, rank: trend.rank ?? null, description: trend.description ?? null, search_query: trend.query ?? trend.name, region_woeid: data.woeid, returned_count: data.count, detected_at: detectedAt, })); for (const row of trendRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from datetime import datetime, timezone import json import requests response = requests.get( "https://xquik.com/api/v1/x/trends", params={"woeid": 23424977, "count": 10}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() detected_at = datetime.now(timezone.utc).isoformat().replace("+00:00", "Z") trend_rows = [ { "trend_name": trend["name"], "rank": trend.get("rank"), "description": trend.get("description"), "search_query": trend.get("query", trend["name"]), "region_woeid": data["woeid"], "returned_count": data["count"], "detected_at": detected_at, } for trend in data["trends"] ] for row in trend_rows: print(json.dumps(row)) ``` Use `GET /x/trends` to retrieve X's ranked trends for a place you choose. Pick the place by `country`, `location`, or `woeid`. Without one, trends are worldwide. Use trends for planning, monitor setup, search jobs, and alerts. Each example emits one JSON record for every returned trend. Store `trend_name` for every result. Keep `rank`, `description`, and `query` when the response includes them. Leave omitted fields unset. Use the trend name when `query` is missing. Also store `region_woeid`, `returned_count`, and your own `detected_at` timestamp. Pass `search_query` to [Search Tweets](/api-reference/x/search-tweets) for matching tweets. Save each snapshot before you search. ## Build a regional trend monitor Poll one WOEID on a consistent schedule. Store every trend name and returned optional field. Keep missing values unset. Keep `tweetVolume` as null when X returns null. Compare ranks within the same region. Do not mix worldwide and country results inside one ranking. Keep the WOEID on every row. Use the returned search query to retrieve matching tweets. Keep the trend snapshot before starting that search. Each tweet batch then links to the regional topic that started it. Missing tweet volume means unknown. Do not convert it to 0. X may omit that field for some trends. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `woeid` | `integer` | No | Positive Where On Earth ID for the region. It wins over `country` and `location`. Invalid or nonpositive values fall back to those names, then to `1` (worldwide). See [Trends guide](/guides/trends) for common regions, or [List trend locations](/api-reference/x/trend-locations) for every place. | | `country` | `string` | No | Country to read trends for, by name or 2-letter code. Examples are `Turkey` and `TR`. Case insensitive. | | `location` | `string` | No | Town or country to read trends for, by name, such as `Istanbul`. Case insensitive. Add `country` when 2 towns share a name. [List trend locations](/api-reference/x/trend-locations) returns every name. | | `count` | `integer` | No | Number of trends to return. Default `30`, max `50`. Invalid or below-minimum values fall back to `30`. | | `at` | `string` | No | A past time, to read what was trending on Twitter then. Takes an ISO 8601 time, a date such as `2026-10-13`, or Unix seconds. A time without a zone reads as UTC. It also takes a span back from now. A span is a number and `s`, `m`, `h`, or `d`. So `at=24h` reads what was trending on Twitter yesterday at this hour. That holds on every run of a schedule. The answer is the stored list nearest that time. Its own time is in `capturedAt`. History starts 2026-10-13 02:20 UTC. A time over 24 hours from every stored list returns 404 and costs nothing. [Get trends history](/api-reference/x/trends-history) reads a range. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send a full Xquik account API key. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys through the API-key scheme's Bearer alias. Direct MPP uses the `Payment ...` credential from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `trends` | `object[]` | Array of trending topics. | | `trends[].name` | `string` | Trend name or hashtag. | | `trends[].rank` | `number` | Trend rank. Omitted if unavailable. | | `trends[].description` | `string` | Trend description. Omitted if unavailable. | | `trends[].query` | `string` | Search query for this trend. Omitted if unavailable. | | `trends[].promotedContent` | `string \| null` | Promotion identifier. Null for organic trends. | | `trends[].tweetVolume` | `number \| null` | Approximate public post volume when X supplies it. | | `trends[].url` | `string` | X (Twitter) search URL for the trend. | | `count` | `number` | Number of trends returned. | | `woeid` | `number` | WOEID used for the request. | | `location` | `object` | The place `country` or `location` named, with the fields of a [trend location](/api-reference/x/trend-locations). Absent when `woeid` picked the place or the request named none. | | `capturedAt` | `string` | When Xquik read this list from X, as ISO 8601 in UTC. Present only with `at`. It comes from the stored list and is never estimated. | | `requestedAt` | `string` | The time `at` asked for, as Xquik read it. A span such as `24h` shows here as the time it counted back to. Present only with `at`. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "trends": [ { "name": "#AI", "rank": 1, "description": "Trending in Technology", "query": "%23AI", "promotedContent": null, "tweetVolume": 250000, "url": "https://x.com/search?q=%23AI" } ], "count": 1, "woeid": 23424977 } ``` A request with `location=Istanbul` also names the place it read. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "trends": [], "count": 0, "woeid": 2344116, "location": { "woeid": 2344116, "name": "Istanbul", "country": "Turkey", "countryCode": "TR", "placeType": "Town", "placeTypeCode": 7, "parentWoeid": 23424969, "url": "http://where.yahooapis.com/v1/place/2344116" } } ``` ### 400 Invalid input X lists no trends for that `country` or `location`. With `at`, so does a `woeid` X lists no trends for. An `at` that Xquik cannot read also returns 400. So does a value past its length limit. The request costs nothing. ### 401 Unauthenticated Missing or invalid API key. ### 402 Payment required Account keys receive account payment options. Guest keys receive only the guest top-up action. Anonymous calls receive `WWW-Authenticate: Payment` plus a guest wallet action. Failed requests never create checkout. Confirm a payment option first. ### 404 No stored list With `at`, Xquik holds no list within 24 hours of that time. Before the place's first stored list, the message names when its archive starts. X serves no older lists. Without `at`, a `woeid` X lists no trends for also returns 404. The request costs nothing. `{ "error": "not_found", "message": "Xquik stores no trends for this place before 2026-10-13 02:20 UTC. X serves no older lists, so ask for that time or later." }` ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded The Xquik tier limit blocked the request. Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Twitter trends API questions ### How do I get Twitter trends programmatically? Call `GET /x/trends` with a `country`, a `location`, or a `woeid`, and a result `count`. Read each trend's name, rank, query, description, and available tweet volume. ### Can I get Twitter trends by country or city name? Yes. Send `country=TR` or `location=Istanbul`. Names ignore case. The response returns the place it read as `location`. ### Can I track trending hashtags by region? Yes. Poll the same WOEID on a stable schedule. Compare ranks within the same region. Save each detection time. Use `query` to search tweets related to each trending hashtag. Use the trend name when the response omits `query`. ### How do I authenticate to the Twitter trends API? Send an Xquik API key or OAuth bearer token. A `paid_reads` guest key can use the API-key scheme's Bearer alias. For direct MPP, anonymous requests get a payment challenge. ### How much does a trends request cost? The pricing callout above shows the current credit and direct MPP cost. Failed requests return a documented error without creating checkout. ### How do I build trend tracking into an app? Schedule one regional request, then store each returned snapshot. Compare the latest ranks with the previous snapshot. Send rank changes you care about to a dashboard, monitor, or alert queue. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > This endpoint returns trends directly from X. For broader Radar topic discovery, use [List Radar Items](/api-reference/radar/list). > [!NOTE] > > **Next steps.** [Search Tweets](/api-reference/x/search-tweets) to find tweets about a trending topic. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "X lists no trends for that place. List places with GET /x/trends/locations." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Xquik stores no trends for this place before 2026-10-13 02:20 UTC. X serves no older lists, so ask for that time or later." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Trends history by date, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/trends-history Read the Twitter trends archive of any place. Get past X (Twitter) trends by date and time, from 2026-10-13 on. Each step holds 1 list. 1 credit per list. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/trends/history` **1 credit per list returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/trends/history \ --data-urlencode "country=TR" \ --data-urlencode "from=2026-10-13" \ --data-urlencode "to=2026-10-14" \ --data-urlencode "every=1h" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ country: "TR", from: "2026-10-13", to: "2026-10-14", every: "1h", }); const response = await fetch(`https://xquik.com/api/v1/x/trends/history?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const trendRows = data.snapshots.flatMap((snapshot) => snapshot.trends.map((trend) => ({ captured_at: snapshot.capturedAt, region_woeid: data.woeid, rank: trend.rank, trend_name: trend.name, tweet_volume: trend.tweetVolume ?? null, })), ); for (const row of trendRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/x/trends/history", params={"country": "TR", "from": "2026-10-13", "to": "2026-10-14", "every": "1h"}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() trend_rows = [ { "captured_at": snapshot["capturedAt"], "region_woeid": data["woeid"], "rank": trend["rank"], "trend_name": trend["name"], "tweet_volume": trend.get("tweetVolume"), } for snapshot in data["snapshots"] for trend in snapshot["trends"] ] for row in trend_rows: print(json.dumps(row)) ``` Use `GET /x/trends/history` to read the Twitter trends archive of a place. It answers what was trending on Twitter yesterday or last week. It covers any day since 2026-10-13. Xquik stores 1 list per place every 5 minutes. It keeps each list for 25 months. The archive starts 2026-10-13 02:20 UTC. Earlier trends are not available. Each returned list costs 1 credit, so 24 lists cost 24 credits. A step with no stored list returns nothing and costs nothing. ## Read Twitter trends history by date Pick the place by `country`, `location`, or `woeid`. Without one, trends are worldwide. Set the range with `from` and `to`, and the step with `every`. `from` and `to` take a time or span back from now, such as `7d`. A schedule can then read the last day on every run. The answer names the range it read in `fromTime` and `toTime`. Each step returns the first list Xquik stored in it, oldest first. Every list carries `capturedAt`, the time Xquik read it from X. Xquik never estimates that time. A request returns 24 lists, or up to 100 with `limit`. A wider range answers `has_next_page` as `true`. Send `next_cursor` as `cursor` for the next lists. For 1 past moment, send `at` to [Get X trends](/api-reference/x/trends) instead. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `woeid` | `integer` | No | Positive Where On Earth ID for the region. It wins over `country` and `location`. Invalid or nonpositive values fall back to those names, then to `1` (worldwide). [List trend locations](/api-reference/x/trend-locations) returns every place. | | `country` | `string` | No | Country to read trends history for, by name or 2-letter code. Examples are `Turkey` and `TR`. Case insensitive. | | `location` | `string` | No | Town or country to read trends history for, by name, such as `Istanbul`. Case insensitive. Add `country` when 2 towns share a name. | | `from` | `string` | No | Start of the range. Takes an ISO 8601 time, a date such as `2026-10-13`, or Unix seconds. A time without a zone reads as UTC. It also takes a span back from now. A span is a number and `s`, `m`, `h`, or `d`. For example, `from=7d` reads the last 7 days. Defaults to 24 hours before `to`. History starts 2026-10-13 02:20 UTC. A range that begins earlier returns the stored part. Alias `sinceTime`. | | `to` | `string` | No | End of the range, which it leaves out. Takes the forms of `from`. For example, `from=2d` with `to=1d` reads the day before the last 24 hours. Defaults to now. Alias `untilTime`. | | `every` | `string` | No | Step between 2 returned lists, as a number and `m`, `h`, or `d`. Examples are `15m`, `1h`, and `1d`. Default `1h`. A step under `5m` returns every stored list. | | `count` | `integer` | No | Number of trends in each list. Default `30`, max `50`. Invalid or below-minimum values fall back to `30`. | | `limit` | `integer` | No | Maximum lists 1 request returns and charges. Default `24`, max `100`. Your credit balance can return fewer. | | `cursor` | `string` | No | The `next_cursor` of the page before, for the next lists. It keeps the time of the first request. That way, a range of spans stays the same on every page. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Send a full Xquik account API key. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `snapshots` | `object[]` | 1 stored list per step, oldest first. A step with no stored list is left out. | | `snapshots[].capturedAt` | `string` | When Xquik read this list from X, as ISO 8601 in UTC. It comes from the stored list and is never estimated. | | `snapshots[].count` | `number` | Trends in this list. | | `snapshots[].trends` | `object[]` | The trends of the list, with the fields of [Get X trends](/api-reference/x/trends). `rank` is the trend's place in X's list at that time. | | `count` | `number` | Lists returned and charged. | | `fromTime` | `string` | Start of the range as Xquik read it, as ISO 8601 in UTC. A span such as `7d` shows here as the time it counted back to. | | `toTime` | `string` | End of the range as Xquik read it, which the range leaves out. Without `to`, it is the time of the first request. | | `woeid` | `number` | WOEID used for the request. | | `location` | `object` | The place `country` or `location` named, with the fields of a [trend location](/api-reference/x/trend-locations). Absent when `woeid` picked the place or the request named none. | | `has_next_page` | `boolean` | Whether the range holds more lists. | | `next_cursor` | `string` | Send it as `cursor` for the next lists. Empty on the last page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "snapshots": [ { "capturedAt": "2026-10-13T14:00:26.000Z", "count": 1, "trends": [ { "name": "#AI", "rank": 1, "description": "Trending in Technology", "query": "%23AI", "promotedContent": null, "tweetVolume": 250000, "url": "https://x.com/search?q=%23AI" } ] } ], "count": 1, "fromTime": "2026-10-13T00:00:00.000Z", "toTime": "2026-10-14T00:00:00.000Z", "woeid": 1, "has_next_page": false, "next_cursor": "" } ``` ### 400 Invalid input An unknown place returns 400. So does a `from` that is not earlier than `to`. A time, step or `cursor` Xquik cannot read also returns 400. So does a value past its length limit. The request costs nothing. ### 404 No stored list The range ends before the place's first stored list. The message names when its archive starts. X serves no older lists. The request costs nothing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded The Xquik tier limit blocked the request. Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Twitter trends archive API questions ### How do I see what was trending on Twitter yesterday? Call `GET /x/trends/history` with yesterday's date as `from` and today's date as `to`. Add `every=1h` for 1 list per hour. Add `every=1d` for the first list of the day. ### How far back does the Twitter trends archive go? It starts 2026-10-13 02:20 UTC. Xquik keeps each list for 25 months. A range that ends before the start returns 404 and costs nothing. ### How often does Xquik store a list? Every 5 minutes, for every place X offers trends for. A step under `5m` returns every stored list. ### How much does trends history cost? Each returned list costs 1 credit, so 24 lists cost 24 credits. A step with no stored list costs nothing. A request returns 100 lists at most. ### What if no list matches a step? The response leaves that step out. Xquik never fills a gap with a made-up list. Each returned list states its own `capturedAt`. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Get X trends](/api-reference/x/trends) reads the current trends of a place. With `at`, it reads 1 past moment. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "X lists no trends for that place. List places with GET /x/trends/locations." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "not_found", "message": "Xquik stores no trends for this place before 2026-10-13 02:20 UTC. X serves no older lists, so ask for that time or later." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # X (Twitter) API tweet analysis parameters & budget Source: https://docs.xquik.com/api-reference/x/tweet-analysis-parameters Set the posts, questions, baseline, and budget for X (Twitter) tweet analysis. See every body parameter for sentiment, brand, news, signal, and viral calls. > For the complete documentation index, see [llms.txt](/llms.txt). Every tweet analysis route accepts this body. Each route adds its own questions and answers. ## Pick the posts to analyze Send `tweetIds`, `texts`, a page, or a search, never more than 1. Sending none, or more than 1, returns `400 invalid_input`. | Source | Send | Posts analyzed | | - | - | - | | Post IDs | `tweetIds`, post IDs or post URLs | Each post once | | Your own texts | `texts`, strings | Each text. Reads nothing from X | | A page | 1 of the page fields below | Up to `limit` posts, 20 by default | | A search | 1 or more of the search fields below | Up to `limit` posts, 20 by default | A page reads 1 post's thread or 1 account's tab. | Page field | Posts it reads | | - | - | | `threadOf` | 1 post's thread, as [Get tweet thread](/api-reference/x/tweet-thread) reads it. A post ID or URL | | `repliesBy` | 1 account's Replies tab, as [Get user replies](/api-reference/x/user-replies) reads it. A handle, user ID, or profile URL | | `mediaBy` | 1 account's Media tab, as [Get user media](/api-reference/x/user-media) reads it. A handle, user ID, or profile URL | | `likedBy` | The posts 1 account liked, as [Get user likes](/api-reference/x/user-likes) reads them. A handle, user ID, or profile URL | `sinceTime`, `untilTime` & `queryType` narrow a search only. Sending them with a page returns `400 invalid_input`. A search combines every search field you send into 1 X (Twitter) search. The entries of 1 kind join as alternatives. `username` & `usernames` together read as `(from:NASA OR from:ESA)`. Each kind narrows the others. X (Twitter) searches up to 512 characters. | Search field | Posts it finds | | - | - | | `query` | An X (Twitter) search, with the operators of [Search Tweets](/api-reference/x/search-tweets) | | `queries` | Up to 100 searches. A post matching any of them counts | | `username` | 1 account's posts. A handle, `@handle`, or profile URL | | `usernames` | Up to 100 accounts' posts. Handles, `@handles`, or profile URLs | | `listId` | A public List's posts. A List ID or URL | | `listIds` | Up to 100 public Lists' posts. List IDs or URLs | | `quotesOf` | The quotes of 1 post. A post ID or URL | | `repliesTo` | The replies in 1 post's conversation. A post ID or URL | | `sinceTime` & `untilTime` | Posts between 2 times. An ISO 8601 time or Unix seconds | `queryType` sets the order, `Latest` or `Top`. For more posts than 1 call returns, send the same search again. In that search, set `cursor` to `next_cursor`. Stop when `has_next_page` is `false`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "username": "NASA", "sinceTime": "2026-09-25T00:00:00Z", "untilTime": "2026-09-26T00:00:00Z" } ``` ## Compare with an earlier answer Send the `results` of an earlier call as `baseline` to see what changed. Each row in the new `results` gets `monitor`. `analysisSummary.monitor` counts the posts per status. The comparison costs nothing extra. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "query": "Sony WH-1000XM6 lang:en", "baseline": [ { "id": "1893456789012345678", "answers": { "sentiment": "positive", "intensity": 1.2 } } ] } ``` A baseline row needs the post's `id`, or `tweet.id`, and its `answers`. Send whole result rows when you have them. Their `monitor` carries the settings' fingerprint, so rows from other settings show as `not_comparable`. | `monitor.status` | Meaning | | - | - | | `first_run` | You sent no baseline | | `new_to_baseline` | The baseline has no row for this post | | `unchanged` | Every decision matches the baseline | | `changed` | At least 1 decision clearly moved. `changes` lists each 1 | | `not_comparable` | Other settings made the row, or it answers none of these questions | A decision counts as changed only when its answer clearly leaves the old one. So near ties between calls stay `unchanged`. Keep `analysis` the same between calls for comparable answers. ## Budget the analysis Each analyzed post costs 2 credits. Each text in `texts` costs the same. Posts in `unanalyzed` cost nothing. When credits cover fewer posts than you asked for, fewer come back. The posts left over appear in `unanalyzed` with `insufficient_credits`. If credits cover no post, the call returns `402 insufficient_credits`. | `unanalyzed[].reason` | Meaning | What to do | | - | - | - | | `post_unavailable` | X returns no such post | Skip the post | | `missing_text` | The post has no text | Skip the post | | `insufficient_credits` | Credits ran out | Add credits, then send it again | | `context_limit` | The settings leave the post no room | Shorten the context or questions | | Any other reason | The analysis failed (`status: "failed"`) | Send the post again | A call can run out of time before it reaches every post. The posts or texts left over come back in `unprocessed_ids`, and they cost nothing. Send those post IDs again in `tweetIds`, and those texts again in `texts`. For texts, `text:3` names the third text you sent. A search or page also returns `next_cursor` for the posts after them. ## Body parameters | Body parameter | Type | Required | Description | | - | - | - | - | | `tweetIds` | `string[]` | No | Post IDs or post URLs, such as `x.com/nasa/status/20`, as many as the body holds. A post named twice is analyzed once. Send `tweetIds`, `texts`, or a search, not more than 1. | | `query` | `string` | No | X (Twitter) search to analyze, with the operators of [Search Tweets](/api-reference/x/search-tweets). X (Twitter) searches up to 512 characters, counted with the other search fields. Search Tweets counts `q` the same way. | | `username` | `string` | No | Analyze 1 account's posts. Send a handle, with or without `@`, or a profile URL. | | `listId` | `string` | No | Analyze a public List's posts. Send its ID or URL. | | `quotesOf` | `string` | No | Analyze the quotes of 1 post. Send its ID or URL. | | `repliesTo` | `string` | No | Analyze the replies in 1 post's conversation. Send its ID or URL. | | `queries` | `string[]` | No | Up to 100 X (Twitter) searches, read as 1 search. A post matching any of them counts. | | `usernames` | `string[]` | No | Up to 100 accounts, read as 1 search. Send handles, with or without `@`, or profile URLs. | | `listIds` | `string[]` | No | Up to 100 public Lists, read as 1 search. Send their IDs or URLs. | | `threadOf` | `string` | No | Analyze 1 post's thread. Send its ID or URL, with no other source. | | `repliesBy` | `string` | No | Analyze 1 account's Replies tab. Send a handle, user ID, or profile URL, with no other source. | | `mediaBy` | `string` | No | Analyze 1 account's Media tab. Send a handle, user ID, or profile URL, with no other source. | | `likedBy` | `string` | No | Analyze the posts 1 account liked. Send a handle, user ID, or profile URL, with no other source. | | `sinceTime` | `string` | No | Inclusive start of the search, such as `2026-09-25T00:00:00Z`. Unix seconds also work. A time without an offset is UTC. | | `untilTime` | `string` | No | Exclusive end of the search. Unix seconds also work. A time without an offset is UTC. | | `queryType` | `string` | No | Search order. Use `Latest` or `Top`. Defaults to `Latest`. | | `limit` | `integer` | No | Maximum posts to analyze from the search or page. Accepts `1` or more. Defaults to `20`. Credits can return fewer. | | `cursor` | `string` | No | The `next_cursor` of the page before. Send the same search or page with it. | | `texts` | `string[]` | No | Texts of your own, such as drafts, as many as the body holds. Each must contain words. Reads nothing from X. | | `topic` | `string` | No | Keep only posts about this topic, such as `the Rust programming language`. AI checks each post first, and only kept posts are analyzed and cost credits. `topicFilter` states the cutoff and counts. Send `topic` or `imageShows`, not both. | | `imageShows` | `string` | No | Keep only posts whose photos show this, such as `charts` or `a rocket`. Only photos X does not mark sensitive are checked, and only kept posts are analyzed and cost credits. `imageFilter` states the cutoff and counts. | | `baseline` | `object[]` | No | Rows of an earlier answer to compare with, such as its `results`. Each needs the post's `id`, or `tweet.id`, and its `answers`. Each new result's `monitor` says whether the post is new, changed, or unchanged. The comparison costs nothing extra. | | `analysis` | `object` | No | Optional settings. Leave it out to ask the route's own questions. | | `analysis.targets` | `object[]` | No | Brands, people, assets, or topics the questions are about. Each has a `name` and optional `aliases`, such as a ticker or product name. | | `analysis.context` | `string` | No | Background the AI reads with every post, such as your product or market. | | `analysis.questions` | `object[]` | No | Questions of your own, which replace the route's questions. They fit in 8,000 bytes together. Each needs an `id` and a `type` of `choice`, `score`, or `probability`. Each also needs a `version` and `instructions`. A choice adds `categories`, a score adds `levels`, and a probability can add `criteria`. | | `analysis.preset` | `string` | No | A ready set of questions, used when `questions` is left out. Use `brand`, `complaints`, `competitors`, `purchase_intent`, `product_feedback`, `news`, `sentiment`, or `market`. `complaints`, `competitors`, `purchase_intent`, and `product_feedback` need `targets`. | | `analysis.maxContextBytes` | `integer` | No | Bytes of post, quote, and settings the AI reads. Accepts `219-64000`. Defaults to `64000`. Xquik cuts a longer post to fit. | | `analysis.concurrency` | `integer` | No | Posts analyzed at the same time. Accepts `1-16`. Defaults to `16`. | | `analysis.images` | `boolean` | No | Reads up to 4 images per post with its text, at no extra cost. Defaults to `true`. Images of posts X marks sensitive stay unread. Send `false` to analyze the text alone. `contextAvailability.media` is `images` when the AI read them. | # Tweet embed HTML & oEmbed, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/tweet-embed Get the HTML that embeds one public tweet on a website, with the tweet link and author. Pick a light or dark theme, hide media or the thread. 1 credit a call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/embed` **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call Embed tweet returns the HTML that shows one public tweet on a website. The endpoint is `GET /api/v1/x/tweets/{id}/embed`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/2102882545427714266/embed \ --data-urlencode "theme=dark" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "2102882545427714266"; const params = new URLSearchParams({ theme: "dark", omitScript: "true" }); const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/embed?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const { embed } = await response.json(); const embedRow = { tweet_id: embed.tweetId, tweet_url: embed.url, author_name: embed.authorName, html: embed.html, width: embed.width ?? null, }; process.stdout.write(`${JSON.stringify(embedRow)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "2102882545427714266" response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/embed", params={"theme": "dark", "omitScript": "true"}, headers={"x-api-key": "xq_your_api_key_here"}, ) embed = response.json()["embed"] embed_row = { "tweet_id": embed["tweetId"], "tweet_url": embed["url"], "author_name": embed["authorName"], "html": embed["html"], "width": embed.get("width"), } print(json.dumps(embed_row)) ``` Use `GET /x/tweets/{id}/embed` when a page, CMS, or newsletter tool shows a tweet. The HTML is the markup X gives websites for that tweet. Each call costs 1 credit. A refused request costs nothing. ## Place the embed on a page Insert `embed.html` where the tweet belongs. The markup holds the tweet text and a script tag that loads X's widget. The widget then draws the full tweet card in the reader's browser. Send `omitScript=true` when a page shows several tweets. Load X's widget script once on that page instead. Store `embed.html` with the tweet ID and the options you sent. A stored embed saves a second call for the same tweet and look. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `theme` | `string` | No | Color theme of the embed. Use `light` or `dark`. X uses `light` when you omit it. Any letter case works. | | `hideMedia` | `boolean` | No | Set `true` to leave photos, videos, and link cards out. | | `hideThread` | `boolean` | No | Set `true` to leave the tweet this one replies to out. | | `omitScript` | `boolean` | No | Set `true` to leave the widget script tag out. Use it on pages that load the script once themselves. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `embed` | `object` | The embed of the tweet. | | `embed.tweetId` | `string` | ID of the embedded tweet. | | `embed.url` | `string` | Link to the tweet with its author's username. | | `embed.authorName` | `string` | Display name of the tweet's author. | | `embed.authorUrl` | `string` | Link to the author's profile. | | `embed.html` | `string` | Markup to place on a page. It loads X's widget script unless `omitScript` is `true`. | | `embed.width` | `number` | Width of the embed in pixels. | | `embed.height` | `number` | Height in pixels. Present only when X fixes it. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "embed": { "tweetId": "2102882545427714266", "url": "https://x.com/NASA/status/2102882545427714266", "authorName": "NASA", "authorUrl": "https://x.com/NASA", "html": "

Welcome to the Artemis Accords, Croatia

— NASA (@NASA) September 23, 2026
\n\n", "width": 550 } } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Send theme as light or dark, and hideMedia, hideThread & omitScript as true or false." }` An option has a value the endpoint does not take. Fix the option and send the request again. ### 400 Invalid tweet ID `{ "error": "invalid_tweet_id" }` The provided tweet ID is empty or not a valid format. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls receive a direct MPP `WWW-Authenticate: Payment` challenge plus a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 404 Tweet not found X has no embed for the tweet. The author may have deleted it, or the account is private. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy X returned no embed, or Xquik is busy. Retry after a short delay. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Tweet embed API questions ### How do I embed a tweet on a website with an API? Call `GET /x/tweets/{id}/embed` with the tweet ID or URL. Insert `embed.html` into your page where the tweet belongs. ### How do I get a dark theme tweet embed? Send `theme=dark`. The returned markup then asks X's widget for the dark card. ### How do I embed many tweets on one page? Send `omitScript=true` for each tweet. Load X's widget script once on the page. ### How much does a tweet embed cost? Each call costs 1 credit. A refused or failed request costs nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Get tweet](/api-reference/x/get-tweet) reads the tweet's fields as JSON. [Download media](/api-reference/x/download-media) saves its photos and videos. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Tweet engagement & reach, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/tweet-engagement-insights Get a Twitter or X post's engagements per hour, per view, and per follower of its author, plus how far it spread and how much talk it drew. 1 credit per report. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/insights` **1 credit per report**, whatever it reads · A tweet X doesn't have is free [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/2102882545427714266/insights" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/tweets/2102882545427714266/insights", { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); const { insights } = body; console.log( `${insights.engagementsPerHour} engagements an hour, ${insights.engagementPerView}% of views`, ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/tweets/2102882545427714266/insights", headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) insights = body["insights"] print(f'{insights["engagementsPerHour"]} engagements an hour, {insights["engagementPerView"]}% of views') ``` ## How a tweet performs Use `GET /x/tweets/{id}/insights` to see how fast a tweet draws engagement. It also shows how far the tweet spreads. Name the tweet by ID or URL. Engagements are likes, replies, reposts, and quotes. `amplification` is reposts and quotes per like, and `conversation` is replies per like. A rate is `null` when nothing divides it, such as a tweet without views. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Tweet ID or URL-encoded tweet URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `insights` | `object` | | | `insights.tweetId` | `string` | ID of the tweet. | | `insights.authorId` | `string \| null` | ID of the author. | | `insights.authorUserName` | `string \| null` | Username of the author. | | `insights.createdAt` | `string \| null` | When the tweet went up. | | `insights.ageHours` | `number \| null` | Hours since the tweet went up. | | `insights.metrics` | `object` | Likes, replies, reposts, quotes, bookmarks, and views. | | `insights.engagements` | `number` | Likes, replies, reposts, and quotes. | | `insights.engagementsPerHour` | `number \| null` | Engagements per hour since the tweet went up. | | `insights.engagementPerView` | `number \| null` | Engagements as a percent of views. | | `insights.engagementRate` | `number \| null` | Engagements as a percent of the author's followers. | | `insights.amplification` | `number \| null` | Reposts and quotes per like. | | `insights.conversation` | `number \| null` | Replies per like. | ### 400 Invalid input `{ "error": "invalid_tweet_id" }` Send a tweet ID or a tweet URL. ### 404 Tweet not found A tweet X doesn't have is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [User engagement insights](/api-reference/x/user-engagement-insights) · [Get tweet](/api-reference/x/get-tweet) · [Viral score](/api-reference/x/viral-score) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "insights": { "tweetId": "2102882545427714266", "authorId": "11348282", "authorUserName": "NASA", "createdAt": "2026-09-23T22:07:23.000Z", "ageHours": 133.88 } } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # X (Twitter) API tweet filters & query parameters Source: https://docs.xquik.com/api-reference/x/tweet-filters Filter X (Twitter) API tweet results by author, language, date, media, engagement counts, replies, reposts, phrases, hashtags, and cashtags on read routes. > For the complete documentation index, see [llms.txt](/llms.txt). Read routes that link here accept these optional filters on `tweets[]`. Each route keeps its own target. Xquik filters rows after it fetches each page. Selective filters can return fewer rows than an unfiltered page. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fromUser` | `string` | No | Filter to posts from this username. The `@` prefix is optional. | | `toUser` | `string` | No | Filter to replies directed to this username. | | `mentioning` | `string` | No | Filter to posts that mention this username. | | `language` | `string` | No | Only include posts with this language code. | | `sinceDate` | `string` | No | Include posts created on or after this date or timestamp. | | `untilDate` | `string` | No | Include posts up to this date or timestamp. A date is a UTC day, inclusive, so its own posts count. | | `mediaType` | `string` | No | Use `images`, `videos`, `gifs`, `media`, `links`, or `none`. | | `minLikes` | `integer` | No | Require this minimum like count. | | `minRetweets` | `integer` | No | Require this minimum repost count. | | `minReplies` | `integer` | No | Require this minimum reply count. | | `minQuotes` | `integer` | No | Require this minimum quote count. | | `minViews` | `integer` | No | Require this minimum view count. | | `minBookmarks` | `integer` | No | Require this minimum bookmark count. | | `maxFaves` | `integer` | No | Allow this maximum like count. Missing counts pass. | | `maxRetweets` | `integer` | No | Allow this maximum repost count. Missing counts pass. | | `maxReplies` | `integer` | No | Allow this maximum reply count. Missing counts pass. | | `maxQuotes` | `integer` | No | Allow this maximum quote count. Missing counts pass. | | `blueVerifiedOnly` | `boolean` | No | When `true`, only return posts from Blue-verified authors. | | `verifiedOnly` | `boolean` | No | When `true`, only return posts from verified authors. | | `replies` | `string` | No | Use `include`, `exclude`, or `only` for replies. This setting overrides `includeReplies` when the endpoint supports both. | | `retweets` | `string` | No | Use `include`, `exclude`, or `only` for reposts. | | `exactPhrase` | `string` | No | Match this literal phrase, including any hyphens. | | `excludeWords` | `string` | No | Exclude comma-separated or whitespace-separated terms. | | `anyWords` | `string` | No | Require at least 1 comma-separated or whitespace-separated term. | | `hashtags` | `string` | No | Match these hashtags. Separate values with commas or spaces. | | `cashtags` | `string` | No | Match these cashtags. Separate values with commas or spaces. | | `quotes` | `string` | No | Use `include`, `exclude`, or `only` for quote posts. | | `url` | `string` | No | URL substring or domain that must appear in tweet URL entities. | | `conversationId` | `string` | No | Filter to tweets in this conversation thread. | | `inReplyToTweetId` | `string` | No | Only include replies to this tweet ID. | | `quotesOfTweetId` | `string` | No | Filter to quote tweets of this tweet ID. | | `retweetsOfTweetId` | `string` | No | Filter to retweets of this tweet ID. | # Hidden replies on a tweet, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/tweet-hidden-replies Get the replies a tweet's author hid on Twitter or X, oldest first. Export hidden replies with authors, parents, metrics, and cursors. 1 credit per reply. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/hidden-replies` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/tweets/1893456789012345678/hidden-replies \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 curl -G https://xquik.com/api/v1/x/tweets/1893456789012345678/hidden-replies \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1893456789012345678"; let pageCursor = ""; let position = 0; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch( `https://xquik.com/api/v1/x/tweets/${tweetId}/hidden-replies${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }, ); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const tweet of page.tweets) { position += 1; const hiddenReplyRow = { source_tweet_id: tweetId, hidden_position: position, reply_id: tweet.id, in_reply_to_id: tweet.inReplyToId ?? null, author_username: tweet.author?.username ?? null, text: tweet.text, tweet_url: tweet.url ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? null, view_count: tweet.viewCount ?? null, page_cursor: pageCursor, }; process.stdout.write(`${JSON.stringify(hiddenReplyRow)}\n`); } if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1893456789012345678" page_cursor = "" position = 0 for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/hidden-replies", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: position += 1 hidden_reply_row = { "source_tweet_id": tweet_id, "hidden_position": position, "reply_id": tweet["id"], "in_reply_to_id": tweet.get("inReplyToId"), "author_username": (tweet.get("author") or {}).get("username"), "text": tweet["text"], "tweet_url": tweet.get("url"), "created_at": tweet.get("createdAt"), "like_count": tweet.get("likeCount"), "view_count": tweet.get("viewCount"), "page_cursor": page_cursor, } print(json.dumps(hidden_reply_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## Order and empty results Use `GET /x/tweets/{id}/hidden-replies` for the replies a post's author hid. X (Twitter) lists them under "Hidden replies" on the post. Rows arrive oldest first. The examples above save that order as `hidden_position`. The list also holds the replies to a hidden reply. Use `inReplyToId` to tell them apart from replies to the post. A post without hidden replies returns an empty list, not an error. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [], "has_next_page": false, "next_cursor": "" } ``` The last page looks the same. Stop paging when `has_next_page` is `false`. A post X does not have returns 404 `tweet_not_found`. Xquik charges nothing. ## Which reply endpoint? * Use `GET /api/v1/x/tweets/{id}/hidden-replies` for replies the author hid. * Use `GET /api/v1/x/tweets/{id}/replies` for the replies X shows under a post. * Use `GET /api/v1/x/tweets/{id}/thread` for the conversation around a post. | Reply view | Route | Rows returned | | - | - | - | | Hidden replies | `/x/tweets/{id}/hidden-replies` | Replies the author hid, oldest first. | | Shown replies | `/x/tweets/{id}/replies` | Replies X shows under the post. | | Thread context | `/x/tweets/{id}/thread` | The conversation around the post. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Tweets per page, up to `10000`. A larger value gets the largest page. Defaults to `20`. | ### Tweet result filters These optional filters apply to `tweets[]` returned by this route. They keep the same hidden replies target. Xquik filters rows after it fetches each page. Selective filters can return fewer rows than an unfiltered page. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of hidden replies, oldest first. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text content. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. Omitted if unavailable. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet (long-form post). Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if not a reply. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author handle without `@`. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted if unavailable. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "A reply the author hid", "inReplyToId": "1893456789012345000", "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 200, "viewCount": 15000, "url": "https://x.com/user/status/1893456789012345678", "author": { "id": "44196397", "username": "username", "name": "Xquik", "followers": 1200, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid tweet ID `{ "error": "invalid_tweet_id" }` The tweet ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Tweet replies](/api-reference/x/tweet-replies) · [Tweet thread](/api-reference/x/tweet-thread) · [Get tweet](/api-reference/x/get-tweet) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Quote tweets of a tweet, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/tweet-quotes View quote tweets for an original tweet with an X (Twitter) API. It returns authors, commentary, media, engagement counts, filters, cursors & error responses. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/quotes` > [!NOTE] > > Repost records include `retweetedAt`, the repost event's UTC ISO 8601 timestamp. It is `null` when > that timestamp is unavailable. The API omits it for original posts. The nested original post keeps > its own creation date. This field does not report every account that reposted a post. [Request > per-account timestamps with Get retweeters.](/api-reference/x/retweeters#retweet-timestamps) Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) This route returns quote tweets for one original tweet. Each row includes the quoting tweet's commentary, author, engagement counts, and media attachments. The route is `GET /api/v1/x/tweets/{id}/quotes`. A post X does not have returns `404 tweet_not_found`, as [Get tweet](/api-reference/x/get-tweet) does. Quotes X (Twitter) still lists for a deleted post return as rows. A post without quotes returns an empty page. A 404 costs no credits. Pass `next_cursor` back unchanged as `cursor`. A page can be empty while `has_next_page` is `true`, so keep following `next_cursor`. A cursor in use returns `409 coverage_cursor_unavailable`. Wait for `Retry-After`, then retry it once. A finished or expired cursor returns `410 coverage_cursor_gone`. Restart without a cursor and deduplicate by `id`. A busy read returns `503`. Retry after `Retry-After`. ```bash First page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/1893456789012345678/quotes" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```bash Next page with filters theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/1893456789012345678/quotes \ --data-urlencode "cursor=abc123" \ --data-urlencode "sinceTime=1774500000" \ --data-urlencode "includeReplies=false" \ --data-urlencode "verifiedOnly=true" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1893456789012345678"; const params = new URLSearchParams({ sinceTime: "1774500000", includeReplies: "false", }); const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/quotes?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const nextCursor = data.has_next_page ? data.next_cursor : null; const quoteRows = data.tweets.map((tweet) => ({ quoted_tweet_id: tweetId, quote_id: tweet.id, text: tweet.text, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, quote_count: tweet.quoteCount ?? null, media_urls: tweet.media?.map((item) => item.mediaUrl).filter(Boolean) ?? [], })); const checkpoint = { quoted_tweet_id: tweetId, next_cursor: nextCursor }; for (const row of quoteRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } process.stdout.write(`${JSON.stringify({ checkpoint })}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1893456789012345678" response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/quotes", params={"sinceTime": "1774500000", "includeReplies": "false"}, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() next_cursor = data["next_cursor"] if data["has_next_page"] else None quote_rows = [ { "quoted_tweet_id": tweet_id, "quote_id": tweet["id"], "text": tweet["text"], "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "author_name": (tweet.get("author") or {}).get("name"), "author_followers": (tweet.get("author") or {}).get("followers"), "author_verified": (tweet.get("author") or {}).get("verified"), "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"), "created_at": tweet.get("createdAt"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "quote_count": tweet.get("quoteCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], } for tweet in data["tweets"] ] checkpoint = {"quoted_tweet_id": tweet_id, "next_cursor": next_cursor} for row in quote_rows: print(json.dumps(row)) print(json.dumps({"checkpoint": checkpoint})) ``` The Node.js and Python snippets write JSON Lines quote rows plus a separate checkpoint. They do not write raw response pages. Store each mapped row and the latest `next_cursor`. A moderation queue, campaign report, research job, or agent handoff can then resume. It can resume from the last completed page without duplicate rows. ## Direct quote tweet handoff Use `GET /api/v1/x/tweets/{id}/quotes` when a workflow needs quote tweets as JSON rows. It can be a support, campaign, moderation, research, or agent workflow. The endpoint returns one row for every quote tweet in the response. Store `quoted_tweet_id`, `quote_id`, `text`, `author_id`, `author_username`, `author_name`, `author_followers`, `author_verified`, `author_profile_picture`, `created_at`, and engagement counts. Also store media URLs and a separate `next_cursor` checkpoint. Use `sinceTime`, `untilTime`, `includeReplies`, and tweet result filters to narrow the quote set. Do this before you export rows. > [card] Quote rows > > Store `tweets[]` as quote tweet rows for one source tweet. > [card] Stable upserts > > Store `tweets[].id` as `quote_id` with `quoted_tweet_id` for idempotent > imports and moderation queues. > [card] Author joins > > Store `tweets[].author.id`, `username`, `name`, `followers`, `verified`, and > `profilePicture` for CRM, research, and review tools. > [card] Engagement metrics > > Store `likeCount`, `replyCount`, `retweetCount`, `quoteCount`, `viewCount`, > and `bookmarkCount` when returned. > [card] Media context > > Store `media[].mediaUrl`, `entities`, `quoted_tweet`, and `retweeted_tweet` > when returned to keep attached context. > [card] Window filters > > Use `sinceTime`, `untilTime`, `includeReplies`, and tweet result filters to > narrow a window. It can be a campaign, support, or audit window. > [card] Next page > > Store `has_next_page` and `next_cursor`. Then pass `next_cursor` back as `cursor` > only when `has_next_page` is true. > [card] Credit-limited pages > > Use `tweets.length`, not a requested page size, for row counts. Low balances > can return fewer rows. Direct quote tweet reads cost 1 credit per tweet returned. Low credit balances can return fewer tweets than a full page. Zero affordable results return `402 insufficient_credits`. ## Historical pages vs live quote alerts Use this endpoint when you need existing quote tweets for one source tweet. Use monitors for future quote activity as stored events or signed webhook deliveries. > [card] Historical quote pull > > Call `GET /x/tweets/{id}/quotes`, store `quote_id`, and resume with > `next_cursor` for one known source tweet. > [card] Account quote monitor > > Use [`POST /monitors`](/api-reference/monitors/create) with > `eventTypes: ["tweet.quote"]` when one tracked account's future quote > tweets should produce events. > [card] Keyword quote monitor > > Use [`POST /monitors/keywords`](/api-reference/monitors/create-keyword) > with `eventTypes: ["tweet.quote"]` when matching future quote tweets should > produce events. > [card] Signed webhook delivery > > Use [`POST /webhooks`](/api-reference/webhooks/create) with `tweet.quote`, > verify signatures, and replay stored rows with > [`GET /events`](/api-reference/events/list). ## Quote tweet questions ### What are quote tweets? A quote tweet is a new tweet containing commentary about an original tweet. X calls this format a [Quote Post](https://docs.x.com/x-api/posts/quote-tweets/introduction). This endpoint returns the quoting tweet, its author, and visible engagement. It never changes the original tweet. ### How does an X (Twitter) API view quote tweets? Pass the original tweet's numeric ID through the path. Store every returned `quote_id` before requesting `next_cursor`. Keep the original tweet ID beside each row for attribution, deduplication, and campaign reporting. ### Why are some quote tweets not showing? X controls which quote tweets each request exposes. Deleted, protected, withheld, blocked, or unavailable tweets may not appear. Filters can also remove otherwise visible rows. A missing row cannot confirm zero quote activity. ### How do quote tweets differ from replies and reposts? A quote tweet adds its author's commentary and references the original tweet. A repost shares the original without added commentary. The replies endpoint returns tweets from the original conversation. Use retweeters for reposting profiles. ### How can teams analyze quote tweets? Store text, author, creation time, engagement counts, and media URLs. Keep the source relationship separate. Use both tweet IDs as the deduplication key. Use monitors and signed webhooks for future quote alerts. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from `next_cursor` in a previous response. Leave it empty for the initial request. Pass a cursor only when `has_next_page` is true. | | `mode` | `string` | No | Legacy pagination override. Use `standard` when required by an older client. Search filters such as `keywords` apply only without it. | | `pageSize` | `integer` | No | Tweets per page. Automatic pages accept `1` through `10000`, standard pages `1` through `100`. Defaults to `20`. | | `sinceTime` | `string` | No | Unix timestamp in seconds. Only return quotes after this time. | | `untilTime` | `string` | No | Unix timestamp in seconds. Only return quotes before this time. | The default result holds replies that quote the tweet, as X's Quotes view does. Send `replies=exclude` to drop such replies. ### Tweet result filters These optional filters apply to `tweets[]` returned by this route. They keep the same quoted tweet. Xquik filters rows after it fetches each page. Selective filters can return fewer rows than an unfiltered page. | Query parameter | Type | Required | Description | | - | - | - | - | | `includeReplies` | `boolean` | No | Keep replies that quote the post. Automatic pages keep them unless this is `false`. Standard pages keep them only when it is `true`. Explicit `replies` takes precedence. | | `queryType` | `string` | No | `Latest` lists the newest quotes first. `Top` lists the quotes X (Twitter) ranks highest. `Top` is X's ranking, not a count order. So a later page can hold a quote X (Twitter) ranks higher. Any case works. The alias `sort` also takes `Recency` & `Relevance`. Send the same value with each cursor. Standard pages list `Latest`. | See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `cardName` | `string` | No | Keep only Tweets with this card type, such as `poll2choice_text_only`. | | `source` | `string` | No | X search no longer supports `source`. A Tweet search with it answers 424 & charges nothing. | | `excludeSource` | `string` | No | X search no longer supports `excludeSource`. A Tweet search with it answers 424 & charges nothing. | | `geocode` | `string` | No | X search no longer supports `geocode`. A Tweet search with it answers 424 & charges nothing. | | `near` | `string` | No | A place name. A country, such as United States, works like `placeCountry` & keeps Tweets tagged there. A city keeps Tweets about it. | | `within` | `string` | No | X search no longer supports `within`. A Tweet search with it answers 424 & charges nothing. Use `near` alone. | | `safe` | `boolean` | No | When `true`, enable X safe-search filtering. | | `news` | `boolean` | No | X no longer searches `filter:news`, so leave this unset. | | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | | Query parameter | Type | Required | Description | | - | - | - | - | | `keywords` | `string` | No | Words the Tweets must match, in X search syntax. | | `place` | `string` | No | Search within this X place ID. [Search places](/api-reference/x/search-places) finds the ID by name. | | `placeCountry` | `string` | No | Search within this country code. | | `pointRadius` | `string` | No | Geo point radius in X search syntax, such as `-73.99 40.73 25mi`. | | `boundingBox` | `string` | No | Geo bounding box in X search syntax, such as `-74.1 40.6 -73.9 40.8`. | | `advancedQuery` | `string` | No | Raw X search operators appended to the final search query. | | Query parameter | Type | Required | Description | | - | - | - | - | | `listId` | `string` | No | Search within this X List ID. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which tweet engagement endpoint? > [card] Quote tweets > > Use `GET /x/tweets/{id}/quotes` for tweet rows that quote one source tweet. > [card] Tweet replies > > Use [`GET /x/tweets/{id}/replies`](/api-reference/x/tweet-replies) when you > need reply tweet rows under the source tweet. > [card] Retweeters > > Use [`GET /x/tweets/{id}/retweeters`](/api-reference/x/retweeters) for user > profiles that reposted one source tweet. > [card] Tweet likers > > Use [`GET /x/tweets/{id}/favoriters`](/api-reference/x/favoriters) for user > profiles that liked one source tweet. > [card] Saved exports > > Use [`Create extraction`](/api-reference/extractions/create) with > `toolType=quote_extractor` for a saved job or CSV, JSON, or XLSX > export. > [card] Search handoff > > Use [`Search tweets`](/api-reference/x/search-tweets) when you need keyword, > operator, or structured-filter discovery across many source tweets. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of quote tweets. | | `tweets[].id` | `string` | This value is the tweet ID. | | `tweets[].text` | `string` | This value contains the tweet text. | | `tweets[].type` | `string` | This value identifies the tweet type when available. | | `tweets[].createdAt` | `string` | This value contains the ISO 8601 creation timestamp. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | This ID identifies the tweet receiving the reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if unavailable. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if unavailable. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].likeCount` | `number` | This value records the like count when available. | | `tweets[].retweetCount` | `number` | This value records the repost count when available. | | `tweets[].replyCount` | `number` | This value records the reply count when available. | | `tweets[].quoteCount` | `number` | This value records the quote tweet count when available. | | `tweets[].viewCount` | `number` | This value records the view count when available. | | `tweets[].bookmarkCount` | `number` | This value records the bookmark count when available. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | The tweet's language code appears here when X returns it. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | X can return paid partnership and AI-generated media labels here. Paid partnership state appears in `advertising.isPaidPromotion`. AI media state appears in `aiGenerated.hasAiGeneratedMedia`. X may omit this object. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author handle without `@`. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | This value records the author's follower count when available. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | This array contains media attachments when available. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | ### 401 Unauthenticated Anonymous requests receive `WWW-Authenticate: Bearer`. This is not a Payment challenge. ### 402 Payment required Account keys receive account options. A guest wallet receives a checkout option. Confirm any payment action. > [!NOTE] > > **Related.** [Tweet replies](/api-reference/x/tweet-replies) · [Tweet thread](/api-reference/x/tweet-thread) · [Retweeters](/api-reference/x/retweeters) · [Tweet favoriters](/api-reference/x/favoriters) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "2102761519985332442", "text": "This galaxy is a little extra.\n\nMeet Messier 106, a spiral galaxy with an extra set of arms. These two additional arms are made of gas heated up by jets from the galaxy’s central black hole. The jets’ superheated shockwaves are depicted in royal blue by @chandraxray. https://t.co/421Lzs0r0c", "retweetCount": 1364, "replyCount": 271, "likeCount": 9775 } ], "has_next_page": true, "next_cursor": "DAAHCgABHTK6Vr___-sLAAIAAAATMjEwMTc3MDE4NjE1NjA1Mjk1OQgAAwAAAAIAAA", "filtered_count": 0 } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Get replies to a tweet, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/tweet-replies Get replies to a tweet by ID with cursors, author profiles, engagement metrics, media, and time filters. Complete mode reports coverage. 1 credit per reply. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/replies` > [!NOTE] > > Repost records include `retweetedAt`, the repost event's UTC ISO 8601 timestamp. It is `null` when > that timestamp is unavailable. The API omits it for original posts. The nested original post keeps > its own creation date. This field does not report every account that reposted a post. [Request > per-account timestamps with Get retweeters.](/api-reference/x/retweeters#retweet-timestamps) Result counts cap paid authenticated calls. Low credits reduce the page or ID list. Zero affordable results return `402 insufficient_credits`. **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) > [!NOTE] > > Omit `mode` to get the fullest results. The response shape stays the same. > Pass `next_cursor` back unchanged as `cursor`. Keep the same endpoint, target, > query, and filters. Existing unprefixed cursors keep their legacy behavior. `after`, `limit`, and `pageSize` aliases also keep working. Billing still counts only returned rows. Use `mode=standard` only to keep the legacy pagination. A page can be empty or underfilled. Continue while `has_next_page` is `true`. Stop only after the response reports `has_next_page=false`. First-page requests do not support `Idempotency-Key` retries. Repeating a cursorless request starts a separate extraction. Results returned by that extraction incur their normal charges. Save each response before requesting its next page. A cursor sent again within 10 minutes returns the same page at no charge. After 10 minutes, you cannot replay earlier or terminal responses. If automatic coverage is busy, an initial request returns a standard data page. Live coverage cursors remain atomic. A cursor sent again while its page loads returns that page at no charge. Other repeats return `409 coverage_cursor_unavailable` with exact `Retry-After` seconds. Wait, then send the same cursor again. Repeated busy responses never authorize restarting with another cursor. Expired, superseded, or identity-mismatched cursors return `410 coverage_cursor_gone`. So does a cursor sent again after 10 minutes. The response omits `Retry-After`. Restart without a cursor. Keep received results. Deduplicate restarted results by `id`. Malformed cursors return `400 invalid_coverage_cursor`. Restart without them. Get replies by tweet ID for analysis, support, moderation, giveaways, and agents. > [!WARNING] > > Reply visibility depends on X. Complete mode answers 200 when > `diagnostic.complete` is `true` or rows reach `limit`. Otherwise it answers > `424 replies_incomplete`. A `sinceTime` or > `untilTime` window covered to its end returns 200. A post that shows none of > its counted replies returns 200 with `hiddenReplies`. Retry only while > `diagnostic.sourcesEnded` is `false`. > Never treat missing rows as proof that a user did not reply. See [reply coverage and optional fields](/guides/tweet-profile-api-fields). ## X (Twitter) API reply questions ### How complete is a tweet reply collection? Protected accounts' replies count toward coverage but aren't returned. X may omit deleted, hidden, or unavailable replies. `mode=complete` adds nested replies & a coverage diagnostic. Direct replies match `inReplyToId` to the source tweet. Trust `diagnostic.complete` for direct coverage only. On a `sinceTime` or `untilTime` request it means the whole window was covered. It does not prove that Xquik returned every nested reply. Requested limits & deadlines still apply. Check `strategiesAttempted` for early stops. ### How can applications control reply API costs? ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # First page of replies curl "https://xquik.com/api/v1/x/tweets/1893456789012345678/replies" \ -H "x-api-key: xq_your_api_key_here" | jq # Resume with the previous next_cursor curl -G "https://xquik.com/api/v1/x/tweets/1893456789012345678/replies" \ --data-urlencode "cursor=DAACCgACGE..." \ -H "x-api-key: xq_your_api_key_here" | jq # Bound a campaign or moderation window curl -G "https://xquik.com/api/v1/x/tweets/1893456789012345678/replies" \ --data-urlencode "sinceTime=1777392000" \ --data-urlencode "untilTime=1777478400" \ -H "x-api-key: xq_your_api_key_here" | jq # Request advanced nested-reply diagnostics curl -G "https://xquik.com/api/v1/x/tweets/1893456789012345678/replies" \ --data-urlencode "mode=complete" \ --data-urlencode "limit=25000" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1893456789012345678"; let pageCursor = ""; for (let pageCount = 0; pageCount < 3; pageCount += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/replies${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); const replyRows = page.tweets.map((reply) => ({ parent_tweet_id: tweetId, reply_id: reply.id, text: reply.text, author_id: reply.author?.id ?? null, author_username: reply.author?.username ?? null, created_at: reply.createdAt ?? null, in_reply_to_id: reply.inReplyToId ?? null, conversation_id: reply.conversationId ?? null, like_count: reply.likeCount ?? null, media_urls: (reply.media ?? []).map((item) => item.mediaUrl).filter(Boolean), page_index: pageCount, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, })); for (const row of replyRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1893456789012345678" page_cursor = "" for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/replies", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for reply in page["tweets"]: reply_row = { "parent_tweet_id": tweet_id, "reply_id": reply["id"], "text": reply["text"], "author_id": (reply.get("author") or {}).get("id"), "author_username": (reply.get("author") or {}).get("username"), "created_at": reply.get("createdAt"), "in_reply_to_id": reply.get("inReplyToId"), "conversation_id": reply.get("conversationId"), "like_count": reply.get("likeCount"), "media_urls": [ item["mediaUrl"] for item in reply.get("media", []) if item.get("mediaUrl") ], "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page["next_cursor"], "has_next_page": page["has_next_page"], } print(json.dumps(reply_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## Direct replies handoff Use `GET /x/tweets/{id}/replies` for support, community, moderation, giveaway, or agent workflows. The examples above write rows. They are JSON Lines rows with `parent_tweet_id`, `reply_id`, `text`, author IDs and usernames. They also have thread joins, media URLs, & cursors. The moderation table below adds follower, verification, timing, and engagement projections. Use [`reply_extractor`](/guides/tweet-replies-export) instead when a team needs an estimate or a reusable extraction ID. Use it for stored result pages or CSV, JSON, and XLSX downloads after completion. ## Build a reply moderation table Store one row per reply. Keep the parent Tweet ID and conversation ID beside the reply. Support, moderation, campaign, and giveaway reviews can then reconstruct each conversation branch. | Reply column | Response source | Review use | | - | - | - | | `author_followers` | `tweets[].author.followers` | Add audience context without using it as an identity key. | | `author_verified` | `tweets[].author.verified` | Keep the observed verification state. | | `created_at` | `tweets[].createdAt` | Sort replies inside the campaign or moderation window. | | `like_count` | `tweets[].likeCount` | Prioritize replies with more visible engagement. | | Collection checkpoint | Stored value | Recovery rule | | - | - | - | | Incomplete complete-mode run | `424 replies_incomplete` plus `diagnostic` | Keep rows, inspect evidence, and follow `recommendedFallback`. | ## Which replies endpoint? * Use `GET /api/v1/x/tweets/{id}/replies` for one tweet's replies as JSON rows. * Use [`reply_extractor`](/guides/tweet-replies-export) when you need saved CSV, JSON, or XLSX exports. * Use `GET /api/v1/x/tweets/search` when you need keyword, operator, structured-filter, or `queryType` search. To search one post's replies, send `q=conversation_id:{id}` there. This route reads replies without a search. So `q` or `query` here answers 400 before any read or charge. * Use `GET /api/v1/x/tweets/{id}/thread` when you need ordered thread context around a tweet. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). A retweet ID returns the original post's replies. | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `mode` | `string` | No | Omit it for automatic maximum direct-reply coverage. Use `standard` for legacy pagination. Use `complete` for nested replies and detailed diagnostics. | | `limit` | `number` | No | Complete mode defaults to `25000` combined direct and nested replies. Set a smaller or larger total with `limit`, starting at `1`. | | `pageSize` | `number` | No | Automatic pages accept `1` through `10000`. Standard pages accept `1` through `100`. Omit this field in complete mode. `limit`, `count`, `max_results`, `maxItems`, `max_items` & `per_page` also work outside complete mode. Default `20`. | | `cursor` | `string` | No | Pass `next_cursor` back unchanged. New Xquik cursors resume automatic coverage. Existing unprefixed cursors keep legacy behavior. | | `after` | `string` | No | Legacy `cursor` alias on automatic pages. | | `sinceTime` | `string` | No | Unix timestamp in seconds. Only return replies after this time. | | `untilTime` | `string` | No | Unix timestamp in seconds. Only return replies before this time. Pair with `sinceTime` for closed campaign, support, or audit windows. | | `scope` | `string` | No | In complete mode, select `all`, `direct`, or `nested` replies. | | `maxDepth` | `integer` | No | In complete mode, set the maximum reply depth from the source post. | | `sort` | `string` | No | Sort by `relevance`, `latest`, `oldest`, or `likes`. Complete mode defaults to relevance. Automatic pages list the newest first unless you set `sort`. With `likes`, each page is sorted by likes. A later page can hold a reply with more likes. The order is final on the last page, where `has_next_page` is `false`. `latest` & `oldest` sort every row by date. `orderPartial: true` means replies may be missing between sorted rows. Retry later for a gap-free order. | | `excludeOriginalAuthor` | `boolean` | No | In complete mode, exclude replies from the source-post author. | | `includeOriginalPost` | `boolean` | No | In complete mode, include the source post and count it toward `limit`. | | `includeHidden` | `boolean` | No | In complete mode, add the replies the post's author hid. Each has `hiddenByAuthor: true` and counts toward `limit` like any reply. Xquik adds hidden replies only when the post has any. A post without them costs nothing extra. A paged request answers 400. Get its hidden replies from [Get hidden replies](/api-reference/x/tweet-hidden-replies). | | `hasMediaOnly` | `boolean` | No | In complete mode, only return replies containing media. | ### Tweet result filters These filters apply to automatic and standard pagination. Remove every filter before requesting complete mode. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of reply tweets. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text. | | `tweets[].type` | `string` | Tweet type, when available. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. | | `tweets[].inReplyToId` | `string` | Parent tweet ID. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if unavailable. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if unavailable. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count, when available. | | `tweets[].retweetCount` | `number` | Repost count, when available. | | `tweets[].replyCount` | `number` | Reply count, when available. | | `tweets[].quoteCount` | `number` | Quote tweet count, when available. | | `tweets[].viewCount` | `number` | View count, when available. | | `tweets[].bookmarkCount` | `number` | Bookmark count, when available. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | The tweet's language code, when X returns it. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Offsets of the rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another. Omitted if unavailable. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Paid partnership and AI media labels in `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia`. X may omit this object. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author handle without `@`. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | This value records the author's follower count when available. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments, when available. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | | `nested_replies` | `object[]` | Complete mode's nested replies. Exclude them from direct coverage. | | `orderPartial` | `boolean` | Present with `latest` or `oldest` sort when replies may be missing between sorted rows. Retry later for a gap-free order. | | `hiddenByAuthor` | `boolean` | Present on a reply row when the post's author hid this reply. Complete mode adds such replies when `includeHidden=true`. | | `hiddenReplies` | `integer` | Present on the last automatic page & on a complete-mode answer without rows. X counts this many more replies but shows them to nobody. They may be hidden, protected or deleted. A retry returns the same replies. | | `diagnostic` | `object` | Complete-mode coverage evidence. Omitted from standard responses. | | `diagnostic.complete` | `boolean` | Whether direct coverage met the target without truncation. | | `diagnostic.replyTreeComplete` | `boolean` | Known child counts match the source post & every collected reply. Omitted when confirmation is unavailable. Counts reflect collection time. Continue pagination while `has_next_page` is `true`. | | `diagnostic.replyScopeComplete` | `boolean` | Known child counts confirm all replies within the requested scope & depth. Deeper replies may remain. Omitted when confirmation is unavailable. Check source errors & truncation separately. | | `diagnostic.reportedReplyCount` | `number` | Reply count reported on the source tweet. | | `diagnostic.targetDirectReplies` | `number` | Minimum direct replies required for the coverage target. | | `diagnostic.uniqueDirectReplies` | `number` | Unique replies whose parent matches the requested tweet. | | `diagnostic.coveragePercentage` | `number` | Unique direct replies divided by the reported count. | | `diagnostic.nestedReplyCount` | `number` | Nested replies excluded from direct coverage. | | `diagnostic.pagesAttempted` | `number` | Pages attempted across every collection strategy. | | `diagnostic.strategiesAttempted` | `object[]` | Strategy names, page counts, contributions, and stop reasons. | | `diagnostic.duplicateCount` | `number` | Duplicate tweet IDs removed across strategies. | | `diagnostic.cursorFailures` | `number` | Cursor requests that failed. | | `diagnostic.repeatedCursorCount` | `number` | Repeated cursors rejected to prevent loops. | | `diagnostic.emptyFalseProgressPages` | `number` | Pages that added no new replies. | | `diagnostic.malformedCount` | `number` | Malformed response items rejected. | | `diagnostic.unrelatedCount` | `number` | Tweets rejected because they belong elsewhere. | | `diagnostic.missingResponseModulesOrFields` | `string[]` | Expected X modules or fields that were unavailable. | | `diagnostic.recommendedFallback` | `string` | Recommended action when coverage remains incomplete. | | `diagnostic.richness` | `object` | Field-presence counts across collected direct replies. Includes `totalReplies`, `text`, `author`, `createdAt`, `language`, `url`, and `entities`. Also includes `media`, `article`, `card`, `communityNote`, `quotedOrRepostedTweet`, and `engagementCounts`. | | `diagnostic.responseTruncated` | `boolean` | Whether the requested limit truncated safe results. | | `diagnostic.sourcesEnded` | `boolean` | `true` when the list is final. A retry returns the same rows. | ### 400 Invalid tweet ID The response uses `invalid_tweet_id`. Send a post ID or post URL instead. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Replies incomplete Collected rows & diagnostics stay in the answer. Rows are billed as usual. `recommendedFallback` says what to do next. A cut at your `limit` returns `200` with `limit_reached: true`. ### 503 Complete reply extraction busy Wait for the `Retry-After` duration before repeating complete mode. ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "2083169393878684056", "text": "@OpenAI A model optimizing its own serving cost after deployment is a neat flywheel to see in production ⚙️", "retweetCount": 0, "replyCount": 0, "likeCount": 1 } ], "has_next_page": true, "next_cursor": "xqcv1_tkGoEx1UJRqeog9a2BJdmzUZTMCoU_M8kb6ZZwaDFa0.1", "filtered_count": 0 } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "replies_incomplete", "message": "Replies are incomplete. Retry complete mode later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Check if a user retweeted, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/tweet-repost-check Check whether one X account reposted a tweet, with the repost time & ID, for giveaway & campaign proof. Reads the account's newest posts. 1 credit per check. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/retweeters/check` **1 credit per check** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/2098439298617856319/retweeters/check \ --data-urlencode "user=discord" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "2098439298617856319"; const params = new URLSearchParams({ user: "discord" }); const response = await fetch( `https://xquik.com/api/v1/x/tweets/${tweetId}/retweeters/check?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" } }, ); const check = await response.json(); if (!response.ok) throw new Error(JSON.stringify(check)); const proofRow = { tweet_id: check.tweetId, user_id: check.userId, reposted: check.isRetweeted, reposted_at: check.retweetedAt, read_whole_timeline: check.complete, }; process.stdout.write(`${JSON.stringify(proofRow)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "2098439298617856319" response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/retweeters/check", params={"user": "discord"}, headers={"x-api-key": "xq_your_api_key_here"}, ) check = response.json() if not response.ok: raise RuntimeError(check) proof_row = { "tweet_id": check["tweetId"], "user_id": check["userId"], "reposted": check["isRetweeted"], "reposted_at": check["retweetedAt"], "read_whole_timeline": check["complete"], } print(json.dumps(proof_row, separators=(",", ":"))) ``` ## Read the answer The answer says whether the account reposted the post. * `isRetweeted: true` names the repost in `retweetId` and its time in `retweetedAt`. * `isRetweeted: false` with `complete: true` means the account never reposted the post. * `isRetweeted: false` with `complete: false` means no repost among the newest posts. An older repost can exist. A protected account returns 403 `x_account_protected`. Xquik charges nothing. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/discord/status/2098439298617856319`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `user` | `string` | Yes | The account to check. Send a user ID, a username with or without `@`, or a profile URL. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `isRetweeted` | `boolean` | Whether the account reposted the post. | | `retweetedAt` | `string \| null` | When the account reposted it, else `null`. | | `retweetId` | `string \| null` | The ID of the account's repost, else `null`. | | `tweetId` | `string` | The post checked. | | `userId` | `string` | The account checked. | | `checkedPosts` | `number` | How many of the account's newest posts the check read. | | `complete` | `boolean` | Whether the check read the account's whole timeline. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "isRetweeted": true, "retweetedAt": "2026-09-11T16:59:50.000Z", "retweetId": "2098456494362460375", "tweetId": "2098439298617856319", "userId": "3065618342", "checkedPosts": 20, "complete": false } ``` ### 400 Invalid tweet ID `{ "error": "invalid_tweet_id" }` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` `user` is missing or invalid. ### 403 Protected account `{ "error": "x_account_protected", "message": "Account is protected. Choose a public account." }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Retweeters](/api-reference/x/retweeters) · [Check follower](/api-reference/x/check-follower) · [Get tweet](/api-reference/x/get-tweet) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Tweet video subtitles & text, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/tweet-subtitles Get caption tracks of a public tweet's videos, with language, timed cues, and the full text as a transcript. 1 credit when a track comes back, free otherwise. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/subtitles` **1 credit when a track comes back** · [All plans](https://xquik.com/en) from \$0.00012/credit Tweet subtitles returns the caption tracks of one public tweet's videos. The endpoint is `GET /api/v1/x/tweets/{id}/subtitles`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/tweets/2104593672624886205/subtitles \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "2104593672624886205"; const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/subtitles`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const { subtitles } = await response.json(); const transcriptRows = subtitles.tracks.map((track) => ({ tweet_id: subtitles.tweetId, media_key: track.mediaKey ?? null, language: track.language ?? null, auto_generated: track.autoGenerated, cue_count: track.cues.length, transcript: track.text, })); process.stdout.write(`${JSON.stringify(transcriptRows)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "2104593672624886205" response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/subtitles", headers={"x-api-key": "xq_your_api_key_here"}, ) subtitles = response.json()["subtitles"] transcript_rows = [ { "tweet_id": subtitles["tweetId"], "media_key": track.get("mediaKey"), "language": track.get("language"), "auto_generated": track["autoGenerated"], "cue_count": len(track["cues"]), "transcript": track["text"], } for track in subtitles["tracks"] ] print(json.dumps(transcript_rows)) ``` Use `GET /x/tweets/{id}/subtitles` when you need what a tweet's video says as text. Each track holds its language, timed cues, and the full text as one line. A call that returns a track costs 1 credit. A tweet without captions costs nothing. ## Build a transcript from the tracks Read `text` for the whole transcript as one line. Read `cues` for timed lines, to show beside a player or to cut clips. A video can hold several tracks, one per language. Pick a track by `language`. `autoGenerated` is `true` when X transcribed the audio itself. An uploaded caption file has `autoGenerated: false` and its file name in `name`. A long video splits its captions into files. Xquik reads every file of a track. When X doesn't serve a file in time, the cues stop before it. `truncated` is then `true`. A tweet with no video, or a video without captions, returns `"tracks": []`. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `subtitles` | `object` | The caption tracks of the tweet's videos. | | `subtitles.tweetId` | `string` | ID of the tweet. | | `subtitles.tracks` | `object[]` | Caption tracks. Empty when no video has captions. | | `subtitles.tracks[].mediaKey` | `string` | Media key of the video, as media rows carry it. | | `subtitles.tracks[].language` | `string` | Language code of the track, in lowercase. | | `subtitles.tracks[].name` | `string` | Track name the uploader or X gave it. | | `subtitles.tracks[].autoGenerated` | `boolean` | `true` when X transcribed the audio itself. | | `subtitles.tracks[].url` | `string` | Link to the track's first WebVTT file. | | `subtitles.tracks[].text` | `string` | Every cue's text in order, as one line. | | `subtitles.tracks[].truncated` | `boolean` | `true` when X didn't serve every caption file of the track in time. The cues then cover the files before it. | | `subtitles.tracks[].cues` | `object[]` | Timed captions in order. Each cue has `startMs` and `endMs` in milliseconds. It also has `text`, with a line break between lines. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "subtitles": { "tweetId": "2104593672624886205", "tracks": [ { "mediaKey": "13_2104593621043314689", "language": "en", "name": "Promo Vid Version 6 - Planetary Defenders - This Is Not an Exercise_Caption.en_US.srt", "autoGenerated": false, "url": "https://video.twimg.com/subtitles/amplify_video/2104593621043314689/0/-FdxBBY2iGcoP5wb.vtt", "text": "This asteroid 2024 YR4 might get interesting. There was a chance that it could impact Earth.", "truncated": false, "cues": [ { "startMs": 0, "endMs": 3370, "text": "This asteroid\n2024 YR4 might get interesting." }, { "startMs": 3403, "endMs": 6406, "text": "There was a chance that it could impact\nEarth." } ] } ] } } ``` ### 400 Invalid tweet ID `{ "error": "invalid_tweet_id" }` The provided tweet ID is empty or not a valid format. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 404 Tweet not found X has no such tweet. The author may have deleted it, or the account is private. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy X did not serve a caption file in time, or Xquik is busy. Retry after a short delay. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Tweet subtitles API questions ### How do I get the transcript of a Twitter video with an API? Call `GET /x/tweets/{id}/subtitles` with the tweet ID or URL. Read `subtitles.tracks[0].text` for the transcript. ### Does it work for videos without uploaded captions? Yes, when X transcribed the audio itself. Those tracks have `autoGenerated: true`. A video X has no captions for returns no track. ### Which format are the captions in? Each cue has a start and an end in milliseconds, and its text. `url` links to the track's first WebVTT file on X's video host. ### How much does a tweet's subtitles call cost? A call that returns at least 1 track costs 1 credit. A tweet without captions costs nothing. A refused or failed request costs nothing. ### Does Xquik transcribe the audio? No. Xquik reads the caption tracks X serves with the video. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Get tweet](/api-reference/x/get-tweet) reads the tweet's fields as JSON. [Download media](/api-reference/x/download-media) saves its photos and videos. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Tweet thread & conversation, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/tweet-thread Retrieve the tweet thread around one tweet with authors, reply relationships, text, media, engagement metrics, and cursors. Costs 1 credit per tweet returned. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/thread` > [!NOTE] > > Repost records include `retweetedAt`, the repost event's UTC ISO 8601 timestamp. It is `null` when > that timestamp is unavailable. The API omits it for original posts. The nested original post keeps > its own creation date. This field does not report every account that reposted a post. [Request > per-account timestamps with Get retweeters.](/api-reference/x/retweeters#retweet-timestamps) Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) Get tweet thread returns tweet rows in the conversation thread around one source tweet. Results exclude X ads. The endpoint is `GET /api/v1/x/tweets/{id}/thread`. A post X does not have returns `404 tweet_not_found`, as [Get tweet](/api-reference/x/get-tweet) does. Deleted, suspended-account & protected posts count as missing. A 404 costs no credits. ```bash First page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/1893456789012345678/thread" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```bash Next page theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/1893456789012345678/thread \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "1893456789012345678"; const cursor = process.env.XQUIK_CURSOR ?? ""; const params = new URLSearchParams(); if (cursor !== "") { params.set("cursor", cursor); } const query = params.toString(); const url = `https://xquik.com/api/v1/x/tweets/${tweetId}/thread${query ? `?${query}` : ""}`; const response = await fetch(url, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const nextCursor = data.has_next_page ? data.next_cursor : null; const threadRows = data.tweets.map((tweet) => { const author = tweet.author ?? {}; return { source_tweet_id: tweetId, thread_tweet_id: tweet.id, text: tweet.text, author_id: author.id ?? null, author_username: author.username ?? null, author_name: author.name ?? null, author_followers: author.followers ?? null, author_verified: author.verified ?? null, author_profile_picture: author.profilePicture ?? null, created_at: tweet.createdAt ?? null, conversation_id: tweet.conversationId ?? null, in_reply_to_id: tweet.inReplyToId ?? null, media_urls: tweet.media?.map((item) => item.mediaUrl).filter(Boolean) ?? [], }; }); const checkpoint = { source_tweet_id: tweetId, next_cursor: nextCursor }; for (const row of threadRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } process.stdout.write(`${JSON.stringify({ checkpoint })}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "1893456789012345678" cursor = "" params = {"cursor": cursor} if cursor else None response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/thread", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() next_cursor = data["next_cursor"] if data["has_next_page"] else None thread_rows = [] for tweet in data["tweets"]: author = tweet.get("author") or {} thread_rows.append( { "source_tweet_id": tweet_id, "thread_tweet_id": tweet["id"], "text": tweet["text"], "author_id": author.get("id"), "author_username": author.get("username"), "author_name": author.get("name"), "author_followers": author.get("followers"), "author_verified": author.get("verified"), "author_profile_picture": author.get("profilePicture"), "created_at": tweet.get("createdAt"), "conversation_id": tweet.get("conversationId"), "in_reply_to_id": tweet.get("inReplyToId"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], } ) checkpoint = {"source_tweet_id": tweet_id, "next_cursor": next_cursor} for row in thread_rows: print(json.dumps(row)) print(json.dumps({"checkpoint": checkpoint})) ``` The Node.js and Python snippets write JSON Lines thread rows plus a separate checkpoint. They do not write raw response pages. Store each mapped row and the latest `next_cursor`. A support timeline, research job, moderation queue, or agent handoff can then resume. It can resume from the last completed page without duplicate rows. ## Direct tweet thread handoff Use `GET /api/v1/x/tweets/{id}/thread` when a workflow needs ordered thread rows around one tweet. Store `source_tweet_id`, `thread_tweet_id`, `text`, `author_id`, `author_username`, `author_name`, `author_followers`, `author_verified`, `author_profile_picture`, and `created_at`. Also store `conversation_id`, `in_reply_to_id`, media URLs, and a separate `next_cursor` checkpoint for later jobs. > [card] Thread rows > > Store `tweets[]` as the thread context rows returned for one source tweet. > [card] Stable upserts > > Store `tweets[].id` as `thread_tweet_id` with `source_tweet_id` for > idempotent imports. > [card] Reply joins > > Store `conversationId`, `inReplyToId`, `inReplyToUserId`, and > `inReplyToUsername` to rebuild thread structure. > [card] Author joins > > Store `tweets[].author.id`, `username`, `name`, `followers`, `verified`, and > `profilePicture` for review, CRM, or research tools. > [card] Media context > > Store `media[].mediaUrl`, `entities`, `quoted_tweet`, and `retweeted_tweet` > when returned to keep attached context. > [card] Next page > > Store `has_next_page` and `next_cursor`. Then pass `next_cursor` back as `cursor` > only when `has_next_page` is true. > [card] Credit-limited pages > > Use `tweets.length`, not a requested page size, for row counts. Low balances > can return fewer rows. > [card] Saved exports > > Use `thread_extractor` for a saved extraction job or CSV, JSON, or > XLSX export. Direct tweet thread reads cost 1 credit per tweet returned. Low credit balances can return fewer tweets than a full page. Zero affordable results return `402 insufficient_credits`. ## Reconstruct an ordered tweet thread Use this route when several connected posts form one authored sequence. Start from a known tweet ID. Store each tweet ID, text, author, creation time, engagement counts, media, and thread position. Keep the starting tweet ID with the complete result. Render posts in the returned thread order. Do not sort by engagement counts. Keep media and quote relationships inside each post. Thread results can support long-form reading, approved archiving, or conversation context. A reply from another author may belong to a different conversation path. Use tweet replies for responses under one post. Use quote tweets for external commentary. Use exact tweet lookup when only one post is required. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor from `next_cursor` in a previous response. Omit for the first page. Pass a cursor only when `has_next_page` is true. | | `pageSize` | `integer` | No | Tweets per page, up to `10000`. A larger value gets the largest page. Defaults to `20`. | ### Tweet result filters See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which thread endpoint? > [card] Tweet thread > > Use `GET /x/tweets/{id}/thread` for conversation thread context around one > tweet. > [card] Tweet replies > > Use [`GET /x/tweets/{id}/replies`](/api-reference/x/tweet-replies) when you > need reply tweet rows under one source tweet. > [card] Quote tweets > > Use [`GET /x/tweets/{id}/quotes`](/api-reference/x/tweet-quotes) for tweet > rows that quote one source tweet. > [card] Search tweets > > Use [`GET /x/tweets/search`](/api-reference/x/search-tweets) when you need > keyword, operator, or structured-filter discovery across many tweets. > [card] Saved exports > > Use [`Create extraction`](/api-reference/extractions/create) with > `toolType=thread_extractor` for a saved job or CSV, JSON, or XLSX > export. > [card] Single tweet > > Use [`Get tweet`](/api-reference/x/get-tweet) when you only need one tweet > object by ID. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of tweets in the thread, in time order. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether this tweet is a reply in the thread. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if unavailable. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if unavailable. | | `tweets[].conversationId` | `string` | Thread conversation ID. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author handle without `@`. | | `tweets[].author.name` | `string` | Author display name. Omitted if unavailable. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted when the tweet has no media. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Thread starts here...", "createdAt": "2026-03-27T10:00:00.000Z", "author": { "id": "11348282", "username": "NASA", "name": "NASA", "followers": 12000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": false, "next_cursor": "" } ``` ### 400 Invalid tweet ID `{ "error": "invalid_tweet_id" }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Tweet replies](/api-reference/x/tweet-replies) · [Quote tweets](/api-reference/x/tweet-quotes) · [Retweeters](/api-reference/x/retweeters) · [Create extraction](/api-reference/extractions/create) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Translate a tweet's text, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/tweet-translation Translate one public tweet into the language you pick with X's own translation. Get the text, source language, and links with offsets. 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/tweets/{id}/translation` **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call Translate tweet returns X's own translation of one public tweet. You pick the language. The endpoint is `GET /api/v1/x/tweets/{id}/translation`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/2102882545427714266/translation \ --data-urlencode "language=tr" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweetId = "2102882545427714266"; const params = new URLSearchParams({ language: "tr" }); const response = await fetch(`https://xquik.com/api/v1/x/tweets/${tweetId}/translation?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const { translation } = await response.json(); const translationRow = { tweet_id: translation.tweetId, source_language: translation.sourceLanguage ?? null, language: translation.language, text: translation.text, links: (translation.entities.urls ?? []).map((link) => link.expanded_url), }; process.stdout.write(`${JSON.stringify(translationRow)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests tweet_id = "2102882545427714266" response = requests.get( f"https://xquik.com/api/v1/x/tweets/{tweet_id}/translation", params={"language": "tr"}, headers={"x-api-key": "xq_your_api_key_here"}, ) translation = response.json()["translation"] translation_row = { "tweet_id": translation["tweetId"], "source_language": translation.get("sourceLanguage"), "language": translation["language"], "text": translation["text"], "links": [link["expanded_url"] for link in translation["entities"].get("urls", [])], } print(json.dumps(translation_row)) ``` Use `GET /x/tweets/{id}/translation` when a reader needs a tweet in another language. The text is X's own translation, as x.com shows it under the post. Each call costs 1 credit. A refused request costs nothing. ## Translate tweets for a multilingual feed Read tweets with [Search Tweets](/api-reference/x/search-tweets) or [Get tweet](/api-reference/x/get-tweet). Most tweets carry `lang`, the language code X detects. Call this endpoint only for tweets whose `lang` differs from your reader's language. Store `tweetId`, `language`, and `text` together. A stored translation saves a second call for the same tweet and language. `entities` holds the links, mentions, and tags of the translated text. Their `indices` point into `text`, so you can link them without parsing. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | Post ID or URL-encoded post URL, such as `x.com/nasa/status/20`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `language` | `string` | Yes | Language code to translate into, such as `en`, `tr`, `pt-br`, or `zh-tw`. Any letter case works, and `pt_BR` reads as `pt-br`. A language name, such as `turkish`, returns `400 invalid_language`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `translation` | `object` | X's translation of the tweet. | | `translation.tweetId` | `string` | ID of the translated tweet. | | `translation.language` | `string` | Language code of the translated text, in lower case. | | `translation.sourceLanguage` | `string` | Language code X detects in the tweet. Omitted when X names none. | | `translation.text` | `string` | Translated tweet text. | | `translation.entities` | `object` | Links, mentions, and tags with their offsets in the translated text. Empty when the text has none. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "translation": { "tweetId": "2102882545427714266", "language": "tr", "sourceLanguage": "en", "text": "Artemis Anlaşmaları’na Hoş Geldiniz, Hırvatistan https://t.co/Xe1nm2pkSX", "entities": { "urls": [ { "url": "https://t.co/Xe1nm2pkSX", "expanded_url": "https://go.nasa.gov/3VcvAQn", "display_url": "go.nasa.gov/3VcvAQn", "indices": [49, 72] } ] } } } ``` ### 400 Invalid language `{ "error": "invalid_language", "message": "Send language as a language code, such as en, tr, pt-br or zh-tw." }` `language` is missing or is not a language code. Send a code, not a language name. ### 400 Invalid tweet ID `{ "error": "invalid_tweet_id" }` The provided tweet ID is empty or not a valid format. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls receive a direct MPP `WWW-Authenticate: Payment` challenge plus a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 404 Tweet not found The tweet does not exist. The author may have deleted it, or the ID is invalid. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy X returned no translation, or Xquik is busy. Retry after a short delay. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Tweet translation API questions ### How do I translate a tweet with an API? Call `GET /x/tweets/{id}/translation` with the tweet ID and a `language` code. The response holds the translated text in `translation.text`. ### Which languages can I translate a tweet into? Send any language code X translates into. Examples are `en`, `es`, `tr`, `ja`, and `pt-br`. A code that names no language returns `400 invalid_language` and costs nothing. ### How do I know the tweet's original language? Read `translation.sourceLanguage`. It holds the language code X detects in the tweet. The field is absent when X names no language. ### How much does a tweet translation cost? Each call costs 1 credit. A refused or failed request costs nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Get tweet](/api-reference/x/get-tweet) reads the original text and its `lang`. [Search Tweets](/api-reference/x/search-tweets) finds tweets to translate. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "tweet_not_found", "message": "Tweet not found. Check the tweet ID." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # User profile lookup & counts, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/twitter-profile-lookup Look up a Twitter or X profile by username or user ID. Retrieve the bio, follower and following counts, verification status, location, and links. 1 credit. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}` **1 credit per call** · [All plans](https://xquik.com/en) from \$0.00012/credit Direct [MPP](/mpp/machine-payments-protocol) at USD 0.00015 per call > [!TIP] > > See [Read Data Richness](/guides/tweet-profile-api-fields) for every optional > profile field. Xquik omits fields that X does not supply. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/username \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const username = "username"; const response = await fetch(`https://xquik.com/api/v1/x/users/${username}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const profileRow = { user_id: data.id, username: data.username, display_name: data.name, bio: data.description ?? null, follower_count: data.followers ?? null, following_count: data.following ?? null, verified: data.verified ?? false, verified_type: data.verifiedType ?? null, profile_url: data.url ?? null, profile_image_url: data.profilePicture ?? null, created_at: data.createdAt ?? null, unavailable_reason: data.unavailableReason ?? null, }; process.stdout.write(`${JSON.stringify(profileRow)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.get( "https://xquik.com/api/v1/x/users/username", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() profile_row = { "user_id": data["id"], "username": data["username"], "display_name": data["name"], "bio": data.get("description"), "follower_count": data.get("followers"), "following_count": data.get("following"), "verified": data.get("verified", False), "verified_type": data.get("verifiedType"), "profile_url": data.get("url"), "profile_image_url": data.get("profilePicture"), "created_at": data.get("createdAt"), "unavailable_reason": data.get("unavailableReason"), } print(json.dumps(profile_row)) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "io" "log" "net/http" "os" ) func main() { username := "username" req, err := http.NewRequest("GET", "https://xquik.com/api/v1/x/users/"+username, nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", "xq_your_api_key_here") resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } var user map[string]any if err := json.Unmarshal(body, &user); err != nil { log.Fatal(err) } row := map[string]any{ "user_id": user["id"], "username": user["username"], "display_name": user["name"], "bio": user["description"], "follower_count": user["followers"], "following_count": user["following"], "verified": user["verified"], "verified_type": user["verifiedType"], "profile_url": user["url"], "profile_image_url": user["profilePicture"], "created_at": user["createdAt"], "unavailable_reason": user["unavailableReason"], } if err := json.NewEncoder(os.Stdout).Encode(row); err != nil { log.Fatal(err) } } ``` Use `GET /x/users/{id}` when a workflow needs one profile row. Use it for CRM enrichment, lead scoring, account monitoring, or support triage. Store `user_id`, `username`, `display_name`, `bio`, `follower_count`, `following_count`, `verified`, `verified_type`, `profile_url`, `profile_image_url`, `created_at`, and `unavailable_reason`. Do not log the full lookup response. > [card] Profile row > > Store `id` as `user_id` plus `username`, `name`, `description`, `followers`, > `following`, `verified`, and `verifiedType`. > [card] Lookup key > > Join on the numeric user ID, which does not change. Use username lookup when the > workflow starts from a handle. > [card] Availability > > Store `unavailable` and `unavailableReason` when returned. Retries, > support triage, and CRM syncs can then distinguish missing accounts from unavailable > profiles. > [card] Next action > > Use the returned `id` for followers, following, timelines, media, and > DMs. Use it for follow checks and monitor setup. ## Store a Twitter profile lookup Keep the numeric X (Twitter) user ID as the stable key. Profile usernames, names, bios, counts, verification, locations, links, and images can change between lookups. | Profile column | Response field | CRM or warehouse rule | | - | - | - | | `x_user_id` | `id` | Use as the stable profile upsert and relationship key. | | `x_username` | `username` | Store the current handle. Do not use it as the key. | | `display_name` | `name` | Keep the public profile name observed during lookup. | | `bio` | `description` | Store the profile bio when X returns it. | | `follower_count` | `followers` | Keep the observed follower count with the lookup time. | | `following_count` | `following` | Keep the observed following count with the lookup time. | | `verified` | `verified` | Record the observed verification state. | | `verified_type` | `verifiedType` | Distinguish returned business or government verification types. | | `location` | `location` | Keep the public profile location when supplied. | | `profile_url` | `url` | Keep the public website link from the profile. | | `profile_image_url` | `profilePicture` | Use the returned image in profile previews and review queues. | | `account_created_at` | `createdAt` | Keep the account creation timestamp when available. | | `unavailable` | `unavailable` | Separate an unavailable profile from a successful active lookup. | | `unavailable_reason` | `unavailableReason` | Handle suspended, deactivated, or otherwise unavailable profiles separately. | | Next workflow | Stable input | Route | | - | - | - | | Follower export | `id` | `/x/users/{id}/followers` | | Following export | `id` | `/x/users/{id}/following` | | Profile timeline | `id` | `/x/users/{id}/tweets` | | Profile replies | `id` | `/x/users/{id}/replies` | | Profile media | `id` | `/x/users/{id}/media` | | Profile highlights | `id` | `/x/users/{id}/highlights` | | One follow relationship | Source and target usernames | `/x/followers/check` | | Saved profile or audience job | Numeric profile ID in the selected tool input | `/extractions` | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Which user endpoint? > [card] User profile > > Use `GET /x/users/{id}` for one profile row by username or numeric user ID. > [card] Search users > > Use [`GET /x/users/search`](/api-reference/x/search-users) when the workflow > starts from a name, keyword, or partial handle. > [card] Profile timeline > > Use [`GET /x/users/{id}/tweets`](/api-reference/x/user-tweets) for posts from > one profile. > [card] Followers > > Use [`GET /x/users/{id}/followers`](/api-reference/x/followers) when the next > step needs audience rows. > [card] Follow check > > Use [`GET /x/followers/check`](/api-reference/x/check-follower) when the > workflow only needs one source-target relationship. > [card] Saved exports > > Use [`Create extraction`](/api-reference/extractions/create). > Create saved CSV, JSON, or XLSX jobs. Export followers, following, timelines, > media, or search. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` authenticates `paid_reads` guest keys. Direct MPP uses the `Payment ...` credential. Get it from the `WWW-Authenticate: Payment` challenge. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `id` | `string` | User ID. | | `username` | `string` | X (Twitter) username. | | `name` | `string` | Display name. | | `description` | `string` | Profile bio. Omitted if empty. | | `followers` | `number` | Follower count. Omitted if unavailable. | | `following` | `number` | Following count. Omitted if unavailable. | | `verified` | `boolean` | Whether the user is verified. Omitted if unavailable. | | `profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `location` | `string` | Profile location. Omitted if empty. | | `accountBasedIn` | `object \| null` | Country or region X shows for the account, with `value`, `level` & `observedAt`. X infers it from account access. It states no nationality or exact location. `null` when X shows none. Omitted when it's not available yet. | | `accountBasedInUnavailable` | `boolean` | `true` when `accountBasedIn` is not available yet. Retry later to get it. Omitted otherwise. | | `accountBasedInAccurate` | `boolean` | `false` when X notes that `accountBasedIn` may be inaccurate. Omitted if unavailable. | | `connectedVia` | `string` | How the account first connected to X, such as `United States App Store`. Omitted if unavailable. | | `connectedViaAccurate` | `boolean` | `false` when X notes that the `connectedVia` country may be inaccurate. Omitted if unavailable. | | `usernameChanges` | `object` | How often the account changed its username. It holds `count` and, after a change, `lastChangedAt`. Omitted if unavailable. | | `birthdate` | `object` | The `day`, `month`, and `year` parts of the birthday the account made public. Omitted if unavailable. | | `createdAt` | `string` | ISO 8601 account creation timestamp. Omitted if unavailable. | | `statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `url` | `string` | Website URL from profile. Omitted if empty. | | `email` | `string` | First email the account publishes on its profile, lowercased. Omitted when it publishes none. | | `contactInfo` | `object` | Emails, phone numbers & links the account publishes on its own profile. Each email has `value`, `domain` & `source`. Each phone has `value` & `source`. Each link has `url`, `network` & `source`. `source` is the profile field that holds it, such as `bio` or `url`. `writtenAs` keeps the account's own spelling of a spelled-out email or number. Omitted when the profile publishes none. | | `favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `hasCustomTimelines` | `boolean` | Whether the user has custom timelines (lists). Omitted if unavailable. | | `isTranslator` | `boolean` | Whether the user is a Twitter translator. Omitted if unavailable. | | `withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `pinnedTweetIds` | `string[]` | IDs of pinned tweets. Omitted if none. | | `isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `unavailable` | `boolean` | Whether the account is unavailable (suspended, deactivated). Omitted if available. | | `unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `communityRole` | `string` | Role within a returned community context. Omitted outside community results. | | `listedCount` | `number` | Public lists that include the profile. Omitted if unavailable. | | `fastFollowersCount` | `number` | Followers X (Twitter) counts as fast followers. Omitted if unavailable. | | `normalFollowersCount` | `number` | Followers minus fast followers. Omitted if unavailable. | | `subscribersCount` | `number` | Accounts subscribed to the profile's paid Subscriptions. 0 when it has none. Omitted if unavailable. | | `defaultProfile` | `boolean` | Whether the profile keeps X's default theme. Omitted if unavailable. | | `defaultProfileImage` | `boolean` | Whether the profile keeps X's default avatar. Omitted if unavailable. | | `geoEnabled` | `boolean` | Whether the profile may add a location to posts. Omitted if unavailable. | | `hasExtendedProfile` | `boolean` | Whether the profile filled X's extended fields, such as a birth date. Omitted if unavailable. | | `isTranslationEnabled` | `boolean` | Whether the account turned on X's translation of its posts. Omitted if unavailable. | | `advertiserAccountType` | `string` | The account's X Ads type. `none` for an account without ads, or `promotable_user` for one that may run them. Omitted if unavailable. | | `advertiserAccountServiceLevels` | `string[]` | X Ads services the account uses, such as `analytics`, `media_studio` or `smb`. Empty for an account without ads. Omitted if unavailable. | | `businessProfileState` | `string` | Whether X treats the profile as a business profile. `none` or `enabled`. Omitted if unavailable. | | `verificationReason` | `object` | X's `text` on why the profile is verified. `entities` link parts of that text. Omitted if unavailable. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "987654321", "username": "username", "name": "Xquik", "description": "X real-time data platform", "followers": 10000, "following": 500, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/xquik/photo.jpg", "coverPicture": "https://pbs.twimg.com/profile_banners/xquik/cover.jpg", "location": "San Francisco", "url": "https://xquik.com", "createdAt": "2020-01-15T00:00:00.000Z", "statusesCount": 5000, "mediaCount": 120, "favouritesCount": 430, "isAutomated": false, "possiblySensitive": false, "hasCustomTimelines": false, "pinnedTweetIds": ["1234567890"] } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The path names no user. Send a user ID, username or profile URL. ### 401 Unauthenticated Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. Anonymous calls receive a direct MPP `WWW-Authenticate: Payment` challenge plus a guest wallet creation action. No checkout starts automatically. Confirm any payment action. ### 404 User not found X shows no profile for the user. It adds `reason`, which is `not_found`, or `suspended` when X (Twitter) suspended the account. Check the username or choose another account. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Next steps.** [Check Follower](/api-reference/x/check-follower) to verify follow relationships. [Search Tweets](/api-reference/x/search-tweets) to find tweets from this user. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # User affiliates & team export, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-affiliates Get the accounts a Twitter or X organization lists as its affiliates, in X's order. Export staff & product accounts with profiles. 1 credit per account. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/affiliates` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/discord/affiliates \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 curl -G https://xquik.com/api/v1/x/users/discord/affiliates \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const user = "discord"; let pageCursor = ""; let position = 0; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch(`https://xquik.com/api/v1/x/users/${user}/affiliates${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const account of page.users) { position += 1; const affiliateRow = { source_user: user, position, user_id: account.id, username: account.username, name: account.name, followers: account.followers ?? null, verified: account.verified ?? false, }; process.stdout.write(`${JSON.stringify(affiliateRow)}\n`); } if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user = "discord" page_cursor = "" position = 0 for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user}/affiliates", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for account in page["users"]: position += 1 affiliate_row = { "source_user": user, "position": position, "user_id": account["id"], "username": account["username"], "name": account["name"], "followers": account.get("followers"), "verified": account.get("verified", False), } print(json.dumps(affiliate_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## Affiliates in X's order Use `GET /x/users/{id}/affiliates` for the accounts an organization lists as its affiliates. Rows arrive in X's order, & each row is a full profile. The examples above save that order as `position`. An account without affiliates returns an empty list, not an error. Stop paging when `has_next_page` is `false`. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/discord`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Profiles per page, up to `10000`. A larger value gets the largest page. Defaults to `200`. | ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of affiliated accounts, in X's order. | | `users[].id` | `string` | User ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. Omitted if empty. | | `users[].followers` | `number` | Follower count. Omitted if unavailable. | | `users[].following` | `number` | Following count. Omitted if unavailable. | | `users[].verified` | `boolean` | Whether the user is verified. Omitted if unavailable. | | `users[].profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. Omitted if empty. | | `users[].createdAt` | `string` | ISO 8601 account creation timestamp. Omitted if unavailable. | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | IDs of pinned tweets. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/xquik/photo.jpg" } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get user](/api-reference/x/twitter-profile-lookup) · [Followers](/api-reference/x/followers) · [Batch users](/api-reference/x/batch-users) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # List a user's articles, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-articles List the X Articles a Twitter or X profile published, newest first. Export Article posts with titles, previews, covers, and metrics. 1 credit per post. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/articles` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/nasa/articles \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 curl -G https://xquik.com/api/v1/x/users/nasa/articles \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const user = "nasa"; let pageCursor = ""; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch(`https://xquik.com/api/v1/x/users/${user}/articles${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const tweet of page.tweets) { const articleRow = { source_user: user, article_id: tweet.article?.id ?? null, article_title: tweet.article?.title ?? null, article_preview: tweet.article?.previewText ?? null, tweet_id: tweet.id, text: tweet.text, tweet_url: tweet.url ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? null, view_count: tweet.viewCount ?? null, page_cursor: pageCursor, }; process.stdout.write(`${JSON.stringify(articleRow)}\n`); } if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user = "nasa" page_cursor = "" for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user}/articles", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: article = tweet.get("article") or {} article_row = { "source_user": user, "article_id": article.get("id"), "article_title": article.get("title"), "article_preview": article.get("previewText"), "tweet_id": tweet["id"], "text": tweet["text"], "tweet_url": tweet.get("url"), "created_at": tweet.get("createdAt"), "like_count": tweet.get("likeCount"), "view_count": tweet.get("viewCount"), "page_cursor": page_cursor, } print(json.dumps(article_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## Order and empty results Use `GET /x/users/{id}/articles` for the posts on a profile's Articles tab. Rows arrive newest first. Each post's `article` holds the Article's `id`, `title`, `previewText`, `coverMediaUrl`, and dates. The list holds no Article body. Pass a post's `id` to [`GET /x/articles/{tweetId}`](/api-reference/x/get-article) for the full text. A user without Articles returns an empty list, not an error. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [], "has_next_page": false, "next_cursor": "" } ``` The last page looks the same. Stop paging when `has_next_page` is `false`. A protected account returns 403 `x_account_protected`. Xquik charges nothing. ## Which profile endpoint? * Use `GET /api/v1/x/users/{id}/articles` for the Articles a profile published. * Use `GET /api/v1/x/articles/{tweetId}` for 1 Article's full text. * Use `GET /api/v1/x/users/{id}/tweets` for the whole profile timeline. * Use `GET /api/v1/x/users/{id}/media` when every row must be a media tweet. | Profile feed | Route | Rows returned | | - | - | - | | Articles tab | `/x/users/{id}/articles` | Article posts, newest first. | | Profile timeline | `/x/users/{id}/tweets` | Original profile posts by default. | | Media-only posts | `/x/users/{id}/media` | Profile tweets that contain media. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Tweets per page, up to `10000`. A larger value gets the largest page. Defaults to `20`. | ### Tweet result filters These optional filters apply to `tweets[]` returned by this route. They keep the same Articles target. Xquik filters rows after it fetches each page. Selective filters can return fewer rows than an unfiltered page. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of Article tweets, newest first. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text content. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. Omitted if unavailable. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet (long-form post). Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if not a reply. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author handle without `@`. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted if unavailable. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].article` | `object` | The Article this post carries, with `id`, `title`, `previewText`, `coverMediaUrl`, `coverMedia`, `metadata`, and `lifecycleState`. It holds no body. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Read all the new updates", "article": { "id": "1893400000000000000", "title": "What changed this month", "previewText": "A summary of this month's updates." }, "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 200, "viewCount": 15000, "url": "https://x.com/user/status/1893456789012345678", "author": { "id": "44196397", "username": "username", "name": "Xquik", "followers": 1200, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 403 Protected account `{ "error": "x_account_protected", "message": "Account is protected. Choose a public account." }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get X article](/api-reference/x/get-article) · [Get user timeline](/api-reference/x/user-tweets) · [User highlights](/api-reference/x/user-highlights) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Translate a user's bio, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-bio-translation Translate a Twitter or X profile's bio into the language you pick with X's own translation. Get the text, its source language, and links. 1 credit per call. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/translation` **1 credit per translation** · A profile without a bio is free [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/nasa/translation?language=es" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const params = new URLSearchParams({ language: "es" }); const response = await fetch(`https://xquik.com/api/v1/x/users/nasa/translation?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); if (body.translation === null) { console.log(body.message); } else { console.log( `${body.translation.sourceLanguage} -> ${body.translation.language}: ${body.translation.text}`, ); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/users/nasa/translation", params={"language": "es"}, headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) translation = body["translation"] if translation is None: print(body["message"]) else: print(f'{translation.get("sourceLanguage")} -> {translation["language"]}: {translation["text"]}') ``` ## A bio in the language you pick Use `GET /x/users/{id}/translation` to read a profile's bio in another language. X translates it, as x.com does when it shows a translated bio. Name the profile by user ID, username, or profile URL. `sourceLanguage` is the language X detects in the bio, when it names one. `entities` holds the links, mentions, and tags of the translated text with their offsets. A profile without a bio returns `translation: null` & a `message`, free of charge. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `language` | `string` | Yes | Language code to translate into, such as `es`, `tr`, `pt-br`, or `zh-tw`. Upper and lower case both work. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `translation` | `object \| null` | X's translation of the bio, or `null` when the profile has no bio. | | `translation.userId` | `string` | ID of the account whose bio X translated. | | `translation.userName` | `string` | Username of that account. | | `translation.language` | `string` | Language code of the translated text, in lower case. | | `translation.sourceLanguage` | `string` | Language code X detects in the bio. Omitted when X names none. | | `translation.text` | `string` | Translated bio. | | `translation.entities` | `object` | Links, mentions, and tags of the translated text, with their offsets. Empty when the text has none. | | `message` | `string` | Says why `translation` is `null`. | ### 400 Invalid input `{ "error": "invalid_language" }` Send `language` as a language code, such as `es`. An empty or invalid profile name returns `invalid_user_id`. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [Get user](/api-reference/x/twitter-profile-lookup) · [Translate tweet](/api-reference/x/tweet-translation) · [Batch users](/api-reference/x/batch-users) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "translation": { "userId": "11348282", "userName": "NASA", "language": "es", "sourceLanguage": "en", "text": "Haciendo lo aparentemente imposible, posible. ✨" } } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # User engagement rate insights, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-engagement-insights Get a Twitter or X profile's engagement rate, average likes, replies, reposts and views per post, posting rate, and top post from its recent posts. 1 credit. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/insights` **1 credit per report**, whatever it reads · A user X doesn't know is free [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/nasa/insights" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/nasa/insights", { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); const { insights } = body; console.log( `@${insights.userName}: ${insights.engagementRate}% engagement, ${insights.postsPerDay} posts a day`, ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/users/nasa/insights", headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) insights = body["insights"] print(f'@{insights["userName"]}: {insights["engagementRate"]}% engagement, {insights["postsPerDay"]} posts a day') ``` ## A profile's engagement at a glance Use `GET /x/users/{id}/insights` to size up an account before you work with it. Name the user by user ID, username, or profile URL. The report reads the profile's counts and its 20 most recent posts. Set `limit` to read more. It still costs 1 credit. A read stops at your count or the account's oldest post. It also stops after about 40 seconds. A read of more than 800 posts can miss a few. `sample.read` says how many posts it read. `sample.posts` says how many of them the averages used. Reposts and the pinned post stay out. So the averages describe the account's own recent posts. Engagements are likes, replies, reposts, and quotes. A rate is `null` when nothing divides it. One case is a profile without posts of its own. A protected account's posts are private. Its report has counts and account age, `postsPrivate: true`, and a `message` that says so. It costs the same 1 credit. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Recent posts to read, from `1` up. `pageSize`, `count`, `max_results`, `maxItems`, `max_items` & `per_page` are accepted aliases. Default `20`. | | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `insights` | `object` | | | `insights.userId` | `string` | ID of the profile. | | `insights.userName` | `string` | Username of the profile. | | `insights.followers` | `number` | Followers. | | `insights.following` | `number` | Accounts the user follows. | | `insights.posts` | `number` | Posts the user has made. | | `insights.accountAgeDays` | `number \| null` | Whole days since the account joined X. | | `insights.postsPrivate` | `boolean` | `true` when only the account's followers see its posts. The report then has its counts only. | | `insights.sample` | `object` | The recent posts the read covered. `read` counts them all. `posts` counts those the averages used. `oldestAt` and `newestAt` say when the oldest and newest of those went up. | | `insights.averages` | `object \| null` | Likes, replies, reposts, quotes, bookmarks, views, and engagements per post. `null` without posts. | | `insights.engagementRate` | `number \| null` | Average engagements per post, as a percent of followers. | | `insights.engagementPerView` | `number \| null` | Engagements as a percent of views across the sample. | | `insights.postsPerDay` | `number \| null` | Sampled posts per day, from the oldest one until now. | | `insights.topPostId` | `string \| null` | The sampled post with the most engagements. | | `message` | `string` | Says why the report has counts only, for a protected account. | ### 400 Invalid input `{ "error": "invalid_user_id" }` Send a user ID, a username, or a profile URL. ### 404 User not found A user X doesn't know is free. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [Tweet engagement insights](/api-reference/x/tweet-engagement-insights) · [Get user](/api-reference/x/twitter-profile-lookup) · [User timeline](/api-reference/x/user-tweets) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "insights": { "userId": "11348282", "userName": "NASA", "followers": 92376187, "following": 115, "posts": 74336 } } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # X (Twitter) API user filters & profile parameters Source: https://docs.xquik.com/api-reference/x/user-filters Filter X (Twitter) API user results by followers, following, posts, account age, verification, website, location, email, bio, and username on user routes. > For the complete documentation index, see [llms.txt](/llms.txt). User routes that link here accept these optional filters on `users[]`. Each route keeps its own target. Selective filters can return fewer rows than an unfiltered page. ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `minFollowers` | `integer` | No | Require this minimum follower count. Filtering happens before billing. | | `maxFollowers` | `integer` | No | Allow this maximum follower count. Missing counts pass this filter. | | `minFollowing` | `integer` | No | Require this minimum following count. | | `maxFollowing` | `integer` | No | Allow this maximum following count. Missing counts pass this filter. | | `minStatuses` | `integer` | No | Require this minimum post count. | | `maxStatuses` | `integer` | No | Allow this maximum post count. Missing counts pass this filter. | | `minAccountAgeDays` | `integer` | No | Require this minimum account age in days. | | `verifiedOnly` | `boolean` | No | When `true`, only return verified profiles. | | `blueVerifiedOnly` | `boolean` | No | When `true`, only return profiles X marks as blue verified. X marks many business and government accounts blue too. Use `verifiedType` for 1 badge type. | | `verifiedType` | `string` | No | Match the exact verification type. | | `hasWebsite` | `boolean` | No | When `true`, require a profile website. | | `hasLocation` | `boolean` | No | When `true`, require a profile location. | | `hasEmail` | `boolean` | No | When `true`, only return profiles that publish an email. | | `businessEmailOnly` | `boolean` | No | When `true`, require an email outside free webmail, such as Gmail. | | `emailDomains` | `string` | No | Require an email at one of these domains, such as `acme.com,stanford.edu`. Separate domains with commas. Subdomains match. | | `bioContains` | `string` | No | Match any comma-separated or line-separated bio term, ignoring case. | | `locationContains` | `string` | No | Require this text in the profile location. | | `usernameContains` | `string` | No | Require this text in the username. | # A user's highlighted tweets, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-highlights Get the posts on a Twitter or X profile's Highlights tab, in X's order. Export highlighted tweets with authors, metrics, media, and cursors. 1 credit per post. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/highlights` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/nasa/highlights \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 curl -G https://xquik.com/api/v1/x/users/nasa/highlights \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const user = "nasa"; let pageCursor = ""; let position = 0; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch(`https://xquik.com/api/v1/x/users/${user}/highlights${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const tweet of page.tweets) { position += 1; const highlightRow = { source_user: user, highlight_position: position, tweet_id: tweet.id, text: tweet.text, tweet_url: tweet.url ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? null, view_count: tweet.viewCount ?? null, page_cursor: pageCursor, }; process.stdout.write(`${JSON.stringify(highlightRow)}\n`); } if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user = "nasa" page_cursor = "" position = 0 for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user}/highlights", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: position += 1 highlight_row = { "source_user": user, "highlight_position": position, "tweet_id": tweet["id"], "text": tweet["text"], "tweet_url": tweet.get("url"), "created_at": tweet.get("createdAt"), "like_count": tweet.get("likeCount"), "view_count": tweet.get("viewCount"), "page_cursor": page_cursor, } print(json.dumps(highlight_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## Order and empty results Use `GET /x/users/{id}/highlights` for the posts on a profile's Highlights tab. Rows arrive in X's order. The examples above save that order as `highlight_position`. A user without highlights returns an empty list, not an error. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [], "has_next_page": false, "next_cursor": "" } ``` The last page looks the same. Stop paging when `has_next_page` is `false`. A protected account returns 403 `x_account_protected`. Xquik charges nothing. ## Which profile endpoint? * Use `GET /api/v1/x/users/{id}/highlights` for the Highlights tab only. * Use `GET /api/v1/x/users/{id}/tweets` for the whole profile timeline. * Use `GET /api/v1/x/users/{id}/media` when every row must be a media tweet. | Profile feed | Route | Rows returned | | - | - | - | | Highlights tab | `/x/users/{id}/highlights` | Highlighted posts, in X's order. | | Profile timeline | `/x/users/{id}/tweets` | Original profile posts by default. | | Media-only posts | `/x/users/{id}/media` | Profile tweets that contain media. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Tweets per page, up to `10000`. A larger value gets the largest page. Defaults to `20`. | ### Tweet result filters These optional filters apply to `tweets[]` returned by this route. They keep the same highlights target. Xquik filters rows after it fetches each page. Selective filters can return fewer rows than an unfiltered page. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of highlighted tweets, in X's order. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text content. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. Omitted if unavailable. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet (long-form post). Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if not a reply. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author handle without `@`. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted if unavailable. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Launch day recap", "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 200, "viewCount": 15000, "url": "https://x.com/user/status/1893456789012345678", "author": { "id": "44196397", "username": "username", "name": "Xquik", "followers": 1200, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" } } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 403 Protected account `{ "error": "x_account_protected", "message": "Account is protected. Choose a public account." }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get user timeline](/api-reference/x/user-tweets) · [User media](/api-reference/x/user-media) · [User likes](/api-reference/x/user-likes) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Export tweets a user liked, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-likes Read your X account's liked tweets with authors, text, media & metrics. Connect an X account first. X shows likes only to their owner. Other profiles get 424. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/likes` ## When to read liked tweets Use this route for the liked tweets of your connected X account. Pass that account's user ID or username as `id`. Callers without a connected X account get `424 account_required`. Use [Connect X account](/api-reference/x-accounts/connect) to add one. Guest keys get `403 forbidden`. X has shown likes only to their owner since 2024. When another profile reports likes and X hides them, the route returns `424 likes_unavailable`. It does not return an empty `200`. When your connected X accounts are busy, the route returns `503`. Retry after the `Retry-After` delay. The output is tweet rows with engagement and pagination. Use media or timeline routes when you need posts the user wrote. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/44196397/likes \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 curl -G https://xquik.com/api/v1/x/users/44196397/likes \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userId = "44196397"; let pageCursor = ""; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch(`https://xquik.com/api/v1/x/users/${userId}/likes${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); const likedRows = page.tweets.map((tweet) => ({ liked_by_user_id: userId, liked_tweet_id: tweet.id, text: tweet.text, tweet_url: tweet.url ?? null, created_at: tweet.createdAt ?? null, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, quote_count: tweet.quoteCount ?? null, view_count: tweet.viewCount ?? null, media_urls: (tweet.media ?? []).map((item) => item.mediaUrl).filter(Boolean), page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, })); for (const row of likedRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user_id = "44196397" page_cursor = "" for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user_id}/likes", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: liked_row = { "liked_by_user_id": user_id, "liked_tweet_id": tweet["id"], "text": tweet["text"], "tweet_url": tweet.get("url"), "created_at": tweet.get("createdAt"), "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "author_name": (tweet.get("author") or {}).get("name"), "author_followers": (tweet.get("author") or {}).get("followers"), "author_verified": (tweet.get("author") or {}).get("verified"), "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "quote_count": tweet.get("quoteCount"), "view_count": tweet.get("viewCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page["next_cursor"], "has_next_page": page["has_next_page"], } print(json.dumps(liked_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## User likes handoff `GET /x/users/{id}/likes` returns liked tweet rows from one account. Use it when a CRM, warehouse, recommendation job, or agent needs those rows. The examples above write JSON Lines rows with the liked-by user. Rows also hold the liked tweet ID, text, tweet URL, author ID, and username. They also hold the display name, follower count, verified state, and profile image URL. They also hold engagement counts, media URLs, and cursor fields. A worker can then resume from the last saved `next_cursor`. ## Build a liked-tweet library Use this route to collect tweets liked by one profile. Keep the source user ID with every tweet. A tweet can appear in several users' liked feeds. Store fields that support review. * Tweet ID, text, author, and creation time. * Like, reply, repost, quote, and view counts. * Photo, video, or animated GIF URLs. * Source profile ID, cursor, and collection time. A like does not prove agreement, ownership, or endorsement. Store the original author separately. For repeated collection, compare tweet IDs between snapshots. New IDs are newly observed likes. A missing ID proves little, because paging depth and like visibility can change. Use user media when the workflow needs tweets containing media from the profile itself. Use user tweets for the profile timeline. Each feed returns different tweets. ## Compare liked-feed snapshots Label every run as complete or partial. Compare only complete runs collected to the same paging depth. Keep first-seen and last-seen timestamps in your own store. The endpoint returns the current page, not a historical like event log. When a liked tweet disappears, record it as no longer observed. Do not claim the user removed the like unless another verified source confirms it. Tweet deletion or availability changes can produce the same observation. For review queues, link each row to the source tweet. Keep the liking profile separate from the tweet author. Store reviewer labels outside the tweet response. Use fixed values such as relevant, irrelevant, or needs review. Do not overwrite the original tweet text with notes. Keep both values in separate fields. | Liked-tweet library column | Response source | Library rule | | - | - | - | | `liked_by_x_user_id` | Resolved source profile ID | Keep the liking profile separate from the tweet author. | | `tweet_id` | `tweets[].id` | Use as the stable liked-tweet upsert key. | | `tweet_url` | `tweets[].url` | Open the original tweet during review. | | `text` | `tweets[].text` | Keep the original tweet body without reviewer edits. | | `author_id` | `tweets[].author.id` | Keep the original author as a stable identity. | | `author_username` | `tweets[].author.username` | Display the author handle observed during collection. | | `created_at` | `tweets[].createdAt` | This is the tweet's creation time, not the like time. | | `like_count` | `tweets[].likeCount` | Store the visible tweet count observed during collection. | | `media_urls` | `tweets[].media[].mediaUrl` | Keep image, video, or animated GIF URLs. | | `snapshot_id` | Integration value | Group liked-tweet pages from the same collection run. | | `snapshot_complete` | Integration value | Compare disappearance only across complete snapshots. | | `collected_at` | Integration timestamp | Record first-seen and last-seen times for audits. | | Snapshot comparison | Tweet ID condition | Safe interpretation | | - | - | - | | Newly observed | Present only in the latest complete snapshot | The tweet was newly observed in the liked feed. | | Still observed | Present in both complete snapshots | The tweet remained visible at both collection times. | | No longer observed | Present only in the earlier complete snapshot | Availability changed. Do not claim the user removed the like. | | Unknown | Either snapshot is partial or uses different paging depth | Do not classify. Keep both collection records. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Tweets per page, up to `10000`. A larger value gets the largest page. Defaults to `20`. | ### Tweet result filters These optional filters apply to `tweets[]` returned by this route. They keep the same liked-tweets target. Xquik filters rows after it fetches each page. Selective filters can return fewer rows than an unfiltered page. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of liked tweets. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text content. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. Omitted if unavailable. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet (long-form post). Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if not a reply. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author handle without `@`. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted if unavailable. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "A tweet that was liked", "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 300, "retweetCount": 80, "url": "https://x.com/user/status/1893456789012345678", "author": { "id": "44196397", "username": "username", "name": "Xquik", "followers": 1200, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" }, "media": [{ "type": "photo", "mediaUrl": "https://pbs.twimg.com/media/example.jpg" }] } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 401 Unauthenticated Missing or invalid API key. ### 402 Payment required Account keys get account options. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed When X hides a profile's reported likes from other accounts, the route returns `424 likes_unavailable`. Retrying does not help. It returns `424 x_api_unavailable` when the read service is unavailable. Without a connected X account, the route returns `424 account_required`. Connect one, then retry. `{ "error": "account_required", "message": "This read needs your own connected X account. Connect or restore it at dashboard.xquik.com/account, then retry." }` > [!NOTE] > > **Related.** [Get user timeline](/api-reference/x/user-tweets) · [User media](/api-reference/x/user-media) · [User mentions timeline](/api-reference/x/user-mentions) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Lists a user belongs to, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-list-memberships Get the public X (Twitter) Lists that include an account. Each List has its name, description, member and follower counts & owner profile. 1 credit per List. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/list-memberships` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. When remaining credits cannot cover the full page, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per List returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/verge/list-memberships \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const username = "verge"; const response = await fetch(`https://xquik.com/api/v1/x/users/${username}/list-memberships`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); if (!response.ok) throw new Error(JSON.stringify(data)); const nextCursor = data.has_next_page ? data.next_cursor : null; const listRows = data.lists.map((list) => ({ profile_username: username, list_id: list.id, list_name: list.name, member_count: list.memberCount ?? null, follower_count: list.subscriberCount ?? null, owner_username: list.owner?.username ?? null, list_url: list.url ?? null, next_cursor: nextCursor, })); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests username = "verge" response = requests.get( f"https://xquik.com/api/v1/x/users/{username}/list-memberships", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() if not response.ok: raise RuntimeError(data) next_cursor = data["next_cursor"] if data["has_next_page"] else None list_rows = [ { "profile_username": username, "list_id": item["id"], "list_name": item["name"], "member_count": item.get("memberCount"), "follower_count": item.get("subscriberCount"), "owner_username": (item.get("owner") or {}).get("username"), "list_url": item.get("url"), "next_cursor": next_cursor, } for item in data["lists"] ] ``` The Node.js and Python snippets build 1 row per List. Store `listRows` or `list_rows` with `nextCursor` or `next_cursor` before requesting the next page. ## Read the Lists that include an account Use `GET /x/users/{id}/list-memberships` to read the public Lists that include 1 account. They match the profile's List memberships page on X. Each List carries its `owner` profile, so you can see who listed the account. Compare `memberCount` and `subscriberCount` to find the Lists with reach. Store each List `id`, since a List name can change. A private List stays out of every answer. An empty `lists` array with `has_next_page: false` means no more public Lists include the account. It costs nothing. Use [User lists](/api-reference/x/user-lists) for the Lists the account created. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/verge`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Lists per page, up to `10000`. A larger value gets the largest page. Defaults to `20`. Also read as `limit`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `lists` | `object[]` | Public Lists that include the account. | | `lists[].id` | `string` | Numeric List ID. | | `lists[].name` | `string` | List name. | | `lists[].description` | `string` | List description. Empty when the owner wrote none. | | `lists[].memberCount` | `number` | Accounts on the List. | | `lists[].subscriberCount` | `number` | Accounts that follow the List. | | `lists[].owner` | `object` | Public profile of the List owner, with the fields of [Get User](/api-reference/x/twitter-profile-lookup). | | `lists[].url` | `string` | List page on x.com. | | `lists[].createdAt` | `string` | When the owner made the List (ISO 8601). | | `lists[].bannerUrl` | `string` | URL of the banner the owner uploaded. Omitted when the owner uploaded none. | | `lists[].customBanner` | `object` | Owner's uploaded banner, with `url`, `width`, `height`, `salientRect`, `mediaId`, `mediaKey` & dominant colors in `palette`. Omitted when there is none. | | `lists[].defaultBanner` | `object` | Banner X shows when the owner uploaded none, with `url`, `width`, `height` & `salientRect`. 2 calls can return different default banners. | | `lists[].facepileUrls` | `string[]` | Avatar URLs of a few List members, which X may pick per request. | | `lists[].membersContext` | `string` | Member count as X words it, such as `35 members`. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "lists": [ { "id": "1284239399492833280", "name": "#Mars2020 Science & Tech", "description": "Official accounts on the Perseverance Mars rover mission.", "memberCount": 35, "subscriberCount": 76, "owner": { "id": "1232783237623119872", "username": "NASAPersevere", "name": "NASA's Perseverance Mars Rover", "followers": 2887286, "verified": true }, "url": "https://x.com/i/lists/1284239399492833280", "createdAt": "2020-07-17T21:31:47.000Z", "membersContext": "35 members" } ], "has_next_page": true, "next_cursor": "DAAHCgABHTwHK3H..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 403 Protected account `{ "error": "x_account_protected", "message": "Account is protected. Choose a public account." }` The account is protected, so X shows its Lists to no one else. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded The Xquik tier limit blocked the request. Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## X (Twitter) List memberships questions ### How do I see which Lists a Twitter account is on? Call `GET /x/users/{id}/list-memberships` with the user ID, username, or profile URL. Each result is a public List that includes the account. ### How much does it cost? Each returned List costs 1 credit. An empty page costs nothing. Lower `pageSize` to return fewer Lists. ### Does it return private Lists? No. It returns only public Lists. Private Lists stay out of every answer. ### How do I get the Lists an account created? Use [User lists](/api-reference/x/user-lists). It returns the public Lists the account created. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [List members](/api-reference/x/list-members) reads who is on a List, and [List tweets](/api-reference/x/list-tweets) reads its timeline. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Lists a user created, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-lists Get the public X (Twitter) Lists an account created, in X's order. Each List has its name, description, member and follower counts & owner. 1 credit per List. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/lists` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. When remaining credits cannot cover the full page, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per List returned** · [All plans](https://xquik.com/en) from \$0.00012/credit ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/verge/lists \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const username = "verge"; const response = await fetch(`https://xquik.com/api/v1/x/users/${username}/lists`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); if (!response.ok) throw new Error(JSON.stringify(data)); const nextCursor = data.has_next_page ? data.next_cursor : null; const listRows = data.lists.map((list) => ({ profile_username: username, list_id: list.id, list_name: list.name, member_count: list.memberCount ?? null, follower_count: list.subscriberCount ?? null, owner_username: list.owner?.username ?? null, list_url: list.url ?? null, next_cursor: nextCursor, })); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests username = "verge" response = requests.get( f"https://xquik.com/api/v1/x/users/{username}/lists", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() if not response.ok: raise RuntimeError(data) next_cursor = data["next_cursor"] if data["has_next_page"] else None list_rows = [ { "profile_username": username, "list_id": item["id"], "list_name": item["name"], "member_count": item.get("memberCount"), "follower_count": item.get("subscriberCount"), "owner_username": (item.get("owner") or {}).get("username"), "list_url": item.get("url"), "next_cursor": next_cursor, } for item in data["lists"] ] ``` The Node.js and Python snippets build 1 row per List. Store `listRows` or `list_rows` with `nextCursor` or `next_cursor` before requesting the next page. ## Read the Lists an account created Use `GET /x/users/{id}/lists` to read the public Lists 1 account created. The Lists come in X's order, as the profile's Lists tab shows them. Each List carries the `id` that [List members](/api-reference/x/list-members), [List followers](/api-reference/x/list-followers) and [List tweets](/api-reference/x/list-tweets) take. Store the `id`, since a List name can change. A private List stays out of every answer. An empty `lists` array with `has_next_page: false` means the account has no more public Lists. It costs nothing. Use [List memberships](/api-reference/x/user-list-memberships) for the Lists that include the account. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/verge`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Lists per page, up to `10000`. A larger value gets the largest page. Defaults to `20`. Also read as `limit`, `count`, `max_results`, `maxItems`, `max_items` or `per_page`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `lists` | `object[]` | Public Lists the account created, in X's order. | | `lists[].id` | `string` | Numeric List ID. | | `lists[].name` | `string` | List name. | | `lists[].description` | `string` | List description. Empty when the owner wrote none. | | `lists[].memberCount` | `number` | Accounts on the List. | | `lists[].subscriberCount` | `number` | Accounts that follow the List. | | `lists[].owner` | `object` | Public profile of the List owner, with the fields of [Get User](/api-reference/x/twitter-profile-lookup). | | `lists[].url` | `string` | List page on x.com. | | `lists[].createdAt` | `string` | When the owner made the List (ISO 8601). | | `lists[].bannerUrl` | `string` | URL of the banner the owner uploaded. Omitted when the owner uploaded none. | | `lists[].customBanner` | `object` | Owner's uploaded banner, with `url`, `width`, `height`, `salientRect`, `mediaId`, `mediaKey` & dominant colors in `palette`. Omitted when there is none. | | `lists[].defaultBanner` | `object` | Banner X shows when the owner uploaded none, with `url`, `width`, `height` & `salientRect`. 2 calls can return different default banners. | | `lists[].facepileUrls` | `string[]` | Avatar URLs of a few List members, which X may pick per request. | | `lists[].membersContext` | `string` | Member count as X words it, such as `35 members`. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "lists": [ { "id": "1284239399492833280", "name": "#Mars2020 Science & Tech", "description": "Official accounts on the Perseverance Mars rover mission.", "memberCount": 35, "subscriberCount": 76, "owner": { "id": "1232783237623119872", "username": "NASAPersevere", "name": "NASA's Perseverance Mars Rover", "followers": 2887286, "verified": true }, "url": "https://x.com/i/lists/1284239399492833280", "createdAt": "2020-07-17T21:31:47.000Z", "membersContext": "35 members" } ], "has_next_page": true, "next_cursor": "DAAHCgABHTwHK3H..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 403 Protected account `{ "error": "x_account_protected", "message": "Account is protected. Choose a public account." }` The account is protected, so X shows its Lists to no one else. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for `Retry-After`, then retry. ### 429 Rate limit exceeded The Xquik tier limit blocked the request. Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field. ### 424 Dependency failed The opt-in normalized contract returns 424 when the read service fails. Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502. ## Twitter user Lists questions ### How do I get the Lists a Twitter account created? Call `GET /x/users/{id}/lists` with the user ID, username, or profile URL. Each result is a public List the account created. ### How much does it cost? Each returned List costs 1 credit. An empty page costs nothing. Lower `pageSize` to return fewer Lists. ### Does it return private Lists? No. It returns only public Lists. Private Lists stay out of every answer. ### How do I see the Lists an account is on? Use [List memberships](/api-reference/x/user-list-memberships). It returns the public Lists that include the account. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [List members](/api-reference/x/list-members) reads who is on a List, and [List tweets](/api-reference/x/list-tweets) reads its timeline. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Check if a user is live, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-live-status Check whether a Twitter or X user is broadcasting live right now, with their latest broadcast's title, state, times, and viewer counts. 1 credit per check. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/live` **1 credit per check** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/nasa/live" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/nasa/live", { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); if (body.live) { console.log(`@${body.userName} is live: ${body.broadcast.title}`); } else if (body.broadcast === null) { console.log(`@${body.userName} has no broadcast`); } else { console.log(`@${body.userName} last broadcast ended at ${body.broadcast.endedAt}`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/users/nasa/live", headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) broadcast = body["broadcast"] if body["live"]: print(f'@{body["userName"]} is live: {broadcast["title"]}') elif broadcast is None: print(f'@{body["userName"]} has no broadcast') else: print(f'@{body["userName"]} last broadcast ended at {broadcast.get("endedAt")}') ``` ## Is a user live right now? Use `GET /x/users/{id}/live` to check whether a user is broadcasting live video on X. Name the user by user ID, username, or profile URL. `live` is `true` while the user's latest broadcast is running. `broadcast` is that latest broadcast, live or ended, with the fields of [Get broadcast](/api-reference/x/get-broadcast). It is `null` when X shows no broadcast for the user. Poll this endpoint to alert your team when a creator goes live. Polling also lets you log when a brand's streams start and end. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `live` | `boolean` | `true` while the user's latest broadcast is running. | | `broadcast` | `object \| null` | The user's latest broadcast, live or ended, or `null` when X shows none. See [Get broadcast](/api-reference/x/get-broadcast) for every field. | | `broadcast.id` | `string` | Broadcast ID. | | `broadcast.title` | `string` | Broadcast title. | | `broadcast.state` | `string` | Such as `NotStarted`, `Running`, or `Ended`, as X names it. | | `broadcast.startedAt` | `string` | When the broadcast started, as ISO 8601. | | `broadcast.endedAt` | `string` | When the broadcast ended, as ISO 8601. Omitted while it runs. | | `broadcast.totalWatching` | `number` | Viewers watching, as X counts them. | | `userId` | `string` | ID of the user. | | `userName` | `string` | Username of the user. | ### 400 Invalid input `{ "error": "invalid_user_id" }` Send a user ID, a username, or a profile URL. ### 404 User not found A user X does not know is free of charge. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [Get broadcast](/api-reference/x/get-broadcast) · [Get user](/api-reference/x/twitter-profile-lookup) · [Get Space](/api-reference/x/get-space) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "live": false, "userId": "11348282", "userName": "NASA", "broadcast": { "id": "1DxLdZyVPMMxm", "title": "NASA's SpaceX Crew-12 Re-Entry & Splashdown", "state": "Ended", "startedAt": "2026-10-08T14:20:33.863Z", "endedAt": "2026-10-08T16:38:16.770Z" } } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # A user's photos & videos, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-media Scrape tweets with photos, videos, and GIFs from a Twitter or X profile. Export media posts with authors, metrics, cursors, and timestamps. 1 credit per tweet. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/media` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/44196397/media \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 curl -G https://xquik.com/api/v1/x/users/44196397/media \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userId = "44196397"; let pageCursor = ""; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch(`https://xquik.com/api/v1/x/users/${userId}/media${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); const mediaRows = page.tweets.map((tweet) => ({ source_user_id: userId, media_tweet_id: tweet.id, text: tweet.text, tweet_url: tweet.url ?? null, created_at: tweet.createdAt ?? null, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, quote_count: tweet.quoteCount ?? null, view_count: tweet.viewCount ?? null, media_urls: (tweet.media ?? []).map((item) => item.mediaUrl).filter(Boolean), media_types: (tweet.media ?? []).map((item) => item.type).filter(Boolean), page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, })); for (const row of mediaRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user_id = "44196397" page_cursor = "" for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user_id}/media", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: media_items = tweet.get("media", []) media_row = { "source_user_id": user_id, "media_tweet_id": tweet["id"], "text": tweet["text"], "tweet_url": tweet.get("url"), "created_at": tweet.get("createdAt"), "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "author_name": (tweet.get("author") or {}).get("name"), "author_followers": (tweet.get("author") or {}).get("followers"), "author_verified": (tweet.get("author") or {}).get("verified"), "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "quote_count": tweet.get("quoteCount"), "view_count": tweet.get("viewCount"), "media_urls": [ item["mediaUrl"] for item in media_items if item.get("mediaUrl") ], "media_types": [item["type"] for item in media_items if item.get("type")], "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page["next_cursor"], "has_next_page": page["has_next_page"], } print(json.dumps(media_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## User media handoff `GET /x/users/{id}/media` returns recent media tweets from one account. Use it when a gallery, moderation queue, warehouse, or agent needs those tweets. The examples above write JSON Lines rows with the source user. Rows also hold the media tweet ID, text, tweet URL, author ID, and username. They also hold the display name, follower count, verified state, and profile image URL. They also hold engagement counts, `media_urls`, `media_types`, and cursor fields. A worker can then resume from the last saved `next_cursor`. A protected account returns 403 `x_account_protected`. Xquik charges nothing. ## Which media endpoint? * Use `GET /api/v1/x/users/{id}/media` when every row must be a media tweet from one profile. Store `media_urls`, `media_types`, `media_tweet_id`, `page_cursor`, `next_cursor`, and `has_next_page`. * Use `GET /api/v1/x/users/{id}/tweets` when the sync also needs non-media posts or replies. * For one known tweet ID, use `GET /api/v1/x/tweets/{id}` for its media plus full tweet detail. * Use `POST /api/v1/x/media` only to host or validate media before a write. It takes a local file or HTTPS media URL. Pass `mediaUrl` to `POST /api/v1/x/tweets`, or pass `mediaId` as the only `media_ids` item for `POST /api/v1/x/dm/{userId}`. ## Build a profile media inventory Use this route for tweets containing photos, videos, or animated GIFs from one profile. Keep the source profile ID with every media item. Use the inventory for asset review, campaign research, or approved archiving. Respect the original publisher and applicable usage rights. ## Hand media into an asset workflow Create one child row per media item. Include the parent tweet ID, media type, source URL, author ID, and collection time. Choose the best available video variant only after inspecting its metadata. Keep the original variant list when later processing may need another format. Do not download every asset during discovery. First filter and approve the relevant tweets. Then call the download route with the selected tweet IDs. Keep attribution and source links in any archive. The media URL alone does not explain the asset's publisher or where it appeared. Record download status separately from discovery status. A listed media URL does not mean you downloaded the asset. | Media inventory column | Response source | Asset rule | | - | - | - | | `source_x_user_id` | Resolved profile ID | Keep every media tweet tied to the intended profile. | | `tweet_id` | `tweets[].id` | Use as the parent key for one or more media items. | | `tweet_url` | `tweets[].url` | Keep the original X post for attribution and review. | | `tweet_text` | `tweets[].text` | Keep the caption or post context beside each asset. | | `author_id` | `tweets[].author.id` | Keep the original publisher as a stable identity. | | `created_at` | `tweets[].createdAt` | Store the tweet publication time. | | `media_index` | Position inside `tweets[].media` | Keep the order of several assets on one tweet. | | `media_type` | `tweets[].media[].type` | Separate photo, video, and animated GIF processing. | | `media_url` | `tweets[].media[].mediaUrl` | Deduplicate an asset only within its parent tweet. | | `video_variants` | `tweets[].media[].videoVariants` | Keep every returned rendition until someone approves a download. | | `page_cursor` | Request `cursor` | Resume the profile media inventory after stored pages. | | `collected_at` | Integration timestamp | Audit when you observed the media URL and engagement counts. | | Asset decision | Required evidence | Next action | | - | - | - | | Review only | Tweet URL, media URL, author, and text | Keep the remote asset linked to its source tweet. | | Approved image download | Image media type and approved usage | Call the download route with the parent tweet ID. | | Approved video download | Video variants and selected format | Choose a variant after inspecting bitrate and content type. | | Rejected asset | Reviewer decision and reason | Keep the source record without downloading the file. | | Failed selected download | Tweet ID, media URL, and failure state | Retry only the selected asset, not the entire profile inventory. | ## Keep only chart posts Send `imageShows` to keep the posts whose photos show a kind. This request keeps only the charts from an account. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G "https://xquik.com/api/v1/x/users/KobeissiLetter/media" \ -H "x-api-key: $XQUIK_API_KEY" \ --data-urlencode "imageShows=charts" \ --data-urlencode "pageSize=40" ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "2118113888486986103", "text": "BREAKING: South Korea's exports surged +94% YoY in October, to $115 billion", "imageScore": 0.97 } ], "has_next_page": true, "next_cursor": "DAABCgABHTJTdij___0KAAIbgoUNp9ohKAgAAwAAAAIAAA", "imageFilter": { "imageShows": "charts", "question": "Does a picture attached to this post show a chart or graph that plots data, such as a line, bar, pie or candlestick chart? Judge the pictures in tweet.images.", "cutoff": 0.5, "checked": 40, "kept": 21, "unchecked": [] } } ``` * Presets are `charts`, `screenshots`, `product_photos`, `memes` & `people`. Any other text is read as a description, such as `a rocket`. * Only photos X doesn't mark sensitive get checked. Videos & flagged photos never get opened. * Each kept post costs 2 credits, the AI analysis price. A post the filter drops costs nothing. Posts without a safe photo cost nothing. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Tweets per page. Accepts `1-100`. Defaults to `20`. | ### Tweet result filters These optional filters apply to `tweets[]` returned by this route. They keep the same media-tweets target. Xquik filters rows after it fetches each page. Selective filters can return fewer rows than an unfiltered page. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | ### Keep posts by topic or photo Send 1 of these to keep only the posts you want. AI-powered analysis checks each post the page reads. Posts scoring 0.5 or more come back, each with its score. Each kept post costs 2 credits instead of 1. A dropped post costs nothing. The page size counts checked posts. Posts the check can't answer cost nothing & stay out. They need an Xquik API key, since each kept post bills Xquik credits. RapidAPI & pay-per-request calls with them get 400 `invalid_input`. | Query parameter | Type | Required | Description | | - | - | - | - | | `topic` | `string` | No | Keep only posts about this topic, such as `the Rust programming language`. Kept posts carry `topicScore`, & `topicFilter` states the 0.5 cutoff & counts. Up to 200 characters. | | `imageShows` | `string` | No | Keep only posts whose photos show this. Send `charts`, `screenshots`, `product_photos`, `memes` or `people`. You can also describe it in words, such as `a rocket`. Only photos X doesn't mark sensitive get checked. Posts without such a photo stay out at no charge. Kept posts carry `imageScore`, & `imageFilter` states the 0.5 cutoff & counts. Up to 200 characters. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of tweets containing media. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text content. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. Omitted if unavailable. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet (long-form post). Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if not a reply. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author handle without `@`. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Author profile image URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted if unavailable. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Check out this photo", "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 200, "viewCount": 15000, "url": "https://x.com/user/status/1893456789012345678", "author": { "id": "44196397", "username": "username", "name": "Xquik", "followers": 1200, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" }, "media": [{ "type": "photo", "mediaUrl": "https://pbs.twimg.com/media/example.jpg" }] } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get user timeline](/api-reference/x/user-tweets) · [User highlights](/api-reference/x/user-highlights) · [User likes](/api-reference/x/user-likes) · [User mentions timeline](/api-reference/x/user-mentions) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # A user's mentions timeline, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-mentions Retrieve one user's X (Twitter) mentions timeline with cursor pagination and time windows. It returns authors, metrics, and media. 1 credit per tweet returned. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/mentions` Retrieve tweets that mention one profile. Store tweet IDs, authors, timestamps, media, engagement counts, and pagination cursors. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit This route returns tweets that mention one X account. Use it for brand mentions, support inboxes, lead routing, and agent handoffs. The route is `GET /api/v1/x/users/{id}/mentions`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # Username mentions timeline curl "https://xquik.com/api/v1/x/users/username/mentions" \ -H "x-api-key: xq_your_api_key_here" | jq # Numeric user ID mentions timeline curl "https://xquik.com/api/v1/x/users/44196397/mentions" \ -H "x-api-key: xq_your_api_key_here" | jq # Time-bounded mentions window curl -G "https://xquik.com/api/v1/x/users/username/mentions" \ --data-urlencode "sinceTime=1777392000" \ --data-urlencode "untilTime=1777478400" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userIdOrUsername = "username"; let pageCursor = ""; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch( `https://xquik.com/api/v1/x/users/${userIdOrUsername}/mentions${params}`, { headers: { "x-api-key": "xq_your_api_key_here" } }, ); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); const mentionRows = page.tweets.map((tweet) => ({ mentioned_user_id_or_username: userIdOrUsername, tweet_id: tweet.id, text: tweet.text, tweet_url: tweet.url ?? null, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, created_at: tweet.createdAt ?? null, conversation_id: tweet.conversationId ?? null, is_reply: tweet.isReply ?? false, in_reply_to_id: tweet.inReplyToId ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, quote_count: tweet.quoteCount ?? null, media_urls: (tweet.media ?? []).map((item) => item.mediaUrl).filter(Boolean), page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, })); for (const row of mentionRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user_id_or_username = "44196397" page_cursor = "" for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user_id_or_username}/mentions", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: mention_row = { "mentioned_user_id_or_username": user_id_or_username, "tweet_id": tweet["id"], "text": tweet["text"], "tweet_url": tweet.get("url"), "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "author_name": (tweet.get("author") or {}).get("name"), "author_followers": (tweet.get("author") or {}).get("followers"), "author_verified": (tweet.get("author") or {}).get("verified"), "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"), "created_at": tweet.get("createdAt"), "conversation_id": tweet.get("conversationId"), "is_reply": tweet.get("isReply", False), "in_reply_to_id": tweet.get("inReplyToId"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "quote_count": tweet.get("quoteCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page["next_cursor"], "has_next_page": page["has_next_page"], } print(json.dumps(mention_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` The Node.js and Python snippets write one JSON Lines row per mentioned tweet. Store each row with the latest `next_cursor` before requesting the next page. ## Direct mention handoff `GET /x/users/{id}/mentions` returns the newest tweets mentioning one account. Use it for a support, community, brand monitoring, lead routing, or agent workflow. This mentions timeline endpoint accepts a username or numeric user ID. It returns one JSON page at a time. Use [`mention_extractor`](/api-reference/extractions/create) for a saved extraction, estimate, or CSV, JSON, or XLSX file export. Store `mentioned_user_id_or_username`, `tweet_id`, `text`, `tweet_url`, `author_id`, `author_username`, `author_name`, `author_followers`, `author_verified`, `author_profile_picture`, `created_at`, and `conversation_id`. Also store reply context, engagement counts, media URLs, `page_cursor`, `has_next_page`, and `next_cursor`. Treat `next_cursor` as opaque. Pass it back as `cursor` only when `has_next_page` is true. Use `sinceTime` and `untilTime` to bound a poller window. Zero affordable results return `402 insufficient_credits`. ## Build a mentions triage job These checkpoints fit a support inbox, lead queue, campaign report, or agent workflow. They cover mention pages for a fixed time window, with a cursor to resume. > [card] Resolve the target > > Use a username when the handle is stable. Store a numeric user ID for > repeat jobs and warehouse joins. > [card] Bound the window > > Pass `sinceTime` and `untilTime` for a closed mention window. Do this when a > poller, support queue, or campaign report needs one. > [card] Route the row > > Store author fields, reply context, and `conversation_id` for triage or > scoring. Also store engagement counts, `tweet_url`, and `media_urls` for > triage or scoring. > [card] Cursor checkpoint > > Store `page_cursor`, `next_cursor`, and `has_next_page` before requesting > another mentions page. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "mentions_job_id": "brand-mentions-q2", "mentions_route": "GET /api/v1/x/users/{id}/mentions", "mentioned_user_id_or_username": "username", "since_time": "1777392000", "until_time": "1777478400", "cursor_param": "cursor", "page_cursor": "", "next_cursor": "DAACCgACGRElMJcAAA", "has_next_page": true, "saved_export_tool": "mention_extractor" } ``` | Mention queue column | Response source | Triage use | | - | - | - | | `mentioned_x_user_id` | Resolved target profile ID | Keep every mention tied to the intended account. | | `tweet_id` | `tweets[].id` | Deduplicate mentions and open one source tweet. | | `tweet_url` | `tweets[].url` | Send reviewers to the original X post. | | `text` | `tweets[].text` | Apply support, lead, campaign, or moderation rules. | | `author_id` | `tweets[].author.id` | Keep a stable mention-author key. | | `author_username` | `tweets[].author.username` | Display the current author handle. | | `author_followers` | `tweets[].author.followers` | Add audience context to priority rules. | | `author_verified` | `tweets[].author.verified` | Keep the observed verification state. | | `created_at` | `tweets[].createdAt` | Enforce the intended support or campaign window. | | `conversation_id` | `tweets[].conversationId` | Group mention tweets from one conversation. | | `in_reply_to_id` | `tweets[].inReplyToId` | Join reply mentions to their immediate parent. | | `media_urls` | `tweets[].media[].mediaUrl` | Keep image and video context for review. | | Mention rule | Concrete condition | Queue action | | - | - | - | | Direct support request | Approved support phrase in `text` | Create a support-review item. | | Campaign mention | Campaign phrase within `sinceTime` and `untilTime` | Add the tweet to the campaign report. | | High-reach author | Approved `author.followers` threshold | Raise the review priority. | | Reply in an existing thread | Non-empty `inReplyToId` or `conversationId` | Attach the existing conversation context. | | Media evidence | Non-empty `media` | Keep image or video URLs with the triage record. | | No approved rule | No explicit rule matches | Store the mention with no category. | ## Which timeline endpoint? * Use `GET /api/v1/x/users/{id}/mentions` for one user's mentions timeline. * Use `GET /api/v1/x/users/{id}/tweets` for one user's profile timeline. * Use `GET /api/v1/x/tweets/search` for keyword, operator, or advanced search. * Use `GET /api/v1/x/timeline` for the authenticated account's home timeline. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor for the mentions timeline. Omit it for the first page. Then pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Tweets per page, up to `10000`. A larger value gets the largest page. Defaults to `20`. | | `sinceTime` | `string` | No | Unix timestamp in seconds. Only return mentions after this time. Set it when a poller, support inbox, or campaign monitor needs a bounded window. | | `untilTime` | `string` | No | Unix timestamp in seconds. Only return mentions before this time. Pair with `sinceTime` for closed reporting windows. | | `ownThreads` | `string` | No | With `replies=exclude`, also leave out replies to the author's own posts. Accepts `exclude`. The search then skips every reply. | ### Tweet result filters These optional filters apply to `tweets[]` returned by this route. They keep the same mentions target. Xquik filters rows after it fetches each page. Selective filters can return fewer rows than an unfiltered page. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of tweets mentioning the user. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet. Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if unavailable. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if unavailable. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities. Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author X (Twitter) username. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted when the tweet has no media. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Hey @user check this out!", "createdAt": "2026-03-27T10:00:00.000Z", "likeCount": 5, "author": { "id": "987654321", "username": "customer", "name": "Customer", "followers": 4200, "verified": false, "profilePicture": "https://pbs.twimg.com/profile_images/customer/photo.jpg" } } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get user timeline](/api-reference/x/user-tweets) · [User media](/api-reference/x/user-media) · [User likes](/api-reference/x/user-likes) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # A user's replies timeline, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-replies Retrieve one user's X With Replies timeline with cursor pagination, parent tweet context, author fields, engagement metrics, and media. 1 credit per tweet. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/replies` ## When to use the With Replies timeline Use this route when every page must include replies. It can include parent context for each reply row. Use the standard user timeline when original posts are the primary target. Like x.com's Replies tab, this route never opens with the pinned tweet. Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) > [!NOTE] > > Omit `mode` to get the fullest results. The response shape stays the same. > Pass `next_cursor` back unchanged as `cursor`. Keep the same endpoint, target, > query, and filters. Existing unprefixed cursors keep their legacy behavior. `after`, `limit`, and `pageSize` aliases also keep working. Billing still counts only returned rows. Use `mode=standard` only to keep the legacy pagination. A page can be empty or underfilled. Continue while `has_next_page` is `true`. Stop only after the response reports `has_next_page=false`. First-page requests do not support `Idempotency-Key` retries. Repeating a cursorless request starts a separate extraction. Results returned by that extraction incur their normal charges. Save each response before requesting its next page. A cursor sent again within 10 minutes returns the same page at no charge. After 10 minutes, you cannot replay earlier or terminal responses. If automatic coverage is busy, an initial request returns a standard data page. Live coverage cursors remain atomic. A cursor sent again while its page loads returns that page at no charge. Other repeats return `409 coverage_cursor_unavailable` with exact `Retry-After` seconds. Wait, then send the same cursor again. Repeated busy responses never authorize restarting with another cursor. Expired, superseded, or identity-mismatched cursors return `410 coverage_cursor_gone`. So does a cursor sent again after 10 minutes. The response omits `Retry-After`. Restart without a cursor. Keep received results. Deduplicate restarted results by `id`. Malformed cursors return `400 invalid_coverage_cursor`. Restart without them. > [!NOTE] > > This route returns the With Replies timeline for one > public X profile. It includes replies by default. You do not need > `includeReplies=true` on `GET /api/v1/x/users/{id}/tweets`. > > Protected accounts return HTTP 403 with `x_account_protected`. Choose a public account. > This applies to every mode, including continuation requests. Xquik collects no results and charges nothing. > Public profile lookup remains available. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # Username With Replies timeline curl https://xquik.com/api/v1/x/users/elonmusk/replies \ -H "x-api-key: xq_your_api_key_here" | jq # Numeric user ID With Replies timeline curl https://xquik.com/api/v1/x/users/44196397/replies \ -H "x-api-key: xq_your_api_key_here" | jq # Include parent tweet context for reply rows curl -G https://xquik.com/api/v1/x/users/elonmusk/replies \ --data-urlencode "includeParentTweet=true" \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 - pass next_cursor from the previous response curl -G https://xquik.com/api/v1/x/users/elonmusk/replies \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userIdOrUsername = "elonmusk"; let pageCursor = ""; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = new URLSearchParams(); if (pageCursor !== "") params.set("cursor", pageCursor); params.set("includeParentTweet", "true"); const response = await fetch( `https://xquik.com/api/v1/x/users/${userIdOrUsername}/replies?${params}`, { headers: { "x-api-key": "xq_your_api_key_here" } }, ); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); const replyRows = page.tweets.map((tweet) => ({ source_user_id_or_username: userIdOrUsername, tweet_id: tweet.id, text: tweet.text, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, created_at: tweet.createdAt ?? null, is_reply: tweet.isReply ?? false, in_reply_to_id: tweet.inReplyToId ?? null, in_reply_to_username: tweet.inReplyToUsername ?? null, conversation_id: tweet.conversationId ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, quote_count: tweet.quoteCount ?? null, view_count: tweet.viewCount ?? null, media_urls: (tweet.media ?? []).map((item) => item.mediaUrl).filter(Boolean), page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, })); for (const row of replyRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user_id_or_username = "44196397" page_cursor = "" for page_index in range(3): params = {"includeParentTweet": "true"} if page_cursor: params["cursor"] = page_cursor response = requests.get( f"https://xquik.com/api/v1/x/users/{user_id_or_username}/replies", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: reply_row = { "source_user_id_or_username": user_id_or_username, "tweet_id": tweet["id"], "text": tweet["text"], "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "author_name": (tweet.get("author") or {}).get("name"), "author_followers": (tweet.get("author") or {}).get("followers"), "author_verified": (tweet.get("author") or {}).get("verified"), "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"), "created_at": tweet.get("createdAt"), "is_reply": tweet.get("isReply", False), "in_reply_to_id": tweet.get("inReplyToId"), "in_reply_to_username": tweet.get("inReplyToUsername"), "conversation_id": tweet.get("conversationId"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "quote_count": tweet.get("quoteCount"), "view_count": tweet.get("viewCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page["next_cursor"], "has_next_page": page["has_next_page"], } print(json.dumps(reply_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## Build a profile reply archive Use this route to collect replies authored by one profile. Keep the source profile ID with every reply. Also keep the replied-to tweet ID when available. Use reply rows for support review, conversation research, or approved archiving. Do not merge them into original posts without a clear reply flag. Deduplicate by reply tweet ID. Save every page before advancing its cursor. New replies can shift the first page between runs. | Profile reply column | Response source | Archive rule | | - | - | - | | `source_x_user_id` | Resolved profile ID | Keep the authored-reply archive tied to one stable profile. | | `reply_id` | `tweets[].id` | Use as the stable reply upsert and deduplication key. | | `text` | `tweets[].text` | Keep the reply body returned by the API. | | `created_at` | `tweets[].createdAt` | Order replies by creation time, not cursor position. | | `in_reply_to_id` | `tweets[].inReplyToId` | Join each reply to its immediate parent tweet. | | `conversation_id` | `tweets[].conversationId` | Group reply rows from the same X conversation. | | `parent_tweet` | `tweets[].parentTweet` | Keep parent context when `includeParentTweet=true`. | | `like_count` | `tweets[].likeCount` | Rank authored replies by observed likes. | | `reply_count` | `tweets[].replyCount` | Identify replies that started deeper discussion. | | `media_urls` | `tweets[].media[].mediaUrl` | Keep images and videos attached to the reply. | | `page_cursor` | Request `cursor` | Record which With Replies page produced the row. | | `collected_at` | Integration timestamp | Tell repeated reply archive snapshots apart. | | Reply collection requirement | Route and parameters | Use | | - | - | - | | Every authored reply | `/x/users/{id}/replies` | Collect one profile's With Replies timeline. | | Parent tweet context | Add `includeParentTweet=true` | Review the source tweet beside each authored reply. | | Optional replies in a profile timeline | `/x/users/{id}/tweets?includeReplies=true` | Combine original posts and replies in one profile feed. | | Replies under one tweet | `/x/tweets/{id}/replies` | Collect every returned reply to a specific source tweet. | | Media-only profile posts | `/x/users/{id}/media` | Collect profile tweets that contain media. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor for the With Replies timeline. Omit it for the first page. Then pass the `next_cursor` value from the previous response to fetch the next page. | | `mode` | `string` | No | Omit it for automatic maximum coverage. Use `standard` for legacy pagination. Search filters such as `keywords` apply only without it. | | `pageSize` | `number` | No | Automatic pages accept `1` through `10000`. Unprefixed legacy cursors accept `1` through `100`. Source availability, filters, or credits can return fewer. Default `20`. | | `sinceTime` | `string` | No | Keep posts created at or after this time. Send ISO 8601, such as `2026-09-25T19:20:41Z`, or Unix seconds. A time without an offset is UTC. | | `untilTime` | `string` | No | Keep posts created before this time, in the same formats. With `sinceDate` or `untilDate`, the narrower window applies. | | `includeParentTweet` | `boolean` | No | Include each reply's parent tweet as `parentTweet` on the reply. Defaults to `false`. A reply whose parent X does not return comes without it. Search filters such as `keywords` do not apply with it. | ### Tweet result filters These optional filters apply to `tweets[]` returned by this route. They keep the same user target. Xquik filters rows after it fetches each page. Selective filters can return fewer rows than an unfiltered page. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `cardName` | `string` | No | Keep only Tweets with this card type, such as `poll2choice_text_only`. | | `source` | `string` | No | X search no longer supports `source`. A Tweet search with it answers 424 & charges nothing. | | `excludeSource` | `string` | No | X search no longer supports `excludeSource`. A Tweet search with it answers 424 & charges nothing. | | `geocode` | `string` | No | X search no longer supports `geocode`. A Tweet search with it answers 424 & charges nothing. | | `near` | `string` | No | A place name. A country, such as United States, works like `placeCountry` & keeps Tweets tagged there. A city keeps Tweets about it. | | `within` | `string` | No | X search no longer supports `within`. A Tweet search with it answers 424 & charges nothing. Use `near` alone. | | `safe` | `boolean` | No | When `true`, enable X safe-search filtering. | | `news` | `boolean` | No | X no longer searches `filter:news`, so leave this unset. | | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | | Query parameter | Type | Required | Description | | - | - | - | - | | `keywords` | `string` | No | Words the Tweets must match, in X search syntax. | | `place` | `string` | No | Search within this X place ID. [Search places](/api-reference/x/search-places) finds the ID by name. | | `placeCountry` | `string` | No | Search within this country code. | | `pointRadius` | `string` | No | Geo point radius in X search syntax, such as `-73.99 40.73 25mi`. | | `boundingBox` | `string` | No | Geo bounding box in X search syntax, such as `-74.1 40.6 -73.9 40.8`. | | `advancedQuery` | `string` | No | Raw X search operators appended to the final search query. | | Query parameter | Type | Required | Description | | - | - | - | - | | `listId` | `string` | No | Search within this X List ID. | ### Keep posts by topic or photo Send 1 of these to keep only the posts you want. AI-powered analysis checks each post the page reads. Posts scoring 0.5 or more come back, each with its score. Each kept post costs 2 credits instead of 1. A dropped post costs nothing. The page size counts checked posts. Posts the check can't answer cost nothing & stay out. They need an Xquik API key, since each kept post bills Xquik credits. RapidAPI & pay-per-request calls with them get 400 `invalid_input`. | Query parameter | Type | Required | Description | | - | - | - | - | | `topic` | `string` | No | Keep only posts about this topic, such as `the Rust programming language`. Kept posts carry `topicScore`, & `topicFilter` states the 0.5 cutoff & counts. Up to 200 characters. | | `imageShows` | `string` | No | Keep only posts whose photos show this. Send `charts`, `screenshots`, `product_photos`, `memes` or `people`. You can also describe it in words, such as `a rocket`. Only photos X doesn't mark sensitive get checked. Posts without such a photo stay out at no charge. Kept posts carry `imageScore`, & `imageFilter` states the 0.5 cutoff & counts. Up to 200 characters. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of tweets from the user's With Replies timeline. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text content. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. Omitted if unavailable. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet (long-form post). Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if not a reply. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities (URLs, hashtags, mentions). Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author X (Twitter) username. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted if unavailable. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].parentTweet` | `object` | The tweet this reply answers, with `includeParentTweet=true`. Omitted when X does not return it. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | | `hiddenTimeline` | `boolean` | Present on an empty last page when X shows this account's timeline to nobody. A retry returns the same page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "Reply tweet content", "createdAt": "2026-02-24T10:00:00.000Z", "isReply": true, "inReplyToId": "1893456000000000000", "conversationId": "1893456000000000000", "likeCount": 500, "retweetCount": 120, "replyCount": 45, "viewCount": 25000, "url": "https://x.com/elonmusk/status/1893456789012345678", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk", "followers": 150000000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" }, "media": [{ "type": "photo", "mediaUrl": "https://pbs.twimg.com/media/example.jpg" }] } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get user timeline](/api-reference/x/user-tweets) · [Tweet replies](/api-reference/x/tweet-replies) · [User media](/api-reference/x/user-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Shadowban test for a user, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-shadowban Check whether X hides an account from search, search suggestions, or reply threads, with the posts and replies behind each result. 1 credit per item read. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/shadowban` **1 credit per profile, post, suggestion & reply in the answer** [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/nasa/shadowban" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/users/nasa/shadowban", { headers: { "x-api-key": "xq_your_api_key_here" }, }); const body = await response.json(); if (!response.ok) throw new Error(JSON.stringify(body)); for (const [name, check] of Object.entries(body.checks)) { console.log(`${name}: ${check.verdict} (${check.reason})`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/x/users/nasa/shadowban", headers={"x-api-key": "xq_your_api_key_here"}, ) body = response.json() if not response.ok: raise RuntimeError(body) for name, check in body["checks"].items(): print(f'{name}: {check["verdict"]} ({check["reason"]})') ``` ## Is an account shadowbanned on X (Twitter)? Use `GET /x/users/{id}/shadowban` to run 4 checks on 1 account. Name the account by user ID, username, or profile URL. * `account` reads whether the account is active, protected, or suspended. * `search` looks for the account's recent posts in X (Twitter) search. It uses `from:username`, sorted by Latest. * `suggestion` looks for the account among the accounts X (Twitter) suggests for its username. * `replies` opens the threads of up to 3 recent replies to other accounts. It finds where each reply shows. Each check answers `pass`, `fail`, or `unknown`. It adds a `reason` and the evidence it read. The reply check answers `pass` or `unknown`, since X ranks replies for each viewer. A protected account gets the suggestion check only. A suspended account gets the account check only. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `limit` | `integer` | No | Recent posts to read for the timeline, engagement, and reply checks, from `1` up. A read stops at your count or the account's oldest post. It also stops after about 40 seconds. A read of more than 800 posts can miss a few. `pageSize`, `count`, `max_results`, `maxItems`, `max_items` & `per_page` are accepted aliases. Default `20`. | | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `username` | `string \| null` | Username of the account. `null` for a suspended account named by user ID. | | `userId` | `string \| null` | ID of the account. `null` for a suspended account named by username. | | `account` | `string` | `active`, `protected`, or `suspended`. | | `checks` | `object` | The 4 checks. Each has `verdict`, `reason`, and `evidence`. | | `checks.account` | `object` | `pass` with `active` or `protected`, or `fail` with `suspended`. `evidence.profileUrl` opens the profile on X. | | `checks.search` | `object` | `pass` with `listed` or `fail` with `missing`. `evidence` holds `query`, `searchUrl`, `recentPostIds`, and `foundPostIds`. | | `checks.suggestion` | `object` | `pass` with `suggested` or `fail` with `not_suggested`. `evidence` holds `query` and `suggestedUsernames`. | | `checks.replies` | `object` | `pass` with `in_thread`, or `unknown` with `more_replies` or `not_found`. `evidence.replies` lists each reply with its `placement`, `replyUrl`, and `parentUrl`. | ### 400 Invalid input `{ "error": "invalid_user_id" }` Send a user ID, a username, or a profile URL. ### 404 User not found A user X does not know is free of charge. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. > [!NOTE] > > **Related.** [Get user](/api-reference/x/twitter-profile-lookup) · [Search tweets](/api-reference/x/search-tweets) · [Search autocomplete](/api-reference/x/search-autocomplete) > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples ### 200 example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "username": "NASA", "userId": "11348282", "account": "active", "checkedAt": "2026-11-03T02:15:00.000Z", "overall": "clear", "checks": { "account": { "verdict": "pass", "reason": "active", "evidence": { "profileUrl": "https://x.com/NASA" } }, "search": { "verdict": "pass", "reason": "listed", "evidence": { "query": "from:NASA", "searchUrl": "https://x.com/search?q=from%3ANASA&f=live", "recentPostIds": ["2103610284464316469"], "foundPostIds": ["2103610284464316469"] } }, "suggestion": { "verdict": "pass", "reason": "suggested", "evidence": { "query": "NASA", "suggestedUsernames": ["NASA"] } }, "replies": { "verdict": "unknown", "reason": "more_replies", "evidence": { "replies": [ { "replyId": "2103589735449141451", "replyUrl": "https://x.com/i/status/2103589735449141451", "parentId": "2102883223948628205", "parentUrl": "https://x.com/i/status/2102883223948628205", "placement": "more_replies" } ] } }, "replyLock": { "verdict": "pass", "reason": "replies_show", "evidence": { "checkedReplies": 2, "shownReplies": 2 } } } } ``` * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Similar accounts to a user, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-similar Get the accounts X (Twitter) lists as similar to a profile, in X's order. Find lookalike accounts & competitors with full profiles. 1 credit per account. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/similar` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/nasa/similar \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const user = "nasa"; let pageCursor = ""; let position = 0; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch(`https://xquik.com/api/v1/x/users/${user}/similar${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const account of page.users) { position += 1; const similarRow = { source_user: user, position, user_id: account.id, username: account.username, name: account.name, followers: account.followers ?? null, verified: account.verified ?? false, }; process.stdout.write(`${JSON.stringify(similarRow)}\n`); } if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user = "nasa" page_cursor = "" position = 0 for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user}/similar", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for account in page["users"]: position += 1 similar_row = { "source_user": user, "position": position, "user_id": account["id"], "username": account["username"], "name": account["name"], "followers": account.get("followers"), "verified": account.get("verified", False), } print(json.dumps(similar_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## Similar accounts in X's order Use `GET /x/users/{id}/similar` for the accounts X (Twitter) lists as similar to a profile. Rows arrive in X's order, & each row is a full profile. The examples above save that order as `position`. At the default page size, the whole list fits in 1 page. So `has_next_page` is `false`. With a smaller `pageSize`, pass `next_cursor` to read the rest. Results can differ between calls. If X (Twitter) lists no similar accounts, you get an empty list, no error. The list is X's "Similar to" list for the profile you name. It never holds the profile itself. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Profiles per page, up to `10000`. A larger value gets the largest page. Defaults to `200`. | ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of similar accounts, in X's order. | | `users[].id` | `string` | User ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. Omitted if empty. | | `users[].followers` | `number` | Follower count. Omitted if unavailable. | | `users[].following` | `number` | Following count. Omitted if unavailable. | | `users[].verified` | `boolean` | Whether the user is verified. Omitted if unavailable. | | `users[].profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. Omitted if empty. | | `users[].createdAt` | `string` | ISO 8601 account creation timestamp. Omitted if unavailable. | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | IDs of pinned tweets. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/xquik/photo.jpg" } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get user](/api-reference/x/twitter-profile-lookup) · [Followers](/api-reference/x/followers) · [Batch users](/api-reference/x/batch-users) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # A user's creator subscriptions, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/user-subscriptions Get the creators a Twitter or X user subscribes to, in X's order, with full profiles. A hidden subscription list returns no rows. 1 credit per creator. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/subscriptions` > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/cb_doge/subscriptions \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 curl -G https://xquik.com/api/v1/x/users/cb_doge/subscriptions \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const user = "cb_doge"; let pageCursor = ""; let position = 0; for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const params = pageCursor === "" ? "" : `?${new URLSearchParams({ cursor: pageCursor })}`; const response = await fetch(`https://xquik.com/api/v1/x/users/${user}/subscriptions${params}`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); for (const account of page.users) { position += 1; const creatorRow = { source_user: user, position, user_id: account.id, username: account.username, name: account.name, followers: account.followers ?? null, verified: account.verified ?? false, }; process.stdout.write(`${JSON.stringify(creatorRow)}\n`); } if (!page.has_next_page || page.next_cursor === "") break; pageCursor = page.next_cursor; } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user = "cb_doge" page_cursor = "" position = 0 for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user}/subscriptions", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for account in page["users"]: position += 1 creator_row = { "source_user": user, "position": position, "user_id": account["id"], "username": account["username"], "name": account["name"], "followers": account.get("followers"), "verified": account.get("verified", False), } print(json.dumps(creator_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break page_cursor = page["next_cursor"] ``` ## Creators in X's order Use `GET /x/users/{id}/subscriptions` for the creators a user subscribes to. Rows arrive in X's order, & each row is a full profile. The examples above save that order as `position`. An account that hides its subscriptions returns an empty list, not an error. Stop paging when `has_next_page` is `false`. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/cb_doge`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor. Pass the `next_cursor` value from the previous response to fetch the next page. | | `pageSize` | `integer` | No | Profiles per page, up to `10000`. A larger value gets the largest page. Defaults to `200`. | ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of subscribed creators, in X's order. | | `users[].id` | `string` | User ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. Omitted if empty. | | `users[].followers` | `number` | Follower count. Omitted if unavailable. | | `users[].following` | `number` | Following count. Omitted if unavailable. | | `users[].verified` | `boolean` | Whether the user is verified. Omitted if unavailable. | | `users[].profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. Omitted if empty. | | `users[].createdAt` | `string` | ISO 8601 account creation timestamp. Omitted if unavailable. | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | IDs of pinned tweets. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted if not verified or standard blue check. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/xquik/photo.jpg" } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Get user](/api-reference/x/twitter-profile-lookup) · [Followers](/api-reference/x/followers) · [Batch users](/api-reference/x/batch-users) > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # X (Twitter) timeline of a user's tweets, API docs Source: https://docs.xquik.com/api-reference/x/user-tweets Read a user's X (Twitter) timeline by API with full text, replies, reposts, likes, quotes, views, attached media, and cursor pagination. 1 credit per tweet. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/tweets` > [!NOTE] > > Repost records include `retweetedAt`, the repost event's UTC ISO 8601 timestamp. It is `null` when > that timestamp is unavailable. The API omits it for original posts. The nested original post keeps > its own creation date. This field does not report every account that reposted a post. [Request > per-account timestamps with Get retweeters.](/api-reference/x/retweeters#retweet-timestamps) Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per tweet returned** · [All plans](https://xquik.com/en) from \$0.00012/credit > [!NOTE] > > Omit `mode` to get the fullest results. The response shape stays the same. > Pass `next_cursor` back unchanged as `cursor`. Keep the same endpoint, target, > query, and filters. Existing unprefixed cursors keep their legacy behavior. `after`, `limit`, and `pageSize` aliases also keep working. Billing still counts only returned rows. Use `mode=standard` only to keep the legacy pagination. A page can be empty or underfilled. Continue while `has_next_page` is `true`. Stop only after the response reports `has_next_page=false`. First-page requests do not support `Idempotency-Key` retries. Repeating a cursorless request starts a separate extraction. Results returned by that extraction incur their normal charges. Save each response before requesting its next page. A cursor sent again within 10 minutes returns the same page at no charge. After 10 minutes, you cannot replay earlier or terminal responses. If automatic coverage is busy, an initial request returns a standard data page. Live coverage cursors remain atomic. A cursor sent again while its page loads returns that page at no charge. Other repeats return `409 coverage_cursor_unavailable` with exact `Retry-After` seconds. Wait, then send the same cursor again. Repeated busy responses never authorize restarting with another cursor. Expired, superseded, or identity-mismatched cursors return `410 coverage_cursor_gone`. So does a cursor sent again after 10 minutes. The response omits `Retry-After`. Restart without a cursor. Keep received results. Deduplicate restarted results by `id`. Malformed cursors return `400 invalid_coverage_cursor`. Restart without them. This route returns the public profile timeline for one Twitter or X account. The route is `GET /api/v1/x/users/{id}/tweets`. Protected accounts return HTTP 403 with `x_account_protected`. Choose a public account. This applies to every mode, including continuation requests. Xquik collects no results and charges nothing. Public profile lookup remains available. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # Username profile timeline curl https://xquik.com/api/v1/x/users/elonmusk/tweets \ -H "x-api-key: xq_your_api_key_here" | jq # Numeric user ID profile timeline curl https://xquik.com/api/v1/x/users/44196397/tweets \ -H "x-api-key: xq_your_api_key_here" | jq # Replies and parent tweet context curl -G https://xquik.com/api/v1/x/users/elonmusk/tweets \ --data-urlencode "includeReplies=true" \ --data-urlencode "includeParentTweet=true" \ -H "x-api-key: xq_your_api_key_here" | jq # Page 2 - pass next_cursor from the previous response curl -G https://xquik.com/api/v1/x/users/elonmusk/tweets \ --data-urlencode "cursor=abc123" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userIdOrUsername = "elonmusk"; const response = await fetch(`https://xquik.com/api/v1/x/users/${userIdOrUsername}/tweets`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); let page = await response.json(); if (!response.ok) throw new Error(JSON.stringify(page)); let pageCursor = ""; const seenCursors = new Set(); for (let pageIndex = 0; pageIndex < 3; pageIndex += 1) { const timelineRows = page.tweets.map((tweet) => ({ source_user_id_or_username: userIdOrUsername, tweet_id: tweet.id, text: tweet.text, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, author_followers: tweet.author?.followers ?? null, author_verified: tweet.author?.verified ?? null, author_profile_picture: tweet.author?.profilePicture ?? null, created_at: tweet.createdAt ?? null, is_reply: tweet.isReply ?? false, in_reply_to_id: tweet.inReplyToId ?? null, like_count: tweet.likeCount ?? null, reply_count: tweet.replyCount ?? null, retweet_count: tweet.retweetCount ?? null, quote_count: tweet.quoteCount ?? null, view_count: tweet.viewCount ?? null, media_urls: (tweet.media ?? []).map((item) => item.mediaUrl).filter(Boolean), page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor, has_next_page: page.has_next_page, })); for (const row of timelineRows) process.stdout.write(`${JSON.stringify(row)}\n`); if (!page.has_next_page || page.next_cursor === "") break; if (page.next_cursor === pageCursor || seenCursors.has(page.next_cursor)) { throw new Error("pagination cursor repeated"); } seenCursors.add(page.next_cursor); pageCursor = page.next_cursor; const nextResponse = await fetch( `https://xquik.com/api/v1/x/users/${userIdOrUsername}/tweets?${new URLSearchParams({ cursor: pageCursor })}`, { headers: { "x-api-key": "xq_your_api_key_here" } }, ); page = await nextResponse.json(); if (!nextResponse.ok) throw new Error(JSON.stringify(page)); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user_id_or_username = "44196397" page_cursor = "" seen_cursors = set() for page_index in range(3): params = {"cursor": page_cursor} if page_cursor else {} response = requests.get( f"https://xquik.com/api/v1/x/users/{user_id_or_username}/tweets", params=params, headers={"x-api-key": "xq_your_api_key_here"}, ) page = response.json() if not response.ok: raise RuntimeError(page) for tweet in page["tweets"]: timeline_row = { "source_user_id_or_username": user_id_or_username, "tweet_id": tweet["id"], "text": tweet["text"], "author_id": (tweet.get("author") or {}).get("id"), "author_username": (tweet.get("author") or {}).get("username"), "author_name": (tweet.get("author") or {}).get("name"), "author_followers": (tweet.get("author") or {}).get("followers"), "author_verified": (tweet.get("author") or {}).get("verified"), "author_profile_picture": (tweet.get("author") or {}).get("profilePicture"), "created_at": tweet.get("createdAt"), "is_reply": tweet.get("isReply", False), "in_reply_to_id": tweet.get("inReplyToId"), "like_count": tweet.get("likeCount"), "reply_count": tweet.get("replyCount"), "retweet_count": tweet.get("retweetCount"), "quote_count": tweet.get("quoteCount"), "view_count": tweet.get("viewCount"), "media_urls": [ item["mediaUrl"] for item in tweet.get("media", []) if item.get("mediaUrl") ], "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page["next_cursor"], "has_next_page": page["has_next_page"], } print(json.dumps(timeline_row, separators=(",", ":"))) if not page["has_next_page"] or not page["next_cursor"]: break if page["next_cursor"] == page_cursor or page["next_cursor"] in seen_cursors: raise RuntimeError("pagination cursor repeated") seen_cursors.add(page["next_cursor"]) page_cursor = page["next_cursor"] ``` ## Archive tweets from one profile Use this user-tweets route when the source profile is already known. It fits profile timeline exports, account research, and approved historical backfills. Follow these steps for a repeatable profile timeline. * Resolve the profile to a numeric user ID. * Choose a stable page size. * Save each page before its next cursor. * Deduplicate resumed rows by tweet ID. * Stop when no next page remains. Row order does not identify a tweet. New tweets can change the first page. Use tweet IDs for updates and deduplication. The first page opens with the pinned tweet, flagged `isPinned`. Later pages skip it. With replies included, it never opens the page. Rows stay in newest-first date order on every page. They include the account's reposts. Pass `retweets=exclude` to drop reposts. | Timeline requirement | Route and parameters | Result shape | | - | - | - | | Original profile posts | `/x/users/{id}/tweets` | Profile tweets without replies by default. | | Profile posts and replies | `/x/users/{id}/tweets?includeReplies=true` | Original posts plus reply rows. | | Replies with parent context | Add `includeParentTweet=true` | Reply rows with parent tweet context when available. | | Media-only profile feed | `/x/users/{id}/media` | Tweets containing profile media. | | Highlights tab posts | `/x/users/{id}/highlights` | Highlighted posts, in X's order. | | Keyword or date search | `/x/tweets/search` | Search results selected by query, operator, date, or media filters. | | Connected account home feed | `/x/timeline` | Ranked home timeline rows for the authenticated account. | ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pagination cursor for the profile timeline. Omit it for the first page. Then pass the `next_cursor` value from the previous response to fetch the next page. | | `mode` | `string` | No | Omit it for automatic maximum coverage. Use `standard` for legacy pagination. Search filters such as `keywords` apply only without it. | | `pageSize` | `number` | No | Automatic pages accept `1` through `10000`. Unprefixed legacy cursors accept `1` through `100`. Source availability, filters, or credits can return fewer. Default `20`. | | `sinceTime` | `string` | No | Keep posts created at or after this time. Send ISO 8601, such as `2026-09-25T19:20:41Z`, or Unix seconds. A time without an offset is UTC. | | `untilTime` | `string` | No | Keep posts created before this time, in the same formats. With `sinceDate` or `untilDate`, the narrower window applies. | | `includeReplies` | `boolean` | No | Include reply tweets. Defaults to `false`. Explicit `replies` takes precedence. When you exclude replies, the author's replies to their own posts stay. They continue a thread, and X shows them on the Posts tab. | | `includeParentTweet` | `boolean` | No | Include each reply's parent tweet as `parentTweet` on the reply. Defaults to `false`. A reply whose parent X does not return comes without it. Search filters such as `keywords` do not apply with it. | ### Tweet result filters These optional filters apply to `tweets[]` returned by this route. They keep the same user target. Xquik filters rows after it fetches each page. Selective filters can return fewer rows than an unfiltered page. See [tweet filters](/api-reference/x/tweet-filters) for every filter. Common ones are `fromUser`, `language`, `sinceDate`, `mediaType`, `minLikes`, and `hashtags`. | Query parameter | Type | Required | Description | | - | - | - | - | | `cardName` | `string` | No | Keep only Tweets with this card type, such as `poll2choice_text_only`. | | `source` | `string` | No | X search no longer supports `source`. A Tweet search with it answers 424 & charges nothing. | | `excludeSource` | `string` | No | X search no longer supports `excludeSource`. A Tweet search with it answers 424 & charges nothing. | | `geocode` | `string` | No | X search no longer supports `geocode`. A Tweet search with it answers 424 & charges nothing. | | `near` | `string` | No | A place name. A country, such as United States, works like `placeCountry` & keeps Tweets tagged there. A city keeps Tweets about it. | | `within` | `string` | No | X search no longer supports `within`. A Tweet search with it answers 424 & charges nothing. Use `near` alone. | | `safe` | `boolean` | No | When `true`, enable X safe-search filtering. | | `news` | `boolean` | No | X no longer searches `filter:news`, so leave this unset. | | Query parameter | Type | Required | Description | | - | - | - | - | | `sinceId` | `string` | No | Return Tweets whose IDs exceed this ID. | | `maxId` | `string` | No | Return Tweets at or below this ID. | | `nativeRetweets` | `boolean` | No | When `true`, only return native reposts. | | Query parameter | Type | Required | Description | | - | - | - | - | | `withinTime` | `string` | No | Match Tweets from this recent window, such as `90m` or `7d`. Use a whole number & `s`, `m`, `h` or `d`. | | Query parameter | Type | Required | Description | | - | - | - | - | | `keywords` | `string` | No | Words the Tweets must match, in X search syntax. | | `place` | `string` | No | Search within this X place ID. [Search places](/api-reference/x/search-places) finds the ID by name. | | `placeCountry` | `string` | No | Search within this country code. | | `pointRadius` | `string` | No | Geo point radius in X search syntax, such as `-73.99 40.73 25mi`. | | `boundingBox` | `string` | No | Geo bounding box in X search syntax, such as `-74.1 40.6 -73.9 40.8`. | | `advancedQuery` | `string` | No | Raw X search operators appended to the final search query. | | Query parameter | Type | Required | Description | | - | - | - | - | | `listId` | `string` | No | Search within this X List ID. | ### Keep posts by topic or photo Send 1 of these to keep only the posts you want. AI-powered analysis checks each post the page reads. Posts scoring 0.5 or more come back, each with its score. Each kept post costs 2 credits instead of 1. A dropped post costs nothing. The page size counts checked posts. Posts the check can't answer cost nothing & stay out. They need an Xquik API key, since each kept post bills Xquik credits. RapidAPI & pay-per-request calls with them get 400 `invalid_input`. | Query parameter | Type | Required | Description | | - | - | - | - | | `topic` | `string` | No | Keep only posts about this topic, such as `the Rust programming language`. Kept posts carry `topicScore`, & `topicFilter` states the 0.5 cutoff & counts. Up to 200 characters. | | `imageShows` | `string` | No | Keep only posts whose photos show this. Send `charts`, `screenshots`, `product_photos`, `memes` or `people`. You can also describe it in words, such as `a rocket`. Only photos X doesn't mark sensitive get checked. Posts without such a photo stay out at no charge. Kept posts carry `imageScore`, & `imageFilter` states the 0.5 cutoff & counts. Up to 200 characters. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `tweets` | `object[]` | Array of tweets by the user. | | `tweets[].id` | `string` | Tweet ID. | | `tweets[].text` | `string` | Tweet text content. | | `tweets[].type` | `string` | Tweet type. Omitted if unavailable. | | `tweets[].createdAt` | `string` | ISO 8601 creation timestamp. Omitted if unavailable. | | `tweets[].isNoteTweet` | `boolean` | Whether this is a Note Tweet (long-form post). Omitted if unavailable. | | `tweets[].isPinned` | `boolean` | Whether the author pinned this post to their profile. Omitted if unavailable. | | `tweets[].likeCount` | `number` | Like count. Omitted if unavailable. | | `tweets[].retweetCount` | `number` | Retweet count. Omitted if unavailable. | | `tweets[].replyCount` | `number` | Reply count. Omitted if unavailable. | | `tweets[].quoteCount` | `number` | Quote tweet count. Omitted if unavailable. | | `tweets[].viewCount` | `number` | View count. Omitted if unavailable. | | `tweets[].bookmarkCount` | `number` | Bookmark count. Omitted if unavailable. | | `tweets[].url` | `string` | Permalink URL on X. Omitted if unavailable. | | `tweets[].lang` | `string` | Tweet language code. Omitted if unavailable. | | `tweets[].isReply` | `boolean` | Whether the tweet is a reply. Omitted if unavailable. | | `tweets[].inReplyToId` | `string` | Tweet ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUserId` | `string` | User ID being replied to. Omitted if not a reply. | | `tweets[].inReplyToUsername` | `string` | Username being replied to. Omitted if not a reply. | | `tweets[].conversationId` | `string` | Conversation thread ID. Omitted if unavailable. | | `tweets[].source` | `string` | Client used to post the tweet. X sends it for some posts only. | | `tweets[].displayTextRange` | `number[]` | Start and end offsets for rendered tweet text. Omitted if unavailable. | | `tweets[].isLimitedReply` | `boolean` | Whether replies are limited. Omitted if unavailable. | | `tweets[].isQuoteStatus` | `boolean` | Whether this tweet quotes another tweet. Omitted if unavailable. | | `tweets[].isRetweet` | `boolean` | Whether this row is a retweet. `text` carries the original post in full. | | `tweets[].entities` | `object` | Parsed entities (URLs, hashtags, mentions). Omitted if unavailable. | | `tweets[].contentDisclosure` | `object` | Disclosure metadata for paid partnership and AI-generated media labels. Includes `advertising.isPaidPromotion` and `aiGenerated.hasAiGeneratedMedia` when X returns them. Omitted if unavailable. | | `tweets[].author` | `object` | Tweet author profile. Omitted if unavailable. | | `tweets[].author.id` | `string` | Author user ID. | | `tweets[].author.username` | `string` | Author X (Twitter) username. | | `tweets[].author.name` | `string` | Author display name. | | `tweets[].author.followers` | `number` | Follower count. Omitted if unavailable. | | `tweets[].author.verified` | `boolean` | Whether the author is verified. Omitted if unavailable. | | `tweets[].author.profilePicture` | `string` | Profile picture URL. Omitted if unavailable. | | `tweets[].author.profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `tweets[].media` | `object[]` | Media attachments. Omitted if unavailable. | | `tweets[].media[].mediaUrl` | `string` | Direct media URL. | | `tweets[].media[].videoVariants` | `object[]` | Available video renditions with bitrate, content type, and URL. Omitted for images. | | `tweets[].media[].type` | `string` | Media type. | | `tweets[].media[].url` | `string` | Shortened URL from the tweet text. | | `tweets[].parentTweet` | `object` | The tweet this reply answers, with `includeParentTweet=true`. Omitted when X does not return it. | | `tweets[].quoted_tweet` | `object` | Embedded quoted tweet. Omitted if not a quote tweet. | | `tweets[].retweeted_tweet` | `object` | Original retweeted tweet. Omitted if not a retweet. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Opaque cursor for the next page. Empty string when no more results. | | `hiddenTimeline` | `boolean` | Present on an empty last page when X shows this account's timeline to nobody. A retry returns the same page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893456789012345678", "text": "User's tweet content", "createdAt": "2026-02-24T10:00:00.000Z", "likeCount": 500, "retweetCount": 120, "replyCount": 45, "viewCount": 25000, "contentDisclosure": { "advertising": { "isPaidPromotion": true }, "aiGenerated": { "detectionSource": "GrokSignature", "hasAiGeneratedMedia": true } }, "url": "https://x.com/elonmusk/status/1893456789012345678", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk", "followers": 150000000, "verified": true, "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg" }, "media": [{ "type": "photo", "mediaUrl": "https://pbs.twimg.com/media/example.jpg" }] } ], "has_next_page": true, "next_cursor": "DAADDAABCgABF..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` The user ID is empty or invalid. ### 404 User not found The username or user ID doesn't resolve. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [User replies timeline](/api-reference/x/user-replies) · [User media](/api-reference/x/user-media) · [User highlights](/api-reference/x/user-highlights) · [User likes](/api-reference/x/user-likes) · [User mentions timeline](/api-reference/x/user-mentions) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Export verified followers, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/verified-followers Retrieve verified X (Twitter) followers by username or user ID with cursor pagination. Use them for CRM, scoring, and agent workflows. 1 credit per result. > For the complete documentation index, see [llms.txt](/llms.txt). `GET https://xquik.com/api/v1/x/users/{id}/verified-followers` Retrieve verified profiles that follow one X account. Store stable user IDs, handles, verification types, counts, and pagination cursors. > [!NOTE] > > Requested result counts are upper bounds for paid authenticated calls. Remaining credits may not cover the full page or ID list. If so, Xquik returns fewer results. If zero paid results are affordable, it returns `402 insufficient_credits`. **1 credit per result returned** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) Get verified followers returns verified profiles that follow one X account. Name the account by username or numeric user ID. The endpoint is `GET /api/v1/x/users/{id}/verified-followers`. > [!NOTE] > > Omit `mode` to get the fullest results. The response shape stays the same. > Pass `next_cursor` back unchanged as `cursor`. Keep the same endpoint, target, > query, and filters. Existing unprefixed cursors keep their legacy behavior. `after`, `limit`, and `pageSize` aliases also keep working. Billing still counts only returned rows. Use `mode=standard` only to keep the legacy pagination. A page can be empty or underfilled. Continue while `has_next_page` is `true`. Stop only after the response reports `has_next_page=false`. First-page requests do not support `Idempotency-Key` retries. Repeating a cursorless request starts a separate extraction. Results returned by that extraction incur their normal charges. Save each response before requesting its next page. A cursor sent again within 10 minutes returns the same page at no charge. After 10 minutes, you cannot replay earlier or terminal responses. If automatic coverage is busy, an initial request returns a standard data page. Live coverage cursors remain atomic. A cursor sent again while its page loads returns that page at no charge. Other repeats return `409 coverage_cursor_unavailable` with exact `Retry-After` seconds. Wait, then send the same cursor again. Repeated busy responses never authorize restarting with another cursor. Expired, superseded, or identity-mismatched cursors return `410 coverage_cursor_gone`. So does a cursor sent again after 10 minutes. The response omits `Retry-After`. Restart without a cursor. Keep received results. Deduplicate restarted results by `id`. Malformed cursors return `400 invalid_coverage_cursor`. Restart without them. ```bash Username theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/username/verified-followers" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```bash Numeric user ID theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/44196397/verified-followers" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const userId = "44196397"; const response = await fetch(`https://xquik.com/api/v1/x/users/${userId}/verified-followers`, { headers: { "x-api-key": "xq_your_api_key_here" }, }); const data = await response.json(); const verifiedRows = data.users.map((user) => ({ source_user_id: userId, x_user_id: user.id, username: user.username, display_name: user.name, verified_type: user.verifiedType ?? "standard", follower_count: user.followers ?? null, following_count: user.following ?? null, profile_image_url: user.profilePicture ?? null, })); const nextCursor = data.has_next_page ? data.next_cursor : null; const checkpoint = { source_user_id: userId, next_cursor: nextCursor }; for (const row of verifiedRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } process.stdout.write(`${JSON.stringify(checkpoint)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests user_id = "44196397" response = requests.get( f"https://xquik.com/api/v1/x/users/{user_id}/verified-followers", headers={"x-api-key": "xq_your_api_key_here"}, ) data = response.json() verified_rows = [ { "source_user_id": user_id, "x_user_id": user["id"], "username": user["username"], "display_name": user["name"], "verified_type": user.get("verifiedType", "standard"), "follower_count": user.get("followers"), "following_count": user.get("following"), "profile_image_url": user.get("profilePicture"), } for user in data["users"] ] next_cursor = data["next_cursor"] if data["has_next_page"] else None checkpoint = {"source_user_id": user_id, "next_cursor": next_cursor} for row in verified_rows: print(json.dumps(row)) print(json.dumps(checkpoint)) ``` The Node.js and Python snippets build verified follower rows. They do not print the full response page. Store `verifiedRows` or `verified_rows` with the checkpoint. A worker can then resume pagination with `next_cursor` without duplicating imported profiles. ## Direct verified followers handoff For one JSON page of a user's verified followers now, use `GET /x/users/{id}/verified-followers`. It suits a CRM, warehouse, scoring, enrichment, or agent workflow. The endpoint accepts a username or numeric user ID. It returns verified follower profile rows with cursor fields. For estimated jobs, saved extractions, or CSV, JSON, or XLSX file export, use [`verified_follower_explorer`](/api-reference/extractions/create). > [card] Verified rows > > Store `users[]` as the verified follower profile rows returned on this page. > [card] Stable upserts > > Store `users[].id` as `x_user_id` for CRM, warehouse, scoring, and agent deduplication. > [card] Readable labels > > Store `users[].username` and `users[].name` for handles, labels, enrichment, and review queues. > [card] Verification signals > > Store `users[].verified` and `verifiedType` to segment standard, business, and government accounts. > [card] Audience signals > > Store `users[].followers`, `users[].following`, and `statusesCount` for scoring and prioritization. > [card] Profile enrichment > > Store `users[].description`, `location`, `url`, `profilePicture`, and `coverPicture` when returned. > [card] Next page > > Store `has_next_page` and `next_cursor`. Then pass `next_cursor` back as `cursor` only when `has_next_page` is true. Direct verified followers cost 1 credit per user returned. Low credit balances can return fewer users than a full page. Zero affordable results return `402 insufficient_credits`. A protected account returns 403 `x_account_protected`. Xquik charges nothing. ## Review verified followers separately Use this route when the verification filter is part of the question. Keep the source account ID with every returned profile. Verified follower rows can support account research, partner review, or audience segmentation. Verification does not prove relevance or endorsement. Apply another review step before outreach or ranking. ## Build a verified follower directory Start with one source account ID or username. Resolve and store its stable user ID. Keep that source ID on every verified follower row. Store follower user ID, username, profile name, biography, location, and profile image when returned. Keep `verified` and `verifiedType` as separate fields. Add follower count, following count, and collection time. Use verification type for a documented segment. Do not translate it into authority, relevance, identity quality, or endorsement. Add those judgments only through your own reviewed process. Use stable follower IDs for CRM upserts. Usernames, names, biographies, images, verification, and counts can change. Overwrite them on each import. Keep rejected import rows for review. ## Validate verified follower export completeness Deduplicate resumed pages by source account ID and follower user ID. Keep the newest complete profile fields. Keep the earliest collection evidence when an audit needs it. Record page count, unique row count, first cursor, last cursor, and completion time. Mark result caps, low credits, failed pages, and interrupted downloads. Never call those runs complete. Compare the exported row count with the saved extraction result when using a job. Investigate duplicate user IDs, rejected rows, and parsing errors. Check incomplete downloads before loading a warehouse. ## Path parameters | Path parameter | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | User ID, username with or without `@`, or URL-encoded profile URL, such as `x.com/nasa`. See [path IDs](/api-reference/overview#path-ids). | ## Query parameters | Query parameter | Type | Required | Description | | - | - | - | - | | `cursor` | `string` | No | Pass `next_cursor` back unchanged. New Xquik cursors resume automatic coverage. Existing unprefixed cursors keep legacy behavior. | | `mode` | `string` | No | Optional compatibility override. Omit it to get the fullest list. `standard` keeps the legacy pagination. Use `coverage` for a one-shot diagnostic response without cursor pagination. | | `after` | `string` | No | Legacy cursor alias. Use `cursor`. When both are present, `cursor` wins. | | `pageSize` | `number` | No | Automatic pages accept `20` through `10000`. Standard pages accept `20` through `200`. The default is `200`. Sources can return fewer profiles. | | `limit` | `number` | No | With `mode=coverage`, set a one-shot cap from `1` through `10000`. Otherwise, this is a legacy page size alias. `pageSize` wins. | | `enrichProfiles` | `boolean` | No | Set `true` to add each row's full profile, as `GET /x/users/{id}` returns it. Pages take several seconds longer. The price per row stays the same. Later pages can leave it out, & `next_cursor` still works. Default `false`. | ### Choose fields | Query parameter | Type | Required | Description | | - | - | - | - | | `fields` | `string` | No | Fields to keep in each row, comma-separated, such as `id,text,author.username`. Use dots for nested fields. Case & underscores do not matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics always stay. An unknown name returns `400 unknown_field` with the valid names, before any read. The price stays the same. | | `omit` | `string` | No | Fields to drop from each row, comma-separated, such as `entities,media`. It takes the same names as `fields`. With `fields`, it drops from the kept fields. | ## Which verified follower endpoint? > [card] Verified followers > > Use `GET /x/users/{id}/verified-followers` for verified accounts that follow > one profile. > [card] All followers > > Use [`GET /x/users/{id}/followers`](/api-reference/x/followers) when you need > verified and unverified followers. > [card] Following list > > Use [`GET /x/users/{id}/following`](/api-reference/x/following) for accounts > the profile follows. > [card] Saved exports > > Use [`verified_follower_explorer`](/api-reference/extractions/create) for a > saved verified follower extraction with CSV, JSON, or XLSX download. ### User result filters These filters apply before billing. Selective filters can return fewer rows. See [user filters](/api-reference/x/user-filters) for every filter. Common ones are `minFollowers`, `verifiedOnly`, `hasWebsite`, `hasEmail`, `bioContains`, and `locationContains`. | Query parameter | Type | Required | Description | | - | - | - | - | | `maxScan` | `integer` | No | Most profiles 1 request reads, kept or dropped by the filters. The answer then holds the kept profiles, the dropped count & the next cursor. Each request may send its own value. Without it, a filtered read scans at most 100,000 profiles of the list. The limit spans all pages of the read. The page that reaches the limit ends the list & names `scanLimit`. An unfiltered read has no scan limit. | ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account key. Sessions and OAuth also work. | | `Authorization` | `string` | No | `Bearer xq_your_guest_key_here` for `paid_reads`. | ## Response ### 200 OK With `enrichProfiles=true`, each row carries the full profile. The `x-xquik-profile-enrichment` header then counts the rows that have it, as in `enriched=180; requested=200`. A row without it keeps its list fields. | Field | Type | Description | | - | - | - | | `users` | `object[]` | Array of verified follower profiles. | | `users[].id` | `string` | X (Twitter) user ID. | | `users[].username` | `string` | X (Twitter) username. | | `users[].name` | `string` | Display name. | | `users[].description` | `string` | Profile bio. Omitted if empty. | | `users[].followers` | `number` | Follower count. | | `users[].following` | `number` | Following count. | | `users[].verified` | `boolean` | Whether the user is verified. Always true for this endpoint. | | `users[].verifiedType` | `string` | Verification type (for example `Business`, `Government`). Omitted for standard blue check. | | `users[].profilePicture` | `string` | Profile picture URL. | | `users[].profilePictureOriginal` | `string` | The same profile picture at full size, to download. Omitted if unavailable. | | `users[].location` | `string` | Profile location. Omitted if empty. | | `users[].accountBasedIn` | `object \| null` | Country or region X shows for the account, with `value`, `level` & `observedAt`. X infers it from account access. It states no nationality or exact location. `null` when X shows none. Present with `enrichProfiles=true`, unless it's not available yet. | | `users[].accountBasedInUnavailable` | `boolean` | `true` when this row's `accountBasedIn` is not available yet. Retry later to get it. Omitted otherwise. | | `users[].createdAt` | `string` | ISO 8601 account creation timestamp. | | `users[].statusesCount` | `number` | Total number of tweets posted. Omitted if unavailable. | | `users[].coverPicture` | `string` | Cover or banner image URL. Omitted if unavailable. | | `users[].mediaCount` | `number` | Total number of media tweets posted. Omitted if unavailable. | | `users[].url` | `string` | Website URL from profile. Omitted if empty. | | `users[].email` | `string` | First email the account publishes on its profile, lowercased. Omitted when it publishes none. | | `users[].contactInfo` | `object` | Emails, phone numbers & links the account publishes on its own profile. Each email has `value`, `domain` & `source`. Each phone has `value` & `source`. Each link has `url`, `network` & `source`. `source` is the profile field that holds it, such as `bio` or `url`. `writtenAs` keeps the account's own spelling of a spelled-out email or number. Omitted when the profile publishes none. | | `users[].favouritesCount` | `number` | Total number of tweets liked. Omitted if unavailable. | | `users[].hasCustomTimelines` | `boolean` | Whether the user has custom timelines. Omitted if unavailable. | | `users[].isTranslator` | `boolean` | Whether the user is an X translator. Omitted if unavailable. | | `users[].withheldInCountries` | `string[]` | Country codes where the account is withheld. Omitted if empty. | | `users[].possiblySensitive` | `boolean` | Whether X flags the account as possibly sensitive. Omitted if unavailable. | | `users[].pinnedTweetIds` | `string[]` | IDs of pinned tweets. Omitted if none. | | `users[].isAutomated` | `boolean` | Whether X marks the account as automated. Omitted if unavailable. | | `users[].automatedBy` | `string` | Username of the account operator if automated. Omitted if not automated. | | `users[].unavailable` | `boolean` | Whether the account is unavailable. Omitted if available. | | `users[].unavailableReason` | `string` | Reason the account is unavailable. Omitted if available. | | `users[].profile_bio` | `object` | Structured profile bio with entity annotations. Omitted if unavailable. | | `users[].isBlueVerified` | `boolean` | Whether the account has X Premium verification. Omitted if unavailable. | | `users[].isVerified` | `boolean` | Normalized verification status. Omitted if unavailable. | | `users[].profileBannerUrl` | `string` | Profile banner URL. Omitted if unavailable. | | `users[].protected` | `boolean` | Whether the account protects its posts. Omitted if unavailable. | | `users[].communityRole` | `string` | Role within the requested community context. Omitted outside community results. | | `has_next_page` | `boolean` | Whether more results are available. | | `next_cursor` | `string` | Cursor for the next page. | | `scanLimit` | `object` | Present when a filtered read without `maxScan` scans 100,000 profiles of the list. It is on that read's last page. `limit` is 100000. `rowsRead` counts the profiles read across all pages, kept or dropped. `message` says how to read further. `has_next_page` is false on that page. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "987654321", "username": "username", "name": "Xquik", "followers": 10000, "verified": true, "verifiedType": "Business" } ], "has_next_page": true, "next_cursor": "DAACCgACGE..." } ``` ### 400 Invalid user ID `{ "error": "invalid_user_id", "message": "Send a user ID, @username or profile URL, such as x.com/nasa." }` ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. ### 402 Payment required Account keys get account options. Guest keys get guest top-up only. No checkout starts automatically. Confirm any payment action. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. > [!NOTE] > > **Related.** [Create extraction](/api-reference/extractions/create) with `verified_follower_explorer` for saved verified follower jobs. [Export extraction](/api-reference/extractions/export) for CSV, JSON, or XLSX downloads. See also [Get followers](/api-reference/x/followers), [Get following](/api-reference/x/following), and [Get followers you know](/api-reference/x/followers-you-know). > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **404** `{ "error": "user_not_found", "message": "X user not found. Check the username." }` * **409** `{ "error": "coverage_cursor_unavailable", "message": "Cursor busy. Retry after the indicated delay." }` * **410** `{ "error": "coverage_cursor_gone", "message": "Cursor finished, expired, or superseded. Restart pagination without cursor." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Maximum coverage is busy. Retry shortly." }` # Viral score of tweets & drafts, X (Twitter) API docs Source: https://docs.xquik.com/api-reference/x/viral-score Score how viral X posts and drafts read with AI. Get a Viral Score from 0 to 100, a verdict, and the 8 traits behind it. Costs 2 credits per analyzed post. > For the complete documentation index, see [llms.txt](/llms.txt). `POST https://xquik.com/api/v1/x/analysis/viral-score` **2 credits per analyzed post** · [All plans](https://xquik.com/en) from \$0.00012/credit · Supports [guest paid reads](/guides/guest-wallets) Viral score reads each post or draft with AI. It answers 8 questions about the wording. It turns the answers into a Viral Score from `0` to `100`. The endpoint is `POST /api/v1/x/analysis/viral-score`. The score rates the wording. It does not predict likes or views. | Answer | Type | Values | | - | - | - | | `hook` | Score | `0` no hook, `1` a clear opening, `2` a sharp opening | | `clarity` | Score | `0` confusing, `1` takes effort, `2` clear on first read | | `informative` | Score | `0` none, `1` a familiar point, `2` a useful takeaway | | `funny` | Score | `0` not funny, `1` mildly amusing, `2` funny enough to share | | `ragebait` | Probability | From `0` to `1`, the chance it mainly provokes outrage | | `ai_written` | Probability | From `0` to `1`, the chance it reads like generic machine copy | | `spam` | Probability | From `0` to `1`, the chance it reads like spam or a scam | | `reaction` | Choice | `share`, `reply`, `like`, `argue`, or `ignore` | A giveaway, contest, scam, joke, or hype post scores `informative` `0`. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/analysis/viral-score \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "texts": [ "We cut our build time from 9 minutes to 40 seconds. Here is the 1 config change that did it.", "Big news coming soon!!! Stay tuned 🚀🚀🚀" ] }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/x/analysis/viral-score", { method: "POST", headers: { "x-api-key": "xq_your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ texts: [ "We cut our build time from 9 minutes to 40 seconds. Here is the 1 config change that did it.", "Big news coming soon!!! Stay tuned 🚀🚀🚀", ], }), }); const data = await response.json(); if (!response.ok) throw new Error(`${data.error}: ${data.message}`); const drafts = data.results.map((result) => ({ text: result.tweet.text, score: result.viralScore, verdict: result.viralVerdict, stops: result.viral.stops, hook: result.answers.hook, })); process.stdout.write( `${JSON.stringify({ drafts, average: data.analysisSummary.viral.averageScore })}\n`, ); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import requests response = requests.post( "https://xquik.com/api/v1/x/analysis/viral-score", headers={"x-api-key": "xq_your_api_key_here"}, json={ "texts": [ "We cut our build time from 9 minutes to 40 seconds. Here is the 1 config change that did it.", "Big news coming soon!!! Stay tuned 🚀🚀🚀", ], }, timeout=120, ) data = response.json() if not response.ok: raise RuntimeError(f"{data['error']}: {data['message']}") drafts = [ { "text": result["tweet"]["text"], "score": result["viralScore"], "verdict": result["viralVerdict"], "stops": result["viral"]["stops"], "hook": result["answers"]["hook"], } for result in data["results"] ] print(json.dumps({"drafts": drafts, "average": data["analysisSummary"]["viral"]["averageScore"]})) ``` The snippets print each draft's score, verdict, and hook. They do not print the full response. ## Score drafts before you post Send your drafts in `texts`. Xquik reads nothing from X for them. Each draft costs the same as 1 analyzed post. Drafts come back with the IDs `text:1`, `text:2`, and so on. Rewrite a draft with a low `hook` or `clarity` first. Those 2 traits carry half of the score. ## Read the Viral Score Hook, clarity, payoff, and the expected reaction raise the score. Payoff is the higher of `informative` and `funny`. Wording that reads like generic machine copy lowers it. | `viralVerdict` | Score | | - | - | | `send_it` | 70 to 100 | | `edit_first` | 40 to 69 | | `sleep_on_it` | 0 to 39 | Hard stops cap the score of likely spam, ragebait, and generic machine copy. `viral.stops` lists the stops that applied, such as `spam`. `viral.weights` names the version of these rules, such as `viral_lite:1`. `viralScore` is `null` when a trait has no answer. Xquik never fills a missing score with a guess. ## Compare with real engagement `viralAlgorithmScore` applies X's published ranking weights to public counts of posts read from X. A like weighs `0.5`, a reply `5`, a repost `1`, and a quote `5`. It divides the sum by views and multiplies by 1,000. A post without a view count uses followers. `viral.algorithmBasis` names the divisor. The AI never sees these counts. It reads the text and its context only. The estimate is not X's score, since X uses signals outside public data. `viralActualEngagementRate` is `log10(1 + weighted engagement per 1,000 followers)`. `analysisSummary.viral.calibration` compares it with the Viral Score across the posts. ## Score an account's posts Send `username` to score an account's recent posts. `analysisSummary.viral` then holds a report per author in `accounts` and a `leaderboard`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "username": "NASA", "limit": 50 } ``` ## Pick the posts to analyze Send `tweetIds`, `texts`, a page, or a search, never more than 1. See [pick the posts to analyze](/api-reference/x/tweet-analysis-parameters#pick-the-posts-to-analyze) for each source. ## Compare with an earlier answer Send the `results` of an earlier call as `baseline` to see what changed. The comparison costs nothing extra. See [compare with an earlier answer](/api-reference/x/tweet-analysis-parameters#compare-with-an-earlier-answer) for an example. ## Budget the analysis Each analyzed post costs 2 credits. Each text in `texts` costs the same. Posts in `unanalyzed` cost nothing. See [budget the analysis](/api-reference/x/tweet-analysis-parameters#budget-the-analysis) for each reason. ## Body See [body parameters](/api-reference/x/tweet-analysis-parameters#body-parameters) for every field. Common ones are `tweetIds`, `texts`, `query`, `username`, and `limit`. ## Headers | Header | Type | Required | Description | | - | - | - | - | | `x-api-key` | `string` | No | Full account API key. An OAuth bearer token also works. | | `Authorization` | `string` | No | Send `Bearer xq_your_guest_key_here` for an active `paid_reads` guest key. | | `Content-Type` | `string` | Yes | Must be `application/json`. The body can be up to 256 KB. | ## Response ### 200 OK | Field | Type | Description | | - | - | - | | `results` | `object[]` | Each analyzed post with its answers. Each row costs 2 credits. | | `results[].tweet` | `object` | The post, as [Search Tweets](/api-reference/x/search-tweets) returns it. Your own texts have the IDs `text:1`, `text:2`, and so on. | | `results[].answers` | `object` | Each decision by question ID. `hook`, `clarity`, `informative`, and `funny` are levels from `0` that can have decimals. `reaction` is a category. The rest are probabilities from `0` to `1`. | | `results[].analysis` | `object` | The answers in full. `status` is `succeeded`. `answers` gives each answer's `value`, `confidence`, and `probabilities`, or a `probability`. `questions` names the ID and version of each question. `contextBytes` and `contextAvailability` say what the AI read beside the post's text. | | `results[].sourceDomains` | `string[]` | Hostnames the post links to, without `t.co`. | | `results[].cashtags` | `string[]` | Cashtags in the post's text, in upper case. | | `results[].monitor` | `object` | The comparison with `baseline`. It holds `status`, `changedQuestionIds`, and `changes` with each `previous` and `current` decision. It also holds the settings' `configurationFingerprint`. | | `results[].viralScore` | `integer \| null` | How viral the wording reads, from `0` to `100`. `null` when a trait has no answer. | | `results[].viralVerdict` | `string \| null` | `send_it` from `70`, `edit_first` from `40`, else `sleep_on_it`. | | `results[].viralAlgorithmScore` | `number \| null` | The post's public counts as 1 comparable number, per 1,000 views or followers. | | `results[].viralActualEngagementRate` | `number \| null` | `log10` of 1 plus the weighted engagement per 1,000 followers. `null` without a follower count. | | `results[].viral` | `object` | The score with its rules version in `weights`. It also holds the hard `stops` that capped the score and the engagement comparison. | | `unanalyzed` | `object[]` | Each post without an analysis. These cost nothing. | | `unanalyzed[].id` | `string` | Post ID, or `text:1` and so on for your own texts. | | `unanalyzed[].status` | `string` | `skipped` or `failed`. | | `unanalyzed[].reason` | `string` | `post_unavailable`, `missing_text`, `insufficient_credits`, or `context_limit`. Any other reason means the analysis failed. Send the post again. | | `unprocessed_ids` | `string[]` | IDs of the posts or texts the time ran out for. Send them again. They cost nothing. | | `analysisSummary` | `object` | Totals of the answers across the analyzed posts. | | `analysisSummary.schemaVersion` | `integer` | Version of the summary's shape. | | `analysisSummary.rows` | `object` | Posts by outcome, counted in `analyzed`, `failed`, and `skipped`. | | `analysisSummary.engagement` | `integer` | Likes, reposts, replies, and quotes of the analyzed posts. | | `analysisSummary.questions` | `object` | Totals by question ID. Scores have `mean`, `engagementWeightedMean`, and `levels`. Probabilities have `mean`, `yes`, and `no`. `reaction` has `counts`, `shares`, `engagementShares`, and `top` posts. | | `analysisSummary.targets` | `object[]` | Each target in `analysis.targets` has `name`, `mentions`, `share`, `engagement`, `choices`, and `top` posts. | | `analysisSummary.cashtags` | `object[]` | Posts and category counts per cashtag, most posts first, up to 20. | | `analysisSummary.sourceDomains` | `object[]` | Posts per linked hostname, most posts first, up to 20. | | `analysisSummary.viral` | `object` | `scored` and `unscored` posts, `averageScore`, and `verdicts` counts. It also holds the `calibration` of scores against actual engagement and the `leaderboard`. `accounts` holds a report per author. | | `analysisSummary.monitor` | `object` | Posts per `monitor.status` in `statuses`, and up to 50 changed posts in `changedRows`. | | `has_next_page` | `boolean` | Whether the search has more posts. Always `false` for `tweetIds` and `texts`. | | `next_cursor` | `string` | Send it as `cursor` with the same search for the next page. Empty when there is none. | ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "results": [ { "tweet": { "id": "text:1", "text": "We cut our build time from 9 minutes to 40 seconds. Here is the 1 config change that did it.", "type": "text" }, "analysis": { "status": "succeeded", "answers": [ { "questionId": "hook", "questionVersion": "viral_lite:2", "type": "score", "value": 2, "confidence": 0.86 }, { "questionId": "spam", "questionVersion": "viral_lite:2", "type": "probability", "probability": 0.02 } ] }, "answers": { "hook": 2, "clarity": 2, "informative": 2, "funny": 0, "ragebait": 0.01, "ai_written": 0.06, "spam": 0.02, "reaction": "share" }, "sourceDomains": [], "cashtags": [], "viralScore": 99, "viralVerdict": "send_it", "viralAlgorithmScore": null, "viralActualEngagementRate": null, "viral": { "score": 99, "verdict": "send_it", "weights": "viral_lite:1", "stops": [], "algorithmScore": null, "actualEngagementRate": null } } ], "unanalyzed": [], "analysisSummary": { "schemaVersion": 1, "rows": { "analyzed": 1, "failed": 0, "skipped": 0 }, "engagement": 0, "questions": { "hook": { "type": "score", "mean": 2 } }, "targets": [], "cashtags": [], "sourceDomains": [], "viral": { "weights": "viral_lite:1", "scored": 1, "unscored": 0, "averageScore": 99, "verdicts": { "send_it": 1, "edit_first": 0, "sleep_on_it": 0 } } }, "has_next_page": false, "next_cursor": "" } ``` ### 400 Invalid input `{ "error": "invalid_input", "message": "Send 1 or more texts in texts, each with words in it." }` The body names no posts or names more than 1 source. A body with an invalid field gets the same error. The message says what to send instead. The request costs nothing. ### 401 Unauthenticated Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge. Missing or invalid API key. Check the `x-api-key` header value. ### 402 Payment required Full account keys can receive `no_subscription`, `subscription_inactive`, `no_credits`, or `insufficient_credits` with account payment options. Guest keys receive only the guest top-up action. The failed request creates no checkout. Ask the user to confirm before calling any checkout or top-up route. ### 403 Protected account `{ "error": "x_account_protected" }` A search that needs a protected author returns this. Choose a public account. The request costs nothing. ### 502 X API unavailable The read service returned an error. Retry after a short delay. ### 503 Service busy Xquik is busy. Wait for the `Retry-After` header, then send the request again. The request costs nothing. ### 429 Rate limit exceeded You exceeded your tier rate limit. Wait for the `Retry-After` header before retrying. ### 424 Dependency failed The normalized v1 response contract can return 424 when the read service is unavailable. ## Tweet viral score API questions ### How do I check if a tweet will go viral? Send the draft in `texts`. `viralScore` rates its wording from `0` to `100`. `viralVerdict` says whether to post it, edit it, or wait. ### Does the score predict likes or views? No. It rates the wording only. Timing, followers, and X's ranking decide the reach. `viralAlgorithmScore` shows how a posted tweet actually performed. ### Why did my draft score low? Read `answers`. A low `hook` or `clarity` costs the most points. `viral.stops` names any hard stop, such as `spam` or `ragebait`, that capped the score. ### Can I score someone else's posts? Yes. Send their handle in `username`, post IDs in `tweetIds`, or a search in `query`. ### How much does the viral score cost? Each analyzed post or draft costs 2 credits. Posts in `unanalyzed` and refused requests cost nothing. ### Does this replace X's official API? No. This page documents Xquik, an independent third-party service. It does not document X's official API. > [!NOTE] > > **Next steps.** [Classify posts](/api-reference/x/classify-tweets) asks your own questions, or [Sentiment analysis](/api-reference/x/sentiment-analysis) reads the attitude of posts. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) ## Response examples * **400** `{ "error": "invalid_input", "message": "Invalid input. Check the request body." }` * **401** `{ "error": "unauthenticated", "message": "Authentication required." }` * **402** `{ "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." }` * **403** `{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }` * **424** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **429** `{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }` * **502** `{ "error": "x_api_unavailable", "message": "X data source temporarily unavailable. Try again later." }` * **503** `{ "error": "x_api_unavailable", "message": "Xquik is busy right now. Retry shortly." }` # Xquik changelog for X (Twitter) API & scraper news Source: https://docs.xquik.com/changelog Track Xquik REST, MCP, SDK, tweet search, follower export, monitor, webhook, extraction, account action, and contract changes. Newest changes come first. > For the complete documentation index, see [llms.txt](/llms.txt). Search tweets, API keys, signed webhooks, and user profiles appear in this changelog. So do REST, MCP, authentication, billing, and writes. **November 2026** v1 **Changed** * Each webhook delivery now gets 30 days, where it got 7. One still failing after that ends `exhausted`. A paused webhook or monitor holds its deliveries for those 30 days. See [Retry policy](/webhooks/overview#retry-policy) * The price lists now show the X sign-in fee. A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. See [X sign-in fee](/guides/billing#x-sign-in-fee) * A past time over 24 hours from every stored list now answers `404 not_found`. It answered `400 invalid_input`. So does a `GET /x/trends/history` range that ends before a place's first stored list. Both cost nothing. An unknown place name & unreadable input still answer `400` * Connect links let your users connect an X account on a page Xquik hosts. They need no Xquik signup. Your backend never receives their password. See [Connect your users' X accounts](/guides/connect-x-accounts-for-your-users) * Connect links now need **Connect X accounts** on the API key. That covers making, listing, reading & revoking them. A link stops while its key is paused or lacks that permission. It ends once that key is revoked, rotated, expired or deleted. Each link names that key in `apiKeyId`. `GET /x/account-connection-links` lists your links. A sign-in with missing details answers `400` & leaves the link as it was * A new key permission, Connect X accounts, opens this API to your backend. It connects, reconnects, retries & disconnects X accounts. It starts off, and Full access doesn't include it. Only a dashboard session can turn it on. See [Connect your users' X accounts](/guides/connect-x-accounts-for-your-users). MCP tools still never take X passwords * X account logins no longer stop at 10 per 15 minutes. Failed logins slow a caller down, & each account it connects lifts that limit. Reconnects follow the same limits & cooldowns * `POST /x/accounts/{id}/reauth` can answer `202` for an email code, & `409 x_account_mismatch` for another X account's sign-in * `POST /x/media/download` takes any number of posts in `tweetIds`, where it took 50. Posts it had no time to read come back in `unprocessedTweetIds` at no charge. Send them again * `GET /x/tweets` & `GET /x/users/batch` take as many IDs as fit in 1 URL. They took 100 * `GET /x/users/batch/tweets` takes any number of users, where it took 20. `pageSize` goes up to 300 posts a user. Users it had no time to read come back in `unprocessed_ids` at no charge * `GET /x/users/{id}/insights` & `GET /x/users/{id}/shadowban` read past where X ends a profile timeline. So `limit=2000` returns 2,000 posts. The rows below that place come from search, which can miss a few posts * `sample.read` in user insights gives the posts read. `sample.posts` gives the posts the averages used * Every Community route takes an ID or a URL-encoded `x.com/i/communities` link. So does the `communityId` search filter * Changes to Xquik resources get 6,000 requests per minute, `DELETE` included. X (Twitter) actions through a connected account keep 120 per minute. A `429` message names the limit and the wait * Extraction jobs take up to 10,000 items per target list. That covers usernames, search queries, Community IDs, List IDs & profile relations * `POST /x/communities` answers `422 x_community_creation_closed` and charges nothing. X stopped accepting new Communities in April 2026 * An empty last page from `GET /x/users/{id}/tweets`, `GET /x/users/{id}/replies` or `GET /x/tweets/search` can carry `hiddenTimeline`. It means X shows that account's timeline to nobody * An MCP answer over 24,000 characters now stays valid JSON. It keeps whole items from the start. Each cut says `--- TRUNCATED ---`. `truncated` holds the full size, `next`, `result_id` & a CSV `download_url` * The `execute` tool states what 1,000 credits cost in dollars * The `execute` tool says its 55 seconds include waits. It also says how long a post can take. A script past the limit with no request running gets a refusal. The refusal names its last successful request * Hidden likers answer `424 favoriters_unavailable`. The message names the post's retweeters path **New** * `GET /x/tweets/search` takes `topic` & keeps only posts about it, such as `the Rust programming language`. Each kept post carries its `topicScore`, & `topicFilter` states the 0.5 cutoff. Each kept post costs 2 credits. MCP's `searchTweets` takes it too * `POST /x/users/{id}/block` blocks a user from a connected X account, & `DELETE` unblocks. `POST /x/users/{id}/mute` mutes, & `DELETE` unmutes. Each call costs 10 credits * `POST /x/tweets/{id}/bookmark` bookmarks a post from a connected X account, & `DELETE` removes the bookmark. Each call costs 10 credits like other writes, & MCP clients get both through `execute` * `POST /x/media/download` takes `imageShows` & saves only posts whose photos show it. Each saved post costs 2 credits, on top of the save price * `POST /extractions` takes `topic` or `imageShows` on tools that return posts. It stores only the posts that match. Each stored post costs 2 credits instead of its read price. A dropped post costs nothing. The job's `topicFilter` or `imageFilter` states the cutoff & counts * `GET /x/users/{id}/tweets`, `/replies` & `/media` take `imageShows` & keep only posts whose photos show it. Send `charts`, `screenshots`, `product_photos`, `memes`, `people` or your own words. They take `topic` too, & search takes `imageShows`. Each kept post costs 2 credits * AI analysis now reads each post's images with its text, at no extra cost * Send `analysis.images: false` to analyze the text alone. Images of posts X marks sensitive stay unread * `contextAvailability.media` is `images` when the AI read a post's images. An image-only post now gets answers * `GET /x/users/{id}/shadowban` checks 1 X account. It looks for a search ban, a search suggestion ban & reply deboosting. It also says if the account is active, protected or suspended * Each check answers `pass`, `fail` or `unknown` with its reason. It also names the posts, suggestions or replies it read. It costs 1 credit per profile, post, suggestion & reply in the answer. Guest keys can call it * Sentiment analysis adds `emotion`, the main emotion of each post, at the same price. It answers `joy`, `anger`, `sadness`, `fear`, `surprise`, `disgust` or `none` * `GET /radar` search trend items add `volumes`. It lists each search volume change with its time * Each search trend news story adds its `imageUrl` & `publishedAt` when the story has them **October 2026** v1 Read the [October 2026 changes](/changelog/2026-10). **September 2026** v1 Read the [September 2026 changes](/changelog/2026-09). **August 2026** v1 Read the [August 2026 changes](/changelog/2026-08). **July 2026** v1 Read the [July 2026 changes](/changelog/2026-07). **April 2026** v1 Read the [April 2026 changes](/changelog/2026-04). **March 2026** v1 Read the [March 2026 changes](/changelog/2026-03). # Xquik changelog for March 2026 X (Twitter) API Source: https://docs.xquik.com/changelog/2026-03 What changed in Xquik in March 2026, across the X (Twitter) REST API, MCP server, SDKs, tweet search, follower exports, monitors, webhooks & extractions. > For the complete documentation index, see [llms.txt](/llms.txt). **March 2026** v1 **New** * MPP expanded from 16 to 31 eligible endpoints * Webhook delivery signing now uses HMAC-SHA256 with `X-Xquik-Signature` header **Changed** * OAuth 2.1 discovery metadata now served from `/.well-known/oauth-authorization-server` * Rate limit responses include `Retry-After` header # Xquik changelog for April 2026 X (Twitter) API Source: https://docs.xquik.com/changelog/2026-04 What changed in Xquik in April 2026, across the X (Twitter) REST API, MCP server, SDKs, tweet search, follower exports, monitors, webhooks & extractions. > For the complete documentation index, see [llms.txt](/llms.txt). **April 2026** v1 **New** * `POST /x/tweets` - added `media` field (1-4 image URLs). `text` is now optional when media is present * `POST /x/accounts/{id}/reauth` - added `email` parameter * `POST /x/media` - now accepts `image/webp` and `image/avif`. Allowed types are AVIF, GIF, JPEG, PNG, WebP, and MP4 * `POST /x/accounts` and `POST /x/accounts/{id}/reauth` responses now include a `health` field. Its values are `healthy`, `locked`, `needsReauth`, `recovering`, `suspended`, and `temporaryIssue`. The same field now appears on `GET /x/accounts` list and detail responses * New error code `login_cooldown` (429) for `POST /x/accounts` and `POST /x/accounts/{id}/reauth`. Its body has `reason` and `retryAfterMs`, and it sends a `Retry-After` header * All 17 write endpoints now document the standardized error responses. Those endpoints are under `/x/tweets`, `/x/users`, `/x/dm`, `/x/profile`, `/x/media` and `/x/communities`. The responses are `403 account_needs_reauth`, `403 account_restricted`, `422 write_rejected`, `429 rate_limited_by_x`, and `503 transient_error` * `GET /radar` items now expose 15 metadata fields per source, up from 8. They are `mrr`, `growthPercent`, `last30Days`, `total` (required), `customers`, `activeSubscriptions` and `onSale`. The optional fields are `askingPrice`, `country`, `growthMrrPercent`, `multiple`, `paymentProvider`, `rank`, `category` and `xHandle` * Expanded Machine Payments Protocol (MPP) pay-per-use to 31 endpoints (tweets, communities, lists, user data) * New guides cover LangChain, Pydantic AI, CrewAI, Mastra, Google ADK, and Microsoft Agent Framework **Changed** * Billing migrated to credits-only model (usage-quota removed) * In the `GET /account` response, `creditInfo` replaces `currentPeriod` * In the `POST /extractions/estimate` response, `creditsRequired` / `creditsAvailable` replace `usagePercent` / `projectedPercent` * Monitor delivery changed. The public API contract did not change. * `POST /x/tweets/{id}/like` and `POST /x/tweets/{id}/retweet` are now end-to-end idempotent. Calling either on an already-acted-on tweet returns 200 success. The earlier silent rejection produced a 500 plus an account cooldown. **Removed** * Xquik no longer emits event types `follower.gained` and `follower.lost`. Valid event types are `tweet.new`, `tweet.quote`, `tweet.reply`, `tweet.retweet` (plus `webhook.test`). * Error code `shadow_account` (422) removed from `POST /monitors` * Error code `stream_registration_failed` (502) removed from `POST /monitors` (monitor activation is now asynchronous) * Telegram bot endpoints and integrations pipeline endpoints removed # Xquik changelog for July 2026 X (Twitter) API Source: https://docs.xquik.com/changelog/2026-07 What changed in Xquik in July 2026, across the X (Twitter) REST API, MCP server, SDKs, tweet search, follower exports, monitors, webhooks & extractions. > For the complete documentation index, see [llms.txt](/llms.txt). **July 2026** v1 **Changed** * From July 21, 2026, X write endpoints require an `Idempotency-Key` header * Requests without it return `400 missing_idempotency_key`. Xquik does not charge them * A key that is not 1 to 255 visible ASCII characters returns `400 invalid_idempotency_key` * Send 1 unique key per intended write. Reuse it only to retry that same write # Xquik changelog for August 2026 X (Twitter) API Source: https://docs.xquik.com/changelog/2026-08 What changed in Xquik in August 2026, across the X (Twitter) REST API, MCP server, SDKs, tweet search, follower exports, monitors, webhooks & extractions. > For the complete documentation index, see [llms.txt](/llms.txt). **August 2026** v1 **New** * Accountless guest wallets prepay 33 GET routes through a scoped `paid_reads` key * `POST /guest-wallets`, `GET /guest-wallets/status`, and `POST /guest-wallets/topups` support hosted checkout after confirmation without an account * Active guest keys expose the same 33-route read-only catalog through API MCP * OAuth discovery advertises claimed `service_auth` agents with revocable access tokens and identity assertions * API MCP v2.6.0 supports MCP `2026-07-28` through `server/discover` * Modern discovery and tool catalogs include private cache hints * `POST /compose` now returns 7 source-specific `radarRecommendations` with endpoints, use cases, and drafting guidance * Reddit Radar items now expose available post text, destination URLs, and media. They also expose available public engagement signals, estimated vote counts, and post state * `GET /x/account-connection-attempts/{id}` reports the state of a tracked connection. It is pending, successful, failed, or waiting for an email code **Changed** * `GET /x/tweets/search` accepts `pageSize` as a `limit` alias * API MCP v2.6.58 gives `execute` calls 55 seconds of bounded wall time. It documents compact result projection. It keeps completed request diagnostics after a timeout * `GET /x/accounts` supports cursor pages through `limit` and `cursor` * The best-practice contract paginates X accounts by default. Legacy responses retain up to 10,000 accounts * Extraction estimates and jobs now default `resultsLimit` to 10,000. Native MCP schemas retain OpenAPI defaults * API MCP v2.6.43 advertises immutable tool catalogs and disables change subscriptions * API MCP v2.6.42 adds OpenAPI-native tools at `https://xquik.com/mcp?codemode=false`. Code Mode remains the default * API MCP v2.6.41 removes the extraction row threshold from OpenAPI routing metadata * API MCP v2.6.40 uses `docs`, `search`, and `execute`. Tool descriptions contain mechanics, not endpoint choices * Modern MCP calls are request-scoped and require no initialization session * Stateless 2025-era MCP clients remain compatible at the same endpoint * Field guidance now documents REST naming exceptions and MCP normalization * Export guidance now separates file formats from downstream column selection * Account connection email-code challenges now return immediately as a resumable `202 requires_email_code` response * `POST /x/accounts` can return a durable `202 pending` response with `Location` and `Retry-After`. Follow that attempt instead of resending credentials * Account connection failures now expose the exact cooldown through `retryAfterMs` and `Retry-After`. Retry controls show a live countdown * Direct MPP now covers 7 fixed-price `charge` operations. Result-sized reads use guest or full account credits * Follow checks and article reads cost USD 0.00075 per direct MPP call * Every response after an accepted MPP payment includes `Payment-Receipt`, including non-2xx responses * The 26 non-MPP anonymous paid reads return `401` with `WWW-Authenticate: Bearer`. The answer also carries a guest wallet action * The 7 direct MPP reads return `402` with `WWW-Authenticate: Payment` and the same guest action * Reddit Radar now lists only items with full details * Startup growth Radar items now add founder, company, acquisition, margin, and revenue-efficiency fields. Each field appears when available * A successful Compose score now points to `GET /x/accounts` and `POST /x/tweets`. It keeps the one-click `intentUrl` **Removed** * Obsolete public account location fields # Xquik changelog for September 2026 X (Twitter) API Source: https://docs.xquik.com/changelog/2026-09 What changed in Xquik in September 2026, across the X (Twitter) REST API, MCP server, SDKs, tweet search, follower exports, monitors, webhooks & extractions. > For the complete documentation index, see [llms.txt](/llms.txt). **September 2026** v1 **New** * `DELETE /x/dm/{userId}/messages/{messageId}` deletes a DM from your account's side * The other person keeps it. It costs 10 credits, only when X deletes it * MCP adds it as `deleteDm`, and the SDKs as `dm.delete_message` * Profiles add `accountBasedInUnavailable: true` when `accountBasedIn` is not available yet * Those profiles omit `accountBasedIn`. Treat the label as unknown & retry later * `accountBasedIn: null` still means X shows no label **Changed** * Native MCP adds `readSavedResult`, which reads a saved oversized answer in free pages * Oversized answers up to the 2 MiB MCP response limit now save. The old limit was 256 KB * An oversized answer's `retry` names only tools your MCP catalog lists * A search X refuses returns `424 search_unavailable`, never an empty page * User Tweets, user replies, quotes & List Tweets list `keywords`, `place`, `placeCountry`, `pointRadius`, `boundingBox` & `advancedQuery` * User Tweets, user replies & quotes also list `listId`, and Tweet search lists `keywords` * With a search filter such as `keywords`, a user timeline filters every Tweet. It no longer filters only older ones * `max_results` sets the page size wherever `limit` & `count` do * `maxItems`, `max_items` & `per_page` set it too * Tweet search `queryType` takes any case & the aliases `type`, `search_type`, `product`, `category` & `section` * `Photos`, `Videos` & `Media` return posts with that media type. `People` & `Lists` answer 400 with the route to use * Direct replies stop listing 8 search filters they never applied * Those are `cardName`, `source`, `excludeSource`, `geocode`, `near`, `within`, `safe` & `news` * List Tweets & direct replies take the legacy `after` cursor alias on every page * Community search applies `withinTime` * Events prefer `monitorId` to `monitor_id`. A monitor filter without a usable ID lists no events * A cursor ignores parameters its route doesn't read, so dropping one keeps it * A post X never published fails as `x_post_not_sent`. You pay nothing & can post again * Writes X never confirms end `expired` & charge nothing. Check your X account before you retry * X's 500, 504 & 408 after the send keep a write `pending_confirmation` as `x_write_ambiguous` * Pending answers say `retryable: false` * Before the send, those give `x_transient_error` & are safe to retry, not `x_write_failed` * X refusals that state a reason return `422 x_rejected`. They used to return `500 x_write_failed` * X's refusal of an image's size returns `422 x_image_invalid` * Avatar & banner uploads take images up to 15 MiB. Xquik fits them to X's limits * Post images over 5 MiB shrink to fit. GIFs & videos go to X unchanged * An unreadable image returns `415 unsupported_media_type` * An image Xquik can't shrink enough returns `413 media_too_large` * OpenAPI lists 413 & 415 on media writes, plus 3 media error codes * Post & user path params take URLs & handles. See [path IDs](/api-reference/overview#path-ids) * Post params take a post ID or an x.com or twitter.com post URL * User params take a user ID or a username with or without `@`. They also take a profile URL * Writes look up a username first. An unknown username returns `422 x_target_not_found` * Other input returns `400 invalid_tweet_id` or `400 invalid_user_id` * `GET /x/users/{id}` returns `invalid_user_id` where it returned `invalid_username` * Writes X refuses outright return `422 x_rejected` & charge nothing * `POST /x/communities` returns `422 x_account_feature_required` when the account can't create communities * Both used to look like unconfirmed writes * MCP `execute` takes paths with or without `/api/v1`, such as `/x/users/nasa/follow` * `GET /x/users/{id}/tweets` & `GET /x/users/{id}/replies` now list `sinceTime`, `untilTime` & `mode` * Both routes already applied them. `sinceTime` keeps its exact second & `untilTime` drops it * A time without an offset reads as UTC. That holds on every route that takes these bounds * An offset whose `+` arrived unencoded, such as `21:20:41 02:00`, reads as `+02:00` * Community Tweets, List Tweets, thread & batch users now list every filter they applied * Quotes list `includeReplies`, and bookmark folders list `cursor` * Likes, media & mentions drop search operators such as `cardName`. They never applied them * Replies to a post that is unavailable on X return `422 x_reply_target_unavailable` * Some used to return `500 x_write_failed` * Xquik sends nothing & charges nothing. Check the post on x.com or reply to another post * `GET /draws`, `GET /drafts` & `GET /events` return `400 invalid_input` for an unknown cursor * Before, they returned the first page again * Send the last `nextCursor` you received, or omit the cursor to start over * An empty cursor still returns the first page * Replies, quotes, retweeters & thread of a post X does not have return `404 tweet_not_found` * They used to return 200 with an empty page. `GET /x/tweets/{id}` already returned this 404 * An empty first page tells you whether the post exists. A post without engagement still returns 200 * A 404 costs no credits * Each account now gets 500 reads a second, up from 300 * Writes still allow 120 a minute & deletes 60 a minute * `429 x_rate_limited` messages now name the wait from `Retry-After`, such as about 15 minutes * Without a known wait, the message says to try again later * Writes X refuses as possibly automated return `422 x_automation_refused` * They used to return `429 x_rate_limited` * Waiting does not change X's answer. Send the next request now with a new `Idempotency-Key` * If X keeps refusing, check the account on x.com. Vary your text or pace * These refusals cost nothing * `429 x_rate_limited` now covers only X's rate limits. Wait for `Retry-After` when present * `GET /x/tweets/{id}/replies` with `sort=latest` or `sort=oldest` can set `orderPartial: true` * Rows stay sorted by date & keep the same status. Replies may be missing between them * Nothing marked such answers before. Retry later for a gap-free order * `GET /x/tweets/{id}/replies` applies `sort` on automatic pages too * Those pages used to list the newest replies first, whatever the `sort` * Without `sort`, automatic pages still list the newest first. Standard pages ignore `sort` * `POST /draws` enters every direct reply & retweeter X shows * Draws used to include fewer entries * Entries are direct replies to the post. Replies to other replies no longer enter * A draw on a busy post takes about 1 minute. Keep the request open for 100 seconds * `GET /x/tweets/{id}/retweeters` returns more complete lists * `POST /draws` returns `424` when it can't collect every entry * It used to draw from the entries collected so far * Retry after `replies_incomplete` or `retweeters_incomplete` * `draw_too_large` means the post has more entries than 1 draw can hold. Contact support * Xquik saves & charges nothing for these draws * Bookmark folder reads on accounts without X Premium return `424 bookmark_folders_unavailable` * This covers `GET /x/bookmarks/folders` & `GET /x/bookmarks?folderId=...` * They used to return an empty list. The message says to upgrade on X or read all bookmarks * These answers cost nothing * Search Tweets returns `424 search_unavailable` at once for `filter:vine`, `filter:consumer_video`, `filter:pro_video`, `filter:news` & `retweets_of:` * X no longer searches these. `news=true` gets the same answer * The message says what to change, such as the term to remove * A query X refuses as a whole also gets `424 search_unavailable`. One example is a query over 512 characters * These answers cost nothing * Follower, following, verified follower, retweeter & user search pages take `enrichProfiles=true` * Each row then carries the full profile, with fields such as `accountBasedIn` * The `x-xquik-profile-enrichment` header counts the rows that carry it * Extractions of these rows take `enrichProfiles` & add the profile at `enrichmentData.profile` * The price per row stays the same * Complete-mode replies return 200 after covering a whole `sinceTime` or `untilTime` window * Replies outside the window no longer turn that answer into `424 replies_incomplete` * Complete-mode replies add `diagnostic.sourcesEnded` * `true` means the list is final. X hides the other replies * A `424 replies_incomplete` with `sourcesEnded: true` returns the same rows on retry * Its message says X hides the other replies instead of asking for a retry * `withinTime` now filters user Tweets, replies, media, likes & mentions * It also filters Tweet replies & quotes * Posts outside the window no longer come back or cost credits * Use a whole number & `s`, `m`, `h` or `d`, such as `90m` or `7d` * On these routes, other values return `400 invalid_input` * `GET /x/users/batch` returns the profiles it read when some IDs fail * IDs that failed to load come back in `failed_ids`. Retry them * Failed IDs cost nothing * Draws charge follow checks only for authors who pass your other filters * `POST /draws` accepts an optional `Idempotency-Key` header * An exact retry returns the original draw with `Idempotency-Replayed: true` & charges nothing * A retry while the first request runs returns `409 idempotency_in_progress` * Another body with the same key returns `409 idempotency_conflict` * A draw that fails its save or final charge stores nothing & charges nothing * The dashboard sends 1 key per draw, so a resubmit returns the saved draw * Webhook retries have no attempt limit. They continue until your endpoint returns `2xx` * `410 Gone` retries like any other failure * A failing endpoint gets 1 waiting delivery at a time. It gets one at least every 15 minutes * When that delivery succeeds, Xquik starts sending `pending` deliveries * Resume Webhook & `isActive: true` start sending waiting deliveries at once * Without them, a rejected delivery can wait up to 7 days after a fix * Only a paused or deleted webhook marks deliveries `exhausted` * Resume within 30 days of an event to receive its held delivery * Return `2xx` for deliveries you skip. A rejected one can delay new ones up to 15 minutes * Private reads use only your connected X account * They cover bookmarks, bookmark folders, notifications, home timeline, likes, likers & mutual followers * Without one, these routes return `424 account_required` * They return `503` while your connected X accounts are busy * `favoriters` & `user_likes` extraction jobs need a connected X account * Without one, the job fails with `errorMessage` set to `errorXAccountRequired` * Guest keys no longer cover likes, likers & mutual followers * Guest keys get `403 forbidden` on these 3 routes * Guest wallets now prepay 30 GET routes * Small conversation searches return more complete results by default * Reply Scraper 1.2.65 reports completion more accurately * Reply reads return more replies within your requested limit * Reply Scraper 1.2.64 recovers replies after a stall & keeps collected rows * Dated author searches return more complete results * Searches requiring protected authors return an access error before collecting results * Tweet Scraper 1.12.99 returns more Latest search results * Multi-author Tweet searches return more complete results * Pagination docs now explain cursor retries & first-page limits * Tweet search keeps exact ID boundaries across pages * `sinceId` excludes its ID. `maxId` includes its ID * MCP reports missing response-field reads without changing returned values * MCP search keeps response descriptions and date-only string types * Profile, list, and quote reads keep explicit reply filters * Image previews resize AVIF sources again * MCP search keeps shared response schemas in `spec.components.schemas`, reducing repeated contract data * Extractions from mixed tweet, reply, quote, thread, and profile-media sources retain attached public media # Xquik changelog for October 2026 X (Twitter) API Source: https://docs.xquik.com/changelog/2026-10 What changed in Xquik in October 2026, across the X (Twitter) REST API, MCP server, SDKs, tweet search, follower exports, monitors, webhooks & extractions. > For the complete documentation index, see [llms.txt](/llms.txt). **October 2026** v1 **New** * Pick what an API key can call on the [API keys page](https://dashboard.xquik.com/en/api-keys). Add write, monitors, exports or billing to a read key * Calls outside a key's scopes get `403 insufficient_scope`, REST & MCP alike. `requiredScope` names the scope to add * `POST /api-keys` & `PATCH /api-keys/{id}` take `scopes`, & every key carries it. Full access keys work as before * Lock an API key to your IPs on the [API keys page](https://dashboard.xquik.com/en/api-keys). It takes up to 20 IPs or CIDR ranges. An empty list allows any IP * Calls from other IPs get `403 ip_not_allowed`, REST & MCP alike. The message names the calling IP * `POST /api-keys` & `PATCH /api-keys/{id}` take `allowedIps`, & every key carries it. Keys without a list work as before * Pause an API key on the [API keys page](https://dashboard.xquik.com/en/api-keys) & resume it later. Select several keys to pause or resume them together * A paused key gets `403 api_key_paused` on every API route & the MCP server. Pausing keeps the key & its settings * `PATCH /api-keys/{id}` takes `paused`, & a paused key carries `pausedAt`. Keys you never pause work as before * `PATCH /api-keys` pauses or resumes up to 100 keys in 1 request * API keys take an optional monthly credit budget, `monthlyBudgetCredits`, on create & update * Each key shows `monthlySpentCredits`, its spend this UTC calendar month. The owner gets 1 email at 80% * At its budget, new REST, MCP & Actor calls with the key get `403 api_key_budget_reached` * The key works again next UTC month, or once the owner raises its budget * `GET /x/sports/{league}/games/{id}/roster` returns both teams' players with jersey, position, headshot & X account * `GET /x/sports/{league}/games/{id}/player-props` returns the prop lines & American odds X shows for an NFL game * Each costs 1 credit, & `ncaafb` gets a free `unsupported_league`. MCP adds them as `getFootballRoster` & `getFootballPlayerProps`, and guest keys can call them * A football player's `xUser` now carries `protected`, `superFollowEligible` & `labelType`, which rosters fill * `GET /x/sports/{league}/games/{id}/posts` lists a game's top or latest posts. It also gives the X (Twitter) search that finds them * It costs 1 credit per post, & a game X does not know is free. MCP adds it as `getSportsGamePosts`, and guest keys can call it * `GET /x/sports/{league}/games/{id}/audience` returns a game's live viewers, fan picks per team, chat state & teams. It costs 1 credit, & a game X does not know is free. MCP adds it as `getSportsGameAudience` * `GET /x/sports/{league}/games` lists NFL or college football games in a time window. Each game carries its game & team IDs * `GET /x/sports/{league}/games/{id}` returns a game's scoreboard. Its `/plays` route returns every drive & play. Its `/box-score` route returns team totals & player stats * Each costs 1 credit, & a game X does not know is free. MCP adds them as `listFootballGames`, `getFootballScoreboard`, `getFootballPlays` & `getFootballBoxScore`, and guest keys can call them * OpenAPI declares the `Deprecation`, `Link` & `Sunset` headers on each answer that sends them * The [versioning & deprecation policy](/guides/versioning) lists today's deprecated items, their dates & the 90-day notice * Profiles carry `redirectsToUsername`, the handle x.com redirects the profile to. A renamed account's new handle is one example * `GET /x/news/{id}/versions` returns every version X wrote of a news story from Explore, oldest first * Each version has its time, headline & text. It costs 1 credit per request, & a story X does not know is free. MCP adds it as `getXNewsStoryVersions`, and guest keys can call it * `GET /x/spaces/search` takes `queryType=Live` & `queryType=Upcoming`, which list Spaces on air now or scheduled. Both match words in Space titles * Each row is the full Space `GET /x/spaces/{id}` returns, for 1 credit * `GET /x/community-notes/contributors/{alias}` answers a Community Notes contributor's note counts by rating & rating counts * Its `/notes` route lists every note they wrote with its post. That includes the notes x.com hides. Its `/deleted-notes` route lists the notes they deleted * The lookup costs 1 credit & each note costs 1 credit. An unknown alias is free. MCP adds them as `getCommunityNotesContributor`, `listCommunityNotesContributorNotes` & `listCommunityNotesContributorDeletedNotes`, and guest keys can call them * `GET /x/trends/history` reads Xquik's Twitter trends archive. The archive holds the lists X showed for a place over a time range * It returns 1 stored list per step, each with its own `capturedAt`. Stored lists start at 2026-10-13 02:20 UTC. Each list costs 1 credit, up to 100 per request * `GET /x/trends` takes `at` & answers with the stored list nearest that time, for 1 credit. MCP adds the range as `getXTrendsHistory`, and guest keys can call it * `at`, `from` & `to` also take a span back from now, like `24h` or `7d`. With a span, a schedule reads yesterday's trends on every run * A range answer names the times it read in `fromTime` & `toTime`. Its `next_cursor` keeps every page on the first request's time * `POST /webhooks/telegram` gives a t.me link to @XquikBot. The link connects a Telegram chat to your monitors * Press Start & each event arrives as a message. Retries, deliveries & resume work as for webhooks. It's free * `GET /events/stream` sends your monitor events live over 1 connection, as server-sent events * Reconnect with `Last-Event-ID` to replay what you missed from the last 30 days. Streaming is free * `GET /x/users/{id}/insights` answers a profile's engagement rate, averages per post, posting rate & top post * `GET /x/tweets/{id}/insights` answers a tweet's engagements per hour, per view & per follower of its author * Each report costs 1 credit, & a profile or tweet X doesn't know is free. MCP adds them as `getUserInsights` & `getTweetInsights`, and guest keys can call them * `GET /x/tweets/top` lists the tweets X ranks highest. X ranks them by likes, replies, quotes, bookmarks, shares or views * Pick a day, week or month, & all of X, a country or a language. Each tweet costs 1 credit, up to 100 per list. MCP adds it as `getTopTweets`, and guest keys can call it * `GET /x/users/{id}/live` says whether a user is broadcasting live on X now. It also returns their latest broadcast * It costs 1 credit per check, & a user X does not know is free. MCP adds it as `getUserLiveStatus`, and guest keys can call it * `GET /x/tweets/{id}/replies` with `mode=complete` takes `includeHidden=true` and adds the replies the post's author hid * Each has `hiddenByAuthor: true` and costs 1 credit like any reply. A post without hidden replies costs nothing extra * `GET /x/users/{id}/translation` returns X's own translation of a profile's bio into the language you pick * It costs 1 credit per translation, & a profile without a bio is free. MCP adds it as `translateUserBio`, and guest keys can call it * `GET /x/tweets/{id}/replies` no longer answers 503 when X counts replies it shows nobody. It ends the list instead * The last page names them in `hiddenReplies`, & it costs nothing extra * `GET /x/tweets/{id}/retweeter-ids` returns the user IDs of a post's reposters. It keeps the order & pages of `GET /x/tweets/{id}/retweeters` * Each ID costs 1 credit, & a post nobody reposted is free. MCP adds it as `getTweetRetweeterIds`, and guest keys can call it * `GET /x/communities/{id}/members/search` finds a Community's members by name or username, each with its role * It costs 1 credit per member, & an answer without members is free. MCP adds it as `searchCommunityMembers`, and guest keys can call it * Posts in a Community add `communityName` beside `communityId` when X sends the name. It costs nothing extra * The 6 analysis endpoints take `baseline`, the rows of an earlier answer. Each result's `monitor` says whether the post is new, changed or unchanged. The comparison costs nothing extra * Score answers, such as `intensity` or `conviction`, can have decimals between levels * 6 AI analysis endpoints read X posts, searches or your own texts. Each analyzed post costs 2 credits * `POST /x/analysis/sentiment` answers each post's attitude, its intensity & its sarcasm probability * `POST /x/analysis/brand` answers each post's relevance, attitude & customer relationship for your brand * `POST /x/analysis/news` answers each post's format, source attribution & relevance to your topic * `POST /x/analysis/market-signals` answers each post's stance on an asset & counts bullish & bearish posts per cashtag * `POST /x/analysis/viral-score` rates how viral a post or draft reads, from 0 to 100. Each score comes with a verdict * `POST /x/analysis/classify` answers up to 8 questions you write, as categories, scores or yes/no * A search can name an account in `username` or a List in `listId`. Or it can name a post in `quotesOf` or `repliesTo`. It reads posts between `sinceTime` & `untilTime` * A post without an analysis costs nothing. MCP lists all 6, and guest keys can call them * `GET /x/articles/{tweetId}` adds `bodyMarkdown`, the Article body as Markdown * It keeps headings, lists, bold, italic, links & images, without HTML. It costs nothing extra * Search rows add `textHighlights`, which mark where the row's `text` matches the search * Each range has `startIndex` & `endIndex`, counted in code points of `text`. It costs nothing extra * `GET /x/users/batch/tweets` returns the newest posts of up to 20 users in 1 call * Name the users by `ids` or `usernames`. It costs 1 credit per post * A user it could not read is named in `unprocessed_ids` & costs nothing * MCP adds it as `getBatchUserTweets`, and guest keys can call it * `GET /x/communities/find` finds X Communities by keyword. It costs 1 credit per Community * `GET /x/communities/popular` lists the most popular Communities of a topic or subtopic * Send the topic by `topicId` or by name as `topic`. It costs 1 credit per Community * `GET /x/communities/topics` lists every Community topic & subtopic, 1 credit per topic * `GET /x/communities/suggested` lists the Communities X (Twitter) suggests to join, 1 credit each * `GET /x/communities/{id}/media` returns a Community's Media tab, 1 credit per post * `GET /x/communities/{id}/tweets` takes `queryType=Top` for the Community's Top posts * Community responses add `banner`, with its size, main colors & focus area * MCP adds `findCommunities`, `getPopularCommunities`, `getCommunityTopics`, `getSuggestedCommunities` & `getCommunityMedia`, and guest keys can call them * Community find & popular answer a free 400 `invalid_cursor` when X refuses a cursor * `GET /x/tweets/{id}/retweeters/check` says whether 1 account reposted a post * It reads the account's newest posts. Each check costs 1 credit * MCP adds it as `getTweetRepostCheck`, and guest keys can call it * `GET /x/users/{id}/affiliates` returns the accounts an organization lists as its affiliates, in X's order * Each row is a full profile. It costs 1 credit per result * MCP adds it as `getUserAffiliates`, and guest keys can call it * `GET /x/users/{id}/subscriptions` returns the creators a user subscribes to, in X's order * Each row is a full profile. It costs 1 credit per result * MCP adds it as `getUserSubscriptions`, and guest keys can call it * `GET /x/users/{id}/follower-ids` and `GET /x/users/{id}/following-ids` return user IDs only * A page holds up to 5,000 IDs, newest first. Each ID costs 1 credit * MCP adds them as `getUserFollowerIds` and `getUserFollowingIds`, and guest keys can call them * `GET /x/tweets/{id}/hidden-replies` returns the replies a post's author hid, oldest first * It lists replies to hidden replies too. It costs 1 credit per reply * MCP adds it as `getTweetHiddenReplies`, and guest keys can call it * `GET /x/tweets/{id}/translation` returns X's own translation of a tweet into the language you pick * It returns the detected source language and the links of the translated text. It costs 1 credit per call * MCP adds it as `translateTweet`. Guest keys and direct MPP can call it * `GET /x/tweets/{id}/embed` returns the HTML that embeds a tweet on a website. It comes in a light or dark theme * It can hide media and the thread, and leave the widget script out. It costs 1 credit per call * MCP adds it as `getTweetEmbed`. Guest keys and direct MPP can call it * `GET /x/links/resolve` returns where up to 100 t.co links lead, in the order sent * It costs 1 credit per resolved link. A link X does not answer for comes back in `unprocessedUrls`, free * MCP adds it as `resolveLinks`, and guest keys can call it * `GET /x/tweets` takes tweet URLs beside tweet IDs in `ids`. It reads a tweet named twice once * `GET /x/followers/check` takes user IDs beside usernames, and returns `sourceId` & `targetId` * `GET /x/tweets/{id}/subtitles` returns the caption tracks of a tweet's videos. Each track has timed cues & the full text * It costs 1 credit when a track comes back. A tweet without captions costs nothing * MCP adds it as `getTweetSubtitles`, and guest keys can call it * `GET /x/users/{id}/similar` lists the accounts X (Twitter) shows as similar, in X's order * It costs 1 credit per account. MCP adds it as `getSimilarUsers`, and guest keys can call it * Results can differ between calls. Xquik now returns a fuller, steadier list * `GET /x/users/{id}/articles` lists the X Articles a profile published, newest first * Each row is the Article's post with its title, preview & cover. It costs 1 credit per post * MCP adds it as `getUserArticles`, and guest keys can call it * `GET /x/users/{id}/highlights` returns the posts on a profile's Highlights tab * Rows keep X's order. It costs 1 credit per post returned * MCP adds it as `getUserHighlights`, and guest keys can call it * `GET /x/trends/locations` lists the places X offers trends for * Each location has its `woeid`, country, country code & place type * `country`, `placeType`, `q` & `limit` filter the list. It costs 1 credit per location * MCP adds it as `getXTrendLocations` * `GET /x/search/autocomplete` returns the accounts, topics, hashtags & cashtags X suggests for a query * `types` keeps only the kinds you choose. `limit` caps the suggestions * Cashtags carry price, market cap & 24-hour change. It costs 1 credit per suggestion * MCP adds it as `autocompleteSearch` * `GET /x/lists/search` finds public Lists by keyword, at 1 credit per List * Each List has its counts, banner & owner profile. Private Lists stay out * MCP adds it as `searchLists`, and the SDKs as `lists.retrieve_search` * `GET /x/users/{id}/lists` returns the public Lists an account created, in X's order * `GET /x/users/{id}/list-memberships` returns the public Lists that include an account * Each List costs 1 credit. MCP adds them as `getUserLists` & `getUserListMemberships` * `GET /x/spaces/search` finds public Spaces by keyword, host or topic, at 1 credit per Space * It returns live, scheduled & ended Spaces, each once per page. MCP adds it as `searchSpaces` * Space search takes `pageSize`, the most Spaces a page returns. It runs from 1 to 100 and defaults to 20 * `GET /x/spaces/{id}` returns 1 Space with its state, times, listener counts, hosts & speakers * It takes a Space ID or URL & costs 1 credit per call. MCP adds it as `getSpace` * `GET /x/spaces/{id}/replay` returns an ended Space's recording as an HLS playback URL * A live or scheduled Space answers 409. It costs 1 credit per call. MCP adds it as `getSpaceReplay` * A Space & each Space search row add `sharings`, the posts shared in the Space * Each sharing has the post, the account that shared it & when * A Space cancelled before it started answers 404 `space_canceled` on its replay * `GET /x/broadcasts/{id}` returns 1 X live video with its title, state, times & watch counts * It takes a broadcast ID or URL & costs 1 credit per call. MCP adds it as `getBroadcast` * Guest keys & direct MPP can call it. Reading a broadcast adds no view to it * A broadcast adds `tweetId` & `tweet`, the post that announces it * A Space & each Space search row add `tweet` beside `tweetId` * Job search answers a free 400 `invalid_cursor` when X refuses a cursor * `GET /x/tweets/{id}/retweeters` answers the same free 400 `invalid_cursor` * `GET /x/jobs/search` searches public X job listings by keyword * Filter by location, work type, seniority, employment type & company * Each job returned costs 1 credit. A closed job is left out & free * `GET /x/jobs/{id}` returns 1 job with its description as text & Markdown * `GET /x/jobs/locations` finds places & the location ID job search takes * MCP adds `searchJobs`, `getJob` & `getJobLocations`, and guest keys can call them * `GET /x/places/search` finds X places by name, at 1 credit per place * Each place has the `id` that tweet search takes as `place` * `GET /x/hashflags` lists the custom emoji X shows after hashtags, at 1 credit each * `q` & `activeOnly` filter the hashflags. Each has its image & the time it runs * MCP adds them as `searchXPlaces` & `getXHashflags`, and guest keys can call both **Changed** * Each webhook delivery gets 7 days. One still failing after that ends `exhausted` * `lastError` says why. A delivery that never got a try shows `Webhook paused`, `Monitor paused` or `Endpoint failing` * A paused webhook or monitor holds its deliveries for those 7 days. Resume before a delivery's 7 days end to receive it * An `exhausted` delivery's event stays 30 days after it ends. Read it with `GET /events/{id}` * X can refuse a reply to a post deleted or hidden from your account. That call returns `422 x_reply_target_unavailable` instead of `x_target_not_found` * Xquik charges nothing. That account's later replies to the post get the same error. `Retry-After` says when to try again * An MCP answer over 24,000 characters returns its first page, not a `response_too_large` error. It carries `characters`, `next_offset`, `next` & `text`, plus `result_id` when the answer is saved * An MCP answer too large to keep also returns no error. It returns its size, its saved reads & the next step * Connecting, re-authenticating, retrying & disconnecting X accounts now needs a signed-in dashboard session. API keys & OAuth tokens get `403 session_required`, so a leaked key never reaches X passwords * The 6 routes are `POST /x/accounts`, `GET /x/account-connection-attempts/{id}`, `POST /x/account-connection-challenges/{id}/submit`, `POST /x/accounts/{id}/reauth`, `POST /x/accounts/bulk-retry` & `DELETE /x/accounts/{id}`. MCP no longer lists them * `GET /x/accounts` & `GET /x/accounts/{id}` still take an API key * For an account with a plan, `POST /subscribe` gives the dashboard billing page. The user signs in there to manage billing. It used to give a billing portal session * API key management & saved-card top-ups answer an API key with `403 session_required`. The answer names the dashboard. This replaces a same-origin error * `POST /webhooks/telegram` without `eventTypes` now connects new posts only. Connected chats keep their event types * Telegram alerts in a burst arrive as 1 digest every few seconds. Only the first message of a minute rings * A busy Telegram chat now gets 5 quick messages, then 1 every 30 s. That keeps it inside Telegram's limits. A quiet chat still gets each alert at once * Discord & Slack channels get the events of 1 post as 1 alert. Alerts that wait together come as 1 message. Their pace matches a Telegram chat's * Telegram, Discord & Slack alerts name events as the dashboard does, such as "New post". A profile change reads as a sentence * A resumed monitor starts from the moment it resumes. Posts made during the pause send no event & stay readable with tweet search * A new keyword monitor no longer sends an older post as its first event * `mode=complete` on `GET /x/tweets/{id}/replies` answers 200 when X shows none of a post's counted replies * The answer names them in `hiddenReplies` instead of `424 replies_incomplete`, & it costs nothing * Active monitors cost 30 credits per hour, up from 21. Creating one needs 30 available credits & charges no lookup credit * Top tweet search skips posts that can't match your query * Skipped posts count in `filtered_count` & cost nothing * `GET /x/tweets/{id}/replies` pages can be empty & still report more * Such a list used to end there, without the replies its next pages hold. Follow `next_cursor` while `has_next_page` is `true` * Tweet search extractions answer 424 `search_unavailable` for a filter X (Twitter) search dropped. They charge nothing * The filters are `source`, `geocode`, `within` & `news: true` * In a query they are `source:`, `geocode:`, `within:`, `retweets_of:`, `filter:vine`, `filter:consumer_video`, `filter:pro_video` & `filter:news` * `POST /extractions`, its dry run & `POST /extractions/estimate` answer before any job starts. The message names the filter to remove * Such an extraction used to end without rows * `excludeSource`, `-source:` & `-within:` keep working until 2027-01-15. X ignores them, so the extraction returns unfiltered rows * Until then those answers carry `Deprecation` & `Sunset` headers. From 2027-01-15 they answer 424 too * `GET /x/followers/check` costs 1 credit per check, down from 5. Direct MPP charges USD 0.00015 per call. A draw's `mustFollowUsername` check costs 1 credit * `descriptionMarkdown` on `GET /x/jobs/{id}` numbers ordered lists 1, 2, 3 and keeps line breaks * It escapes characters that would read as Markdown or HTML. These include `[`, `*` & `<` * `GET /x/communities/{id}/tweets` opens its first page with the pinned post, flagged `isPinned` * An empty `GET /x/communities/suggested` answer means X suggests none right now. It stays free * `GET /x/trends` takes a `country` or a `location` name, such as `location=Istanbul` * The response returns the place it read as `location`. `woeid` still wins * A write's `402` adds `top_up_url` & `dashboard`, which say where to add credits * `404 user_not_found` adds `reason`, which is `not_found` or `suspended` * A suspended account answers "X (Twitter) suspended this account. Choose another account." * Account responses add `connectedAt`, when the account last connected or reconnected * `X-Xquik-Busy-Reason` is now `admission` or `reads` * `GET /x/users/batch` takes `usernames` in place of `ids`, with or without `@` * Send up to 100 usernames. The ID lists then name the usernames as sent * `usernames` also takes profile links, such as `x.com/nasa`. A link is named by its username * The text `undefined` or `null` in `usernames` now answers 400 & costs nothing * A filtered `Latest` Tweet search adds `readBackTo`, how far back it has read * 7 account lists now page with a cursor. They no longer stop at 100 or 200 rows * They are monitors, keyword monitors, webhooks, webhook deliveries, API keys, styles & support tickets * Each takes `limit` & `cursor`, and answers `hasMore` & `nextCursor` * A 1st page keeps its size & order, so existing clients see the same rows * Xquik keeps queued events until all deliveries finish * Events expire 30 days after Xquik creates them * `GET /credits` adds `auto_topup_stopped` & `GET /account` adds `creditInfo.autoTopupStopped` * `true` means 3 declined charges in a row on one card stopped automatic top-up * An event keeps the monitor label from when Xquik created it * Renaming a monitor no longer changes past events or their retries * Each retry of a webhook delivery sends its first attempt's exact body * Tweet & DM `text` now reads as x.com shows it * X's `&`, `<` & `>` arrive as `&`, `<` & `>` * `displayTextRange` & entity `indices` count the decoded text * A repost row now shows its original post's counts * That covers likes, replies, reposts, quotes, bookmarks & views * Tweet search reads `since:`, `until:`, `sinceDate` & `untilDate` as UTC days * x.com uses your time zone, so its day edges can differ * `untilDate` is inclusive, so `untilDate=2026-03-01` returns that day's posts too * Followers come newest first * A reply request with `sinceTime` & `scope=direct` ends once it covers your window * Such a request ends sooner * A write retried with the same `Idempotency-Key` returns the first answer again * It keeps the first status, body & `Retry-After`, with `idempotent: true` added * A rejected post's retry now answers `422` like the first answer, not `200` # Twitter scraper filtering evidence for empty results Source: https://docs.xquik.com/guides/actor-filtering-evidence Explain empty X (Twitter) scraper results with server & Actor filtering counts. Check date filters, find missing evidence, and avoid unnecessary paid retries. Tweet Scraper 1.12.109 records filtering evidence in its `run-report`. Final empty-result & partial diagnostics include the same `filtering` object. Page logs include these counts for each processed page. | Field | Meaning | | - | - | | `serverFilteredRows` | Known rows rejected before the server returned each page. | | `actorFilteredRows` | Returned rows rejected by Actor filters before deduplication & billing. | | `pagesWithUnknownServerFiltering` | Processed pages without valid server filtering counts. | Counts describe rejected rows across processed pages, including repeated source rows. They do not count unique tweets or billable results. Missing server counts remain gaps, even when `serverFilteredRows` equals `0`. Older saved pages & paths without filtering evidence contribute to that gap. Restarts keep the available counts. ## Explain an empty run For example, a profile extraction might report these counts. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "serverFilteredRows": 21, "actorFilteredRows": 0, "pagesWithUnknownServerFiltering": 0 } ``` The server rejected 21 rows before returning them to the Actor. Check your date range & other filters before retrying. These counts alone do not prove that every matching tweet was available. Filtered rows & diagnostics never incur result charges. Apify platform usage remains separate. For interrupted runs, follow the diagnostic's `retryable` value & `nextAction`. See [Actor diagnostics](/guides/tweet-profile-api-fields#read-actor-diagnostics) for completion & recovery fields. # AG2 X (Twitter) API search guide for Python agents Source: https://docs.xquik.com/guides/ag2 Give AG2 agents typed tweet search through Xquik with XquikSearchToolkit, runtime Variables, cursor pagination, and delegated multi-agent research workflows. > For the complete documentation index, see [llms.txt](/llms.txt). [AG2](https://github.com/ag2ai/ag2) is an open-source Python framework for multi-agent systems. AG2 1.0.0 and later ship `XquikSearchToolkit` in `ag2.extensions.tools.search`. Xquik tweet search reaches AG2 agents without a community adapter. AG2 documents the toolkit in its [Xquik Tweet Search reference](https://docs.ag2.ai/docs/user-guide/extensions/tools/search/xquik/). Keep every tweet ID and cursor the API returns. ## Why use AG2 with the Xquik X (Twitter) API? AG2 binds search parameters at tool construction, not at model call time. The agent chooses the query. You choose the window, the ordering, and the result limit. | Boundary | AG2 control | Benefit | | - | - | - | | Tool construction | `XquikSearchToolkit(...)` | Fix `query_type`, `limit`, and time windows outside model control | | Model input | Single `query` argument | The model cannot widen the search window or result limit | | Runtime scope | `Variable` | Resolve per-user or per-tenant values at execution time | | Delegation | `Agent.as_tool()` | Keep the searcher's tool-call history out of the coordinator's context | | Transport | `base_url`, `timeout` | Point at a proxy or tighten deadlines per deployment | Use AG2 for research, monitoring, and reporting agents. Use direct REST for deterministic jobs that need no model decisions. ## AG2 X (Twitter) API prerequisites * Python 3.10 or later * An [Xquik API key](/x-api-quickstart) beginning with `xq_` * An LLM provider key supported by AG2 Public X reads need no X Developer credentials. Authenticate with Xquik. ## Install AG2 ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install "ag2>=1.0.0" ``` `XquikSearchToolkit` calls the Xquik REST API over `httpx`, which AG2 already depends on. You need no extra package. Install your model provider extra as well. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install "ag2[anthropic]>=1.0.0" ``` Store secrets outside source control. ```bash .env theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} XQUIK_API_KEY=xq_YOUR_KEY_HERE ANTHROPIC_API_KEY=YOUR_ANTHROPIC_KEY ``` ```text .gitignore theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} .env ``` ## Register the Xquik tweet search tool Passing the toolkit to an agent registers one tool, `xquik_tweet_search`. It takes a single `query` argument holding an X (Twitter) search string. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import asyncio import os from ag2 import Agent from ag2.config import AnthropicConfig from ag2.extensions.tools.search import XquikSearchToolkit from dotenv import load_dotenv load_dotenv() config = AnthropicConfig(model="claude-sonnet-4-6") agent = Agent( "x-researcher", prompt=( "Search X for evidence before answering. " "Quote tweet text verbatim and keep every tweet ID you receive." ), config=config, tools=[XquikSearchToolkit(api_key=os.environ["XQUIK_API_KEY"])], ) async def main() -> None: reply = await agent.ask("What are developers saying about the Xquik API this week?") print(reply.body) asyncio.run(main()) ``` `api_key` is required. The toolkit raises `ValueError` when it is empty. A missing key fails at construction, not on the first search. ## Bind the search window outside model control Set search defaults on the constructor. The model then cannot widen the window or raise the result limit. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} toolkit = XquikSearchToolkit( api_key=os.environ["XQUIK_API_KEY"], query_type="Latest", # "Latest" or "Top" limit=50, since_time="2026-01-01T00:00:00Z", until_time="2026-02-01T00:00:00Z", ) ``` | Parameter | Type | Purpose | | - | - | - | | `query_type` | `"Latest"` \| `"Top"` | Result ordering | | `limit` | `int` | Upper bound on returned results | | `since_time` | `str` | Start of the time window | | `until_time` | `str` | End of the time window | | `cursor` | `str` | Resume from a prior page | | `base_url` | `str` | Defaults to `https://xquik.com` | | `timeout` | `float` | Request deadline in seconds, defaults to `60.0` | The `search()` factory method takes the same parameters. Use it when you want several differently scoped tools from one toolkit. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} toolkit = XquikSearchToolkit(api_key=os.environ["XQUIK_API_KEY"]) latest = toolkit.search( query_type="Latest", limit=50, name="search_latest_posts", description="Search the newest public X posts.", ) top = toolkit.search( query_type="Top", limit=20, name="search_top_posts", description="Search the highest-engagement public X posts.", ) agent = Agent("analyst", config=config, tools=[latest, top]) ``` ## Read the structured result `xquik_tweet_search` returns a typed response, not a raw payload. | Field | Type | Meaning | | - | - | - | | `query` | `str` | The searched query | | `tweets` | `list[dict]` | Tweet records as the API returned them | | `has_next_page` | `bool` | Whether another page exists | | `next_cursor` | `str` | Cursor for the next page, empty when absent | The toolkit passes tweet records through unmodified. The agent receives every tweet ID, profile ID, and timestamp. Feed `next_cursor` back through the `cursor` parameter to continue pagination. ## Resolve values at runtime with variables Every runtime parameter accepts an AG2 `Variable`. AG2 resolves it from the run context when the tool executes. One tool instance serves many users or tenants. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from ag2.annotations import Variable toolkit = XquikSearchToolkit( api_key=os.environ["XQUIK_API_KEY"], since_time=Variable("window_start"), until_time=Variable("window_end"), limit=Variable("page_size"), ) ``` ## Delegate search in a multi-agent team `Agent.as_tool()` exposes an agent as a tool for another agent. Each delegated task runs on its own stream with its own history. The coordinator receives the delegate's final answer, not its internal tool-call history. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} searcher = Agent( "searcher", prompt="Search X and return tweet text with IDs. Do not summarise.", config=config, tools=[XquikSearchToolkit(api_key=os.environ["XQUIK_API_KEY"], query_type="Latest", limit=50)], ) analyst = Agent( "analyst", prompt="Turn tweet records into a factual brief. Keep every tweet ID.", config=config, ) coordinator = Agent( "coordinator", prompt="Delegate the search, then pass the tweets to the analyst.", config=config, tools=[ searcher.as_tool(description="Search public X posts and return raw tweet records."), analyst.as_tool(description="Analyse tweet records. Pass them in the context parameter."), ], ) reply = await coordinator.ask("Brief me on this week's discussion of X API pricing.") print(reply.body) ``` ## Handle failures The tool raises on non-success HTTP status codes through `httpx`. Read [Error Handling](/guides/error-handling) for status semantics and [Rate Limits](/guides/rate-limits) for retry guidance. Some apps need retries, approval gates, or audit logging around every search. For those, wrap the toolkit with AG2 tool middleware. ## Related guides * [AG2 Xquik Tweet Search reference](https://docs.ag2.ai/docs/user-guide/extensions/tools/search/xquik/) # Xquik platform architecture & X API workflows Source: https://docs.xquik.com/guides/architecture Learn how Xquik searches tweets, exports followers, monitors accounts, signs webhooks, isolates accounts, and enforces API rate limits for each account. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik hosts tweet search, follower exports, profile lookup, monitors, webhooks, and X account actions. You interact through the REST API, MCP server, SDKs, or dashboard. You do not deploy Xquik infrastructure or configure X API credentials. ## Architecture overview ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} ┌───────────────────────────────────────────────┐ │ Clients │ │ REST API · MCP · SDKs · Dashboard · CLI │ └──────────────────────┬────────────────────────┘ │ HTTPS ┌──────────────────────▼────────────────────────┐ │ Public Xquik Interfaces │ │ Authentication · Rate Limits · Usage Gates │ ├───────────────────────────────────────────────┤ │ Read Service · Write Service · Webhooks │ └──────────────────────┬────────────────────────┘ │ ┌──────────────────────▼────────────────────────┐ │ Documented Responses & Events │ └───────────────────────────────────────────────┘ ``` ### Components > [card] REST API > > Documented operations at `https://xquik.com/api/v1/*` for apps, > backends, scripts, and fine-grained pagination. > [card] MCP server > > 4 tools, `docs`, `search`, `execute`, and `whoami`, at `https://xquik.com/mcp`. > They are for ChatGPT, Claude, Cursor, and agent workflows. > [card] Dashboard > > Manage API keys, connected X accounts, monitors, extractions, draws, > webhooks, media, billing, and support. > [card] Monitoring & webhooks > > Track accounts or keywords, store events, and deliver HMAC-signed webhook > payloads with retry history. > [card] Extractions & draws > > Run stored jobs for followers, replies, quotes, retweeters, favoriters, > search, articles, and giveaway draws. > [card] Write actions > > Post tweets and replies, upload media, send DMs, follow, like, retweet, and > update profiles. Poll write status. See [integration workflows](/guides/workflows) for end-to-end code examples using these components. ## Security model ### Authentication Xquik REST uses API key authentication. API MCP accepts OAuth 2.1. It accepts an Xquik API key when the client supports secure request headers. ChatGPT custom apps require OAuth and cannot present custom API keys. > [card] API header > > Send `x-api-key` on every REST API request. MCP clients can authenticate > with the same Xquik API key. > [card] Key format > > Keys start with `xq_` followed by 64 hex characters. The dashboard shows > the full key only once. > [card] One-time display > > Xquik returns the full key only during creation. Store it in a secret manager. > [card] Revocation > > Revoked or inactive keys stop authenticating immediately and return `401`. > [card] Audit trail > > Account audit views show API-key activity. > [card] OAuth 2.1 > > MCP also supports [OAuth 2.1 with S256 PKCE](/oauth/overview) for clients > that require delegated authorization. > [card] Key management > > Create and revoke keys through the authenticated dashboard. > [!WARNING] > > Xquik shows API keys once at creation. Store them in a secret manager. You cannot retrieve a key after creation. ### Data isolation Every API key belongs to a single user account. No key can read another user's data. > [card] Monitors > > Account and keyword monitors belong to the user account that created them. > [card] Events > > Stored events resolve through account or keyword monitor ownership before > returning data. > [card] Webhooks > > Webhook endpoints, signing configuration, and delivery logs belong to one > user. > [card] Extractions > > Extraction jobs, result pages, and exports belong to the user that created > the job. > [card] Draws > > Giveaway draws, entries, and winner lists belong to the user that created > the draw. > [card] API keys > > API-key listing, creation, and revocation filter by the authenticated user > ID. A request for another user's resource returns `404 Not Found`, not `403`. Attackers cannot use the response to enumerate IDs. ### Authorization Xquik uses a flat permission model. It has no roles, no RBAC, and no team workspaces. * **One user, one account.** Each account has full access to all its own resources * **API key scope.** A valid account API key can perform API-key-authorized operations for that account * **API key management.** Listing, creating, and revoking keys require a same-origin dashboard session. API keys and OAuth bearer tokens cannot manage keys * **Credit gates.** Creating extractions, draws, active monitors, media downloads, and X lookups require enough available credits. All webhook operations are free. Reading and managing stored jobs, monitors, and events is free. Active monitors cost 30 credits per hour. ## Rate limits Xquik enforces rate limits per user account with a fixed-window counter algorithm. Each tier has an independent counter. Read counters reset every 1 second. Write and delete counters reset every 60 seconds. > [card] Read bucket > > `GET`, `HEAD`, and `OPTIONS` share a standard user limit. It is 500 requests > per 1 second. > [card] Change bucket > > Other methods on Xquik resources share a standard user limit. It is 6,000 > requests per 60 seconds. > [card] X action bucket > > Actions through a connected X account allow 120 requests per 60 seconds. > [card] Retry window > > Throttled reads return `Retry-After: 1`. Throttled changes and X (Twitter) actions > return up to `Retry-After: 60`. When you reach the limit, requests return `429 Too Many Requests` with a `Retry-After` header. Read throttles return `Retry-After: 1`. Write and delete throttles return `Retry-After: 60`. The [Rate Limits](/guides/rate-limits) guide has detailed explanations and backoff strategies. It also has client-side rate limiter code examples. ## Usage & billing > [card] Subscriptions > > Starter, Pro, and Business plans run from USD 20 to USD 199 per month. > They include monthly credits. > [card] Active monitors > > Monitor slots are unlimited. Active monitors check every 1 second > and cost 30 credits per active monitor-hour. > [card] Credit top-ups > > Top up from USD 10. Credits cost USD 0.00015 each. See > [Billing & Usage](/guides/billing#credit-top-ups). ### What counts as usage > [card] Credit-metered work > > Billed X reads, media downloads, trends, and extraction estimates can > consume credits. Extraction creation, monitor creation, active monitor > hours, and draw execution can also consume credits. > [card] Credit access > > Tweet search, user and follower lookup, and article lookup require enough > available credits. Media download, trends, draw creation, and publish > actions require enough available credits. > [card] Free management paths > > List, read, update, delete, export, test, and delivery-history paths cost no > credits. This holds for draws, extractions, monitors, events, and webhooks. > [card] Free utilities > > Compose, cached styles, drafts, radar, account, and API keys endpoints cost > no credits. X accounts, support, credit balance, and credit top-up endpoints > also cost no credits. See [Billing & Usage](/guides/billing) for credit costs and billing. ## Monitoring architecture Xquik checks active account and keyword monitors every second. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} X signals │ ▼ Monitor processing ──▶ Stored events │ ▼ Signed webhooks ──▶ Customer HTTPS endpoint ``` > [card] Event types > > Account monitors emit 30 event types. They cover posts, profiles, follows, > and followers. Keyword monitors emit tweet types only. > [card] Signed delivery > > Xquik sends an HMAC-SHA256 signed HTTPS `POST` to each active webhook > endpoint. Verify `X-Xquik-Signature`, `X-Xquik-Timestamp`, and > `X-Xquik-Nonce`. > [card] Retry schedule > > Failed deliveries retry for up to 30 days. A failing > endpoint gets 1 retry at a time, at least every 15 minutes. A rejected > delivery can delay new events by up to 15 minutes. Return `2xx` for events > you skip. > [card] Receiver timeout > > Webhook receivers should return `2xx` within 10 seconds. Xquik records slow or > non-`2xx` responses as failed attempts. > [card] Event propagation > > Events usually appear within seconds to minutes. The delay depends on X > stream timing and webhook receiver availability. ## Platform limitations > [card] Bookmarked tweets > > Bookmarks and bookmark folders require a connected X account. Use > [bookmarks](/api-reference/x/bookmarks) and > [bookmark folders](/api-reference/x/bookmark-folders). > [card] Exports > > Extraction exports include every row. A PDF above 10,000 rows comes as a > ZIP of PDF parts. Exports support CSV, JSON, MD, MD Document, PDF, TXT, and > XLSX. > [card] Webhook retries > > Xquik retries each failed delivery for up to 30 days. Then the delivery > shows `exhausted`. Only you can pause or delete a webhook. Events expire 30 days > after Xquik creates them. > [card] Monitor slots > > Monitor slots are unlimited. Active monitors check every 1 second > and cost 30 credits per active monitor-hour. ## Next steps > [card] [Quickstart](/x-api-quickstart) > > Make your first API call. > [card] [Authentication](/api-reference/authentication) > > API key format, header requirements, and dual auth. > [card] [Rate limits](/guides/rate-limits) > > Fixed-window limits, backoff strategies, and code examples. > [card] [Billing & usage](/guides/billing) > > Pricing, credit allowances, and billing. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) # X (Twitter) API pricing, credits & billing guide Source: https://docs.xquik.com/guides/billing X (Twitter) API pricing per call. Compare tweet search and follower export costs, then manage Xquik credits, plans, guest wallets, top-ups, and MPP payments. > For the complete documentation index, see [llms.txt](/llms.txt). Compare X (Twitter) API pricing and X API pricing with Xquik. Read the [X (Twitter) API cost per post](/alternatives/x-api) comparison. This page covers Xquik API pricing for tweet search and follower exports. It covers replies, profiles, timelines, monitors, webhooks, and write actions. Account workflows spend shared credits. Plans grant monthly credits that carry over. Guest wallets prepay the eligible paid-read routes. MPP pays per request on fixed-price operations. ## Subscription > [card] Starter > > USD 20/month. Includes 140,000 monthly credits (USD 0.00014/credit). > Prototyping and low-volume integrations. Monitor slots are unlimited. > [card] Pro > > USD 99/month. Includes 770,000 monthly credits (USD 0.00013/credit). > Production workloads and growing teams. Monitor slots are unlimited. > [card] Business > > USD 199/month. Includes 1,670,000 monthly credits (USD 0.00012/credit). > High-volume automation and enterprise use. Monitor slots are unlimited. Higher tiers give you more credits at a lower per-credit cost. PAYG credits cost USD 0.00015 each. All tiers support unlimited monitor slots. Active monitors cost 30 credits per hour and check every second. The rate includes stored events and webhook delivery. Subscribe from the [dashboard billing page](https://dashboard.xquik.com/en/account?tab=subscription). Plans activate immediately, renew monthly, and grant credits. Metered calls need enough available credits, not an active plan. Guest wallets and MPP provide accountless reads. ### Pick a billing path by job Use these cards to estimate the cost of an X API task. Do it before you run the task. > [card] Search tweets to CSV or JSON > > Use [`GET /x/tweets/search`](/api-reference/x/search-tweets) for a page of tweets or [extractions](/guides/extraction-workflow) for exportable jobs. Each tweet returned or extracted costs 1 credit. > [card] Export followers > > Use [Follower extraction](/guides/extraction-workflow) for CSV, JSON, or XLSX exports. Use [`GET /x/users/{id}/followers`](/api-reference/x/followers) for paginated API reads. Each follower returned costs 1 credit. > [card] Post tweets or replies > > Use [Create tweet](/api-reference/x-write/create-tweet). Send public media URLs in `media` when posting media. A text-only post costs 30 credits. Attached media adds 2 credits per started MB. > [card] Upload media for DMs > > Use [Upload media](/api-reference/x-write/upload-media) when a DM needs an uploaded `media_id`. Each media upload call costs 10 credits. > [card] Monitor tweets to webhooks > > Use [account and keyword monitors](/api-reference/monitors/create) for tweet alerts and signed webhooks. Each active monitor costs 30 credits per monitor-hour, or 720 credits per day. > [card] Recover from 402 > > Inspect `payment_options`. Ask the user to choose and confirm. Account, guest, and anonymous callers receive different payment choices. A key that reads only gets the account page instead. ### Monitor pricing Account monitors and keyword monitors use the same active billing rate. > [card] Account monitor slots > > Account monitor slots are unlimited. Active account monitors bill only while enabled. > [card] Keyword monitor slots > > Keyword monitor slots are unlimited. Active keyword monitors use the same hourly rate. > [card] Active monitor hour > > Each active monitor costs 30 credits per monitor-hour. > [card] Check interval > > Active monitors check every 1 second. > [card] Webhook and event delivery > > Active monitor billing includes webhook and event deliveries. Creating or reactivating an account monitor requires at least 30 available credits. They pay for the first active monitor-hour, and the username lookup is free. Creating or reactivating a keyword monitor also requires at least 30 available credits. It then bills 30 credits per active monitor-hour. New active monitors are due for billing immediately. The create response includes `nextBillingAt`. After a successful hourly charge, the next billing time advances by 1 hour. Hourly billing may not find enough credits. The monitor may then pause until credits are available. Use [`GET /account`](/api-reference/account/get) to inspect current monitor billing. `monitorsUsed` includes active account monitors and active keyword monitors. So do `monitorBilling.activeHourlyBurn` and `monitorBilling.activeDailyEstimate`. ### Plan monitor credits before you monitor tweets Use `GET /account` before creating more tweet monitors or tweet alerts. Each active account monitor or keyword monitor adds `30` credits to `monitorBilling.activeHourlyBurn`. It also adds `720` credits to `monitorBilling.activeDailyEstimate`. > [card] 1 active monitor > > The hourly cost is 30 credits. The daily estimate is 720 credits. Keep at least 30 credits before creating or reactivating one more monitor. > [card] 5 active monitors > > The hourly cost is 150 credits. The daily estimate is 3,600 credits. Keep at least 30 credits before creating or reactivating one more monitor. > [card] 10 active monitors > > The hourly cost is 300 credits. The daily estimate is 7,200 credits. Keep at least 30 credits before creating or reactivating one more monitor. The account API returns the daily estimate for capacity planning. It is 24 hours of the hourly burn. If `creditInfo.balance` is below the next hourly burn, top up before enabling more monitors. ## Monthly credits & carry-over Every paid subscription invoice adds the monthly credit grant to your account balance. Subscription, top-up, and automatic top-up credits stay in that balance until you spend them. * All metered operations deduct from a single shared pool * No separate buckets per operation type * Unused subscription credits carry over to the next billing period * [Rate limits](/guides/rate-limits) also apply to API calls, separately from credit usage * When the shared balance reaches 0, metered calls return `402 Payment Required`. See [error handling](/guides/error-handling#billing--credit-errors-402) for recovery patterns * Reading and managing stored monitor records, stored events, webhooks, and account endpoints are free. Active monitors bill hourly. ```json 402 response body theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "insufficient_credits", "message": "Insufficient credits. Top up or subscribe to continue." } ``` > **Warning.** Xquik rejects metered calls when available credits cannot cover the operation. [Top up credits](/api-reference/credits/topup) or subscribe to continue. A caller on a plan that renews gets top-up only, plus `credits_renew_at`. ```json 402 response body on a plan that renews theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "insufficient_credits", "message": "Your credits renew on Oct 10, 2026. Top up to keep reading.", "credits_renew_at": "2026-10-10T08:30:00.000Z" } ``` A caller whose plan payment failed gets top-up only. The message reads "Your plan's payment failed. Update your payment or top up to keep reading." When the balance hits 0 while reads continue, Xquik emails the account. It sends at most 1 such email per 7 days, in the account's language. ## Per-operation costs Each metered operation deducts credits from your shared pool. Per-credit cost depends on your plan. It ranges from USD 0.00012 (Business) to USD 0.00015 (PAYG). * **1 credit per call.** * [Bookmark folders](/api-reference/x/bookmark-folders) * [Check repost](/api-reference/x/tweet-repost-check) * [Embed tweet](/api-reference/x/tweet-embed) * [Follow check](/api-reference/x/check-follower) * [Get broadcast](/api-reference/x/get-broadcast) * [Get job](/api-reference/x/get-job) * [Get notes contributor](/api-reference/x/community-notes-contributor) * [Get Space](/api-reference/x/get-space) * [Get Space replay](/api-reference/x/space-replay) * [Get tweet](/api-reference/x/get-tweet) * [Get user](/api-reference/x/twitter-profile-lookup) * [Translate tweet](/api-reference/x/tweet-translation) * [Translate user bio](/api-reference/x/user-bio-translation) * [Trends](/api-reference/x/trends) * [Tweet engagement insights](/api-reference/x/tweet-engagement-insights) * [User engagement insights](/api-reference/x/user-engagement-insights) * [User live status](/api-reference/x/user-live-status) * **1 credit per call that returns a caption track.** [Tweet subtitles](/api-reference/x/tweet-subtitles). A tweet without captions costs nothing. * **1 credit per result.** * [Affiliates](/api-reference/x/user-affiliates) * [Bookmarks](/api-reference/x/bookmarks) * [Community media](/api-reference/x/community-media) * [Community member search](/api-reference/x/community-member-search) * [Contributor deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) * [Contributor notes](/api-reference/x/community-notes-contributor-notes) * [Creator subscriptions](/api-reference/x/user-subscriptions) * [DM history](/api-reference/x/dm-history) * [Favoriters](/api-reference/x/favoriters) * [Follower IDs](/api-reference/x/follower-ids) * [Followers you know](/api-reference/x/followers-you-know) * [Following IDs](/api-reference/x/following-ids) * [Hidden replies](/api-reference/x/tweet-hidden-replies) * [List memberships](/api-reference/x/user-list-memberships) * [Notifications](/api-reference/x/notifications) * [Resolve links](/api-reference/x/resolve-links) * [Retweeter IDs](/api-reference/x/retweeter-ids) * [Search autocomplete](/api-reference/x/search-autocomplete) * [Search jobs](/api-reference/x/search-jobs) * [Search lists](/api-reference/x/search-lists) * [Search Spaces](/api-reference/x/search-spaces) * [Similar accounts](/api-reference/x/user-similar) * [Timeline](/api-reference/x/timeline) * [User articles](/api-reference/x/user-articles) * [User highlights](/api-reference/x/user-highlights) * [User lists](/api-reference/x/user-lists) * [User likes](/api-reference/x/user-likes) * [User media](/api-reference/x/user-media) * [Verified followers](/api-reference/x/verified-followers) * **1 credit per tweet returned.** [Batch user tweets](/api-reference/x/batch-user-tweets), [Search tweets](/api-reference/x/search-tweets), [Top tweets](/api-reference/x/top-tweets), [User replies timeline](/api-reference/x/user-replies), [User timeline](/api-reference/x/user-tweets). * **1 credit per location returned.** [Job locations](/api-reference/x/job-locations), [Trend locations](/api-reference/x/trend-locations). * **1 credit per trends list returned.** [Trends history](/api-reference/x/trends-history). 24 lists cost 24 credits, and a step with no stored list costs nothing. * **1 credit per place returned.** [Search places](/api-reference/x/search-places). * **1 credit per hashflag returned.** [Hashflags](/api-reference/x/hashflags). * **1 credit per topic returned, subtopics included.** [Community topics](/api-reference/x/community-topics). * **1 credit per Community returned.** [Find communities](/api-reference/x/community-find), [Popular communities](/api-reference/x/community-popular), [Suggested communities](/api-reference/x/community-suggested). * **1 credit per fresh tweet processed with media.** [Download media](/api-reference/x/download-media). * **2 credits per analyzed post.** [Brand mentions](/api-reference/x/brand-monitoring), [Classify posts](/api-reference/x/classify-tweets), [Market signals](/api-reference/x/market-signals), [News classification](/api-reference/x/news-classification), [Sentiment analysis](/api-reference/x/sentiment-analysis), [Viral score](/api-reference/x/viral-score). A post without an analysis costs nothing. * **5 credits per call.** [Get article](/api-reference/x/get-article). * **10 credits per call.** * [Bookmark](/api-reference/x-write/bookmark) and [remove bookmark](/api-reference/x-write/unbookmark) * Community join or leave * [Delete tweet](/api-reference/x-write/delete-tweet) * [Block](/api-reference/x-write/block) and [unblock](/api-reference/x-write/unblock) * [Follow](/api-reference/x-write/follow) * [Like](/api-reference/x-write/like) * [Mute](/api-reference/x-write/mute) and [unmute](/api-reference/x-write/unmute) * [Remove follower](/api-reference/x-write/remove-follower) * [Retweet](/api-reference/x-write/retweet) * [Send DM](/api-reference/x-write/send-dm) * [Unfollow](/api-reference/x-write/unfollow) * [Unlike](/api-reference/x-write/unlike) * [Unretweet](/api-reference/x-write/unretweet) * [Upload media](/api-reference/x-write/upload-media) * **10 credits, only when X deleted it.** [Delete DM](/api-reference/x-write/delete-dm). * **30 credits per text-only call.** [Create tweet](/api-reference/x-write/create-tweet). Attached media adds 2 credits per started MB across all files. * **30 credits per monitor-hour.** Each active monitor. * **10 credits per X sign-in a write needs.** See [X sign-in fee](#x-sign-in-fee). ### X sign-in fee A write signs in to your X account only when no working session exists. It signs in again when X refuses the session of a sent write. That sign-in costs 10 credits, or USD 0.0015 at the PAYG rate. * Xquik first checks that your credits cover the sign-in and the write. If they don't, you get `402` with no sign-in and no charge. * Xquik charges the 10 credits before the sign-in starts. * A sign-in that fails gets its 10 credits back. * A sign-in that works keeps its fee, even if the write then fails. * A write needs 2 sign-ins at most. * `billing.chargedCredits` on the write leaves the fee out, since it's a separate charge. * Connecting or reconnecting an X account never charges it, and reads never do. ### Extractions & draws Extractions consume 1 or 5 credits per result depending on the extraction type. > [card] Tweet-style results > > 1 credit per result. Includes tweets, replies, quotes, mentions, posts, likes, media, and search exports. > [card] People results > > 1 credit per result. That covers followers, following, favoriters, retweeters, and community members. It also covers people search, list members, list followers, and verified followers. > [card] Article results > > 5 credits per result. Applies to article extractions. Draws charge for the source tweet lookup and the reply search. They charge for retweeter profile checks when `mustRetweet` is true. With `mustFollowUsername`, they charge 1 credit per follow check. That check runs on each author who passes the other filters. The draw first checks that the minimum cost is affordable. Remaining credits cap how many replies and retweeters the draw can inspect. Filters and winner selection run after that. The API may fail to deduct the final computed cost. It then returns `402 insufficient_credits` and stores no draw result. ### Credit-affordable result pages Some paid X (Twitter) read endpoints charge per returned result. They treat `limit`, `pageSize`, `count`, and multi-ID request sizes as upper bounds. The remaining balance may not cover the full requested page. The endpoint can then return fewer results than requested. If zero paid results are affordable, it returns `402 insufficient_credits`. ### Free operations Xquik charges no credits for stored monitor management, stored event reads, or webhook operations. It charges none for extraction and draw reads or exports. It charges none for cost estimates, composition, cached styles, drafts, support, or API keys. It charges none for X account management, credit top-ups, account status, or [Radar](/api-reference/radar/list). Active monitors cost 30 credits per hour. ## Credit top-ups Ask the user to confirm before you create account checkout. Do the same before you charge a saved payment method. * Use the [top-up endpoint](/api-reference/credits/topup) to create a checkout redirect after confirmation * Use the [top-up status endpoint](/api-reference/credits/topup-status) to poll checkout completion * The dashboard uses [quick top-up](/api-reference/credits/quick-topup) for saved methods * Configure automatic top-up from the dashboard. `GET /credits` and `GET /account` return its enabled status and dollar amount. They also return its trigger threshold. * Automatic top-up stops after 3 declined charges in a row. The dashboard then asks you to update the card. A new card, a paid top-up, or a paid plan renewal restarts it. `GET /credits` reports the stop as `auto_topup_stopped`. `GET /account` reports it as `creditInfo.autoTopupStopped`. * Top-up credits cost USD 0.00015 each and reach your balance immediately * Top-up credits do not expire and carry over between billing periods > **Example.** Starter tier (USD 20, 140K credits). A USD 10 top-up adds 66,666 credits at USD 0.00015 per credit. Xquik rounds down to whole credits. ### Recover from 402 An account `402` creates no checkout. Keep the failed request and get the user's confirmation before billing. A full key's `402` lists `payment_options`. A key that reads only gets no checkout actions. Its `next_step` sends the user to `/dashboard/account` instead. 1. Check the current balance. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s https://xquik.com/api/v1/credits \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "balance": "450", "lifetime_purchased": "1000", "lifetime_used": "550", "auto_topup_enabled": false, "auto_topup_stopped": false, "auto_topup_amount_dollars": 10, "auto_topup_threshold": "50000" } ``` 2. After confirmation, create a checkout top-up when no saved payment method is available. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s -X POST https://xquik.com/api/v1/credits/topup \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"dollars": 10}' | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "url": "https://xquik.com/api/v1/credits/topup/redirect?session_id=checkout_session_id", "redirect_url": "https://xquik.com/api/v1/credits/topup/redirect?session_id=checkout_session_id" } ``` The dashboard can charge a saved method after confirmation. Only `charged` grants credits. It opens checkout for `declined` or `no_payment_method`. ## Accountless guest wallets Guest wallets prepay the eligible paid-read routes without an account. The user first confirms USD 10 to 250. `POST /api/v1/guest-wallets` then creates a one-use hosted checkout and returns a `paid_reads` key. Creation does not charge. The key stays inactive until Xquik verifies payment. A guest `402` offers only `POST /api/v1/guest-wallets/topups`. See the [guest wallet guide](/guides/guest-wallets). ## Pay-per-use (MPP) Fixed-price read operations accept direct [MPP](/mpp/machine-payments-protocol) payments. You need no subscription. Media downloads require full account authentication because they create account-tied gallery links. ### MPP per-call pricing Use [MPP overview](/mpp/machine-payments-protocol#eligible-endpoints) for the complete list. Direct MPP uses fixed `charge` pricing. > [card] USD 0.00015 units > > `GET /x/tweets/{id}`, `GET /x/tweets/{id}/translation`, `GET /x/tweets/{id}/embed`, and `GET /x/users/{id}` cost USD 0.00015 per call. `GET /x/followers/check`, `GET /x/spaces/{id}`, `GET /x/spaces/{id}/replay`, `GET /x/broadcasts/{id}`, and `GET /x/communities/{id}/info` cost USD 0.00015 per call. > [card] USD 0.00075 calls > > `GET /x/articles/{tweetId}` costs USD 0.00075 per call. > [card] USD 0.00015 trends > > `GET /trends` and `GET /x/trends` use flat charge intent pricing. > [card] Fixed charge intent > > Every direct MPP operation advertises one fixed `charge` offer per request. ## Checking usage Call `GET /api/v1/account` to see your credit balance, lifetime usage, and monitor billing. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s https://xquik.com/api/v1/account \ -H "x-api-key: xq_your_api_key_here" | jq ``` **Response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "plan": "active", "monitorsAllowed": 9007199254740991, "monitorsUsed": 1, "monitorBilling": { "activeDailyEstimate": "720", "activeHourlyBurn": "30", "creditsPerActiveMonitorDay": "720", "creditsPerActiveMonitorHour": "30", "eventsIncluded": true, "instantCheckIntervalSeconds": 1, "unlimitedSlots": true }, "creditInfo": { "balance": "77000", "lifetimePurchased": "140000", "lifetimeUsed": "63000", "autoTopupEnabled": false, "autoTopupAmountDollars": 10, "autoTopupThreshold": "50000" } } ``` The `creditInfo.balance` field shows how many credits remain. The automatic top-up fields show whether top-up is enabled. They also show the charge amount and the balance threshold. At 0, Xquik rejects metered calls until you [top up credits](/api-reference/credits/topup). > **Tip.** Poll the account endpoint on a schedule to track usage. Alert when `creditInfo.balance` drops below 20% of your plan's monthly credit grant. Then you can top up before credits run out. ### See what a read charged Every answer to a read carries `X-Xquik-Credits-Charged`, the credits that request charged. * A filtered list charges only the rows it returns. * It is `0` for a page a filter empties. It is `0` for a page sent again too. * A write names its charge in `billing.chargedCredits`. ### Cap spending per API key Give each API key a monthly credit budget with `monthlyBudgetCredits`. Set it when you [create a key](/api-reference/api-keys/create) or [update one](/api-reference/api-keys/update). The budget covers REST, MCP and Apify Actor calls that use the key. * `monthlySpentCredits` on each key shows its spend this UTC calendar month. * At 80%, Xquik sends the account owner 1 warning email per key each month. * Calls running at once can't take the key past its budget. * A call that doesn't fit what's left gets `403 api_key_budget_reached` and costs nothing. * A refused call never runs. * A read with a `limit` needs that many results' price left. * A media download needs the price of every post it names. * A read without a `limit` returns only what fits. An extraction, a draw and a style refresh do the same. * A write needs its price plus 20 credits left, enough for 2 [X sign-ins](#x-sign-in-fee). It charges only what it uses. * A started call bills what it delivered, even past a lowered budget. * Raise or remove the budget to unblock the key. Or wait for the next UTC month. A budget never changes what a call costs. It only stops calls that don't fit. ## Cancel renewal & request a refund Open [subscription settings](https://dashboard.xquik.com/en/account?tab=subscription), select **Manage Plan**, and cancel in the hosted billing portal. Cancellation stops future renewals. Access continues through the paid period. Unused credits remain usable after the plan ends. Cancellation does not issue a refund. Charges are non-refundable unless law or Xquik states otherwise. Review the [Terms](https://xquik.com/en/terms) or contact [support](mailto:support@xquik.com). ## FAQ ### What happens when I run out of credits? Account and guest credit failures return `402` with credential-specific payment choices. Anonymous non-MPP paid reads return `401` with a Bearer challenge and guest wallet action. The direct MPP reads return `402` with a Payment challenge and the same action. No error creates checkout or charges a payment method. ### Do unused credits carry over? Yes. Subscription credits and top-up credits stay in the shared balance until you spend them. ### How do I check my credit balance? Call `GET /api/v1/account`. The `creditInfo.balance` field shows remaining credits. ## Next steps * [Get Account](/api-reference/account/get) is the full account endpoint reference with response schema. * [API Overview](/api-reference/overview) covers the base URL, authentication, rate limits, and conventions. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) # Twitter brand monitoring with keywords & webhooks Source: https://docs.xquik.com/guides/brand-monitoring-workflow Monitor Twitter accounts, keywords, mentions, hashtags, products, and campaigns every second. Deliver signed webhook alerts with replayable stored events. > For the complete documentation index, see [llms.txt](/llms.txt). ## Quick answer An Xquik keyword monitor checks 1 X (Twitter) search query every second. An account monitor checks 1 profile every second. Each match goes to a webhook, a Discord channel or a Telegram chat. Webhooks carry an HMAC-SHA256 signature. A running monitor costs 30 credits an hour, which is USD 0.0045. 30 days of 1 monitor cost USD 3.24. Event storage and webhook delivery are included. Keyword monitors are unlimited. Use Xquik monitors for support, marketing, research, or agent pipelines. Xquik offers 2 Twitter monitoring tools, account monitors and keyword monitors. Use an account monitor for one profile. Use a keyword monitor for one search query. Monitor Twitter mentions and deliver matching events to a signed Twitter webhook. Replay stored events. Use one keyword monitor to monitor Twitter keywords and campaign phrases. Use one account monitor to monitor Twitter account activity from a known profile. Route mentions of your brand into support and community management queues. Measure engagement metrics from unique tweets and authors. Review each match before marketing teams create content or replies. ## Build a real time monitoring workflow for Twitter Xquik monitors X only. Add another social media platform connector for other networks. When tracking brand mentions, keep each X event separate. Test each tool with the same queries during a free trial. Compare Tweet IDs, author IDs, timestamps, webhook delivery, and replay results. Use real time Twitter monitoring for campaign and support queries. Keep each keyword and hashtag in a separate monitor. Test every Boolean search before activation. Store historical data from tweet-search backfills separately. Keep live monitor events in their own stream. Analyze data from matched tweets by Tweet ID, author ID, timestamp, and query. Classify each preserved tweet after its monitor event arrives. Create a temporary product launch monitor for its name and branded hashtag. Connect verified events to an AI-powered tweet triage service when needed. Keep automated classification downstream from Xquik's original tweet payload. ## Pick the monitor path > [card] Account monitor > > Use `POST /api/v1/monitors` for one account. Track its posts, replies, > reposts, quotes, or profile field changes. > [card] Keyword monitor > > Use `POST /api/v1/monitors/keywords` for a saved search. Track a brand, > handle, hashtag, product, campaign, or Boolean query. > [card] Signed webhook > > Use `POST /api/v1/webhooks` to deliver monitor events with > `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce`. > [card] Stored event replay > > Use `GET /api/v1/events` to replay account or keyword monitor events. Recover > from receiver downtime, queue errors, or warehouse load failures. ## Answer common Twitter monitoring questions ### What is the best API to track Twitter keyword mentions? Choose an API that stores the exact query and stable event IDs. Test one query for a brand, handle, hashtag, product, or campaign. The Twitter keyword monitor checks for matching tweets every 1 second. Review each Tweet ID, author ID, text, timestamp, media, and matched keyword. Sign every webhook event before sending it to the receiver. Queue each event before acknowledging delivery. Replay stored events after receiver downtime. Compare missed tweet counts for the same query in each tool. Use duplicate alert counts during the final tool comparison. ### How do I monitor a keyword on Twitter in real time? Create a keyword monitor with `POST /api/v1/monitors/keywords`. Use one Boolean query for each product, campaign, hashtag, or support topic. Store its monitor ID and exact query. Test the keyword against recent tweets first. Inspect reply, author, language, and media fields. Subscribe a webhook to required event types. Verify its signature, timestamp, and nonce. Save each event before returning `2xx`. Replay stored events after receiver downtime. Pause inactive monitors after the assigned campaign concludes. ### Track keywords X (Twitter) API Use `POST /api/v1/monitors/keywords` for continuous keyword checks. Separate competitor names and handles from product, support, and campaign queries. Save the monitor ID, query, owner, event types, and enabled state. Test matching tweets before enabling the monitor. Store each Tweet ID and author ID. Deduplicate webhook deliveries by event ID. Put rate-limit or receiver failures into the normal retry path. Never create a changed monitor during those retries. Pause the keyword monitor after its campaign ends. ### Twitter mention tracking tool Xquik provides a Twitter mention tracking tool for webhook review queues. Marketing teams can route matching tweets to their own review queues. Teams then answer brand mentions sooner. Use precise queries to track Twitter mentions in relevant conversations for review. Review each tweet, reply, author, and media attachment. Store the matched keyword, monitor ID, event ID, and delivery ID. Connect Xquik events to broader social listening tools for other networks. Review sentiment and author intent downstream. Compare reply routing too. ### Twitter keyword monitor A Twitter keyword monitor watches one stored search expression. Use one exact brand name, @handle, hashtag, campaign phrase, or product name per monitor. Run a tweet search before approving the keyword. Review tweets, replies, reposts, author profiles, languages, and media. Save the approved query beside its monitor ID. Subscribe the verified webhook only to events its receiver can process. Write received events to a queue that survives restarts. Deduplicate every delivery by event ID. Pause the monitor after its campaign or investigation closes. Store matched Tweet IDs. ### What is the best way to monitor a Twitter account programmatically? Create an account monitor with `POST /api/v1/monitors`. Supply one username and required event types. Store its stable X (Twitter) user ID and monitor ID. The Twitter account monitor API follows new tweets, replies, reposts, and quotes. It also tracks documented profile changes. Deliver each account event to a signed Twitter webhook receiver. Queue the payload before returning `2xx`. Deduplicate deliveries by event ID. Replay stored events after receiver downtime. Reuse the same monitor during uncertain retries. Pause inactive profiles. ### Monitor Twitter mentions Track an @handle, brand spelling, misspelling, product, or campaign hashtag. A handle query finds explicit mentions. Brand keywords find untagged references. Campaign queries isolate time-bounded work. Test every query with tweet search. Review tweets, replies, authors, profiles, and media before continuous checks. Route each matching event to the responsible queue. Store Tweet ID, author ID, timestamp, query, monitor ID, and event ID. Review false matches before broadening a keyword. Replay stored events after webhook downtime. ### Twitter webhook alerts Create one signed webhook for the monitor events your application handles. Verify `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce`. Reject any request with a stale timestamp or reused nonce. Queue the payload, then return `2xx`. Use `streamEventId` for event identity. Use `deliveryId` for each receiver retry or initial delivery. Store monitor ID, keyword, event type, Tweet ID, and author ID. Record the queue result without logging secrets. Replay stored events after webhook or queue failures. Deduplicate every retried delivery before alerting reviewers during outages. ### Twitter account monitor API Use the account monitor API for one known profile. Select the needed tweet, reply, repost, quote, or profile change events. Store the stable X (Twitter) user ID beside the username. Also store monitor ID, owner, event types, webhook destination, and active state. Deduplicate each delivery by event ID. Keep Tweet IDs for post events. Pause accounts after they leave the monitored set. Use keyword monitors for terms spanning many profiles. Each account-monitor workflow should track one relevant profile. Review each profile change before updating downstream records. ### How do I get real-time Twitter alerts via webhook? Create a receiver with `POST /api/v1/webhooks`. Subscribe it to matching monitor events. Verify every signature before parsing the event. Queue valid payloads before returning `2xx`. Use `streamEventId` for event identity. Use `deliveryId` for each receiver attempt. These Twitter webhook alerts remain stored for event recovery. They provide instant alerts without making receiver uptime the only recovery path. Record the monitor, event, Tweet, and author IDs. Also record the receive timestamp and the queue write result. ### How do businesses use Twitter monitoring for customer service? Create one keyword monitor for the brand handle and support phrases. Add one account monitor for replies to the owned profile. Route matching tweets and replies to the assigned support queue. Keep the Tweet, author, conversation, query, and event IDs for each alert. Verify the webhook before queueing each alert. Load the conversation thread when a support agent reviews the alert. Record assignment, response decision, and resolution time. Replay stored events after downtime. Never publish an automatic reply without account approval. ### How do I monitor competitor activity on Twitter? Create separate keyword monitors for each competitor name and handle. Add focused monitors for each product and active campaign phrase during research. Use account monitors when every post from one profile matters. Test each keyword with tweet search before continuous monitoring. Review replies, reposts, authors, media, and recurring false matches. Route each event to the assigned research queue. Store the query, monitor ID, Tweet ID, and event ID for each research alert. Compare unique tweets across equal collection windows. Show paused or incomplete collection windows beside the result totals. Record every query revision. ### How do I integrate Twitter monitoring into a dashboard? Send verified webhook events to a queue that survives restarts. Transform each event into one dashboard record with a stable event identity. Use `streamEventId` for that identity. Show tweet text, author, query, monitor, event type, and received time. Keep historical search backfills separate from live monitor events. Calculate totals from unique Tweet IDs and author IDs. Report delivery failures separately from conversation volume. Replay missing events before closing a reporting window. Display replies, reposts, profiles, and media beside each tweet. ### What are best practices for Twitter monitoring in crisis management? Prepare focused keyword monitors before an incident. Include exact handles, products, campaign terms, and known misspellings. Assign one incident owner and one verified webhook receiver. Give matching crisis tweets and replies priority during review. Keep Tweet ID, author ID, query, timestamp, and event ID. Review the full conversation before any public response. Never infer urgency from one keyword alone. Replay stored events after outages. Pause temporary monitors after the incident review ends. Record each monitor change. ## Plan a brand monitoring scope ### Assign one monitoring goal Teams comparing social media monitoring tools can use Xquik for X-specific monitoring. Assign one owner per monitor. ### Choose one monitor type Use an account monitor for one known profile. Use a keyword monitor for text that can appear across many profiles. Keep the stable X (Twitter) user ID or exact query with its monitor ID. ### Assign one receiver Assign one receiver. Subscribe only to event types it handles. ## Create an account monitor Use account monitors for profile events. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/monitors \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "username": "username", "eventTypes": ["tweet.new", "tweet.reply", "profile.bio.changed"] }' | jq ``` Store the returned `id`, `username`, `xUserId`, `eventTypes`, `isActive`, `createdAt`, and `nextBillingAt`. Keep them with the brand workspace. Review the [Create Account Monitor API contract](https://docs.xquik.com/api-reference/monitors/create). ## Create a keyword monitor Use a keyword monitor when a search query triggers the workflow. Keep the query under 512 characters. Store its ID with the exact query. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/monitors/keywords \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "query": "\"Xquik\" OR @username", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq ``` ## Write focused Twitter monitoring queries Use tweet search to test each query before monitoring starts. A Boolean search should describe one brand, product, campaign, hashtag, or handle. Review tweets, replies, authors, media, and query noise before activation. ## Deliver events to a webhook Create one webhook per receiver. Store the returned `secret` once. Verify every request before queueing the event. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/xquik/brand-monitor", "eventTypes": ["tweet.new", "tweet.reply", "profile.bio.changed"] }' | jq ``` Webhook payloads include `deliveryId`, `streamEventId`, `eventType`, `occurredAt`, and `data`. Return `2xx` after you verify the request and queue the event. ## Route real time alerts to the right team Verify signatures, timestamps, and nonces before queueing alerts. Use `streamEventId` as the event identity across webhook endpoints. Use `deliveryId` to skip retried deliveries. Process slow work after queueing. ## Replay stored events Replay stored events after receiver or queue failures. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/events?monitorId=42&eventType=tweet.new&limit=50" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/events?keywordMonitorId=21&eventType=tweet.new&limit=50" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Store `hasMore` and `nextCursor`. Continue pagination while `hasMore` remains true. To continue, send `nextCursor` as `cursor` for the next request. ## Add search backfill Use search or mention reads for earlier tweets and replies. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/search?q=%22Xquik%22%20OR%20%40username&limit=50" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/username/mentions?limit=50" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ## Measure brand monitoring coverage Count engagement metrics from unique tweet IDs and author IDs. Separate account events from keyword events. Deduplicate by `streamEventId`. ### Calculate share of voice Xquik does not return a calculated share of voice. Build Twitter analytics downstream from unique tweet IDs and event windows. Let the social media management team approve posts in its publishing workflow. For share of voice, compare one brand's unique-tweet count with every brand's count. ### Analyze tweet sentiment downstream Classify sentiment only after storing the original tweet. Keep that tweet text beside its classifier version. ### Report delivery health Compare stored event IDs with webhook records. Label partial reporting windows. ## Receiver row ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "brand_monitor_id": "brand-xquik-q2", "monitor_type": "keyword", "account_monitor_id": null, "keyword_monitor_id": "21", "webhook_id": "15", "delivery_id": "502", "stream_event_id": "9002", "event_type": "tweet.new", "tweet_id": "1893704267862470862", "x_user_id": "987654321", "username": "customer_handle", "query": "\"Xquik\" OR @username", "signature_verified": true, "received_at": "2026-05-24T20:12:00.000Z", "event_replay_route": "GET /api/v1/events?keywordMonitorId=21" } ``` Keep endpoint signing values, raw request bodies, raw signatures, or full headers private. ## Build a brand mention triage queue Show tweet text, author, time, event type, query, and monitor. Store review state against `streamEventId`. Avoid automatic public replies from a brand monitoring event. Review the conversation and account first. Approve X write actions separately. ## Maintain account and keyword monitors Review each monitor's owner, query, event types, receiver, and `nextBillingAt`. Compare each monitor's event types with webhook subscriptions. Test one signed delivery after changes. Pause unused monitors. ## Cost and retry notes > [!TIP] > > Active account and keyword monitors check every 1 second. They cost 30 credits > per active monitor-hour. The rate includes event storage and webhook delivery. > [!TIP] > > Stored event listing is free. Xquik meters search, mention, and other direct > read backfills by returned rows. Pause inactive monitors with `PATCH /api/v1/monitors/{id}` or `PATCH /api/v1/monitors/keywords/{id}` and `{ "isActive": false }`. ## Next steps > [card] [Create account monitor](/api-reference/monitors/create) > > Track one account's posts, replies, reposts, quotes, and profile field > changes. > [card] [Create keyword monitor](/api-reference/monitors/create-keyword) > > Track a search query for brand, campaign, support, or category terms. > [card] [Create webhook](/api-reference/webhooks/create) > > Send signed monitor events to a receiver URL. > [card] [List events](/api-reference/events/list) > > Replay stored monitor events by account monitor, keyword monitor, event type, > and cursor. > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) # Twitter campaign verification API workflow Source: https://docs.xquik.com/guides/campaign-verification-workflow Verify giveaway follows, retweets, replies, quotes, winners, and participant exports through one reviewable Twitter campaign workflow with audit rows. > For the complete documentation index, see [llms.txt](/llms.txt). Use this workflow when a campaign needs one reviewable row per participant. Choose the narrowest check first. Use a draw when winners need selection. Campaign verification separates entry collection, rule checks, winner selection, and publication. Store one campaign ID across every stage. Keep source Tweet IDs, participant user IDs, filters, cursors, timestamps, and verification states. Without these checkpoints, the review cannot trace each decision. ## Pick the proof path > [card] Follow task > > Use `GET /api/v1/x/followers/check?source={participant}&target={brand}` to > check one participant and one target account. > [card] Retweet task > > Use `GET /api/v1/x/tweets/{id}/retweeters` to page retweeters. > [card] Reply or quote task > > Use `GET /api/v1/x/tweets/{id}/replies` for replies. > Use `GET /api/v1/x/tweets/{id}/quotes` for quote posts. > [card] Giveaway selection > > Use `POST /api/v1/draws` for winner selection and published filters. Translate every published participation rule into one documented check. Use follower relationships for follow rules. Use retweeter pages for repost rules. Use reply rows for keywords, hashtags, and mentions. Use quote rows when quotes define campaign participation. Store the endpoint and checked time beside each result. Never infer one campaign activity from another activity. Complete every required check before winner selection begins. A participant can pass one rule and fail another. Keep accepted and rejected states separately. An operator can then explain every inclusion and rejection later. ## Choose the focused picker guide Use the [Twitter giveaway picker guide](/guides/twitter-giveaway-picker) for random winner selection and backups. Use it for exports and public result URLs too. Use the [comment and retweet picker guide](/guides/twitter-comment-retweet-picker) for reply authors, retweeters, and hashtags. Use it for cursors and stable user IDs too. ## Follow check Check one relationship at a time. Store both handles, the result, and time. A follow check proves one source-to-target relationship at one checked time. Store the source handle, target handle, stable user IDs, and response state. Repeat the same request only when the first read is uncertain. Do not treat follower counts as proof for one participant. Use separate rows when campaigns require several target accounts. One successful relationship then cannot satisfy every follow rule. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/followers/check?source=participant_handle&target=username" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ## Tweet-level checks Use tweet endpoints when one source tweet defines campaign participation. Keep each cursor with its participant page. Retrieve every available reply, retweeter, or quote page before evaluation. Save each page before requesting the next cursor. Normalize participants to stable X user IDs. Then join required activities by that stable key. Remove duplicate authors only when published uniqueness rules require it. Keep rejection reasons for missing replies, retweets, quotes, or required text. Do not replace missing proof with displayed engagement counts. > [card] Retweeters > > `GET /api/v1/x/tweets/{id}/retweeters` > [card] Replies > > `GET /api/v1/x/tweets/{id}/replies` > [card] Quotes > > `GET /api/v1/x/tweets/{id}/quotes` Page until `has_next_page` is `false`. Pass `next_cursor` back as `cursor`. Store the campaign ID with every page. ## Giveaway draw Use the Draws API when campaign rules require winner selection. Define every filter before entries close. Never add hidden rules afterward. Record the number of winners and backup winners before running a giveaway. Random selection starts only after every published check completes. Do not randomly pick from an unchecked participant list. Do not pick multiple winners by repeating uncertain create requests. Save the original draw request and returned draw ID right away. Poll that stored draw until completion or failure. Export inspected entries and selected winners as separate records. Reconcile exported row counts with the stored request before publishing results. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/draws \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "tweetUrl": "https://x.com/example_user/status/1893704267862470862", "winnerCount": 3, "backupCount": 2, "uniqueAuthorsOnly": true, "mustRetweet": true, "mustFollowUsername": "username", "requiredKeywords": ["entered"] }' | jq ``` Export inspected participants with `type=entries`. Export selected winners with `type=winners`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345/export?format=csv&type=entries" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -o campaign-entries.csv ``` ## Store one audit row Use stable user IDs as keys. Display names and handles can change. One audit row should answer who, what, when, and how. Store the participant ID, source Tweet ID, proof endpoint, cursor, and state. Add the campaign ID and checked timestamp. Keep the published rule that required the check. Keep rejection reasons without exposing private operator notes. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "campaign_id": "spring-launch-2026", "x_user_id": "9876543210", "username": "participant_handle", "tweet_id": "1893704267862470862", "proof_endpoint": "GET /api/v1/x/followers/check", "proof_cursor": null, "verification_state": "matched", "checked_at": "2026-05-24T19:30:00.000Z" } ``` ## Handle costs and retries > [!TIP] > > Xquik meters direct X (Twitter) read endpoints. Budget by participants and pages. > [!TIP] > > Draw execution can meter tweet, reply, retweeter, and follow checks. `402 insufficient_credits` stops the audit. Fund or narrow it first. Repeat an uncertain read with the same tweet, filter, and cursor. Search draw history before repeating an uncertain create request. Estimate costs from participant checks and expected pagination. Store completed pages so retries never restart the whole campaign audit. Stop on `402 insufficient_credits`. Add credits or narrow the participant set. Respect `429` backoff before repeating reads. Never change campaign rules to avoid a billing or rate-limit response. ## Next steps > [card] [Create draw](/api-reference/draws/create) > > Run a giveaway draw with published eligibility filters. > [card] [Export draw](/api-reference/draws/export) > > Export winners or all inspected entries. > [card] [Check follower](/api-reference/x/check-follower) > > Verify one source and target relationship. > [card] [Get retweeters](/api-reference/x/retweeters) > > Page users who retweeted one campaign tweet. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) # Choose X (Twitter) API fields via fields & omit Source: https://docs.xquik.com/guides/choose-response-fields Return only the tweet, profile, and list fields you need from the X API. Use fields and omit on REST, MCP, and RapidAPI reads. Same price, smaller answers. > For the complete documentation index, see [llms.txt](/llms.txt). Every read returns each row with every public field by default. Add `fields` to keep only the fields you name. Add `omit` to drop fields and keep the rest. The price stays the same. A row costs the same with 2 fields or 200. ## Keep the fields you need Name fields in a comma-separated list. Use a dot for a nested field. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/search?q=artemis&fields=id,text,author.username" \ -H "x-api-key: xq_YOUR_KEY_HERE" ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1893704267862470862", "text": "A public tweet about Artemis.", "author": { "username": "example" } } ], "has_next_page": true, "next_cursor": "DAACCgACGRElMJcAAA" } ``` Cursors, counts, and diagnostics always stay, so pagination keeps working. The row count and row order never change. ## Drop the fields you do not need `omit` takes the same names. It keeps every other field. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/search?q=artemis&omit=entities,media" \ -H "x-api-key: xq_YOUR_KEY_HERE" ``` Send both to keep a parent and drop part of it. `fields=id,author&omit=author.description` returns each author without its bio. ## How to name a field | You want | Send | | - | - | | A top-level field | `fields=id,text,likeCount` | | A field inside an object | `fields=author.username` | | A whole object | `fields=author` | | A field in each item of a list | `fields=media.type` | | A field of a quoted or reposted post | `fields=quoted_tweet.author.username` | * Case and underscores do not matter. `likeCount` and `like_count` name 1 field. * A row that lacks a field leaves it out. The API adds no empty value. * A name may start with the list it belongs to. `tweets.id` equals `id`. * Each parameter takes every name you list. ## Lookups return 1 record A lookup keeps the named fields in each record of its answer. `GET /x/tweets/{id}` returns a `tweet` and its `author`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/1893704267862470862?fields=text,author.username" \ -H "x-api-key: xq_YOUR_KEY_HERE" ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweet": { "text": "A public tweet about Artemis." }, "author": { "username": "example" } } ``` `GET /x/users/{id}` returns the profile itself, so name its fields directly. `fields=id,username,followers` returns those 3 fields. ## Unknown names answer 400 A name the answer does not document returns `400 unknown_field`. Xquik checks names before it reads X, so the request costs nothing. The error names a close field when there is one. It also lists the valid ones. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "unknown_field", "message": "Unknown field author.usrname. Did you mean author.username?", "fieldErrors": [ { "code": "unknown_field", "field": "author.usrname", "message": "Unknown field author.usrname. Did you mean author.username?", "path": "query.fields", "suggestion": "author.username" } ], "allowedFields": ["author.id", "author.username", "author.name"] } ``` `allowedFields` holds every valid name at the place the unknown name stopped. The example shows 3 of them. ## Use it from MCP, RapidAPI, and SDKs * MCP read tools take `fields` and `omit` with the same names. A smaller answer fits more rows in 1 tool result. * RapidAPI answers use `snake_case`. Name fields in either style. `fields=like_count` and `fields=likeCount` return `like_count`. * SDK methods pass both parameters through. A typed row then holds only the fields you named. ## Which endpoints take it Every read that returns rows or 1 record takes `fields` and `omit`. That covers tweets, replies, quotes, timelines, users, and followers. That also covers lists, communities, trends, jobs, Spaces, and lookups. Endpoints that return bare IDs, such as follower IDs, ignore both parameters. Each endpoint page in the [API reference](/api-reference/overview) lists them. For every field a tweet or profile can hold, see the [API field guide](/guides/tweet-profile-api-fields). # Composio Twitter MCP alternative & migration guide Source: https://docs.xquik.com/guides/composio-migration Replace a Composio Twitter MCP session with Xquik for tweet search, profiles, followers, replies, monitors, webhooks, and approved account actions safely. > For the complete documentation index, see [llms.txt](/llms.txt). Migrate a Composio Twitter MCP workflow without losing tweet IDs, followers, replies, or cursors. Keep webhooks and write confirmations. Find Xquik REST routes through `search`. Run approved calls through `execute`. Composio still supports MCP sessions. Choose Xquik for follower exports and monitors. ## Evaluate Composio alternatives for Twitter MCP Composio AI connects users to pre-built tools and handles OAuth. It also exposes AI tools through MCP. The question "what is Composio AI?" needs 3 checks. Check authorization, transport, and execution. This guide compares AI workflow tools, not enterprise AI automation. Platforms for building custom AI agents still need X authorization, tweet fields, and retries. AI-powered workflow builders change only orchestration. Open-source AI agent development does too. Need a Composio open source alternative? Compare broader platforms. For Twitter, Xquik is an X (Twitter) API alternative and X API alternative. Xquik covers tweets, followers, replies, profiles, timelines, monitors, and webhooks. Compare Composio MCP alternatives and Composio dev alternatives with these checks. * **Auth.** Record OAuth ownership. Map each application user to one X profile. * **Tools and APIs.** Record tool calls, API endpoints, and side effects. Choose unified APIs or a direct REST API. * **Agent safety.** Reapprove permissions. Test developer experience through SDK typing, logs, documentation, and rollbacks. * **Workflow safety.** Validate API calls and user profile scope in every AI-assisted social media workflow. * **API docs.** Can developers find the integration platform's API documentation? * **Rollback.** Can operators run tested rollback steps? * **Commercial fit.** Compare pricing, features, free tier, and white-label consent. Never choose an automation tool by its free tier alone. * **Freshness.** Measure real time claims. Name every data sync, such as tweets, profiles, followers, or events. Compare Twitter automation tools by reads, exports, monitors, webhooks, and approved writes. ## Compare current MCP models
Compare current Composio and Xquik Twitter MCP workflows.
Capability Composio session Xquik
MCP endpoint Create a user session. Configure the [Xquik API MCP server](/mcp/overview) once.
Endpoint access Read `session.mcp.url` and `session.mcp.headers`. Complete OAuth or send a supported API key.
X account Scope the session to a user and connection. Bind each credential to one application user or tenant.
Route discovery Load Twitter toolkit schemas through the session. Use `search` to find current Xquik REST routes.
Reads and exports Call the matching action. Use `xquik`, REST, or an extraction job.
Account actions Approve each action, then run it for the connected account. Require approval and confirm the terminal result.
Do not compare volatile tool counts. Compare the exact operations, schemas, permissions, and results your workflow uses. ## Capture the current Composio contract Inventory every Composio tool slug, connection, input, output, and side effect. **1. List every Twitter tool call** List tweet, profile, follower, DM, list, and write calls. **2. Record stable output fields** Keep IDs, usernames, timestamps, metrics, URLs, and cursors. **3. Mark every mutation** Mark tweet creation, replies, likes, follows, DMs, deletes, and list changes. **4. Capture auth ownership** Map each session and connection to one application user. **5. Save retry rules** Save retryable statuses, limits, delays, and idempotency rules. **6. Build representative fixtures** Save sanitized tweet, profile, follower, cursor, and error examples. Exclude API keys, session headers, OAuth tokens, and raw DMs from fixtures. ## Verify the current Composio session code ```bash Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install "composio==0.15.0" ``` ```bash TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npm install "@composio/core@0.14.1" ``` ### Python session MCP Python `composio==0.15.0` exposes `Composio.create()`. Sessions include MCP URL and headers. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import os from composio import Composio composio_client = Composio(api_key=os.environ["COMPOSIO_API_KEY"]) session = composio_client.create( user_id=os.environ["USER_ID"], toolkits=["twitter"], auth_configs={ "twitter": os.environ["COMPOSIO_TWITTER_AUTH_CONFIG_ID"], }, ) COMPOSIO_MCP_URL = session.mcp.url COMPOSIO_MCP_HEADERS = session.mcp.headers ``` Do not pass `mcp=True` to this Python version. The signature rejects it. ### TypeScript session MCP TypeScript `@composio/core==0.14.1` uses `composio.sessions.create()` with an explicit MCP option. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { Composio } from "@composio/core"; const composio = new Composio({ apiKey: process.env.COMPOSIO_API_KEY, }); const session = await composio.sessions.create(process.env.USER_ID!, { toolkits: ["twitter"], authConfigs: { twitter: process.env.COMPOSIO_TWITTER_AUTH_CONFIG_ID!, }, mcp: true, }); const composioMcpUrl = session.mcp.url; const composioMcpHeaders = session.mcp.headers; ``` Keep `session.mcp.headers`. The hosted endpoint may require them. ## Configure the Xquik X (Twitter) MCP server Add the fixed Xquik endpoint to your client. ```bash Claude Code theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} claude mcp add --transport http xquik https://xquik.com/mcp ``` ```bash Codex theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} codex mcp add xquik --url https://xquik.com/mcp codex mcp login xquik ``` ```json Cursor theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "mcpServers": { "xquik": { "url": "https://xquik.com/mcp" } } } ``` Complete Xquik login. Servers may use supported API keys. Store keys in a secret manager. ChatGPT custom apps require OAuth. They cannot present custom Xquik API-key headers. ## Map Composio X (Twitter) tools to Xquik routes Use `search` before selecting a route. Check its path, method, parameters, response, and account permission. > [card] Search tweets > > Use `GET /api/v1/x/tweets/search`. Keep `q`, ordering, windows, filters, and cursors. > [card] Get one tweet > > Use `GET /api/v1/x/tweets/{id}`. Keep the tweet ID. > [card] Get a profile > > Use `GET /api/v1/x/users/{id}` with a username or user ID. > [card] Search profiles > > Use `GET /api/v1/x/users/search`. Keep the query. > [card] Read followers > > Use `GET /api/v1/x/users/{id}/followers`. Keep user IDs and cursors. > [card] Read following > > Use `GET /api/v1/x/users/{id}/following`. Keep following rows separate. > [card] Read user tweets > > Use `GET /api/v1/x/users/{id}/tweets`. Choose reply and parent options. > [card] Read tweet replies > > Use `GET /api/v1/x/tweets/{id}/replies`. Keep direct and nested reply IDs. > [card] Read trends > > Use `GET /api/v1/x/trends`. Keep WOEID, rank, query, and description. > [card] Create monitors > > Use catalog-listed monitor routes. Store the monitor ID before creating webhooks. Use REST or SDKs for binaries and large responses. Use extraction jobs for durable files. ## Discover routes before execution The `search` tool finds authenticated routes without running them. Ask it for route metadata before calling `execute`. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { return Object.entries(spec.paths).flatMap(([path, methods]) => Object.entries(methods).flatMap(([method, operation]) => operation?.summary?.toLowerCase().includes("followers") ? [{ method: method.toUpperCase(), path, ...operation }] : [], ), ); }; ``` Then call the selected route through `xquik.request()`. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { return xquik.request("/api/v1/x/tweets/search", { query: { q: '"model context protocol" lang:en -filter:retweets', queryType: "Latest", limit: 100, }, }); }; ``` Keep searches focused. Keep the exact query beside every tweet page. ## Replace provider-specific cursors Never pass a Composio cursor into Xquik. Start each shadow read at page one. Store each page before its `next_cursor`. Keep request inputs unchanged. Xquik MCP list and search results use `has_more` and `next_cursor`. Pass `cursor` for X resources, events, and extractions. Stop on `has_more=false`, missing cursors, or repeated cursors. Return partial counts and the stop reason. ## Normalize results before cutover ### Tweet search rows Store `q`, window, tweet ID, text, author, timestamp, URL, and separate metrics. ### Profile and follower rows Store user ID, username, name, followers, following, verification, and picture. ### Reply rows Store tweet, conversation, parent, author, timestamp, text, and URL fields. ### Trend rows Store name, rank, query, description, count, and WOEID. ### Monitor and webhook rows Store monitor, endpoint, delivery, and event IDs. Verify signatures. ### Stored event replay Use `GET /api/v1/events` with `cursor`. Store event ID, type, monitor ID, time, `has_more`, and `next_cursor`. ## Keep tenant and account boundaries Keep each Composio session's application user. > [card] One tenant context > > Bind each Xquik credential to one tenant. > [card] One account scope > > Confirm the X account for every call. > [card] No shared bearer tokens > > Never share OAuth tokens between tenants. > [card] Server-side secrets > > Exclude tokens from prompts, traces, and clients. Add secrets only in the MCP transport settings. Exclude agent state and chat history. ## Migrate reads before writes Shadow tweet search, profiles, followers, following, replies, and trends first. Check these rules. * Match accounts and query windows. * Keep tweet and user IDs as strings. * Stop pagination correctly. * Keep missing optional fields. * Deduplicate by stable IDs and keep safe error categories. Expect ranking changes. Compare IDs, coverage, fields, and timestamps within one window. ## Cut over writes safely Do not run Composio and Xquik mutations in parallel. That can duplicate tweets, replies, likes, follows, DMs, or list changes. **1. Disable Composio mutations** Stop old writes. Keep shadow reads. **2. Require explicit approval** Show the action, account, content, recipients, and media. **3. Execute one Xquik write** Call the documented Xquik route. **4. Store durable IDs** Store the returned durable ID. **5. Confirm terminal state** Poll before retrying or showing success. **6. Enable the remaining writes** Migrate one mutation class at a time. Never claim success from an accepted request alone. Confirm the documented terminal response. ## Keep media workflows For tweets and replies, pass public HTTPS image or MP4 URLs. Store the returned ID. For DMs, upload media first. Pass `media_id` inside `media_ids`. Store the message, account, and recipient. Never reuse Composio media IDs. Follow the Xquik contract. ## Handle Xquik errors Branch on the selected route's canonical statuses. > [card] 400 Invalid request > > Fix the request. Do not retry unchanged. > [card] 401 Authentication > > Reauthorize Xquik or add a valid credential. > [card] 402 Account action > > Resolve the account action before retrying. > [card] 404 Not found > > Check the requested resource ID. > [card] 424 Dependency failure > > Save returned rows. Retry only when safe. > [card] 429 Rate limit > > Honor retry guidance and cap backoff. > [card] 502 Retrieval failure > > Retry transient failures with an attempt cap. > [card] Write pending > > Store the action ID and poll its status. Log the route, method, status, and workflow ID. Never log secrets or raw DMs. ## Test, cut over, and roll back **1. Run contract tests** Validate normalized rows and errors. **2. Run shadow reads** Compare providers without writes or notifications. **3. Switch one consumer** Move one consumer to Xquik rows. **4. Observe production runs** Check cursors, duplicates, fields, statuses, and latency. **5. Cut over remaining reads** Move consumers only after their row checks pass. **6. Cut over writes separately** Use the approval and terminal-confirmation process above. Keep the old configuration disabled during validation. Roll back consumers, never completed writes. ## Common Composio Twitter MCP migration questions ### Is Xquik a Composio alternative for Twitter MCP? Yes, for X reads, exports, monitors, webhooks, and approved actions. Compare routes. ### Do I need an X (Twitter) developer account for Xquik? Xquik does not require X developer credentials. Authorize Xquik instead. ### Can I reuse a Composio MCP session URL? No. Configure `https://xquik.com/mcp` separately. Never reuse Composio session URLs. ### Can I reuse Composio pagination cursors? No. Restart at page one. Store each Xquik cursor after its page. ### Can Xquik export Twitter followers and following? Yes. Page through follower routes or create extraction files. ### How do I migrate tweet search without missing posts? Shadow the same query and window. Compare tweet IDs and cursors. ### How do I avoid duplicate tweets during write cutover? Disable Composio writes. Run one approved Xquik write, then confirm it. ## Source and contracts * [Composio Sessions Through MCP](https://docs.composio.dev/docs/sessions-via-mcp) * [Composio Twitter Toolkit](https://composio.dev/toolkits/twitter) * [Xquik MCP Overview](/mcp/overview) * [Xquik MCP Tools](/mcp/tools) * [Xquik Tweet Search API](/api-reference/x/search-tweets) * [Xquik Followers API](/api-reference/x/followers) * [Xquik Error Handling](/guides/error-handling) # Manage multiple X (Twitter) accounts for users Source: https://docs.xquik.com/guides/connect-x-accounts-for-your-users Connect your users' X (Twitter) accounts from your own product, with a hosted link or the API. Your users need no Xquik signup, and connecting is free. > For the complete documentation index, see [llms.txt](/llms.txt). Your users connect their X (Twitter) accounts while staying in your product. They need no Xquik signup, and each account belongs to your Xquik account. Connecting is free. | | Connect link | Direct API | | - | - | - | | Who collects the password | A page Xquik hosts | Your own form | | What your backend receives | The result only | The X password & 2FA secret | | Key you need | Full access, plus **Connect X accounts** | Full access, plus **Connect X accounts** | | Best for | Most products | Products that must keep every step in their own UI | Start with a connect link. Choose the direct API only if your product must own the form. ## Use a connect link Create a link from your backend. The key needs Full access and **Connect X accounts**. [Turn on the permission](#turn-on-the-permission) first. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/account-connection-links \ -H "x-api-key: $XQUIK_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "reference": "crm-user-7", "returnUrl": "https://app.example.com/connected" }' ``` Open the answer's `url` in a pop-up or a new tab. The page can't load in a frame. The person enters their X username, email, password & Authenticator App 2FA secret there. The page names your Xquik account, and asks for any code X emails them. Then [read the link](/api-reference/x-accounts/get-connection-link) with its `id`. Once `status` reads `connected`, you get `accountId`, `xUserId`, `xUsername`, `health` & your `reference`. ### What a link protects * A link works for 30 minutes and connects 1 account. Only its hash is stored. * 5 refused logins end a link, so it can't be used to guess passwords. * The page takes the token out of the address bar, and sends no cookies. * It offers your `returnUrl` as a button. It never redirects by itself. * Send `accountId` to make a reconnect link. It refuses a sign-in for any other X account. * A link stops while its key is paused or lacks **Connect X accounts**. It ends once that key is revoked, rotated, expired or deleted. [List your links](/api-reference/x-accounts/list-connection-links) to find the ones a key made. Treat `url` like a password until it's used. Keep it out of logs & analytics. [Revoke it](/api-reference/x-accounts/revoke-connection-link) if you send it to the wrong person. ## Use the direct API > [!WARNING] > > With this path, your backend receives each user's X password and 2FA secret. > [Your duties](#your-duties) lists what that makes you responsible for. ### Turn on the permission Open [dashboard.xquik.com/en/api-keys](https://dashboard.xquik.com/en/api-keys) and edit a key. Turn on **Connect X accounts**. It starts off on every key. Full access doesn't include it, and only a signed-in dashboard session can change it. A key without it gets `403 x_account_connect_permission_required`. OAuth tokens and MCP tools always get `403 session_required`. X passwords never reach a model. ### Connect an account Generate a `connection_attempt_id` first. You can then read the result even if the response never arrives. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/accounts \ -H "x-api-key: $XQUIK_API_KEY" \ -H "Content-Type: application/json" \ -d @- <<'JSON' { "username": "your_x_username", "email": "account@example.com", "password": "", "totp_secret": "", "connection_attempt_id": "xatt_0123456789abcdef0123456789abcdef" } JSON ``` `totp_secret` is the long Authenticator App key, not a 6-digit code. [Connect X account](/api-reference/x-accounts/connect) explains how a user finds it. ### Handle each answer | Answer | What it means | What to do | | - | - | - | | `201` | The account connected. | Save `id`. Pass it or `xUsername` as `account` on later calls. | | `202` with `pending` | The sign-in is still running. | Wait for `Retry-After`, then read [the attempt](/api-reference/x-accounts/connection-attempt). Don't start again. | | `202` with `requires_email_code` | X sent the user an email code. | Ask for it, then send it to [submit](/api-reference/x-accounts/submit-challenge). | | `422` | X refused the login. | Show `message` and ask the user to check their details. | | `409` | Xquik already has this account. | Tell the user to disconnect it where they first connected it. | | `429` | The login has to wait. | Wait for `Retry-After`, then try once. | A successful attempt read gives `accountId` too. ### Reconnect, retry & disconnect When a password changes or `health` reads `needsReauth`, call [reconnect](/api-reference/x-accounts/reauth) with the new password. It answers like a connect. It refuses a sign-in that belongs to another X account. [Bulk retry](/api-reference/x-accounts/bulk-retry) clears passing failures, so you never send a password for those. [Disconnect](/api-reference/x-accounts/disconnect) removes an account and its stored session. Account activity records each connect, reconnect & disconnect with the key's ID. ### Your duties Your product collects X passwords, so these become your job. * Tell users you collect their password and send it to Xquik. * Send it only over HTTPS, and only from your backend. * Keep request bodies out of your logs, traces, error reports & analytics. * Never store the password or 2FA secret once Xquik answers. * Keep this key in a secret store, and set its allowed IPs. * Use a separate key for connecting, and pause it when you don't need it. Xquik encrypts credentials at rest and never returns them. ## Act as each account Send `account` on each write and DM call to pick which connected account acts. [List X accounts](/api-reference/x-accounts/list) gives each account's `status` and `health`. ## Limits These hold on both paths. Failed logins slow a caller down. Each account you connect lifts that limit, so onboarding many users isn't capped. A caller with no connected accounts gets 10 failed logins per 15 minutes. One X account gets 5 refused logins per 15 minutes, across all callers. A `429` always says how long to wait. # Convex X (Twitter) API with typed actions & webhooks Source: https://docs.xquik.com/guides/convex Call the X (Twitter) API from Convex actions and schedule durable reads. Store signed webhook events once. Show them live in React. See setup and examples. > For the complete documentation index, see [llms.txt](/llms.txt). Convex is a TypeScript backend with a reactive database, actions, and schedules. This guide brings the X (Twitter) API into a Convex app through Xquik. You call every public operation as a typed action. Signed X (Twitter) webhook events land in Convex tables, each one stored once. `usePaginatedQuery` shows them in React as they arrive. Xquik is the world's fastest and cheapest X Twitter scraper service. It has the most complete X (Twitter) data. It bills only for delivered, unique results that match your filters. Reads cost from \$0.00015 / tweet. [`xquik-convex`](https://www.npmjs.com/package/xquik-convex) is a [Convex component](https://docs.convex.dev/components). Its source is public on [GitHub](https://github.com/Xquik-dev/xquik-convex). Xquik does not require an X Developer app. > [card] Typed actions > > Each of the 190 public operations is an action. Each action has validated > arguments and a typed, validated result. > [card] Signed events > > The component's receiver verifies each event and stores it once. > [card] Durable jobs > > `xquik.schedule` runs any operation once or on a repeat. > [card] Live queries > > `usePaginatedQuery` shows new events as they arrive. > [card] Key in the component > > The component reads `XQUIK_API_KEY` only inside its own functions. > [card] Tests > > `xquik-convex/test` adds the component to `convex-test`. ## Install the component Create an [Xquik API key](/x-api-quickstart) in the [dashboard](https://dashboard.xquik.com/en/api-keys). Then install the package in your Convex app. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npm install xquik-convex ``` Add the component in `convex/convex.config.ts`. ```typescript convex/convex.config.ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { defineApp } from "convex/server"; import { v } from "convex/values"; import xquik from "xquik-convex/convex.config.js"; const app = defineApp({ env: { XQUIK_API_KEY: v.optional(v.string()) } }); app.use(xquik, { httpPrefix: "/xquik/", env: { XQUIK_API_KEY: app.env.XQUIK_API_KEY } }); export default app; ``` Store the key as a deployment environment variable. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npx convex env set XQUIK_API_KEY xq_YOUR_KEY_HERE ``` The component reads the key only inside its own functions. `httpPrefix` mounts its webhook receiver under `/xquik/` on your deployment's `.convex.site` URL. ## Call the X (Twitter) API from a Convex action Each public operation is an action in `components.xquik.operations`. Its name is the operation ID from the [API reference](/api-reference/overview). Call it with `ctx.runAction` from your own action. ```typescript convex/tweets.ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { internalAction } from "./_generated/server"; import { components } from "./_generated/api"; export const readTweets = internalAction({ args: {}, handler: async (ctx) => { const profile = await ctx.runAction(components.xquik.operations.getUser, { id: "elonmusk", }); const page = await ctx.runAction(components.xquik.operations.searchTweets, { q: "from:NASA", limit: 20, }); return { profile, tweets: page.tweets }; }, }); ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npx convex run tweets:readTweets ``` * Arguments are the operation's path, query, header, and JSON body fields side by side. * Convex validates the arguments before the call. * Each result has the type and validator of its schema in the API reference. Convex rejects an answer that breaks that schema. * The result holds only the fields that its schema lists. A JSON-LD key such as `@id` arrives as `id`. * `OperationResult<"getUser">` from `xquik-convex` names the result type of `getUser`. * Binary exports return an `ArrayBuffer`. * `streamEvents` reads the event stream for up to 10 seconds. Then it returns the events. A failed call throws a `ConvexError`. Its `data` has these fields. | Field | Value | | - | - | | `status` | HTTP status code | | `error` | Xquik error code | | `message` | Message that names the problem | | `retryAfter` | Seconds to wait, only with a `429` | [Error Handling](/guides/error-handling) explains each error code. ## Receive signed Twitter webhook events `Xquik` is the component's client class. Create it once from `components.xquik`. Create a monitor for an account, then call `xquik.createWebhook` from an action. It creates an Xquik webhook that points at the component's receiver. A monitor bills while it is active, as [Billing](/guides/billing) explains. ```typescript convex/x.ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { Xquik, eventFields } from "xquik-convex"; import { internalAction, internalMutation } from "./_generated/server"; import { components, internal } from "./_generated/api"; const xquik = new Xquik(components.xquik); export const watchNasa = internalAction({ args: {}, handler: async (ctx) => { await ctx.runAction(components.xquik.operations.createMonitor, { username: "NASA", eventTypes: ["tweet.new", "tweet.reply"], }); return await xquik.createWebhook(ctx, { eventTypes: ["tweet.new", "tweet.reply"], onEvent: internal.x.onEvent, }); }, }); export const onEvent = internalMutation({ args: { event: eventFields }, handler: async (_ctx, { event }) => { console.log(event.eventType, event.streamEventId); }, }); ``` `createWebhook` returns `{ endpointId, url, webhookId }`. The signing secret stays in the component's own table. It never reaches your code. `onEvent` is optional. The component runs it once for each `streamEventId` an endpoint receives. If 2 endpoints receive the same event, each endpoint's handler runs once. Run the `testWebhook` operation with the returned `webhookId` as `id`. The receiver answers the `webhook.test` alert with `200` and records `testedAt` on the endpoint. Read it with `components.xquik.webhooks.list`. That query returns `testedAt` as `null` until the first test. For a webhook from `xquik.addWebhook`, the query returns `webhookId` as `null`. `components.xquik.webhooks.remove` deletes the Xquik webhook and the endpoint. ## Register a webhook made elsewhere `xquik.addWebhook` registers a webhook you made somewhere else. Use it for a webhook from the dashboard or an Apify Monitor run. Call it from a mutation with the webhook's secret. It returns the URL to paste there. Add it to `convex/x.ts`. ```typescript convex/x.ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { v } from "convex/values"; export const addWebhook = internalMutation({ args: { secret: v.string() }, handler: async (ctx, { secret }) => await xquik.addWebhook(ctx, { secret }), }); ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npx convex run x:addWebhook '{"secret": "YOUR_WEBHOOK_SECRET"}' ``` ## How the receiver handles each delivery The receiver answers `POST https://YOUR_DEPLOYMENT.convex.site/xquik/webhooks/TOKEN`. > [card] Signature check > > It checks the `X-Xquik-Signature` header. That HMAC-SHA256 covers the > millisecond timestamp, the nonce, and the raw body. > [card] 5-minute window > > It rejects a timestamp more than 5 minutes off. > [card] Nonce once > > It rejects any nonce it has seen. A cron deletes expired nonces every 10 > minutes. > [card] Stored once > > It stores each `streamEventId` once, so retries never add a second event. [Signature verification](/webhooks/verification) explains the signing string and the replay window. ## Schedule durable X (Twitter) API jobs `xquik.schedule` starts a durable job from a mutation. Pass the operation ID, its arguments, and the timing. Add it to `convex/x.ts`. ```typescript convex/x.ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export const pollEvents = internalMutation({ args: {}, handler: async (ctx) => { await xquik.schedule(ctx, "listEvents", { limit: 100 }, { key: "events", everyMs: 300_000 }); }, }); ``` * `key` allows 1 scheduled or running job per key. Another call with that key returns that job's ID. The job keeps its first arguments and timing. * If a keyed job's run crashed, the next call with that key replaces it. * `everyMs` repeats the job. It takes 60000 or more. * `delayMs` delays the first run. * The job stores each run's result. Read it with `components.xquik.jobs.get` or `components.xquik.jobs.list`. A result that breaks its schema fails the job without a retry. * `components.xquik.jobs.cancel` stops a job. * A read that gets `429` or `5xx` retries up to 5 times. Each retry waits longer. * A write that takes an `Idempotency-Key` retries the same way. The component fills the key for you. Scheduled `listEvents` jobs store their events with the webhook events. Local development sees events without a public URL. The component runs no `onEvent` handler for an event from a `listEvents` job. If a webhook later delivers that event, the endpoint's handler still runs once. ## Show Twitter events live in React `components.xquik.events.list` returns stored events, newest first. Wrap it in your own query, with your own auth check. ```typescript convex/events.ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { paginationOptsValidator } from "convex/server"; import { ConvexError } from "convex/values"; import { query } from "./_generated/server"; import { components } from "./_generated/api"; export const list = query({ args: { paginationOpts: paginationOptsValidator }, handler: async (ctx, args) => { if ((await ctx.auth.getUserIdentity()) === null) throw new ConvexError("Sign in first"); return await ctx.runQuery(components.xquik.events.list, args); }, }); ``` Read it with `usePaginatedQuery`. The list updates as events arrive. ```tsx theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { usePaginatedQuery } from "convex/react"; import { api } from "../convex/_generated/api"; export function Events() { const { results, status, loadMore } = usePaginatedQuery( api.events.list, {}, { initialNumItems: 20 }, ); return ( <>
    {results.map((event) => (
  • {event.eventType}
  • ))}
); } ``` * Pass `filter` with `{ eventType }` or `{ monitorId }` to narrow `events.list`. * `components.xquik.events.get` takes `{ streamEventId }` and returns that event. ## Protect the functions you expose Only your backend can call component functions. Clients call only the functions you export. Add your own auth check to each one, as the `list` query above does. `ctx.auth.getUserIdentity()` returns the signed-in user. ## Test your functions with convex-test `xquikTest.register(t)` adds the component to a `convexTest` instance. ```typescript convex/x.test.ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { convexTest } from "convex-test"; import xquikTest from "xquik-convex/test"; import schema from "./schema"; const modules = import.meta.glob("./**/*.ts"); const t = convexTest(schema, modules); xquikTest.register(t); ``` ## Common Convex X (Twitter) API questions ### How do I call the X (Twitter) API from Convex? Install `xquik-convex` and set `XQUIK_API_KEY`. Then call an operation such as `components.xquik.operations.getUser` with `ctx.runAction` from an action. ### Can I call the X (Twitter) API from a query or mutation? No. Convex runs network calls only in actions. From a mutation, start a job with `xquik.schedule`. ### How do I receive X (Twitter) webhooks in Convex? Call `xquik.createWebhook` from an action. The component's receiver verifies and stores each event. ### Does a retried delivery create a duplicate event? No. The receiver stores each `streamEventId` once. ### How do I see events in local development? Schedule a `listEvents` job. Its events land with the webhook events, so you need no public URL. ### What happens when Xquik answers 429? The call throws a `ConvexError` with `retryAfter` in seconds. Scheduled reads retry a `429` up to 5 times. So do writes that take an `Idempotency-Key`. ### Is this Convex sign-in with X? No. This guide reads X (Twitter) data and receives X events. Use your auth provider for sign-in with X. ## Source and next steps * [xquik-convex source](https://github.com/Xquik-dev/xquik-convex) * [xquik-convex on npm](https://www.npmjs.com/package/xquik-convex) * [API reference](/api-reference/overview) * [Webhooks overview](/webhooks/overview) * [Signature verification](/webhooks/verification) * [Tweet Search API](/api-reference/x/search-tweets) * [Rate Limits](/guides/rate-limits) * [Error Handling](/guides/error-handling) # CrewAI Twitter MCP multi-agent guide for Python Source: https://docs.xquik.com/guides/crewai Build a CrewAI Twitter MCP crew for tweet search, profiles, followers, monitors, and exports. It runs reviewed X (Twitter) actions with typed Python handoffs. > For the complete documentation index, see [llms.txt](/llms.txt). Build a CrewAI MCP integration through Xquik's remote X (Twitter) MCP server. Give CrewAI agents tweet searches, profiles, follower exports, monitors, and reviewed X (Twitter) actions. Keep every tweet ID, profile ID, cursor, and job ID. ## Why use CrewAI with MCP for an X (Twitter) API? CrewAI offers an agent framework for complex tasks. Give each agent one role. Xquik supplies documentation search and X (Twitter) API operations through `docs`, `search`, and `execute`. | Boundary | CrewAI control | Benefit | | - | - | - | | Remote MCP | `MCPServerHTTP` | Reach tweet, profile, follower, and monitor routes | | Handoff | Pydantic `output_pydantic` | Reject malformed tweets and cursors | | Sequence | `Process.sequential` | Pass exact tweets between specialists | | Discovery | Static tool filter | Expose schemas without execution | | Review | Tool-free task | Review X (Twitter) actions before writes | | Failures | `has_tool_failures` | Stop incomplete research | This CrewAI multi agent pattern fits research, verification, and reporting. Use direct REST for deterministic jobs without model decisions. ## CrewAI X (Twitter) API prerequisites * Python 3.10 through 3.13 * An [Xquik API key](/x-api-quickstart) beginning with `xq_` * An LLM provider key supported by CrewAI * A connected X account for private reads or X write actions Public X reads need no X Developer credentials. Authenticate with Xquik. Connect an X account only for routes that require one. ## Install CrewAI MCP support CrewAI core includes a native MCP client. This CrewAI Python setup needs no custom adapter. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install "crewai>=1.15,<1.16" ``` CrewAI 1.15 requires MCP 1.28. Avoid MCP 2.x with this release. Store secrets outside source control. ```bash .env theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} XQUIK_API_KEY=xq_YOUR_KEY_HERE OPENAI_API_KEY=YOUR_OPENAI_KEY ``` ```text .gitignore theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} .env xquik-*-handoff.json ``` ## Build a typed CrewAI tweet search agent Start with the expected output, then build the task. CrewAI validates the final handoff against its Pydantic model. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import os from pathlib import Path from typing import Literal from crewai import Agent, Crew, Process, Task from crewai.mcp import MCPServerHTTP from pydantic import BaseModel class TweetRow(BaseModel): tweet_id: str text: str author_username: str | None created: int | None url: str | None class TweetSearchHandoff(BaseModel): query: str route_used: Literal["GET /api/v1/x/tweets/search"] tweets: list[TweetRow] has_more: bool next_cursor: str | None pages_fetched: int stop_reason: Literal[ "complete", "requested_limit", "cursor_stalled", ] xquik_mcp = MCPServerHTTP( url="https://xquik.com/mcp", headers={"x-api-key": os.environ["XQUIK_API_KEY"]}, streamable=True, cache_tools_list=True, ) researcher = Agent( role="Twitter API Researcher", goal="Return exact tweet records and resumable pagination state", backstory=( "You inspect Twitter conversations through documented Xquik routes. " "You preserve source IDs and never invent missing fields." ), llm="openai/gpt-5", mcps=[xquik_mcp], allow_delegation=False, verbose=False, ) search_task = Task( description=( "Use GET /api/v1/x/tweets/search. " "Search 50 latest tweets about CrewAI Twitter MCP. " "Preserve exact tweet IDs, created timestamps, and cursors. " "Stop at the requested limit. Stop if a cursor repeats." ), expected_output="A validated tweet search handoff with pagination state.", agent=researcher, output_pydantic=TweetSearchHandoff, ) crew = Crew( agents=[researcher], tasks=[search_task], process=Process.sequential, verbose=False, ) result = crew.kickoff() if result.has_tool_failures: raise RuntimeError("Twitter MCP tool failed. Inspect result.tool_failures.") handoff = TweetSearchHandoff.model_validate(result.to_dict()) Path("xquik-crewai-handoff.json").write_text( handoff.model_dump_json(indent=2), encoding="utf-8", ) ``` `Agent.mcps` discovers CrewAI MCP tools before execution. `MCPServerHTTP` uses Streamable HTTP by default. The MCP runtime returns normalized snake_case fields through `xquik.request()`. It maps `createdAt` to the Unix-second field `created`. Always inspect `has_tool_failures`. Never pass incomplete results into follower exports or X (Twitter) actions. ## Search tweets with focused queries Send a precise `q`. Keep the exact query in the handoff. | Intent | Example `q` | | - | - | | Framework posts | `"CrewAI" MCP` | | Account timeline | `from:crewAIInc since:2026-07-01 until:2026-08-01` | | X (Twitter) API Python posts | `"Twitter API" Python lang:en min_faves:25` | | Questions | `"multi-agent workflow" ? -filter:retweets` | Use `queryType=Latest` for real time monitoring. Use `Top` for engagement-ranked research. See the [tweet search API contract](/api-reference/x/search-tweets). Pass `next_cursor` unchanged. Stop when `has_more` is false or cursors repeat. Continue empty pages with true `has_more`. Deduplicate by `tweet_id`. ## Build a role-based tweet research crew Give only the researcher access to Twitter MCP search tools. Feed its validated task into a tool-free analyst. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} class TweetAnalysis(BaseModel): query: str analyzed_tweet_ids: list[str] recurring_topics: list[str] top_author_usernames: list[str] next_cursor: str | None analyst = Agent( role="Tweet Conversation Analyst", goal="Analyze only the supplied tweet rows", backstory="You compare exact tweets without fetching extra records.", llm="openai/gpt-5", allow_delegation=False, verbose=False, ) analysis_task = Task( description=( "Analyze the supplied tweet rows. " "Keep every analyzed tweet_id. Preserve the next_cursor." ), expected_output="A typed topic analysis tied to source tweet IDs.", agent=analyst, context=[search_task], output_pydantic=TweetAnalysis, ) research_crew = Crew( agents=[researcher, analyst], tasks=[search_task, analysis_task], process=Process.sequential, verbose=False, ) ``` The `context` list passes the first result into the second. The analyst cannot fetch unrelated tweets or profiles. Choose hierarchical delegation when specialists work independently. Use sequential tasks for cursor-dependent agent collaboration. ## Apply CrewAI MCP integration patterns Each CrewAI agent with MCP server access gets one permission boundary. Teams of AI agents must not share write-capable keys. This CrewAI MCP integration connects external APIs through synchronized schemas. Prefer CrewAI tools before building a CrewAI custom tool. The `tools` tool list shows permitted agent actions. Review agent tools before each tool integration. `import tool` shortcuts and `def run` wrappers duplicate native MCP behavior. Avoid broad web searches when tweet IDs matter. Set `verbose=True` only while debugging complex tasks. Multi agent systems in real world AI applications need one key per agent. ## Keep Twitter actions outside the research crew The `execute` tool runs every route allowed by its key. Never give write permissions to autonomous research crews. Use guest `paid_reads` for eligible paid-read routes. The [guest wallets guide](/guides/guest-wallets) documents this scope. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} class TweetWritePlan(BaseModel): account_id: str text: str reply_to_tweet_id: str | None media_urls: list[str] idempotency_key: str planner = Agent( role="Twitter Action Planner", goal="Prepare one reviewable X action without executing it", backstory="You preserve approved text, target IDs, and account IDs.", llm="openai/gpt-5", tools=[], allow_delegation=False, ) plan_task = Task( description="Prepare a tweet or reply plan from reviewed source tweets.", expected_output="One typed action plan. Do not execute any X request.", agent=planner, output_pydantic=TweetWritePlan, human_input=True, ) ``` `human_input=True` reviews the result, while `tools=[]` blocks execution. After approval, send one REST request. Never retry pending writes automatically. ## Expose endpoint discovery only Expose only `search` for endpoint discovery. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from crewai.mcp import MCPServerHTTP from crewai.mcp.filters import create_static_tool_filter discovery_mcp = MCPServerHTTP( url="https://xquik.com/mcp", headers={"x-api-key": os.environ["XQUIK_API_KEY"]}, tool_filter=create_static_tool_filter( allowed_tool_names=["search"], ), cache_tools_list=True, ) ``` This filter cannot execute X (Twitter) API calls. Its `search` returns methods, parameters, and response fields. Adding `execute` enables authorized execution. ## Use one MCP configuration per tenant Resolve the tenant first. Then create its `MCPServerHTTP` configuration. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} def build_tenant_mcp(user_api_key: str) -> MCPServerHTTP: return MCPServerHTTP( url="https://xquik.com/mcp", headers={"x-api-key": user_api_key}, streamable=True, cache_tools_list=True, ) ``` Never share agents across tenant keys. Keep keys outside prompts, output, memory, traces, and handoffs. Reuse one configuration per crew run. ## Store a resumable CrewAI handoff Store identifiers and checkpoints outside task prose. > [card] Tweet search rows > > Store `q`, `tweet_id`, `created`, `has_more`, and `next_cursor`. > [card] Follower exports > > Store `id` as `user_id`. Keep `username`, `followers`, `has_more`, and `next_cursor`. > [card] Monitor events > > Store `monitor_id`, `event_id`, `occurred_at`, `next_cursor`, and `cursor`. > [card] Webhook deliveries > > Store `webhook_id`, `delivery_id`, and `stream_event_id`. Protect `secret` separately. > [card] Extraction jobs > > Store `extraction_id`, `status`, `poll`, and `export_after_complete`. > [card] Approved X actions > > Store `tweet_id`, `write_action_id`, `status`, `charged_credits`, and `poll`. Never resend pending writes. Store `result.pydantic` or `result.to_dict()`. Avoid free-form `result.raw`. ## Handle X (Twitter) API errors and tool failures The tweet search contract documents these responses. Keep their meanings separate. | Status | Meaning | Crew action | | - | - | - | | `400` | Missing or invalid query | Fix `q`. Never retry unchanged | | `401` | Guest authentication failed | Provide an Xquik key or connect X | | `402` | Credits are unavailable | Stop and request account action | | `424` | X dependency failed | Retry with bounded backoff | | `429` | Twitter rate limit applies | Wait, then resume the cursor | | `502` | Invalid X response | Retry later without changing IDs | Inspect `result.tool_failures` after failures. Log the route, safe message, and task index. After `429`, keep `next_cursor` and completed tweet IDs. Deduplicate by `tweet_id` after recovery. POST and DELETE routes use different statuses. Read each route before retrying. See [error handling](/guides/error-handling). ## Verified CrewAI package versions Xquik checked these versions on August 2, 2026. | Package | Checked compatible version | Compatible range used here | | - | - | - | | `crewai` | 1.15.10 | `>=1.15,<1.16` | | `mcp` | 1.28.1 | `>=1.28.1,<1.29` through CrewAI | | `pydantic` | 2.12.5 | `>=2.11.9,<2.13` through CrewAI | CrewAI 1.15 supports Python 3.10 through 3.13. Review release notes before widening these ranges. ## CrewAI Twitter MCP questions ### What does the CrewAI MCP server do? It exposes Xquik route discovery and execution. Agents search tweets, export followers, replay monitors, and plan reviewed writes. ### How do I search tweets with Python and CrewAI? Call `GET /api/v1/x/tweets/search`. Keep `q`, `tweet_id`, `created`, and `next_cursor`. ### Can CrewAI export Twitter followers? Use the [followers API](/api-reference/x/followers). Choose extraction jobs for CSV, JSON, or XLSX exports. ### How should CrewAI handle agent roles and permissions? Give researchers MCP access. Give planners no tools. Review writes through the [create tweet contract](/api-reference/x-write/create-tweet). ### How should CrewAI handle X (Twitter) API rate limits? Save the cursor and completed tweet IDs. Resume after reset guidance. Never restart pagination. ### Why are CrewAI MCP tools missing? Check the URL, key, versions, and transport. Review [CrewAI GitHub issues](https://github.com/crewAIInc/crewAI/issues) for current defects. ### CrewAI MCP or direct REST? Choose CrewAI MCP for role-based decisions and typed handoffs. Choose REST for fixed routes, scheduled exports, and predictable latency. # X (Twitter) direct message API, DMs, history & media Source: https://docs.xquik.com/guides/direct-message-workflow Look up a user ID, read DM history, send an X (Twitter) direct message. Store the returned message ID, attach one uploaded media item, and handle DM errors. > For the complete documentation index, see [llms.txt](/llms.txt). Use this workflow for support, sales, community, or agent systems. Read DM history and send direct messages from a connected X account. Xquik reads participant-scoped conversations through `GET /x/dm/{userId}/history`. It sends text DMs through `POST /x/dm/{userId}`. It can attach one uploaded media item through `media_ids`. It deletes a DM through `DELETE /x/dm/{userId}/messages/{messageId}`. ## Choose the DM path > [card] Text-only send > > Call `POST /x/dm/{userId}` with `account` and non-empty `text`. Store > `messageId`, `success`, sender account, and recipient ID. > [card] Media send > > Call `POST /x/media` first, then send `media_ids: [""]` on > `POST /x/dm/{userId}`. Use exactly 1 item and store `media_id` beside > `messageId`. > [card] History sync > > Call `GET /x/dm/{userId}/history` with `account` before replying when the > workflow needs private conversation context. Store `messages`, > `has_next_page`, and `next_cursor`. > [card] Username input > > Call `GET /x/users/{id}` first when the app only has a username. DM sends > require the numeric recipient ID in the path. ## When to use this workflow > [card] Look up the recipient > > Use `GET /x/users/{id}` to convert a username to a numeric recipient ID. DM writes require that ID. > [card] Read message history > > Use `GET /x/dm/{userId}/history` with `account` to sync participant-scoped messages. > [card] Send a text DM > > Use `POST /x/dm/{userId}` with `account` and `text`, then store the returned `messageId`. > [card] Attach one media item > > Upload media first, then pass one `mediaId` in `media_ids`. > [card] Avoid bad retries > > Retry only `429` and `503`. Fix `400`, `402`, `403`, and `422` first. ## Data you get > [card] Recipient profile > > `GET /x/users/{id}` returns recipient `id`, `username`, `name`, and profile fields. > [card] History page > > `GET /x/dm/{userId}/history` returns `messages`, `has_next_page`, and `next_cursor`. > [card] Send result > > `POST /x/dm/{userId}` returns `messageId` and `success` for outbound handoff storage. > [card] Media upload > > `POST /x/media` returns `mediaId`, `mediaUrl`, and `success` before the one-item DM attachment send. ## End-to-end direct message handoff Use one checkpoint object after recipient lookup and history sync. Use the same object after a text send and an optional media send. Keep full DM bodies in restricted support, CRM, warehouse, or agent memory systems. Shared run logs should carry IDs, status, cursors, and media references. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "workflow": "direct_message_handoff", "recipient_lookup": { "id": "987654321", "username": "username" }, "history_page": { "account": "myxhandle", "conversation_user_id": "987654321", "messages_count": 25, "page_cursor": null, "next_cursor": "1893726451029384190", "has_next_page": true }, "text_send": { "endpoint": "/api/v1/x/dm/987654321", "account": "myxhandle", "recipient_user_id": "987654321", "message_id": "1893726451029384192", "success": true, "send_status": "sent" }, "media_send": { "upload_media_id": "1893726451023847424", "media_ids": ["1893726451023847424"], "media_url": "https://media.example.com/support-image.png", "message_id": "1893726451029384193", "success": true, "send_status": "sent" }, "audit_row": { "record_type": "dm_handoff_checkpoint", "sender_account": "myxhandle", "recipient_user_id": "987654321", "message_id": "1893726451029384193", "media_id": "1893726451023847424", "source_endpoint": "/api/v1/x/dm/987654321", "handoff_format": "jsonl", "message_text_storage": "restricted_system_only" }, "handoff_state": "store_message_ids_and_private_rows" } ``` > [card] Recipient checkpoint > > Store the numeric `id` and `username` from user lookup. > [card] History checkpoint > > Store `messages_count`, `next_cursor`, and `has_next_page` for each synced history page. > [card] Text send checkpoint > > Store the `message_id`, `success`, `send_status`, sender account, and recipient ID after `POST /x/dm/{userId}`. > [card] Media checkpoint > > Store exactly one uploaded `media_id` beside the returned DM `message_id`. > [card] Audit checkpoint > > Keep shared audit rows limited to IDs, cursors, status, endpoints, and media references. > [card] Invalid fields > > Do not pass `reply_to_message_id`, empty `media_ids`, or more than one media ID. ## Step 1. Look up the recipient user ID `POST /x/dm/{userId}` requires the numeric X (Twitter) user ID in the path. If you only have a username, call `GET /x/users/{id}` first. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/x/users/username \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "987654321", "username": "username", "name": "Xquik" } ``` Trust the DM write response when recording delivery. ## Step 2. Read direct message history Use the sender account as the `account` query parameter. The connected account must belong to the conversation. Direct messages remain private and user-scoped. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/dm/987654321/history \ --data-urlencode "account=myxhandle" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "messages": [ { "id": "1893726451029384191", "text": "Can you send the setup link?", "senderId": "987654321", "receiverId": "123456789", "createdAt": "2026-02-24T10:00:00.000Z" } ], "has_next_page": true, "next_cursor": "1893726451029384190" } ``` For older messages, pass the previous `next_cursor` as `cursor`. Store each message `id`, `text`, `senderId`, `receiverId`, `createdAt`, and optional `mediaUrl`. Put them in your support ticket, CRM note, or JSON export. > [!NOTE] > > DM history and outbound `message_text` values can contain private customer or community conversations. Store them only in private support, CRM, warehouse, or agent memory systems. Shared logs, public artifacts, and status dashboards should omit full DM bodies. They should keep `message_id`, `sender_id`, `receiver_id`, `created_at`, `media_url`, and job status instead. ### Sync and retry rules > [card] Opaque cursor > > Treat `next_cursor` as opaque. Pass it back as `cursor` for the next page. > Do not decode it or build your own cursor. > [card] Store message IDs > > Store every message `id`. Use the ID to deduplicate support tickets, CRM notes, > warehouse rows, or JSON exports. > [card] Participant account > > Use a participant account. `GET /x/dm/{userId}/history` returns > `400 account_required` without `account`. It returns `403 dm_not_permitted` > when the connected account is not in the conversation. > [card] Modern pagination > > Use `cursor`. Keep `maxId` only for older integrations that already depend on it. > [card] Transient retries only > > Retry `429` and `503`. Do not retry `403 dm_not_permitted` with the same non-participant account. ## Step 3. Send a text direct message Use a connected account as the sender. The `account` value can be the connected account username or account ID. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/dm/987654321 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle", "text": "Thanks for reaching out. Here is the next step." }' | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "messageId": "1893726451029384192", "success": true } ``` ### Store the outbound handoff After a `200` response, store one outbound record. Do it before handing control back to a CRM, ticket, queue, or agent. `POST /x/dm/{userId}` returns `messageId` and `success`. Use your own job timestamp if the next system needs `sent_at`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "status": "sent", "recipient_user_id": "987654321", "sender_account": "myxhandle", "message_id": "1893726451029384192", "message_text": "Thanks for reaching out. Here is the next step." } ``` Text-only DM sends omit media fields. Add `media_ids` in the request only for the media send in Step 4. Add `media_id` in the handoff only for that send. When you also sync history, normalize each `messages[]` item separately. Give each item `message_id`, `sender_id`, `receiver_id`, `created_at`, optional `media_url`, and `conversation_user_id`. ### JSON Lines handoff For queue, warehouse, CRM, or agent memory, write to `xquik-dm-handoff.jsonl`. Write one record per history message or outbound send. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "dm_history", "conversation_user_id": "987654321", "sender_account": "myxhandle", "message_id": "1893726451029384191", "sender_id": "987654321", "receiver_id": "123456789", "created_at": "2026-02-24T10:00:00.000Z", "message_text": "Can you send the setup link?", "page_next_cursor": "1893726451029384190" } ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "dm_send", "status": "sent", "conversation_user_id": "987654321", "sender_account": "myxhandle", "recipient_user_id": "987654321", "message_id": "1893726451029384192", "message_text": "Thanks for reaching out. Here is the next step.", "handoff_format": "jsonl" } ``` History rows include `media_url` only when the message has media. Text-only send rows omit `media_id` and `media_ids`. Media send rows use the Step 4 shape. ## Step 4. Send a direct message with media Upload media first, then send exactly one uploaded media ID in `media_ids`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/media \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle", "url": "https://example.com/support-image.png" }' | jq ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/dm/987654321 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle", "text": "Here is the requested image.", "media_ids": ["1893726451023847424"] }' | jq ``` DMs accept one uploaded media ID. Do not pass multiple IDs, an empty array, or `reply_to_message_id`. The media DM send returns the `messageId` and `success` fields, like a text DM. Store the uploaded `media_id` beside that returned message ID. Attachment audits can then join the upload, recipient, sender account, and outbound message. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "messageId": "1893726451029384193", "success": true } ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "dm_media_send", "conversation_user_id": "987654321", "sender_account": "myxhandle", "recipient_user_id": "987654321", "message_id": "1893726451029384193", "message_text": "Here is the requested image.", "media_ids": ["1893726451023847424"], "media_id": "1893726451023847424", "handoff_format": "jsonl" } ``` ## Step 5. Delete a direct message Delete a DM from the sender account's side with its `message_id`. The other person keeps their copy. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X DELETE "https://xquik.com/api/v1/x/dm/987654321/messages/1893726451029384193?account=myxhandle" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: dm-delete-1893726451029384193" | jq ``` A `200` means the conversation no longer shows the DM. It costs 10 credits. `422 x_dm_not_deleted` means X still shows it. You pay nothing. After the `200`, mark the stored `message_id` row as deleted. ## Twitter DM API questions ### How does the X (Twitter) direct message API work? The X (Twitter) direct message API sends one-to-one messages from a connected X account. Use a numeric user ID for each recipient. Send text through `POST /x/dm/{userId}`. This Twitter DM API workflow also reads participant-scoped message history. Store each returned `messageId`. Keep that ID for matching records and audit logs. Use a connected Twitter account for each private message. Reuse the idempotency key only for the identical request. Poll non-terminal write actions through their status URL. Use a new key only when `safeToRetry` is `true`. ### How do I send a Twitter DM through an API? An X (Twitter) API DM send starts with recipient lookup. Call `GET /x/users/{id}` when you only know the username. Then call `POST /x/dm/{userId}` with `account` and `text`. The Twitter direct message API returns `messageId` and `success`. Store both before any CRM, queue, or agent handoff. ### Can the API receive Twitter DMs in real time? Xquik reads saved history on demand. This route does not register real-time DM events. Poll `GET /x/dm/{userId}/history` when the workflow needs new messages. Omit `cursor` from the first history request. Then pass each response's `next_cursor` value as the next request's `cursor`. A Twitter DM history API client should deduplicate each message `id`. ### Why does sending a DM return 403 or 422? A `403` can indicate a disconnected or non-participant account. Reconnect accounts that need reauthorization. Read private conversations through an account that belongs to them. A `422` means X rejected the request. Check recipient permissions, message text, and sender account state. Do not retry an unchanged rejected request. ### Can this API create group DM conversations? This route accepts one recipient `userId`. The Xquik contract does not create group conversations. Do not pass participant arrays to the one-to-one send route. Check the OpenAPI contract before sending message conversations. ### How do I send a DM with media? Upload one image, GIF, or video through `POST /x/media`. Use the returned `mediaId` in a one-item `media_ids` array. To send DM with media, include non-empty text too. Send one media ID. Empty or multiple media IDs fail. Keep upload and message IDs together for private attachment audits. ### Is Twitter DM automation suitable for welcome messages? Use Twitter DM automation only for expected, approved customer conversations. Never send unsolicited welcome messages to new followers. Review [X developer guidance](https://docs.x.com/developer-guidelines) before sending DMs. Keep message bodies inside restricted support or CRM systems. Store IDs and delivery status in shared operational logs. Give recipients a clear way to stop automated messages. ## Costs > [card] Recipient lookup > > `GET /x/users/{id}` costs 1 credit per call. > [card] DM history > > `GET /x/dm/{userId}/history` costs 1 credit per message returned. > [card] Media upload > > `POST /x/media` costs 10 credits per upload call before a media DM send. > [card] DM send > > `POST /x/dm/{userId}` costs 10 credits per call and returns `messageId`. > [card] DM delete > > `DELETE /x/dm/{userId}/messages/{messageId}` costs 10 credits, only when X deletes the DM. ## Error handling > [card] 400 invalid_input > > Check `account`, `text`, `userId`, and one-item `media_ids`. > [card] 400 account_required > > Pass the connected sender handle as `account` when reading DM history. > [card] 402 billing state > > Subscribe or top up credits before retrying. > [card] 403 account_needs_reauth > > Reconnect the sender account from the dashboard. > [card] 403 dm_not_permitted > > Use a connected account that participates in the conversation, or reconnect the account. > [card] 422 x_dm_not_allowed > > X rejected the send with `422 x_dm_not_allowed`. The recipient may not accept DMs from this connected account. Do not retry unchanged. Use another permitted account or ask the recipient to allow messages. > [card] 422 x_dm_not_deleted > > X still shows the DM after a delete. You pay nothing. Retry with a new `Idempotency-Key`. > [card] 422 x_rejected > > Check the recipient, account state, and message content before retrying. > [card] 429 or 503 > > Retry with exponential backoff and respect `Retry-After` when present. ## Handoff checklist > [card] Sender > > Store the connected X account username or ID sent in `account`. > [card] Recipient > > Store the numeric recipient ID used in the `POST /x/dm/{userId}` path. > [card] History > > For DM history exports, store `messages`, `has_next_page`, and > `next_cursor`. Pass `cursor` to fetch older messages. > [card] Text > > Store the required non-empty `text` value. > [card] Media > > Store the optional one-item `media_ids` array containing a `mediaId` from > `POST /x/media`. > [card] Response > > Store `messageId`, `recipient_user_id`, `sender_account`, `message_text`, > and optional `media_id`. Keep them in private audit records or support > systems. > [card] JSON Lines > > Store history and send records in `xquik-dm-handoff.jsonl`. Use it for queues, warehouse loads, CRM syncs, or agent memory. > [!NOTE] > > **Related.** [Send Direct Message](/api-reference/x-write/send-dm) · [Delete Direct Message](/api-reference/x-write/delete-dm) · [Get DM History](/api-reference/x/dm-history) · [Get User](/api-reference/x/twitter-profile-lookup) · [Media Upload Workflow](/guides/media-upload-workflow) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) # X API error handling for tweet & follower workflows Source: https://docs.xquik.com/guides/error-handling Recover Xquik requests, cursors, writes, monitors, webhooks, and dependencies. Follow retry safety, restore account access, and handle reply restrictions. > For the complete documentation index, see [llms.txt](/llms.txt). Choose recovery by `error` code. ## Quick reference Start with HTTP status. Retry only when stated. > [card] 400 request validation > > Do not retry. Fix the body, query, or path. Examples include > `invalid_json`, `invalid_id`, `invalid_tweet_url`, `invalid_tweet_id`. > [card] 401 authentication > > Do not retry. Check `x-api-key`, regenerate revoked keys, or re-authenticate > the connected X account. Covers `unauthenticated` and `x_auth_failure`. > [card] 402 billing and credits > > Do not retry. Read `payment_options`, then get explicit user confirmation. > A key that reads only gets `next_step` with the account page instead. > Covers `no_subscription`, `subscription_inactive`, `payment_failed`, > `no_credits`, and `insufficient_credits`. > [card] 403 permissions and account health > > Do not retry. Delete an extra key, check billing status, or use a > participating DM account. Or re-authenticate the X account or resolve > account health on x.com. Covers `api_key_limit_reached`, `dm_not_permitted`, > `account_needs_reauth`, and `account_restricted`. For `x_account_protected`, > choose a public timeline. For `api_key_paused`, resume the key on the > [API keys page](https://dashboard.xquik.com/en/api-keys), then retry. For > `ip_not_allowed`, add the calling IP to the key, or use a listed IP. For > `insufficient_scope`, add the scope `requiredScope` names to the key. > For `api_key_budget_reached`, raise the key's budget or wait for the next UTC > month. > [card] 404 missing resource > > Do not retry. Verify the resource ID & connected account. Codes include > `account_not_found`, `user_not_found`, `tweet_not_found`, `no_media`, > and other missing resources. > [card] 409 or 410 cursor state > > For a busy cursor, follow `Retry-After`, then send the same cursor again. A > cursor sent again within 10 minutes returns the same page at no charge. > For a gone cursor, restart cursorless and deduplicate IDs. > [card] 422 write validation > > Retry only `x_automation_refused`. Fix the account capability, > target, content, DM permissions, or media URL before sending again. > Covers `x_dm_not_allowed`, `x_reply_not_allowed`, `x_target_not_found`, `x_content_too_long`, > and the other [422 codes](#common-error-codes). > [card] 202 active write > > Do not retry. Store the action and poll `statusUrl` while `terminal` is > `false`. Follow `Retry-After`, `pollAfterMs`, and `nextAction`. > [card] 429 rate limit or cooldown > > Retry depends on the code. Retry `rate_limit_exceeded` and `x_rate_limited` after > `Retry-After` or exponential backoff. Wait out `login_cooldown` via > `retryAfterMs`. Do not retry `x_daily_limit` on the same X account for 24 > hours. > [card] 500, 502, and 503 transient failures > > Retry `internal_error`, `x_api_rate_limited`, > `x_api_unavailable` and `x_api_unauthorized`. For writes, retry only when > `safeToRetry` is `true`, using a new `Idempotency-Key`. > Retry `pagination_stalled` once after 30 seconds. Keep the returned results. ## Common error codes The OpenAPI [`Error`](https://docs.xquik.com/openapi.yaml) schema lists every public code. **Default response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "error_code", "message": "Human-readable description" } ``` Send `xquik-api-contract: 2026-04-29` for a structured `error` object. Some responses also include `message`, `reason`, `retryAfter`, or `retryAfterMs`. > [accordion] Validation errors (400) > > Invalid body, query, or path. > > > [card] invalid_input > > > > Invalid body. Check the endpoint's required fields, types & enum values. > > > [card] invalid_json > > > > Invalid JSON body. Send a parseable JSON object. > > > [card] invalid_id > > > > Invalid path ID. Use the create or list endpoint's numeric string. > > > [card] invalid_tweet_url > > > > Tweet URL is malformed. Use `https://x.com/user/status/ID`. > > > [card] invalid_tweet_id > > > > Send a post ID or post URL, such as `x.com/nasa/status/20`. > > > [card] invalid_username > > > > Username is empty or invalid. Send a username without the `@` prefix. > > > [card] invalid_user_id > > > > Send a user ID, `@username` or profile URL, such as `x.com/nasa`. > > > [card] invalid_message_id > > > > Send a DM ID from [DM history](/api-reference/x/dm-history). > > > [card] account_required > > > > Add your connected X account, such as `?account=@nasa`. > > > [card] invalid_tool_type > > > > Unknown extraction tool type. Use one of the 23 types from > > [Create Extraction](/api-reference/extractions/create). > > > [card] invalid_format > > > > Export format is unsupported. Use `csv`, `json`, `md`, `md-document`, > > `pdf`, `txt`, or `xlsx`. > > > [card] invalid_params > > > > Invalid export query. Check the `format` and `type` values. > > > [card] missing_query > > > > Add the `q` parameter to search & community calls. > > > [card] missing_ids > > > > Provide comma-separated numeric IDs in `ids`. > > > [card] missing_params > > > > Required query parameters are missing. Follower checks need both source > > & target. > > > [card] invalid_media_url > > > > Send each `media` entry as an HTTP or HTTPS URL. > > > [card] unsupported_media_combination > > > > Send 1 MP4 alone, or only images. > > > [card] unsupported_field > > > > The body has a field this endpoint rejects. Remove that field. > > > [card] missing_idempotency_key > > > > The X write has no `Idempotency-Key` header. Send 1 unique key per > > intended write. Reuse it only to retry that write. > > > [card] invalid_idempotency_key > > > > `Idempotency-Key` doesn't match the endpoint's format. Send a random UUID > > v4, which every endpoint accepts. > > > [card] invalid_coverage_cursor > > > > Cursor is malformed. Restart without it and deduplicate stored IDs. > > > [card] invalid_community_topic > > > > Unknown Community topic. Use a name or ID from > > [Community topics](/api-reference/x/community-topics). > > > [card] invalid_cursor > > > > X can't read the cursor, or it expired. Start again without `cursor`, > > then use `next_cursor`. It costs nothing. > [accordion] Authentication errors (401) > > Missing or invalid credentials. Check your API key or session. > > > [card] unauthenticated > > > > API key or bearer token is missing or invalid. Send `x-api-key` or > > regenerate a revoked key. > > > [card] x_auth_failure > > > > The X account's session ended. Re-authenticate it from the > > [dashboard](https://dashboard.xquik.com/en/x-accounts). > [accordion] Anonymous paid-read authentication (401) > > Non-MPP paid reads return `401` with `WWW-Authenticate: Bearer` and a guest wallet action. This is not a Payment challenge. Authenticate or get confirmation before calling the action. > [accordion] Billing & credit errors (402) > > A `402` creates no checkout. Account and OAuth responses advertise account billing actions. Guest responses advertise only `POST /api/v1/guest-wallets/topups`. Direct MPP responses include a Payment challenge and guest option. Get confirmation before calling any action. A write's `402` adds `top_up_url` & `dashboard`. > > > [card] no_subscription > > > > No plan. Check credits, then [top up](/api-reference/credits/topup) or [subscribe](/api-reference/account/subscription-checkout). > > > [card] subscription_inactive > > > > Plan inactive. Remaining credits work. Top up or reactivate on the [billing page](https://dashboard.xquik.com/en/account?tab=subscription). > > > [card] payment_failed > > > > Payment failed. Update the payment method in the > > [dashboard](https://dashboard.xquik.com/en/account?tab=subscription). > > > [card] no_credits > > > > No credits left. Check [Get Account](/api-reference/account/get), then > > use [Top Up Credits](/api-reference/credits/topup) after confirmation. > > > [card] insufficient_credits > > > > Balance is below the operation's cost. Account callers check > > [Get Account](/api-reference/account/get), guest callers > > [Guest Wallet Status](/api-reference/guest-wallets/status). Use only the > > payment action advertised for that credential. > [accordion] Permission errors (403) > > Plan, limits, or account visibility prevent this action. > > > [card] api_key_limit_reached > > > > The account has 100 active API keys. Revoke one before creating another. > > > [card] api_key_paused > > > > This API key is paused. Resume it on the > > [API keys page](https://dashboard.xquik.com/en/api-keys), then retry. > > > [card] api_key_budget_reached > > > > The call doesn't fit what's left of the key's monthly credit budget. It > > returned nothing & cost nothing. Raise or remove the budget with > > [Update API key](/api-reference/api-keys/update). Or wait for the next UTC month. > > > [card] dm_not_permitted > > > > DM history requires a participating connected account. Choose one or reconnect it from the > > [dashboard](https://dashboard.xquik.com/en/x-accounts). > > > [card] account_needs_reauth > > > > The X account needs re-authentication. Reconnect it from the > > [dashboard](https://dashboard.xquik.com/en/x-accounts), then retry. > > > [card] account_restricted > > > > Connected X account is locked, suspended, recovering, or temporarily > > blocked. Resolve account health on x.com or wait before retrying. > [accordion] Not found errors (404) > > The requested resource does not exist or is unavailable to this API key. Or > it is not the expected X object type. > > > [card] not_found > > > > Lookup failed. Verify the ID belongs to your account > > and has not been deleted. > > > [card] account_not_found > > > > No such connected X account. Call > > [List X Accounts](/api-reference/x-accounts/list) and use one it lists. > > > [card] user_not_found > > > > X shows no profile for the username or user ID. `reason` says why with > > `not_found` or `suspended`. Confirm the handle, or choose another > > account when X (Twitter) suspended it. > > > [card] tweet_not_found > > > > The tweet ID doesn't resolve. Check it. The author may have deleted the > > tweet. > > > [card] no_media > > > > The tweet has no downloadable media. Use a tweet with media. > > > [card] article_not_found > > > > Valid Tweet ID, but no X Article. Request an Article URL or use tweet or thread endpoints. > > > [card] draft_not_found > > > > Draft missing. Verify its ID or create one. > > > [card] style_not_found > > > > Style ID missing. Analyze tweets with > > [Analyze Style](/api-reference/styles/analyze). > > > [card] no_cached_style > > > > No cached style for this username. Analyze tweets with [Analyze Style](/api-reference/styles/analyze). > [accordion] Conflict and cursor errors (409/410) > > Reuse duplicate monitors. Recover cursors by status and error code. > > > [card] monitor_already_exists > > > > Duplicate account or keyword monitor. List existing monitors or reuse > > the monitor ID. Or update event types with > > [Update Monitor](/api-reference/monitors/update) or > > [Update Keyword Monitor](/api-reference/monitors/update-keyword). > > > [card] post_unavailable > > > > X no longer shows the post. Creating a post monitor answers `422` for a > > protected post. Resuming one answers `409` while X hides it. `reason` > > names why when X gives one. > > > [card] coverage_cursor_unavailable > > > > Follow the exact `Retry-After` seconds. Retry the same cursor once. > > Repeated busy responses never authorize a fresh extraction. > > > [card] coverage_cursor_gone > > > > No `Retry-After`. Restart cursorless and deduplicate IDs. > > Keep received results. Restarting creates a separate extraction. > [accordion] Media errors (413/415) > > Xquik stops before any X call and charges nothing. > > > [card] unsupported_media_type > > > > Xquik can't read the file or its `Content-Type`. Send a valid, supported file. > > > [card] media_too_large > > > > The file is too big, even after Xquik shrinks images. Send a smaller file. > [accordion] Validation errors (422) > > Write validation failed. Change the account, target, content, DM > permission, or media input before retrying. > > > [card] x_account_feature_required > > > > Missing account capability. Change the account or request. > > > [card] x_account_suspended > > > > X account suspended or restricted. Resolve its status on x.com before further writes. > > > [card] x_account_protected > > > > Target account is protected. Timeline reads return 403, including continuations. Use a public account. > > Profiles remain readable. Xquik collects and charges no results. > > Writes return 422. > > > [card] x_duplicate_action > > > > Operation is complete. Check the target before retrying. Never repeat an unchanged request. > > > [card] x_dm_not_allowed > > > > Recipient does not accept DMs from this account. Use a permitted > > connected account or ask the recipient to allow messages. > > > [card] x_dm_not_deleted > > > > X still shows the DM. Xquik charges nothing. Retry with a new `Idempotency-Key`. > > > [card] x_target_not_found > > > > Target is missing or invisible to the connected X account. > > Verify the ID and that account's access before sending another request. > > Writes also return it for a username X doesn't know. > > > [card] x_reply_not_allowed > > > > This account cannot reply to the post. Choose a post it can reply to. > > > [card] x_reply_target_unavailable > > > > X says the post you're replying to is deleted or hidden from your account. > > Xquik charges nothing. Check the post on x.com or reply to another post. > > > [card] x_content_too_long > > > > Content exceeds the character limit. Shorten it or use an account that > > allows longer posts. > > > [card] x_rejected > > > > X refused the write and said why. Xquik charges nothing. Change the request. > > Retry only when the durable action marks it safe. > > > [card] x_automation_refused > > > > X said the write might be automated & refused it. Xquik charges > > nothing. Send the next request now with a new `Idempotency-Key`. > > Waiting does not help. If X keeps refusing, check the account on x.com. > > Vary your text or pace. > > > [card] x_media_rejected > > > > X couldn't read the uploaded file. Upload a valid JPG, PNG, GIF, WebP, > > or MP4. Do not retry the same file. > > > [card] x_image_invalid > > > > X refused the image's size. Send one from 200x100 to 8192x8192 pixels. > > > [card] media_download_failed > > > > Xquik could not download the public media URL. Fix the HTTPS URL or pass the > > file via multipart/form-data. Do not retry the same URL. > [accordion] Active write lifecycle (202) > > The durable write remains active. Its status is `accepted`, `dispatching`, > or `pending_confirmation`. Follow > [write lifecycle recovery](#write-lifecycle-recovery). > > > [card] x_post_not_sent > > > > X never published the post. Xquik charges nothing. Post again with a new `Idempotency-Key`. > [accordion] Rate limit errors (429) > > Request rate exceeded. See [Rate Limits](/guides/rate-limits) for tier details. > > > [card] rate_limit_exceeded > > > > You reached an Xquik tier or action limit. Wait the `Retry-After` seconds > > from the response. JSON also includes `retryAfter` when available. > > > [card] login_cooldown > > > > A recent login attempt triggered cooldown. Wait `retryAfterMs` or the > > `Retry-After` header before reconnecting or reauthenticating. > > > [card] x_rate_limited > > > > X throttled the write. Follow `Retry-After`, then retry with backoff. > > > [card] x_daily_limit > > > > Connected X account reached its daily posting limit. Wait 24 hours > > before retrying that account, or use another connected account. > [accordion] Server & service errors (500/502/503) > > Transient failures. Retry with exponential backoff, up to 3 attempts. > > > [card] internal_error > > > > Server error. Retry with backoff and > > [contact support](mailto:support@xquik.com) if it continues. > > > [card] x_api_rate_limited > > > > Read service rate limited. Retry in a few minutes. > > > [card] x_api_unavailable > > > > Read service temporarily unavailable or busy. Respect `Retry-After` > > when present, otherwise retry with backoff. > > > [card] pagination_stalled > > > > The list stalled. Wait, then send the same cursor again. > > A second stall ends the list. Keep returned rows. Deduplicate by ID. > > > [card] x_api_unauthorized > > > > Read service authentication failed. Retry later and > > [contact support](mailto:support@xquik.com) if it continues. > > > [card] x_write_failed > > > > Xquik could not explain why the write failed. Follow `safeToRetry` & > > `nextAction`. Contact support if it stays unsafe to retry. > > > [card] x_write_ambiguous > > > > X may have applied the write. X gave 408, 500, 502, 503 or 504 after the > > send, or no confirmation. Poll the action & check the result before > > sending again. > > > [card] x_transient_error > > > > A temporary failure, like X's 408, 500, 502, 503 or 504 before the send. > > Retry only when `safeToRetry` is `true`. ## Write lifecycle recovery Writes can return durable actions. Check their lifecycle fields first. **1. Store the action** Store `id`, `status`, `request.hash`, `account`, `target`, `billing`, and `statusUrl`. **2. Poll the write action** Poll `statusUrl` while `terminal` is `false`. Respect `Retry-After` and `pollAfterMs`. **3. Store the outcome** Store `result` and settled `billing` after `terminal` becomes `true`. **4. Follow retry safety** Retry only when `safeToRetry` is `true`, using a new `Idempotency-Key`. Verify the result when `nextAction.type` is `verify_result`. ## Retry with exponential backoff For reads, retry `pagination_stalled` once. Otherwise retry `429` and `5xx`. Use `Retry-After`, then exponential backoff with jitter. For writes, follow the durable action's `safeToRetry` and `nextAction` fields instead. **Formula.** `delay = baseDelay * 2^attempt + random(0, jitter)` ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} function retryDelayMs(response: Response, attempt: number): number { const retryAfter = response.headers.get("Retry-After"); if (retryAfter) { return Number.parseInt(retryAfter, 10) * 1000; } return 1000 * 2 ** attempt + Math.floor(Math.random() * 1000); } async function shouldRetry(response: Response, attempt: number): Promise { const body = await response .clone() .json() .catch(() => null); if (body?.error === "pagination_stalled") return attempt === 0; return response.status === 429 || response.status >= 500; } ``` ## Rate limit handling > [card] HTTP status > > `429 Too Many Requests` signals a rate limit or account cooldown. > [card] Retry-After header > > `Retry-After` gives the seconds to wait before resending. Without `Retry-After`, read `retryAfter` or `retryAfterMs` from the JSON body. After another 429, back off and stop after 3 attempts. ## Best practices Log status & error codes without credentials or private payloads. Set request timeouts & poll long-running jobs. Deleting missing resources returns `404`. Repeating deletion is safe. > [card] [Rate limits](/guides/rate-limits) > > Rate limit tiers and client-side limits. > [card] [API overview](/api-reference/overview) > > Base URL, authentication, and conventions. # Twitter extraction data handoff to JSON lines Source: https://docs.xquik.com/guides/extraction-data-handoff Hand X (Twitter) extraction results to apps and agents. Page stored rows, write durable JSON Lines, and export CSV, JSON, or XLSX files for each team. > For the complete documentation index, see [llms.txt](/llms.txt). This guide continues the [extraction workflow](/guides/extraction-workflow) after results are ready. ## Data handoff > [card] App or API pipeline > > Use `GET /extractions/{id}`. Store `job`, `results`, `hasMore`, `nextCursor`. > Use `limit` up to 1,000 and pass `nextCursor` as `cursor`. > Use compact output for core fields and tweet counts. > [card] CRM import > > Use `GET /extractions/{id}/export?format=csv`. Store `User ID`, > `Username`, `Display Name`, `Followers`, and `Verified`. Upsert by stable X > user ID when possible. > [card] Warehouse or queue > > Use `GET /extractions/{id}/export?format=json` or paginated JSON. Store > `xUserId`, `xUsername`, `tweetId`, `tweetText`, `createdAt`. Keep the > extraction ID with each load for replay and audit. > [card] Analyst review > > Use `GET /extractions/{id}/export?format=xlsx`. Store export columns plus > enrichment fields. Use CSV or JSON for automation and XLSX for manual review. File exports and paginated JSON both reach every row. A PDF above 10,000 rows comes as a ZIP of PDF parts. ### Option A. Paginate via API Fetch results in pages of up to 1,000 records. Follow `nextCursor` until `hasMore` is false. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # First page curl -s "https://xquik.com/api/v1/extractions/77777?limit=1000" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq # Next page (use nextCursor from previous response) curl -s "https://xquik.com/api/v1/extractions/77777?limit=1000&cursor=990100" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const extractionId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; let cursor = undefined; const allResults = []; do { const params = new URLSearchParams({ limit: "1000" }); if (cursor) params.set("after", cursor); const data = await fetch(`https://xquik.com/api/v1/extractions/${extractionId}?${params}`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" }, }).then((r) => r.json()); allResults.push(...data.results); cursor = data.hasMore ? data.nextCursor : undefined; } while (cursor); console.log(`Fetched ${allResults.length} results`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} extraction_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" all_results = [] cursor = None while True: params = {"limit": 1000} if cursor: params["after"] = cursor data = requests.get( f"https://xquik.com/api/v1/extractions/{extraction_id}", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params=params, ).json() all_results.extend(data["results"]) if data.get("hasMore"): cursor = data["nextCursor"] else: break print(f"Fetched {len(all_results)} results") ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} extractionID := "a1b2c3d4-e5f6-7890-abcd-ef1234567890" cursor := "" var allResults []map[string]interface{} for { url := fmt.Sprintf("https://xquik.com/api/v1/extractions/%s?limit=1000", extractionID) if cursor != "" { url += "&cursor=" + cursor } req, _ := http.NewRequest("GET", url, nil) req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, _ := http.DefaultClient.Do(req) var data struct { Results []map[string]interface{} `json:"results"` HasMore bool `json:"hasMore"` NextCursor string `json:"nextCursor"` } json.NewDecoder(resp.Body).Decode(&data) resp.Body.Close() allResults = append(allResults, data.Results...) if !data.HasMore { break } cursor = data.NextCursor } fmt.Printf("Fetched %d results\n", len(allResults)) ``` ### Durable JSON Lines handoff Some queues, warehouses, or agents need replayable rows. For those, use JSON Lines. Write each paginated result with the cursor state that produced it. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "extraction_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "row_id": "990001", "x_user_id": "44196397", "x_username": "elonmusk", "tweet_id": "1893710452812718080", "tweet_text": "This is a great thread, thanks for sharing.", "page_cursor": "990100", "next_cursor": "990200", "has_more": true, "handoff_format": "jsonl" } ``` Store rows in `xquik-extraction-results.jsonl` for queue replay, warehouse loads, or agent audits. Keep `page_cursor` and `next_cursor` so the job can resume from the last successful page. Each result contains user profile data. Tweet-based tools add tweet data. **Example response** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "990001", "xUserId": "44196397", "xUsername": "elonmusk", "xDisplayName": "Elon Musk", "xFollowersCount": 210500000, "xVerified": true, "xProfileImageUrl": "https://pbs.twimg.com/profile_images/el0n.jpg", "tweetId": "1893710452812718080", "tweetText": "This is a great thread, thanks for sharing.", "tweetCreatedAt": "2026-02-24T10:05:00.000Z", "createdAt": "2026-02-24T10:06:12.000Z" } ``` > [!NOTE] > > Every result includes `id`, `xUserId`, and `createdAt`. The API omits other fields when unavailable. It never sends `null`. Check that a field exists before reading it. ### Option B. Export as file Download results as CSV, JSON, XLSX, Markdown, PDF, or TXT. Available export rows include bios, locations, and engagement counts. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s "https://xquik.com/api/v1/extractions/77777/export?format=csv" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -o extraction-reply_extractor-77777.csv ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const extractionId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; const response = await fetch( `https://xquik.com/api/v1/extractions/${extractionId}/export?format=csv`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" } }, ); const blob = await response.blob(); // Save to file or process as needed ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} response = requests.get( f"https://xquik.com/api/v1/extractions/{extraction_id}/export", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"format": "csv"}, ) with open("extraction-reply_extractor-77777.csv", "wb") as f: f.write(response.content) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} req, _ := http.NewRequest("GET", "https://xquik.com/api/v1/extractions/77777/export?format=csv", nil) req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() file, _ := os.Create("extraction-reply_extractor-77777.csv") defer file.Close() io.Copy(file, resp.Body) ``` > [card] CSV > > `format=csv` returns `text/csv; charset=utf-8` for spreadsheets and data > pipelines. > [card] JSON > > `format=json` returns `application/json; charset=utf-8` for API clients and > programmatic processing. > [card] Markdown > > `format=md` returns `text/markdown; charset=utf-8` for documentation and > issue handoffs. > [card] Markdown document > > `format=md-document` returns `text/markdown; charset=utf-8` for longer > markdown documents. > [card] PDF > > `format=pdf` returns `application/pdf` for reports and sharing. Above > `10,000` rows it returns a ZIP of PDF parts. > [card] TXT > > `format=txt` returns `text/plain; charset=utf-8` for plain text and logs. > [card] XLSX > > `format=xlsx` returns > `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` for > Excel and formatted reports. > [!NOTE] > > Exports include every row. To process a large extraction as it arrives, page through the API. ## Next steps * [Extraction workflow](/guides/extraction-workflow) * [Extraction parameters](/api-reference/extractions/parameters) # Twitter scraper API extraction of tweets & followers Source: https://docs.xquik.com/guides/extraction-workflow Use the Twitter scraper API to scrape tweets, export follower and following profiles, collect reply authors, paginate JSON, and download CSV, JSON, or XLSX. > For the complete documentation index, see [llms.txt](/llms.txt). Run bulk data extractions from X in 5 stages. Check credits, estimate costs, run the job, retrieve JSON pages, and export files. This workflow scrapes tweets, exports followers, pulls tweet replies, saves files, or passes JSON. Files can be CSV, JSON, or XLSX. Paginated JSON can go to a CRM, warehouse, queue, or AI agent. Use `reply_extractor` for reply authors and `follower_explorer` for profiles. Jobs also cover posts, communities, lists, likes, reposts, quotes, and media. Retrieve structured JSON or export CSV, JSON, or XLSX files. Tweet search results can filter authors, dates, engagement, media, relationships, lists, and locations. ## Workflow overview | Extraction stage | Exact API call | Durable checkpoint | | - | - | - | | Check credits | `GET /account` | Available balance | | Estimate results | `POST /extractions/estimate` | `allowed`, `estimatedCost`, `estimatedResults`, `source` | | Start scraping | `POST /extractions` | `id`, `toolType`, `status` | | Retrieve rows | `GET /extractions/{id}` | `nextCursor` while `hasMore` is true | | Export a file | `GET /extractions/{id}/export` | Job ID, format, filename, destination | > [!NOTE] > > Treat `202 Accepted` as a queued run receipt. Xquik reserves credits after the job starts. Poll `GET /extractions/{id}` before handoff. The run can lower `resultsLimit` to the affordable count or fail with `insufficient_credits`. **1. Check credits** Verify that your available credit balance can cover the job. **2. Estimate cost** Preview the extraction cost before committing. Check whether it fits within your remaining budget. **3. Run the extraction** Submit the extraction job, store the `202 Accepted` receipt, then poll before handoff. **4. Retrieve results** Paginate through extracted data via the API. Or export it as CSV, JSON, XLSX, Markdown, PDF, or TXT. **5. Export files** Download a file when the next tool expects one. Formats are CSV, JSON, XLSX, Markdown, PDF, or TXT. ## End-to-end agent handoff Store one checkpoint per extraction run so another worker can resume without rereading logs. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "workflow": "reply_extractor_to_csv", "request": { "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500 }, "estimate": { "estimatedResults": 500, "creditsRequired": "500", "creditsAvailable": "77000", "allowed": true, "source": "replyCount" }, "create_receipt": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "running", "poll_path": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890" }, "json_pages": { "limit": 1000, "page_cursor": null, "next_cursor": "990200", "has_more": true }, "inventory_path": "/api/v1/extractions?status=completed&toolType=reply_extractor", "export_path": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=csv", "handoff_state": "poll_until_completed_then_export" } ``` > [card] Estimate checkpoint > > Store `estimatedResults`, `creditsRequired`, `creditsAvailable`, `allowed`, and `source` before creating the job. > [card] Create receipt > > Store the returned job `id`, `status`, and `poll_path`. Result rows arrive from `GET /extractions/{id}`. > [card] Cursor state > > Store `page_cursor`, `next_cursor`, and `has_more` for each JSON page so workers can resume pagination. > [card] File handoff > > Store `inventory_path` for later job lookup and `export_path` for the download. The download can be CSV, JSON, or XLSX. ## Step 1. Check credits Before running an extraction, call [`GET /account`](/api-reference/account/get) and store a small planning checkpoint. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s https://xquik.com/api/v1/account \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "checkpoint_type": "credit_check", "plan": "active", "credit_balance": "77000", "next_action": "estimate_extraction" } ``` Store `plan` for billing context. Use `creditInfo.balance` to decide whether to continue, top up, or lower `resultsLimit`. Decide before estimating the extraction. ## Step 2. Estimate cost Use the estimate endpoint first. It shows expected rows and credits without charging you. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions/estimate \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const estimate = await fetch("https://xquik.com/api/v1/extractions/estimate", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ toolType: "reply_extractor", targetTweetId: "1893704267862470862", }), }).then((r) => r.json()); if (!estimate.allowed) { throw new Error( `Insufficient credits: need ${estimate.creditsRequired}, have ${estimate.creditsAvailable}`, ); } console.log(`Estimated results: ${estimate.estimatedResults}`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} estimate = requests.post( "https://xquik.com/api/v1/extractions/estimate", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", }, ).json() if not estimate["allowed"]: raise Exception(f"Insufficient credits: need {estimate['creditsRequired']}, have {estimate['creditsAvailable']}") print(f"Estimated results: {estimate['estimatedResults']}") ``` **Response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "allowed": true, "creditsRequired": "150", "creditsAvailable": "77000", "estimatedResults": 150, "source": "replyCount", "resolvedXUserId": "44196397" } ``` The estimate reports these fields. * `allowed`, `creditsRequired`, and `creditsAvailable` show affordability and balance. * `source` and `estimatedResults` give the count basis and projected rows. * `resolvedXUserId` is the ID returned by count-based profile estimates. > [!WARNING] > > `allowed: false` means your balance cannot fund the full estimate. Add credits or lower `resultsLimit`. > [!TIP] > > `resultsLimit` defaults to `10,000` for estimates and jobs. Set any positive integer for a different bound. Billing follows unique emitted results. Source counts such as `followers` or `replyCount` can produce a smaller estimate. ## Step 3. Run the extraction Submit the job with the same parameters you used for the estimate. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} IDEMPOTENCY_KEY=$(uuidgen) curl -X POST https://xquik.com/api/v1/extractions \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: $IDEMPOTENCY_KEY" \ -H "Content-Type: application/json" \ -d '{ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862" }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const idempotencyKey = crypto.randomUUID(); const extraction = await fetch("https://xquik.com/api/v1/extractions", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": idempotencyKey, "Content-Type": "application/json", }, body: JSON.stringify({ toolType: "reply_extractor", targetTweetId: "1893704267862470862", }), }).then((r) => r.json()); console.log(`Job ${extraction.id}: ${extraction.status}`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from uuid import uuid4 extraction = requests.post( "https://xquik.com/api/v1/extractions", headers={"x-api-key": "xq_YOUR_KEY_HERE", "Idempotency-Key": str(uuid4())}, json={ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", }, ).json() print(f"Job {extraction['id']}: {extraction['status']}") ``` **Response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "pollAfterMs": 1000, "statusUrl": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890", "waitUrl": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890?wait=10&limit=1&outputMode=compact", "toolType": "reply_extractor", "status": "running" } ``` The endpoint returns `202 Accepted`. Save the key with the job ID. Reuse that key only after a timeout or lost response. An exact retry returns the original job with `Idempotency-Replayed: true`. A changed request returns `409`. A terminal replay sets `pollAfterMs` to `0` and omits `Retry-After`. ## Step 4. Retrieve results Follow `waitUrl` until terminal. Save row count, cursor, and format before result loading. ## Data handoff Pick the handoff that fits your pipeline, from durable JSON Lines to spreadsheets. See [extraction data handoff](/guides/extraction-data-handoff) for each pattern. ## Tool types reference This section groups the 23 extraction tools by target type. Each requires a specific target field. ### Tweet-based tools > [card] Reply authors > > Use `reply_extractor` with `targetTweetId` to extract users who replied to a > tweet. > [card] Repost authors > > Use `repost_extractor` with `targetTweetId` to extract users who reposted a > tweet. > [card] Quote authors > > Use `quote_extractor` with `targetTweetId` to extract users who quote-posted > a tweet. > [card] Like authors > > Use `favoriters` with `targetTweetId` to extract visible users who liked a > post. Liker identities can be unavailable even when the post reports likes. > The job reads through your connected X account. Without one, the job fails > with `errorMessage` set to `errorXAccountRequired`. > [card] Thread tweets > > Use `thread_extractor` with `targetTweetId` to extract all tweets in a > thread. > [card] Article content > > Use `article_extractor` with `targetTweetId` to extract article content from > a tweet. ### User-based tools > [card] Follower profiles > > Use `follower_explorer` with `targetUsername` to extract followers of an > account. > [card] Following profiles > > Use `following_explorer` with `targetUsername` to extract accounts followed > by a user. > [card] Verified followers > > Use `verified_follower_explorer` with `targetUsername` to extract verified > followers of an account. > [card] Mention tweets > > Use `mention_extractor` with `targetUsername` to extract tweets mentioning > an account. > [card] Account posts > > Use `post_extractor` with `targetUsername` to extract posts from an > account. > [card] Liked tweets > > Use `user_likes` with `targetUsername` to extract liked tweets that X makes visible. X shows likes only to their owner. The job reads through your connected X account. Without one, the job fails with `errorMessage` set to `errorXAccountRequired`. > [card] Media posts > > Use `user_media` with `targetUsername` to extract media posts from a user. > [card] Affiliates > > Use `user_affiliates` with `targetUsername` to extract the accounts an organization lists as its affiliates. ### Community tools > [card] Community members > > Use `community_extractor` with `targetCommunityId` to extract members. > [card] Community moderators > > Use `community_moderator_explorer` with `targetCommunityId` to extract moderators. > [card] Community posts > > Use `community_post_extractor` with `targetCommunityId` to extract posts. > [card] Search within a community > > Use `community_search` with `targetCommunityId` and `searchQuery` to filter Community posts. ### List tools > [card] List members > > Use `list_member_extractor` with `targetListId` to extract members. > [card] List tweets > > Use `list_post_extractor` with `targetListId` to extract tweets. > [card] List followers > > Use `list_follower_explorer` with `targetListId` to extract followers. ### Other tools > [card] People search > > Use `people_search` with `searchQuery` to find user profiles by keyword. > [card] Space participants > > Use `space_explorer` with `targetSpaceId` to extract participants of a > Space. > [card] Tweet search > > Use `tweet_search_extractor` with `searchQuery` to extract tweets by > keyword, hashtag, or structured filters. ### Search filters `tweet_search_extractor` accepts every filter below. `community_search` accepts language, dates, media, verified authors, native reposts, and the listed minimums. Omit unrequested filters. A minimum alone does not request `queryType=Top`. Use `advancedQuery` only for a known X (Twitter) search operator string. > [card] Account filters > > Use `fromUser` for author username and `toUser` for tweets directed to a > user. Use `mentioning` for tweets that mention a user. > [card] Date and language > > Use `language` for a language code such as `en`, `tr`, or `es`. Then bound > the export with `sinceDate` and `untilDate` in `YYYY-MM-DD` format. > [card] Media and engagement > > Use `mediaType` for `images`, `videos`, `gifs`, `media`, `links`, or `none`. > Set `minFaves`, `minRetweets`, `minReplies`, or `minQuotes`. > [card] Conversation filters > > Use `replies`, `retweets`, and `quotes` with `include`, `exclude`, or `only`. > Set `verifiedOnly` when only verified authors should match. > [card] Query refinement > > Combine `exactPhrase`, `excludeWords`, `anyWords`, `hashtags`, `cashtags`, > and `url` for terms, entities, or linked domains. > [card] Tweet relationships > > Use `conversationId`, `inReplyToTweetId`, `quotesOfTweetId`, or > `retweetsOfTweetId` for one conversation or source tweet. > [card] List and location scopes > > Use `listId`, `place`, `placeCountry`, `pointRadius`, or `boundingBox`. > These fields narrow search results to a list or location. > [card] Advanced query > > Use `advancedQuery` only for raw X (Twitter) search syntax. > Prefer the 30 structured fields when one already represents the filter. **Example.** Search for popular English tweets with images from the last week. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "toolType": "tweet_search_extractor", "searchQuery": "artificial intelligence", "language": "en", "mediaType": "images", "minFaves": 100, "sinceDate": "2026-03-06", "untilDate": "2026-03-13", "retweets": "exclude" }' | jq ``` > [!TIP] > > Combine filters with `resultsLimit` to narrow a search and cap its cost. For example, find the 50 top tweets about a topic from verified accounts. Limit them to the last 24 hours. ## Twitter scraper API questions ### What is a Twitter scraper API? A Twitter scraper API collects X posts and profiles through documented requests. Xquik creates a job, returns its ID, and exposes cursor-based JSON results. It can also generate downloadable files. This Twitter data scraper covers tweets, replies, followers, following, communities, and lists. It also covers spaces, likes, reposts, quotes, and media posts. ### Can Python scrape Twitter without the official API? Yes, through Xquik's REST API and the Python examples above. API access still requires an [Xquik API key](/x-api-quickstart). You do not need to maintain an X developer application. Poll the job, follow every cursor, and save structured tweet or profile rows. ### How do I export Twitter followers? Run `follower_explorer` with the Twitter account username in `targetUsername`. This Twitter follower scraper returns visible follower profiles. Estimate the job before creating it. Then poll every JSON page or download a file. The follower export API keeps each Twitter profile ID, username, counts, and verification. It also keeps names when available. ### How do I export tweet replies? Use `reply_extractor` with `targetTweetId` for visible reply-author profiles. Use `tweet_search_extractor` when the reply posts themselves matter. Pass `inReplyToTweetId` to restrict results to one source tweet. A tweet replies export can use CSV, JSON, XLSX, or paginated JSON. Store the source tweet ID, extraction ID, row IDs, and cursor checkpoint. ### Why use a Twitter scrape API instead of a custom web scraper? A custom web scraper must maintain selectors, login behavior, retries, and parsers. A Twitter scrape API uses documented requests, statuses, cursors, and output fields. ## MCP equivalent The same workflow works through the MCP server using the `execute` sandbox tool. > [card] Check account > > The REST route is `GET /account`. In MCP, call > `xquik.request('/api/v1/account')` to confirm account state, credits, and > usage before a run. > [card] Estimate extraction > > The REST route is `POST /extractions/estimate`. In MCP, call > `xquik.request('/api/v1/extractions/estimate', { method: 'POST', body })` > with the same body you plan to run. > [card] Start extraction > > The REST route is `POST /extractions`. In MCP, call > `xquik.request('/api/v1/extractions', { method: 'POST', body })` to create > the background job. > [card] Poll results > > The REST route is `GET /extractions/{id}`. In MCP, call > `xquik.request('/api/v1/extractions/ID')` to retrieve the job status and > rows. **Example prompts for AI agents.** * "How much would it cost to extract all followers of @elonmusk?" * "Extract visible replies to the tweet at `https://x.com/vercel/status/1893704267862470862`" * "Show me the results of my last extraction." > [!NOTE] > > File export (`GET /extractions/{id}/export`) is only available via the REST API. The MCP server returns results as structured JSON via `xquik.request()`. ## Error handling > [card] Resolve billing access > > A `402` means the account cannot fund this extraction. Check the available > balance and `payment_options`. You need no active plan when enough > credits remain. > [card] Top up credits > > `402 insufficient_credits` means the account cannot cover the requested > extraction. Top up credits, wait for the next grant, or lower `resultsLimit`. > [card] Fix toolType > > `400 invalid_tool_type` means `toolType` is not one of the supported > extraction tools. Check the [tool types](#tool-types-reference) reference. > [card] Fix required fields > > `400 invalid_input` usually means the target field is missing or malformed. > Match `targetTweetId`, `targetUsername`, `targetCommunityId`, > `targetListId`, `targetSpaceId`, or `searchQuery` to the selected tool. > [card] Retry read service > > `502 x_api_unavailable` means the read service is temporarily unavailable. > Retry with exponential backoff, then contact support if the error persists. ## Next steps > [card] [Create extraction](/api-reference/extractions/create) > > Full API reference with request and response schemas. > [card] [Estimate extraction](/api-reference/extractions/twitter-scraping-cost-estimator) > > Cost estimation endpoint reference. > [card] [Export extraction](/api-reference/extractions/export) > > CSV, XLSX, and Markdown export with column details. > [card] [Billing & usage](/guides/billing) > > Pricing, credits, and usage scenarios. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) # Twitter follower scraper to export Twitter followers Source: https://docs.xquik.com/guides/follower-export-crm Download a Twitter follower list with usernames, profile URLs, bios, counts, and verification. Export CSV, XLSX, or JSON rows for CRM and warehouse imports. > For the complete documentation index, see [llms.txt](/llms.txt). Download a Twitter follower list as CSV, XLSX, or JSON. Keep each Twitter profile ID, username, bio, verification status, image, and audience count. Import the follower rows into a CRM, spreadsheet, queue, or warehouse. ## Twitter follower export questions ### Download follower list X (Twitter) Run `follower_explorer` when you need a saved follower export. Use it as a Twitter follower tracker for repeatable account snapshots. To run it without code, open the [Twitter follower tracker](https://xquik.com/en/twitter-follower-tracker). For an alert on each new or lost follower, use an [account monitor](/api-reference/monitors/create). Estimate credits before starting. Keep the source username and resolved user ID while polling the job to completion. > [accordion] File formats & follower fields > > Download CSV for CRM lists or spreadsheet imports. Choose > XLSX for analyst review and JSON for queues. Use the user ID as each stored > profile's deduplication key. > Keep follower counts, following counts, verification, collection time, and the > applied result limit. Mark any interrupted export as bounded. ### Export Twitter followers API Use `POST /api/v1/extractions` for a saved follower export. Supply the public username and `follower_explorer`. A defined `resultsLimit` bounds each large export. Use `GET /api/v1/x/users/{id}/followers` for current profile pages. That route returns `users`, `has_next_page`, and `next_cursor`. > [accordion] Cursor, API key & rate-limit rules > > Treat `next_cursor` as opaque. Store every follower page before saving its > cursor. Scope API access to the worker that owns each cursor. Keep the API key > outside exported lists. Handle each documented rate limit and error status. > Use the user ID to deduplicate retries. Store a timestamp for each collected > follower page in its UTC collection record. ### What API can I use to get someone's Twitter followers? Resolve the public profile's stable ID before calling the [live Followers API contract](https://docs.xquik.com/api-reference/x/followers). Use `follower_explorer` for a saved export or list. > [accordion] Public profile boundaries > > A private account does not make its followers public. Confirm the Twitter > profile is public before requesting follower pages. A missing page does not > prove that a profile is private. Save each username, stable ID, and cursor. > Record when you collected each page. Request another page only after the > current profiles become durable. Respect API key scope, credits, and every > returned rate limit. ### How do I export all followers of a Twitter account? Estimate the public profile first. Confirm credits and set `resultsLimit` before creating the follower export. Poll the job until completion or failure. Save each returned list page before its cursor. > [accordion] Completeness & reconciliation > > Deduplicate profiles by stable user ID after retries. > Call the result a full list only when pagination ends normally. > Label exports with fewer profiles as bounded. Record the source > username, first cursor, final cursor, unique row count, and completion time. > Follower totals may change during collection. ### Twitter followers scraper Choose the saved Twitter followers scraper for estimates and reusable files. Use it as a Twitter follower tracker for repeatable account snapshots. Choose the live follower API for low-latency profile pages. > [accordion] Returned profile fields > > Each Twitter profile includes a user ID and username. It may include a bio and > verification. It may also include follower counts, following counts, location, > and profile images. Keep every API key scoped. Respect the read rate limit. > Store cursors with their source profile. > Never restart pagination under another username. ### How can I scrape Twitter followers for a specific account? Supply one public username to `follower_explorer`. Estimate credits, create one job, and poll its returned ID. Export completed follower rows as CSV, JSON, or XLSX. > [accordion] Specific account checkpoints > > Use the live API for current profile pages. Store each > list before its opaque cursor. Use numeric user IDs to deduplicate retries. > Store the mutable username, bio, follower count, following count, and > verification. Stop at a documented limit. Never infer private followers from > an incomplete page. > The final checkpoint records when the export completed. ### Export list of Twitter followers to CSV or Excel Use `follower_explorer` when exporting a Twitter follower list. Choose CSV for CRM imports and Excel-compatible XLSX for analyst review. Choose JSON for queue, warehouse, or application ingestion. > [accordion] CSV, Excel & CRM mapping > > Map `User ID` to the CRM's unique profile field. > Keep username, follower count, following count, verification, and bio as > mutable values. Store the source account and extraction ID. Record every row > cap in the file's import record. Save rejected import rows. Paginated JSON > supports custom jobs that process large follower lists. ### Can I export Twitter followers to a spreadsheet automatically? Schedule estimate, create, poll, and export steps with an SDK or CLI. A no-code workflow must store the extraction ID. Use the [n8n workflow guide](https://docs.xquik.com/guides/n8n) for scheduled follower exports. > [accordion] Spreadsheet automation safety > > Download CSV or XLSX for review. Keep each > API key outside spreadsheet cells. Handle every returned rate limit. Never > duplicate an uncertain create request. Store the source username, user ID, > cursor, row cap, output path, and import result. Never assume a free tier. ### Can I scrape Twitter followers with Python scripts? Use Python `requests` with documented Xquik follower endpoints. Call the live API when the script can store every opaque cursor. Call extraction routes for saved CSV, JSON, or XLSX exports. > [accordion] Python error & output handling > > Browser web scrapers may need cookies. Xquik operates independently from every > official API documented by X. The official X (Twitter) API and Xquik use separate > contracts. Keep the API key outside source files. > Check `402`, `424`, `429`, and `502` before retrying. Normalize each profile by > its stable numeric ID. Write one follower per JSON Lines record. Store the > username, list source, and UTC collection value. ### What are the risks of Twitter follower scraping tools? Risks include partial follower pages, duplicate profiles, and exposed API keys. A repeated cursor can leave the follower list incomplete. Scraped data represents public follower profiles within the requested page boundaries. > [accordion] Follower scraper risk controls > > Never infer consent from a bio. Private accounts do not expose follower lists. > Do not infer inactive > accounts from missing pages or unchanged follower counts. > Store each user ID beside its > mutable username. Mark rate-limit, credit, or result boundaries. Review export > columns before every CRM import. ### How do I get public follower lists responsibly? Public data includes documented profile fields from the requested public accounts. Keep only fields needed by the export's social media workflow. Review the [X Terms of Service](https://x.com/en/tos) at `https://x.com`. > [accordion] Responsible export checklist > > Follow applicable laws, retention rules, and deletion requests. Restrict API > access and every follower export to its intended reviewers. Store the source > profile, user ID, username, cursor, > collection time, and documented boundary. This technical guide is not legal > advice. Xquik is an independent third-party service. Not affiliated with X > Corp. "Twitter" and "X" are trademarks of X Corp. ### Can I download my own X (Twitter) archive instead? X calls its signed-in setting Download an archive of your data. Follow the [official X (Twitter) archive instructions](https://help.x.com/en/managing-your-account/how-to-download-your-x-archive) to create your account backup. > [accordion] X archive vs. follower export > > The ZIP can include profile details, posts, media, followers, following, and > Lists. It contains HTML and JSON, not a cursor-based > API or CRM-ready CSV export. Use Xquik for repeatable public follower exports > with defined row limits. Keep the source user ID and username. Private archives > remain available only to their account owners. Record each downstream file's > source. ## Outcome > [card] 1. Estimate > > Call `POST /extractions/estimate` with `follower_explorer` to check credits and projected row count. > [card] 2. Extract > > Call `POST /extractions` with `targetUsername` and optional `resultsLimit` to start the async job. > [card] 3. Retrieve > > Call `GET /extractions/{id}` when a custom pipeline needs paginated JSON rows. > [card] 4. Export > > Call `GET /extractions/{id}/export?format=csv`, `format=json`, or `format=xlsx` for CRM files. The endpoint also supports `md`, `md-document`, `pdf`, and `txt`. > Exports are free and include every row. A PDF above 10,000 rows comes as a ZIP of > PDF parts. > [card] 5. Import > > Map `User ID` to a CRM unique field for imports, upserts, segments, or warehouse loads. ## Choose the right path > [card] Saved follower export > > For reusable job IDs, cost previews, and CSV, JSON, or XLSX files, call `POST /extractions/estimate`. Then call `POST /extractions` with `follower_explorer`. > [card] Paginated saved rows > > Use `GET /extractions/{id}?limit=1000&cursor={nextCursor}` for saved JSON pages. > [card] Live follower page > > Use `GET /x/users/{id}/followers?pageSize=200&cursor={next_cursor}` when you need the current follower page without creating an extraction job. > Use it for a CRM enrichment job, queue worker, audience sync, or agent. > [card] Shell or SDK handoff > > Some scheduled imports need code-owned JSON Lines, CSV, or XLSX files. For those, use [CLI](/sdks/cli), [TypeScript](/sdks/typescript), [Python](/sdks/python), or [Go SDK](/sdks/go). ## End-to-end follower export handoff ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "workflow": "follower_export_crm", "request": { "toolType": "follower_explorer", "targetUsername": "elonmusk", "resultsLimit": 10000 }, "estimate": { "estimatedResults": 10000, "creditsRequired": "10000", "creditsAvailable": "77000", "allowed": true, "source": "resultsLimit", "resolvedXUserId": "44196397" }, "create_receipt": { "id": "77777", "toolType": "follower_explorer", "status": "running", "poll_path": "/api/v1/extractions/77777" }, "json_pages": { "limit": 1000, "page_cursor": null, "next_cursor": "1001", "has_more": true }, "export_paths": { "csv": "/api/v1/extractions/77777/export?format=csv", "json": "/api/v1/extractions/77777/export?format=json", "xlsx": "/api/v1/extractions/77777/export?format=xlsx" }, "normalized_row": { "x_user_id": "44196397", "x_username": "username", "display_name": "Xquik", "followers_count": 2400, "verified": true, "profile_image_url": "https://pbs.twimg.com/profile_images/xquik.jpg", "bio": "X automation platform", "location": "San Francisco", "account_created_at": "2021-03-01T12:00:00.000Z" }, "crm_import": { "unique_field": "x_user_id", "upsert_mode": "external_id", "file_format": "csv", "file_path": "x-followers-elonmusk.csv" }, "handoff_state": "poll_until_completed_then_export" } ``` > [card] Estimate checkpoint > > Keep `estimatedResults`, `creditsRequired`, `creditsAvailable`, `allowed`, > `source`, and `resolvedXUserId`. `source` is `followers` unless > `resultsLimit` is lower than the follower count. > When the account has fewer followers than `resultsLimit`, the estimate keeps `source: "followers"`. In that case it uses the smaller follower count. > [card] Job checkpoint > > Store the returned job `id`, `status`, and `poll_path`. Do not expect follower rows in the create response. > Store `extractionHandoff` in your job table. Poll by `extraction_id`. Keep > `source_username` and `results_limit` for audit. > [card] Cursor checkpoint > > Every result guarantees `id` and `xUserId`. The API omits optional profile and enrichment fields when absent. Use `limit` up to `1000`. > Pass `nextCursor` as `cursor` until `hasMore` becomes `false`. > [card] CRM checkpoint > > Map `xUserId` to `x_user_id`. Store CSV, JSON, or XLSX `export_paths` and the CRM `unique_field`. > Use the local `-o` path, `exportFilePath`, or `export_file_path` as the durable handoff value. ### Live follower page handoff ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/44196397/followers?pageSize=200&cursor=DAACCgACGRElMJcAAA" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` > [card] Page checkpoint > > The response returns `users`, `has_next_page`, and `next_cursor`. Treat > `next_cursor` as opaque. Never treat `cursor` as a stable follower ID. > [card] Identity > > Map `users[].id` to `x_user_id`, `users[].username` to `x_username`, and `users[].name` to `display_name`. > [card] Audience fields > > Map optional `followers`, `following`, `statusesCount`, `verified`, and `verifiedType` for scoring or segments. > [card] Profile context > > Map optional `description`, `location`, `url`, `profilePicture`, and > `coverPicture`. Map `users[].createdAt` to `account_created_at` when returned. > [card] Credit-aware pages > > Automatic `pageSize` accepts `20` to `10000`. Standard accepts `20` to `200`. > Credits can reduce the returned row count. Zero affordable results return > `402 insufficient_credits`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "job": "direct_follower_page", "source_x_user_id": "44196397", "page_size_requested": 200, "rows_returned": 200, "cursor_used": "DAACCgACGRElMJcAAA", "next_cursor": "DAACCgACGE...", "has_next_page": true, "fetched_at": "2026-05-16T16:50:00.000Z", "page_checkpoint": "44196397:DAACCgACGE..." } ``` ## Step 1. Estimate cost ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions/estimate \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "toolType": "follower_explorer", "targetUsername": "elonmusk", "resultsLimit": 10000 }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const estimate = await fetch("https://xquik.com/api/v1/extractions/estimate", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ toolType: "follower_explorer", targetUsername: "elonmusk", resultsLimit: 10000, }), }).then((response) => response.json()); if (!estimate.allowed) { throw new Error(`Need ${estimate.creditsRequired} credits, have ${estimate.creditsAvailable}`); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests estimate = requests.post( "https://xquik.com/api/v1/extractions/estimate", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, json={ "toolType": "follower_explorer", "targetUsername": "elonmusk", "resultsLimit": 10000, }, ).json() if not estimate["allowed"]: raise RuntimeError( f"Need {estimate['creditsRequired']} credits, have {estimate['creditsAvailable']}" ) ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "allowed": true, "creditsRequired": "10000", "creditsAvailable": "77000", "estimatedResults": 10000, "source": "resultsLimit", "resolvedXUserId": "44196397" } ``` ## Step 2. Start the extraction ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "toolType": "follower_explorer", "targetUsername": "elonmusk", "resultsLimit": 10000 }' | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const job = await fetch("https://xquik.com/api/v1/extractions", { method: "POST", headers: { "x-api-key": "xq_YOUR_KEY_HERE", "Content-Type": "application/json", }, body: JSON.stringify({ toolType: "follower_explorer", targetUsername: "elonmusk", resultsLimit: 10000, }), }).then((response) => response.json()); const extractionHandoff = { extraction_id: job.id, status: job.status, source_username: "elonmusk", results_limit: 10000, handoff_created_at: new Date().toISOString(), }; ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "77777", "toolType": "follower_explorer", "status": "running" } ``` ## Step 3. Poll until complete ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s "https://xquik.com/api/v1/extractions/77777?limit=1000" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ### Paginated JSON handoff ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "job": { "id": "77777", "toolType": "follower_explorer", "status": "completed", "totalResults": 10000, "targetUsername": "elonmusk", "createdAt": "2026-05-08T13:46:00.000Z", "completedAt": "2026-05-08T13:51:00.000Z" }, "results": [ { "id": "1001", "xUserId": "44196397", "xUsername": "username", "xDisplayName": "Xquik", "xFollowersCount": 2400, "xVerified": true, "xProfileImageUrl": "https://pbs.twimg.com/profile_images/xquik.jpg", "enrichmentData": { "user": { "followingCount": 120, "statusesCount": 830, "description": "X automation platform", "location": "San Francisco", "coverPicture": "https://pbs.twimg.com/profile_banners/xquik" }, "tweet": {} }, "createdAt": "2026-05-08T13:51:00.000Z" } ], "hasMore": true, "nextCursor": "1001" } ``` Normalize each follower row before sending it downstream. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "job": "follower_export", "source_username": "elonmusk", "result_id": "1001", "x_user_id": "44196397", "x_username": "username", "display_name": "Xquik", "followers_count": 2400, "verified": true, "profile_image_url": "https://pbs.twimg.com/profile_images/xquik.jpg", "bio": "X automation platform", "location": "San Francisco", "handoff_format": "json" } ``` ## Step 4. Export Twitter follower list in CSV format ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s "https://xquik.com/api/v1/extractions/77777/export?format=csv" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -o x-followers-elonmusk.csv ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { writeFile } from "node:fs/promises"; const extractionId = "77777"; const exportFilePath = "x-followers-elonmusk.csv"; const response = await fetch( `https://xquik.com/api/v1/extractions/${extractionId}/export?format=csv`, { headers: { "x-api-key": "xq_YOUR_KEY_HERE" } }, ); if (!response.ok) { throw new Error(`Export failed with ${response.status}`); } const bytes = Buffer.from(await response.arrayBuffer()); await writeFile(exportFilePath, bytes); const exportHandoff = { extraction_id: extractionId, source_username: "elonmusk", export_format: "csv", export_file_path: exportFilePath, content_disposition: response.headers.get("Content-Disposition") ?? "", handoff_created_at: new Date().toISOString(), }; ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} extraction_id = "77777" export_file_path = "x-followers-elonmusk.csv" response = requests.get( f"https://xquik.com/api/v1/extractions/{extraction_id}/export", headers={"x-api-key": "xq_YOUR_KEY_HERE"}, params={"format": "csv"}, ) response.raise_for_status() with open(export_file_path, "wb") as file: file.write(response.content) ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "job": "follower_export_file", "extraction_id": "77777", "source_username": "elonmusk", "export_format": "csv", "export_file_path": "x-followers-elonmusk.csv", "handoff_format": "file" } ``` ## CRM field mapping > [card] Stable account key > > Map export column `User ID` to `x_user_id` as the custom unique field. Use it for CRM upserts because it is the stable X account identifier. > [card] Handle and display name > > Map `Username` to `x_username` or a social profile field. Map `Display Name` to `display_name` for triage and human review. > [card] Audience metrics > > Map `Followers` to `followers_count`, `Following` to `following_count`, and `Posts` to `posts_count`. Use these counts for segmentation, scoring, and reporting. > [card] Verification flag > > Map `Verified` to `verified`. With it, lead scoring, audience filters, and reviewer queues can separate verified accounts. > [card] Profile context > > Map `Description` to a bio or notes field. Map `Location` to a regional field. Treat both as mutable enrichment, not identity. > [card] Profile media > > Map `Profile Image` to an avatar URL field and `Cover Picture` to a banner URL field. Use both in internal views that show account context. ## Import and upsert rules > [card] [HubSpot import docs](https://knowledge.hubspot.com/import-and-export/set-up-your-import-file) > > Check file requirements, unique identifier rules, and supported spreadsheet formats before importing. > [card] [Salesforce Bulk API 2.0](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_intro.htm) > > For large contact or lead datasets, use CSV upserts with an external ID field. ## Automation handoff Use this handoff when the export runs on a schedule. 1. Store the Xquik extraction ID and source username in your job table. 2. Poll `GET /extractions/{id}` until the API returns `completed`. 3. Download `format=json` for code pipelines or `format=csv` for CRM import tools. 4. Upsert by `x_user_id`, not by display name or username. 5. For audit, save the Xquik job ID, export format, and export file path. Also save the row count and import result. 6. For JSON Lines, write one normalized follower object per line to `xquik-follower-export.jsonl`. ## Related > [card] [Extraction workflow](/guides/extraction-workflow) > > Estimate costs, run jobs, paginate results, and export files. > [card] [Followers API](/api-reference/x/followers) > > Fetch one live follower page with `users`, `has_next_page`, and `next_cursor`. > [card] [n8n guide](/guides/n8n) > > Send extraction rows into Sheets, Slack, and downstream automation. > [card] [Rate limits](/guides/rate-limits) > > Apply read rate limits to direct follower pages and retry `429` responses. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) # X API glossary for tweets, followers & webhooks Source: https://docs.xquik.com/guides/glossary Use this X API glossary to define tweets, replies, reposts, followers, profiles, media, cursors, monitors, webhooks, extractions, credits, and errors. > For the complete documentation index, see [llms.txt](/llms.txt). Use this X API glossary while reading Xquik API responses and guides. It defines concrete tweet, profile, follower, monitor, webhook, and billing terms. X calls its content objects posts. Xquik keeps `tweet` in public route names. This keeps familiar X (Twitter) API terms and existing client integrations. > [!NOTE] > > Treat IDs and cursors as strings. Treat counts as collection-time snapshots. > Treat optional fields as absent unless the response supplies them. ## Quick X API terminology | Term | Short definition | Primary reference | | - | - | - | | Tweet or post | One X content object with text and optional media. | [Get tweet](/api-reference/x/get-tweet) | | Reply | A tweet linked to a direct parent and conversation. | [Tweet replies](/api-reference/x/tweet-replies) | | Quote tweet | A new tweet that embeds another tweet. | [Tweet quotes](/api-reference/x/tweet-quotes) | | Repost or retweet | A redistribution of an existing tweet. | [Retweeters](/api-reference/x/retweeters) | | Profile | An X account's identity, biography, audience, and status fields. | [Get user](/api-reference/x/twitter-profile-lookup) | | Followers | Accounts that follow the source profile. | [Followers](/api-reference/x/followers) | | Following | Accounts the source profile follows. | [Following](/api-reference/x/following) | | Cursor | An opaque token for the next result page. | [Request-efficient usage](/guides/request-efficient-api-usage#store-cursor-checkpoints) | | Extraction | A durable tweet, reply, profile, or audience export job. | [Extraction workflow](/guides/extraction-workflow) | | Monitor | A recurring account, keyword, or post check. | [Create monitor](/api-reference/monitors/create) | | Event | A stored post, profile, or follow change found by a monitor. | [List events](/api-reference/events/list) | | Webhook | A signed HTTP callback containing one monitor event. | [Webhooks](/webhooks/overview) | | Write action | A connected-account operation that changes X state. | [Create tweet](/api-reference/x-write/create-tweet) | | Credit | The shared metered unit used by Xquik operations. | [Pricing & billing](/guides/billing) | | Rate limit | A request-frequency boundary for one account bucket. | [Rate limits](/guides/rate-limits) | ## Tweet, reply & media terms > [accordion] Tweet or post > > One content object published on X. Xquik routes use the word `tweet`. > A tweet can contain text, media, links, mentions, hashtags, or polls. > Store its `id` as a string. See the > [tweet field guide](/guides/tweet-profile-api-fields#tweet-fields). > [accordion] Tweet ID > > The stable string identifier for one tweet. A status URL usually ends with > `/status/{tweetId}`. Use the ID for joins, deduplication, replies, quotes, likes, > reposts, and media lookups. Never store it as a JavaScript number. > [accordion] Reply > > A tweet written in response to another tweet. `inReplyToId` identifies the > direct parent. `conversationId` identifies the root conversation. A reply > remains its own tweet with its own author and engagement counts. > [accordion] Quote tweet > > A new tweet that adds text while referencing another tweet. The outer tweet > owns the quote text. `quoted_tweet` contains the referenced tweet when > available. Keep both tweet IDs and metric snapshots separate. > [accordion] Repost or retweet > > A redistribution of an existing tweet. X now uses the term repost. > Xquik retains `retweet` in route and field names for compatibility. > `retweeted_tweet` contains original tweet context when available. > [accordion] Thread and conversation > > A thread is a connected sequence of tweets and replies. Use > `conversationId` to group a conversation. Use `inReplyToId` to keep > each direct parent edge. Do not infer reply order from IDs alone. > [accordion] Mention > > A reference to an X (Twitter) username inside tweet text. Mentions can appear in > parsed `entities` and monitor events. A mention does not prove a reply, > follow, endorsement, or conversation relationship. > [accordion] Hashtag and cashtag > > A hashtag begins with `#`. A cashtag begins with `$`. > Both can appear inside tweet entities and search queries. > Keep the original token before applying lowercase normalization. > [accordion] Entities > > Parsed tweet markers for URLs, mentions, hashtags, and related tokens. > Entity arrays are conditional. Keep the original tweet text beside > extracted tokens. See the > [official X (Twitter) data dictionary](https://docs.x.com/x-api/fundamentals/data-dictionary) > for X's own object terms. > [accordion] Media > > An image, video, or animated GIF attached to a tweet or message. > Xquik can return media URLs, types, dimensions, preview images, variants, > alt text, and identifiers. Availability depends on the returned object. > [accordion] Engagement counts > > Numeric snapshots for likes, replies, reposts, quotes, views, and bookmarks. > Counts can change after collection. Store `collected_at` with every metrics > snapshot. A missing count does not mean 0. > [accordion] Note tweet and X article > > A Note Tweet carries long-form tweet content and metadata. An X Article is > a separate long-form object referenced from a tweet. Keep returned > nested objects instead of flattening their text into one field. ## Profile, follower & audience terms > [accordion] X user or profile > > The account object behind a username. Core fields include `id`, `username`, > and `name`. Optional fields can include a biography, images, verification, > and location. They can also include followers, following, activity counts, > and availability state. > [accordion] User ID > > The stable string identifier for one X account. Prefer it for database joins. > A username can change. A user ID remains the stronger profile key. > [accordion] Username or handle > > The public account name used after `@`. Xquik accepts usernames with or > without a leading `@` on supported routes. Store the returned user ID too. > [accordion] Followers > > Accounts that follow the source profile. `GET /x/users/{id}/followers` > returns follower profiles and cursor state. A follower snapshot can change > after collection. Store the source user ID and collection time. > [accordion] Following > > Accounts the source profile follows. `GET /x/users/{id}/following` returns > those profiles. Following is directional. It does not prove mutual follow. > [accordion] Follower relationship > > A directional edge between 2 X accounts. Use > [`GET /x/followers/check`](/api-reference/x/check-follower) when one current > relationship matters. Use follower or following pages for audience exports. > [accordion] Protected profile > > An account whose posts have restricted visibility. A public profile lookup > can still return limited metadata. A response can mark an account protected > or unavailable. In that case, do not claim complete tweet or follower > coverage. > [accordion] Timeline > > An ordered page of tweets. A user timeline contains one profile's tweets. > A home timeline reflects the connected account's feed. Save each returned > cursor before requesting the next page. > [accordion] Community > > An X group with members, moderators, rules, and a community tweet timeline. > Xquik exposes community details, members, moderators, tweets, and search. > [accordion] List > > A curated X account collection. List members belong to the collection. > List followers follow the list itself. These are different profile sets. > [accordion] Direct message > > A private message between X accounts. DM history and writes require a > connected X account. Store message IDs, participant IDs, timestamps, and > returned media references. ## Twitter scraper API & export terms > [accordion] Twitter scraper API > > An API that retrieves tweets, replies, profiles, followers, or following as > structured responses. It also retrieves timelines, communities, lists, or > media that way. > Xquik exposes these reads through REST, SDKs, MCP, and Actors. > [accordion] Tweet search > > A query over recent or top tweets. Search can use keywords, hashtags, > authors, dates, media filters, language, and engagement filters. > Keep the exact query and filters across cursor pages. > [accordion] Page > > One bounded response from a list endpoint. A requested page size is an > upper bound. Fewer rows do not prove pagination finished. Check the returned > continuation flag and cursor. > [accordion] Cursor-based pagination > > Pagination using opaque cursor tokens instead of page numbers. For X reads, > pass `next_cursor` back as `cursor`. Events, draws, and extractions use > `cursor`. Radar uses `after`. Drafts use `afterCursor`. Never decode or modify a cursor. > [accordion] Batch lookup > > One request containing multiple tweet or profile IDs. Batch routes reduce > repeated HTTP calls. Each returned object still needs its own ID-based > validation and error handling. > [accordion] Extraction > > A durable job for collecting and saving tweet, reply, profile, follower, or > following results. It also collects and saves community, list, media, or > article results. Store the extraction ID. Poll status before retrieving JSON > pages or file exports. > [accordion] Export > > A saved CSV, JSON, or XLSX representation of extraction results. > Direct API pages can also feed JSONL or database rows. Record the query, > final cursor, row count, format, and completion state. > [accordion] Snapshot > > A collection-time view of profiles, relationships, or engagement counts. > Followers, following, biographies, and tweet metrics can change later. > Store collection timestamps before comparing 2 snapshots. > [accordion] Deduplication > > Removing repeated objects with a stable ID. Deduplicate tweets by tweet ID. > Deduplicate profiles by user ID. Keep the newest complete optional fields when > merging repeated pages or overlapping date windows. ## Monitor, event & webhook terms > [accordion] Monitor > > A recurring account, keyword, or post check. Monitor slots are unlimited. > Account and keyword monitors check every second. Post monitors read their > post every 2 to 4 seconds. Each active monitor costs 30 credits per hour. > Account monitors track one username. Keyword monitors track a search query. > Post monitors track one post. > [accordion] Monitor event > > A stored change found by a monitor. Account monitors support 30 event > types. They cover posts, profile changes, deleted posts, lives, and follows. > They also cover new and lost followers, plus follower and following counts. > Keyword monitors support the 10 `tweet.*` types. Post monitors support 10 > `post.*` types. > [accordion] Tweet event > > A monitor signal such as `tweet.new`, `tweet.reply`, `tweet.quote`, > `tweet.retweet`, `tweet.media`, `tweet.link`, or `tweet.poll`. > Subscribe only to types your receiver handles. > [accordion] Profile event > > A detected profile change. Events cover names, usernames, biographies, > locations, URLs, avatars, and banners. They also cover verification, > protection, pinned tweets, and availability. Keyword monitors do not accept > profile event types. > [accordion] Webhook > > An HTTPS callback for one monitor event. Xquik signs webhook requests with > HMAC-SHA256. Verify `X-Xquik-Signature` and `X-Xquik-Timestamp` before > processing the JSON body. > [accordion] Delivery ID > > The identifier for one webhook delivery attempt sequence. Store > `deliveryId` for receiver deduplication. Repeated delivery attempts must not create > repeated tickets, alerts, or warehouse rows. > [accordion] Stream event ID > > The stable ID of the stored monitor event behind a webhook payload. > When reconciling webhook delivery with stored monitor events, use > `streamEventId`. Join it to the events API. > [accordion] Webhook replay and reconciliation > > Replay means processing a previously stored event again. Reconciliation > compares webhook receipts with the events API. Use event IDs, delivery IDs, > and cursors to find missing or duplicate work. > [accordion] Draw > > A giveaway winner selection from one tweet's eligible participants. > Draws can filter replies, follower counts, account age, reposts, and > following. They can also filter language, keywords, hashtags, and mentions. > Results include an audit page. ## X write & authentication terms > [accordion] Connected X account > > An X account authorized for private reads or write actions. Public tweet, > profile, follower, reply, community, and list reads need no connected > account. Tweets, likes, follows, DMs, and profile changes require one. > [accordion] Write action > > An operation that changes X state. Examples include creating or deleting > tweets, liking, reposting, following, sending DMs, and updating profiles. > Write costs vary by operation and media size. > [accordion] Durable action > > The stored lifecycle record for an X write. It records request identity, > target, billing, status, retry safety, and next action. Store the returned > durable action before starting another write. > [accordion] Idempotency key > > A unique request key that prevents accidental duplicate write submission. > Reuse the key only for the identical request. Use a new key only when the > durable action says `safeToRetry` is `true`. > [accordion] statusUrl, terminal, and safeToRetry > > `statusUrl` identifies the durable action to poll. `terminal` shows whether > processing ended. `safeToRetry` shows whether another submission is safe. > Poll an active action instead of resending it. > [accordion] API key > > Authentication credential passed via the `x-api-key` header. > Account keys also support Bearer authentication. > Generate account keys from the > [API Keys dashboard](https://dashboard.xquik.com/en/api-keys) > or the session-authenticated > [API keys endpoint](/api-reference/api-keys/create). > [accordion] OAuth 2.1 > > Scoped authorization for account access without sharing an API key. > Xquik uses S256 PKCE for authorization-code flows. Keep granted scopes. > Use refresh-token grants only through the documented OAuth endpoints. > [accordion] OpenAPI contract > > The machine-readable specification for public routes, parameters, schemas, > responses, and examples. Use `https://docs.xquik.com/openapi.yaml` as the > public REST contract. Never infer undocumented response statuses. > [accordion] Normalized response contract > > An opt-in response shape selected with > `xquik-api-contract: 2026-04-29`. It uses snake-case envelopes, prefixed > resource IDs, structured errors, and normalized pagination fields. ## Billing, error & rate-limit terms > [accordion] Credits > > The metered unit for API usage. Costs depend on the operation, returned > results, and active monitor hours. They also depend on write type and media > size. > Subscription grants, top-ups, and automatic top-ups add credits to one shared balance. > Unused credits carry over until you spend them. > [accordion] Metered > > An operation that deducts credits. Billed tweet, profile, follower, reply, > and timeline work can be metered. Billed extraction, draw, media, write, and > active-monitor work can also be metered. Check each route's cost callout > before running it. > [accordion] Non-metered > > An operation that consumes no credits. Stored monitor management, stored > event reads, and webhook operations cost no credits. Saved extraction reads, > exports, account status, and API-key management also cost no credits. Active > monitors bill hourly. > [accordion] PAYG > > Pay-as-you-go credits purchased by top-up. Top-up credits cost > USD 0.00015 each. Xquik adds top-up credits to your balance right away. They do not expire. > [accordion] Guest wallet > > An accountless prepaid balance for the eligible GET routes. A verified > hosted payment activates its Bearer key. Guest keys cannot access writes, > account management, or private X (Twitter) reads. > [accordion] MPP > > Machine Payments Protocol for direct per-call payment. Xquik accepts an MPP > Payment challenge on fixed-price read operations. You need no subscription. > A failed request does not create checkout automatically. > [accordion] 402 Payment required > > The caller cannot fund a metered operation. Account and guest responses can > include credential-specific `payment_options`. Confirm any purchase before > creating checkout or charging a saved payment method. > [accordion] 429 Too many requests > > The caller exceeded a request bucket or action cooldown. Read `error` and > `Retry-After` before retrying. A `429` is not a credit failure. > [accordion] Fixed window counter > > Xquik's rate-limiting algorithm. Standard accounts receive independent read, > write, and delete counters. Reads reset after 1 second. Writes and deletes > reset after 60 seconds. See [rate limits](/guides/rate-limits). > [accordion] Retry-After > > A response header containing seconds to wait. It can accompany a `429`, > active write, connection cooldown, or temporary service response. > Inspect the status and error code before choosing an action. ## Common X (Twitter) API definition questions ### What is the difference between a tweet and a post? They describe the same core X content object. X now says post. Xquik keeps tweet terminology in routes, fields, and developer documentation. ### What is the difference between followers and following? Followers are accounts that follow the source profile. Following are accounts the source profile follows. Both relationships are directional. ### How do replies, quotes & reposts differ? A reply points to a parent tweet. A quote adds new text around another tweet. A repost redistributes the original. Keep every involved tweet ID separate. ### Is tweet scraping the same as monitoring? No. A scraper API retrieves requested tweets, profiles, or audience pages. A monitor runs repeatedly and stores the events you select. ### Why does Xquik use cursors instead of page numbers? Cursors keep server-defined continuation state for changing result sets. Pass them back unchanged. Never calculate or decode the next cursor. ### Is a webhook the same as polling? No. A webhook pushes signed monitor events to your HTTPS receiver. Polling repeatedly requests events. Use polling for replay and reconciliation. ### Is an API key the same as a connected X account? No. An API key authenticates the Xquik caller. A connected X account authorizes private reads and X write actions. ### What is the difference between 402 and 429? `402` means the request lacks sufficient payment or credits. `429` means the request exceeded the rate or action frequency limit. > [card] [API field guide](/guides/tweet-profile-api-fields) > > Map tweet, profile, media, relationship, and cursor fields. > [card] [API overview](/api-reference/overview) > > Choose tweet, follower, reply, monitor, webhook, and write routes. > [card] [Error handling](/guides/error-handling) > > Classify validation, billing, rate-limit, dependency, and write errors. # Google ADK MCP X (Twitter) API tutorial for Python Source: https://docs.xquik.com/guides/google-adk Build Google ADK tools for tweet search, followers, monitors, and approved X (Twitter) actions. Follow a Python MCP guide with typed handoffs and retries. > For the complete documentation index, see [llms.txt](/llms.txt). This Google ADK tutorial uses Xquik's remote MCP server. Build a Google ADK X (Twitter) API agent through Xquik using this architecture. This X (Twitter) API for Python workflow searches tweets, profiles, and followers. It also replays monitors and reviews approved X (Twitter) actions. The handoff must keep tweet IDs, profile IDs, cursors, and job IDs. ## Why use Google ADK with an X (Twitter) API? Google's Agent Development Kit (ADK) manages Gemini calls, tools, sessions, and agent handoffs. Model Context Protocol, or MCP, defines interoperable tool schemas. Xquik exposes `docs`, `search`, `execute`, and `whoami` as remote MCP tools. This Google ADK guide assigns one responsibility to each boundary. The Agent Development Kit MCP client loads Xquik route schemas during startup. | Boundary | Google ADK control | Twitter agent benefit | | - | - | - | | Remote MCP | `McpToolset` | Connect Gemini to tweet, profile, follower, and monitor routes | | Final response | Pydantic `output_schema` | Reject malformed tweet rows and pagination state | | Session continuity | `InMemoryRunner` or a durable session service | Resume with the same tweet IDs and cursors | | Agent handoff | `output_key` and sub-agents | Separate research, review, and publishing | | X actions | `require_confirmation` | Pause before the `execute` tool runs | | Tenant credentials | `header_provider` | Resolve one Xquik key for each tenant | Choose ADK when Gemini already powers the surrounding workflow. Choose a direct REST client for deterministic jobs without model decisions. ## Google ADK X (Twitter) API prerequisites * Python 3.10 or later * An [Xquik API key](/x-api-quickstart) beginning with `xq_` * A Google AI API key for Gemini * A connected X account for private reads or X write actions Public X reads do not require X Developer credentials. Authenticate with Xquik. Connect an X account only when the selected route requires it. ## Install Google ADK Python and MCP support Install the current Google ADK 2.6 line with its compatible MCP client. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install --upgrade \ "google-adk[mcp]>=2.6,<2.7" \ "pydantic>=2.12,<3" \ python-dotenv ``` Google ADK 2.6 requires MCP 1.x. Its `mcp` extra excludes MCP 2.x. Store secrets outside source control. ```bash .env theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} XQUIK_API_KEY=xq_YOUR_KEY_HERE GOOGLE_API_KEY=YOUR_GOOGLE_AI_KEY ``` ```text .gitignore theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} .env xquik-*-handoff.json ``` The environment variables isolate Xquik and Google credentials from the agent implementation. Never place either key inside an agent instruction. ## Connect Google Agent Development Kit to an MCP server This Google Agent Development Kit MCP server setup uses Xquik remotely. ADK is the MCP client, while Xquik hosts the remote server. `McpToolset` discovers `docs`, `search`, and `execute` through standard tool calling. These Google ADK tools cover tweets, profiles, followers, monitors, and X (Twitter) actions. The separation keeps agent workflows independent from route schemas. ## Build a Google ADK Python tweet search agent Define the final handoff before creating the agent. ADK validates the final Gemini response while still allowing MCP tool calls. `from google.adk import Agent` imports the current agent class. This Google ADK Python example validates final responses with Pydantic. The X (Twitter) API get tweets workflow calls the documented search route. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import asyncio import os from pathlib import Path from typing import Literal from dotenv import load_dotenv from google.adk import Agent from google.adk.runners import InMemoryRunner from google.adk.tools.mcp_tool.mcp_session_manager import ( StreamableHTTPConnectionParams, ) from google.adk.tools.mcp_tool.mcp_toolset import McpToolset from google.genai import types from pydantic import BaseModel class TweetRow(BaseModel): tweet_id: str text: str author_username: str | None = None created: int | None = None url: str | None = None class TweetSearchHandoff(BaseModel): query: str route_used: str tweets: list[TweetRow] has_more: bool next_cursor: str | None = None pages_fetched: int stop_reason: Literal["complete", "requested_limit", "cursor_stalled"] async def main() -> None: load_dotenv() xquik_tools = McpToolset( connection_params=StreamableHTTPConnectionParams( url="https://xquik.com/mcp", headers={"x-api-key": os.environ["XQUIK_API_KEY"]}, timeout=15, sse_read_timeout=120, ), tool_filter=["docs", "search", "execute"], ) agent = Agent( model="gemini-3.5-flash", name="xquik_tweet_search_agent", instruction=( "Use Xquik for Twitter API requests. " "Use GET /api/v1/x/tweets/search. " "Preserve exact tweet IDs, created timestamps, and cursors. " "Never invent missing tweet fields. " "Stop when the requested limit is reached. " "Stop if the server repeats a cursor." ), tools=[xquik_tools], output_schema=TweetSearchHandoff, ) async with InMemoryRunner( agent=agent, app_name="xquik_adk_app", ) as runner: session = await runner.session_service.create_session( app_name="xquik_adk_app", user_id="user-1", ) final_text = "" async for event in runner.run_async( user_id="user-1", session_id=session.id, new_message=types.Content( role="user", parts=[ types.Part( text=( "Search 50 latest tweets about Google ADK MCP. " "Return compact validated JSON." ) ) ], ), ): if ( event.is_final_response() and event.content and event.content.parts ): final_text = "".join( part.text or "" for part in event.content.parts ) handoff = TweetSearchHandoff.model_validate_json(final_text) Path("xquik-adk-handoff.json").write_text( handoff.model_dump_json(indent=2), encoding="utf-8", ) asyncio.run(main()) ``` The runner closes `McpToolset` when its context exits. Reuse one runner across related turns. Repeated setup adds avoidable MCP handshakes. `xquik.request()` returns normalized snake_case fields from the MCP runtime. It normalizes `createdAt` to the Unix-second field `created`. Align the Pydantic schema with this response format. ## Search tweets with useful X operators Send the search route a focused `q`. Keep the exact query in the handoff. | Search intent | Example `q` | | - | - | | Latest topic tweets | `"Google ADK" MCP` | | One account's timeline window | `from:googlecloud since:2026-07-01 until:2026-08-01` | | Popular English posts | `"agent development kit" lang:en min_faves:25` | | Questions without reposts | `"Twitter API agent" ? -filter:retweets` | | Exact tweet | A numeric Tweet ID or X status URL | This X (Twitter) API integration accepts standard X (Twitter) search operators. Use `queryType=Latest` for chronological monitoring. Use `Top` for engagement ranking. See the complete [tweet search API contract](/api-reference/x/search-tweets). The search query `twitter api get tweets` maps to this route. Pass the returned `next_cursor` unchanged. Never reconstruct a cursor. Stop when `has_more` is false, the requested limit is met, or a cursor repeats. ## Separate tweet research from X (Twitter) actions Xquik exposes one `execute` tool by design. MCP tool-name filters cannot distinguish GET, POST, and DELETE requests inside that tool. This Google ADK multi agent pattern separates research from publishing. Use separate credentials and confirmation rules across multi agent systems. Use separate ADK agents. Let the research agent read tweets and profiles. Make the publishing agent confirm every `execute` call. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import os from google.adk import Agent from google.adk.tools.mcp_tool.mcp_session_manager import ( StreamableHTTPConnectionParams, ) from google.adk.tools.mcp_tool.mcp_toolset import McpToolset def connection() -> StreamableHTTPConnectionParams: return StreamableHTTPConnectionParams( url="https://xquik.com/mcp", headers={"x-api-key": os.environ["XQUIK_API_KEY"]}, ) research_tools = McpToolset( connection_params=connection(), tool_filter=["docs", "search", "execute"], ) approved_write_tools = McpToolset( connection_params=connection(), tool_filter=["execute"], require_confirmation=True, ) researcher = Agent( name="tweet_researcher", model="gemini-3.5-flash", instruction=( "Search tweets and profiles. Preserve IDs, created timestamps, " "has_more, and next_cursor. Never perform X write actions." ), tools=[research_tools], output_key="tweet_research", ) publisher = Agent( name="approved_x_publisher", model="gemini-3.5-flash", instruction=( "Use only reviewed tweet text and the selected X account. " "Never change approved text. Never retry a pending write." ), tools=[approved_write_tools], ) coordinator = Agent( name="twitter_campaign_coordinator", model="gemini-3.5-flash", instruction=( "Delegate tweet research to tweet_researcher. " "Delegate approved X actions to approved_x_publisher." ), sub_agents=[researcher, publisher], ) ``` ADK CLI and ADK Web can present confirmation requests. A custom interface must return ADK's confirmation `FunctionResponse`. Build confirmation into the product workflow. A prompt sentence is not enough. Confirm every `execute` write call. A code-string inspection does not authorize an action. For public research, a guest `paid_reads` key allows eligible GET routes only. [Guest wallets](/guides/guest-wallets) document the exact scope. ## Discovery-only tool filtering Expose only `search` when an agent should inspect endpoint schemas. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} discovery_tools = McpToolset( connection_params=connection(), tool_filter=["search"], ) ``` This setup blocks X (Twitter) API execution. Adding `execute` enables key-authorized reads and writes. Because `execute` wraps methods, name filtering cannot enforce read-only access. Use `search` before unfamiliar operations. It returns routes, methods, parameters, and response fields without calling X. ## Store tweet IDs and cursors in ADK state Keep compact identifiers in session state. Exclude complete tweet pages from ADK prompts and stored session state. Plain state keys belong to one conversation. `user:` keys last across a user's sessions. `app:` keys hold shared configuration. `temp:` keys expire after one invocation. Keep these recommended state entries. * `query` and `query_type` * `last_tweet_id` and `selected_tweet_ids` * `next_cursor` and `pages_fetched` * `monitor_id` and `last_event_id` * `extraction_id`, `status`, and `poll` * `write_action_id`, `status`, and `charged_credits` Never store Xquik keys in ADK state. Let `header_provider` resolve credentials from your secret manager. ## Use tenant-specific Xquik API keys `header_provider` runs when ADK opens the MCP session. Read a non-secret tenant identifier from `ReadonlyContext`. Resolve the key outside the prompt. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from google.adk.agents.readonly_context import ReadonlyContext def tenant_headers(context: ReadonlyContext) -> dict[str, str]: tenant_id = str(context.state["tenant_id"]) api_key = secret_store.get_xquik_key(tenant_id) return {"x-api-key": api_key} tenant_tools = McpToolset( connection_params=StreamableHTTPConnectionParams( url="https://xquik.com/mcp", ), header_provider=tenant_headers, tool_filter=["docs", "search", "execute"], ) ``` `secret_store` represents an existing secret manager. Keep its returned keys outside Gemini prompts and ADK events. ## Handle tweet search errors and rate limits Handle every documented status with its matching recovery step. | Status | Meaning | Agent action | | - | - | - | | `400` | The search query is missing or invalid | Fix `q`. Do not retry unchanged | | `401` | Guest authentication cannot complete this request | Provide an Xquik API key or connect X | | `402` | The account lacks credits | Stop and request account action | | `424` | The X dependency failed | Retry with bounded backoff | | `429` | The X (Twitter) API rate limit applies | Wait for reset guidance, then resume the cursor | | `502` | The X dependency returned an invalid response | Retry later without changing IDs | Do not restart pagination after `429`. Retain `next_cursor` and completed result identifiers. Deduplicate recovered results through the exact `tweet_id`. POST and DELETE routes document different statuses. Read each route before building retry logic. See [error handling](/guides/error-handling). ## Handoff checklist > [card] Tweet search rows > > Store `tweet_id`, `text`, `author_username`, `created`, `url`, `has_more`, `next_cursor`, and the original `q`. > [card] User profile rows > > Store source `id` as `user_id`. Also store `username`, `name`, `followers`, `verified`, and `profile_picture`. Store `has_more`, `next_cursor`, and the source lookup or search query. > [card] Trend rows > > Store each trend `name`, `rank`, `query`, and `description`. Keep response `count`, `woeid`, and the requested region with the run checkpoint. > [card] Monitor and webhook setup > > Store the returned monitor `id` as `monitor_id`, plus `event_types` and `next_billing_at`. Store the returned webhook `id` as `webhook_id`, plus `url`. Store the one-time `secret` in a secret manager. On production deliveries, store `delivery_id` for receiver retry deduplication. Store `stream_event_id` when one monitor event should process once across endpoint changes. > [card] Stored event replay > > Store `event_id`, `type`, `monitor_id`, `monitor_type`, and `occurred_at`. Also store `has_more`, `next_cursor`, and the `cursor` query for the next page. > [card] Extraction jobs > > Store `extraction_id`, `status`, `poll`, and `export_after_complete`. Poll before loading CSV, JSON, or XLSX rows. > [card] Writes > > Store `tweet_id` or `write_action_id`, `reply_to_tweet_id`, `status`, `charged_credits`, and `poll`. Do not resend pending writes. > [card] Media attachments > > For tweets or replies, pass public URLs in `media` or uploaded IDs in `media_ids`. Store `tweet_id` or `write_action_id`. For DMs, upload first and pass one `media_id` in `media_ids`. Store the DM `message_id` and leave `reply_to_message_id` unset. ## Choose Google ADK MCP or the REST API | Requirement | Google ADK with MCP | Direct REST API | | - | - | - | | Natural-language tweet research | Strong fit | Write query logic yourself | | Gemini multi-agent handoffs | Native fit | Add an orchestrator | | Strict scheduled follower export | Extra model step | Strong fit | | Human-approved tweet posting | ADK confirmation flow | Build approval state yourself | | Predictable latency and cost | Less predictable | More predictable | | Typed final handoff | `output_schema` | SDK or Pydantic model | Use MCP when Gemini chooses among related X (Twitter) API operations. Use REST for fixed routes, scheduled exports, or latency-sensitive services. ## Migrate Google ADK 1.x MCP code Google ADK 2.x keeps compatibility aliases. New code should use current API symbols. | Older pattern | Current pattern | | - | - | | `from google.adk.agents import LlmAgent` | `from google.adk import Agent` | | `MCPToolset` | `McpToolset` | | `StreamableHTTPServerParams` | `StreamableHTTPConnectionParams` | | Manual toolset cleanup | `async with InMemoryRunner(...)` | | Prompt-only JSON | Pydantic `output_schema` | `MCPToolset` now emits a deprecation warning. The current class uses the `McpToolset` capitalization. ## Verified Google ADK package versions Xquik checked these versions on August 2, 2026. | Package | Checked compatible version | Compatible range used here | | - | - | - | | `google-adk` | 2.6.1 | `>=2.6,<2.7` | | `mcp` | 1.29.0 | `>=1.24,<2` through the `mcp` extra | | `pydantic` | 2.13.4 | `>=2.12,<3` | Pin a tested minor range. Review ADK 2.x release notes before widening it. ## Google ADK X (Twitter) API questions ### Does Google ADK support MCP? Yes. Python ADK connects to remote Streamable HTTP servers through `McpToolset`. Xquik publishes `docs`, `search`, `execute`, and `whoami` at `https://xquik.com/mcp`. ### How does Google Agent Development Kit differ from MCP? ADK orchestrates Gemini agents. MCP standardizes external tool discovery and invocation. Xquik serves the tools, while `McpToolset` connects the agent. ### Does Google ADK MCP require Google Cloud or Cloud Run? No. The agent code can run wherever Python 3.10 runs. Google Cloud and Cloud Run are optional deployment targets. Xquik requires no local MCP server. ### How do I connect Google ADK to an X (Twitter) API? Create `StreamableHTTPConnectionParams` with the Xquik MCP URL. Send the Xquik API key in the `x-api-key` header. Pass `McpToolset` to `Agent.tools`. ### How do I search tweets with a gemini agent? Ask the agent to call `GET /api/v1/x/tweets/search`. Supply an exact `q`, `queryType`, and limit. Keep `tweet_id`, `created`, and `next_cursor`. This X (Twitter) API integration can get tweets without X Developer credentials. Private routes still require a connected X account. ### Can Google ADK post tweets and replies? Yes. It requires a connected X account. Route every `execute` call through ADK confirmation. Validate the selected account, text, reply ID, and media. See [create tweet](/api-reference/x-write/create-tweet) for the exact contract. ### How do I handle X (Twitter) API rate limits in Python? Treat `429` separately from dependency errors. Save the current cursor and completed tweet IDs. Resume after the reset guidance. Never retry in a tight loop. ### Can a Google ADK agent export Twitter followers? Yes. The [followers API](/api-reference/x/followers) paginates follower profiles through response cursors. Extraction jobs produce larger CSV, JSON, or XLSX exports. Load exported rows only after polling confirms completion. ### Can Google ADK monitor tweets without repeated searches? Yes. Create an account or keyword monitor. Replay stored events by cursor. Connect a webhook when the receiver can verify signatures and deduplicate deliveries. Monitors use scheduled checks and do not promise real time delivery. ### Google ADK or LangChain for a Twitter agent? Choose ADK for Gemini-centered sessions and native agent handoffs. LangGraph supports more model providers and graph orchestration. Xquik supports both frameworks. ### Why does a remote MCP connection close between calls? Keep one runner active during related turns. Its context manager closes each `McpToolset` instance. Increase connection and SSE timeouts for long operations. Do not create one `McpToolset` per prompt. ### Does tool filtering make the X (Twitter) API read-only? Only `search` without `execute` blocks execution. The `execute` tool can run every operation authorized by its key. Separate agents and approvals protect X (Twitter) actions. # Accountless Twitter scraper API with guest wallets Source: https://docs.xquik.com/guides/guest-wallets Read tweets, profiles, followers, replies, timelines, and communities without an Xquik account. No connected X account is required. Fund one guest key. > For the complete documentation index, see [llms.txt](/llms.txt). Guest wallets give prepaid access to eligible X (Twitter) read routes without an account. Here, account means an Xquik account. You need no connected X account. Use one funded guest key to search tweets. Read profiles, followers, replies, timelines, communities, or lists. You need no email address or dashboard. This is accountless access, not anonymous access. Every guest-wallet paid read requires the active guest key returned during wallet creation. Direct MPP reads use a per-request payment credential. > [!WARNING] > > A `401` or `402` response never creates a checkout. Show the payment choices and amount first. Create a hosted checkout only after the user explicitly confirms. Never submit payment for the user. ## Accountless Twitter scraper API questions ### What Twitter APIs work without connecting an X account? Xquik guest wallets cover the documented paid-read routes below. They read tweets, replies, threads, profiles, followers, following, and timelines. Other routes cover communities, lists, trends, relationships, articles, and AI analysis. They do not require a connected X account. The caller still needs one active guest key. Create the wallet, let the user complete checkout, then poll its status. Start reads only when the response reports `usable: true`. Eligible routes cover tweet lookups, search, replies, threads, and profiles. They also cover followers, following, timelines, communities, lists, and trends. Relationship and article routes are also eligible. Guest access excludes posts, likes, reposts, follows, and messages. It also excludes monitors, webhooks, extractions, draws, and account management. Check the route list below before building the request. ### Can I scrape Twitter without an API account? You can read eligible X content without an Xquik account. You need no email address, dashboard login, or OAuth connection. This accountless Twitter scraper uses a prepaid guest key for authentication and credit tracking. Accountless does not mean anonymous. Keep the guest key secret. Send it as a Bearer credential on each eligible read. A missing or inactive key returns the documented `401` or `402` response. Create a wallet only after the user confirms the amount. The hosted checkout does not prove activation. Poll the status route and require `usable: true`. Store the guest key in a secret manager. Never place it in a URL, log, prompt, or shared export. Use full account credentials for writes, monitors, and webhooks. They also cover extraction jobs, draws, and management routes. ### Twitter API no account required It means you need no Xquik account and no connected X account. It does not remove authentication, payment confirmation, route scope, or rate limits. The guest key proves access to its funded wallet. Guest access excludes tweet posting, replies, likes, reposts, and follows. It also excludes messages, monitors, webhooks, extractions, draws, and management. Use a full account key or OAuth token for those operations. The guest wallet remains prepaid. The user chooses and confirms a supported amount. They complete hosted checkout and await verified activation. Each eligible read consumes credits under its documented route contract. A `401` or `402` response only presents recovery choices. It does not authorize wallet creation or payment. ### Accountless Twitter scraper Use an accountless Twitter scraper for read-only searches and public profiles. It does not require an Xquik account. A funded guest key can call the listed paid-read routes. It can retrieve tweets, replies, threads, profiles, followers, and following. It can also read timelines, communities, lists, trends, relationships, articles, and job listings. This path still uses authentication, credits, route limits, and rate limits. It cannot post, like, repost, follow, or send messages. It cannot create monitors, webhooks, extraction jobs, draws, or account changes. Use stable Tweet and user IDs in stored results. Keep the guest key secret. Poll wallet status before the first paid read. ### Guest key X (Twitter) API Use a guest key for prepaid read-only workflows. It fits tweet search, profile lookup, follower pages, and reply pages. It also fits timelines, community reads, and list reads. Use direct MPP when one supported request carries its own payment. Use a full account credential when the workflow needs broader API coverage. Choose the access method before coding retries. Each method returns different payment and authentication recovery actions. Create the wallet after the user confirms the amount. Send a unique UUID v4 idempotency key. Store both secrets securely. Give only the hosted checkout URL to the user. Poll status until `usable: true`. Reuse the same guest key after an approved top-up. Do not create a new wallet when one paid read returns `insufficient_credits`. ## Choose an access method | Access method | Account | Credential | Coverage | Payment | | - | - | - | - | - | | Account API key | Required | Full-scope API key | Full authenticated API | Available account credits. Plans add monthly credits. | | OAuth 2.1 | Required | OAuth Bearer token | Same account capabilities granted by OAuth | Available account credits. Plans add monthly credits. | | Guest wallet | Not required | `paid_reads` API key | Only the prepaid paid-read routes | USD 10 to 250 hosted checkout | | MPP | Not required | Per-request payment credential | Fixed-price GET operations | Per-request payment | Guest wallets do not grant write actions, connected-account reads, monitors, webhooks, extractions, or draws. They also do not grant account, billing, or API-key management, or OAuth access. Full account keys and OAuth behavior remain unchanged. ## Create and activate a wallet **1. Confirm the amount** Ask the user to choose an amount from USD 10 through USD 250. The user must explicitly confirm it. Represent it in cents as `amount_minor`. **2. Create hosted checkout** Call `POST /api/v1/guest-wallets` with `Content-Type: application/json`, a cryptographically random UUID v4 `Idempotency-Key`, and the confirmed amount. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} idempotency_key=$(uuidgen | tr '[:upper:]' '[:lower:]') response=$(curl -sS -X POST https://xquik.com/api/v1/guest-wallets \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $idempotency_key" \ -d '{"amount_minor": 1000, "currency": "usd"}') api_key=$(jq -r '.api_key' <<<"$response") checkout_url=$(jq -r '.checkout_url' <<<"$response") # Store $api_key and $idempotency_key as secrets. Give only $checkout_url to the user. ``` This request creates a one-use hosted checkout. It does not charge the user. **3. Store the credentials** Store the returned `api_key` and the original `Idempotency-Key` in a secret manager. The key appears only in the initial response and an exact idempotent replay. No email recovery is available. **4. Give the user the checkout URL** Give only `checkout_url` to the user. The user completes hosted checkout. Pending checkouts expire after 60 minutes. **5. Poll for verified payment** After payment, poll `GET /api/v1/guest-wallets/status` every `poll_after_seconds` with the guest key. Stop when `latest_purchase.status` is no longer `pending`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/guest-wallets/status \ -H "Authorization: Bearer xq_your_guest_key_here" | jq ``` The key remains inactive for paid reads until status reports `usable: true`. Checkout completion alone is not proof of activation. Xquik activates credits only after it verifies payment. ## Call paid read routes Send an active guest key as a Bearer credential. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets?ids=1893456789012345678,1893456789012345679" \ -H "Authorization: Bearer xq_your_guest_key_here" | jq ``` The `paid_reads` scope permits exactly the routes listed below. They are GET reads and the 6 POST analysis routes. It includes batch `GET /api/v1/x/tweets`. Every other route is unavailable. ## Eligible paid-read routes Guest wallets cover these prepaid routes. All are GET routes except the 6 POST analysis routes. * **Tweets.** * `/api/v1/x/tweets` * `/api/v1/x/tweets/{id}` * `/api/v1/x/tweets/{id}/hidden-replies` * `/api/v1/x/tweets/{id}/insights` * `/api/v1/x/tweets/{id}/retweeters/check` * `/api/v1/x/tweets/search` * `/api/v1/x/tweets/top` * `/api/v1/x/tweets/{id}/quotes` * `/api/v1/x/tweets/{id}/replies` * `/api/v1/x/tweets/{id}/retweeters` * `/api/v1/x/tweets/{id}/retweeter-ids` * `/api/v1/x/tweets/{id}/thread` * `/api/v1/x/tweets/{id}/translation` * `/api/v1/x/tweets/{id}/embed` * `/api/v1/x/tweets/{id}/subtitles` * `/api/v1/x/links/resolve` * **Users.** * `/api/v1/x/users/batch` * `/api/v1/x/users/batch/tweets` * `/api/v1/x/users/search` * `/api/v1/x/users/{id}` * `/api/v1/x/users/{id}/articles` * `/api/v1/x/users/{id}/follower-ids` * `/api/v1/x/users/{id}/followers` * `/api/v1/x/users/{id}/following` * `/api/v1/x/users/{id}/following-ids` * `/api/v1/x/users/{id}/subscriptions` * `/api/v1/x/users/{id}/affiliates` * `/api/v1/x/users/{id}/similar` * `/api/v1/x/users/{id}/translation` * `/api/v1/x/users/{id}/highlights` * `/api/v1/x/users/{id}/insights` * `/api/v1/x/users/{id}/list-memberships` * `/api/v1/x/users/{id}/lists` * `/api/v1/x/users/{id}/live` * `/api/v1/x/users/{id}/shadowban` * `/api/v1/x/users/{id}/media` * `/api/v1/x/users/{id}/mentions` * `/api/v1/x/users/{id}/replies` * `/api/v1/x/users/{id}/tweets` * `/api/v1/x/users/{id}/verified-followers` * **Search.** * `/api/v1/x/search/autocomplete` * **Spaces.** * `/api/v1/x/spaces/search` * `/api/v1/x/spaces/{id}` * `/api/v1/x/spaces/{id}/replay` * **Broadcasts.** * `/api/v1/x/broadcasts/{id}` * **Communities.** * `/api/v1/x/communities/find` * `/api/v1/x/communities/popular` * `/api/v1/x/communities/suggested` * `/api/v1/x/communities/topics` * `/api/v1/x/communities/{id}/info` * `/api/v1/x/communities/{id}/media` * `/api/v1/x/communities/{id}/members` * `/api/v1/x/communities/{id}/members/search` * `/api/v1/x/communities/{id}/moderators` * `/api/v1/x/communities/{id}/tweets` * `/api/v1/x/communities/search` * `/api/v1/x/communities/tweets` * **Community Notes.** * `/api/v1/x/community-notes/contributors/{alias}` * `/api/v1/x/community-notes/contributors/{alias}/notes` * `/api/v1/x/community-notes/contributors/{alias}/deleted-notes` * **Lists.** * `/api/v1/x/lists/search` * `/api/v1/x/lists/{id}/followers` * `/api/v1/x/lists/{id}/members` * `/api/v1/x/lists/{id}/tweets` * **Jobs.** * `/api/v1/x/jobs/search` * `/api/v1/x/jobs/{id}` * `/api/v1/x/jobs/locations` * **Sports.** * `/api/v1/x/sports/{league}/games` * `/api/v1/x/sports/{league}/games/{id}` * `/api/v1/x/sports/{league}/games/{id}/plays` * `/api/v1/x/sports/{league}/games/{id}/box-score` * `/api/v1/x/sports/{league}/games/{id}/roster` * `/api/v1/x/sports/{league}/games/{id}/player-props` * `/api/v1/x/sports/{league}/games/{id}/audience` * `/api/v1/x/sports/{league}/games/{id}/posts` * **Trends.** * `/api/v1/trends` * `/api/v1/x/trends` * `/api/v1/x/trends/history` * `/api/v1/x/trends/locations` * `/api/v1/x/hashflags` * **Places.** * `/api/v1/x/places/search` * **Relationships.** * `/api/v1/x/followers/check` * **Articles.** * `/api/v1/x/articles/{tweetId}` * **Analysis (POST).** * `/api/v1/x/analysis/sentiment` * `/api/v1/x/analysis/brand` * `/api/v1/x/analysis/news` * `/api/v1/x/analysis/market-signals` * `/api/v1/x/analysis/viral-score` * `/api/v1/x/analysis/classify` Some of these routes also accept [direct MPP payment](/mpp/machine-payments-protocol#eligible-endpoints). The others require a guest or full account credential. `/favoriters`, `/likes` & `/followers-you-know` read through your own connected X account. They are not guest routes. Guest keys get `403 forbidden` on them. ## Top up an active wallet When a guest read returns `402 insufficient_credits`, its `payment_options` advertises only `POST /api/v1/guest-wallets/topups`. Ask the user to choose and confirm USD 10 to 250. Then create a new one-use hosted checkout with the existing guest key. Send a new UUID v4 `Idempotency-Key` with it. The top-up response keeps the same wallet and key. It never returns a new key. After payment, poll the same status URL every `poll_after_seconds`. Stop when `latest_purchase.status` is no longer `pending`. See [Top up guest wallet](/api-reference/guest-wallets/topup) for the request and response contract. ## Handle anonymous 401 and 402 responses The non-MPP paid reads return `401` with a Bearer authentication challenge. The response also carries a guest wallet creation action. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} HTTP/2 401 WWW-Authenticate: Bearer realm="xquik" Content-Type: application/json ``` The JSON body includes `payment_options.guest_wallet.create_checkout`. That action describes the guest wallet route and amount bounds. It also gives the required UUID v4 header and returned fields. The Bearer header requests authentication. It is not a Payment challenge. The [direct MPP operations](/mpp/machine-payments-protocol#eligible-endpoints) return `402 application/problem+json` with `WWW-Authenticate: Payment` and the same guest wallet action. Complete the MPP challenge or ask the user to confirm a guest wallet amount. Do not create a guest wallet because a request returned `401` or `402`. The guest wallet action is an offer, not authorization. ## Use guest keys with MCP An active guest key can authenticate the API MCP server. Its `search` and `execute` tools expose only the eligible paid-read routes. The `docs` tool remains available. Writes and all other routes are unavailable. The 3 guest credential routes remain direct REST only. * `POST /api/v1/guest-wallets` * `POST /api/v1/guest-wallets/topups` * `GET /api/v1/guest-wallets/status` MCP cannot execute these routes. It may explain the direct REST flow. The caller must wait for user confirmation before using that flow. See [MCP tools](/mcp/tools) for the scope-specific catalog. ## Protect wallet access * Keep `api_key` and `Idempotency-Key` out of URLs, logs, prompts, and shared output. * Redact the `Idempotency-Key` request header in proxies, gateways, and APM tools. Many log request headers by default. An exact replay with the key returns the wallet's `api_key`. * Respect `Cache-Control: no-store, private` on create, top-up, and status responses. * Reuse an idempotency key only for the exact same request. * Use `usable` and the returned status instead of inferring access from checkout state. * Refunds and disputes reconcile only affected-purchase credits. Unrelated credits remain usable. * Access pauses only during unresolved settlement risk or unrecovered liability. It resumes after resolution. ## Next steps * [Create guest wallet](/api-reference/guest-wallets/create) * [Get guest wallet status](/api-reference/guest-wallets/status) * [Top up guest wallet](/api-reference/guest-wallets/topup) * [MPP overview](/mpp/machine-payments-protocol) * [Authentication](/api-reference/authentication) # Haystack Twitter search API & RAG Python guide Source: https://docs.xquik.com/guides/haystack Build Haystack RAG pipelines with Twitter search and user timeline APIs, typed Documents, citations, pagination, async Python, and exact error handling. > For the complete documentation index, see [llms.txt](/llms.txt). Haystack is an open source framework for Python AI applications. Compare frameworks for building RAG and agent pipelines. Use [`xquik-haystack`](https://github.com/Xquik-dev/xquik-haystack) for current tweets. This Haystack AI framework gives you typed tweet `Document` objects. Each includes text, authors, metrics, and URLs. This Haystack AI API integration supports RAG pipelines and agent workflows. You can follow this guide when building AI applications with Haystack and current tweets. The integration never grants write access. The integration provides 2 read-only components. > [card] Search public tweets > > `XquikTweetSearch` searches keywords, hashtags, accounts, conversations, and > exact phrases. > [card] Fetch user timelines > > `XquikUserTweetsFetcher` retrieves one public account's tweets and optional > replies. Use these components for search, timelines, monitoring, and retrieval-augmented generation. They can retrieve relevant tweets for Haystack AI agents and Haystack AI RAG pipelines. Pipelines and agents can both use these components. Wrap `XquikTweetSearch` with `ComponentTool` when an agent needs a search tool called `search_current_tweets`. Use the [followers API](/api-reference/x/followers) for follower exports. Use the [write API](/api-reference/x-write/create-tweet) for approved publishing. Those actions stay outside this integration. ## Install Haystack and Xquik Use Python 3.10 or newer. Pin both packages for repeatable pipeline builds. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install "xquik-haystack==0.1.3" "haystack-ai==3.0.0" ``` Install inside a virtual environment. PyPI hosts release `0.1.3`. Haystack `3.0.0` supports sync and async runs. The `pip install` command pins both packages for repeatable builds. Create an [Xquik API key](/x-api-quickstart), then export it locally. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export XQUIK_API_KEY="xq_..." ``` Never embed production keys in pipeline YAML, notebooks, or source control. Load the environment variable through a Haystack `Secret` object. ## Search X (Twitter) tweets in Python `XquikTweetSearch` calls the `GET /x/tweets/search` search endpoint. It accepts standard X (Twitter) search syntax and structured filters. Use it for each X (Twitter) API keyword search or exact phrase query. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from haystack import Pipeline from haystack.utils import Secret from haystack_integrations.components.websearch.xquik import XquikTweetSearch search = XquikTweetSearch( api_key=Secret.from_env_var("XQUIK_API_KEY"), top_k=20, query_type="Latest", ) pipeline = Pipeline() pipeline.add_component("twitter_search", search) result = pipeline.run( { "twitter_search": { "query": '"retrieval augmented generation" lang:en -filter:retweets' } } ) documents = result["twitter_search"]["documents"] links = result["twitter_search"]["links"] ``` Use `Latest` for recent monitoring. Use `Top` for engagement-ranked discovery. Store tweet IDs because rankings can change. Save every search query beside its tweet IDs. Set `top_k` to cap the number of tweets in each run. ### Build focused tweet searches | Search intent | Query example | | - | - | | Exact phrase | `"retrieval augmented generation"` | | Account posts | `from:deepset_ai haystack` | | Hashtag search | `#haystack #rag` | | Date window | `haystack since:2026-07-01 until:2026-08-01` | | Exclude reposts | `haystack -filter:retweets` | The API also supports structured search filters. Pass them through `extra_params` during initialization. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} search = XquikTweetSearch( top_k=50, query_type="Latest", extra_params={ "language": "en", "mediaType": "links", "minFaves": 10, "replies": "exclude", }, ) ``` See the [tweet search API](/api-reference/x/search-tweets) for author, reply, quote, URL, and conversation filters. Keep timestamps and cursors outside `extra_params`. ## Choose a search window Bound every retrieval with timestamps. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} result = search.run( query="haystack agents", since_time="2026-07-31T00:00:00Z", until_time="2026-08-01T00:00:00Z", ) ``` Save each window. Deduplicate overlaps by `Document.meta["id"]`. ## Fetch a Twitter user timeline Use `XquikUserTweetsFetcher` for `GET /x/users/{id}/tweets`. Pass a username or numeric X (Twitter) user ID. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from haystack.utils import Secret from haystack_integrations.components.websearch.xquik import ( XquikUserTweetsFetcher, ) timeline = XquikUserTweetsFetcher( api_key=Secret.from_env_var("XQUIK_API_KEY"), include_replies=False, include_parent_tweet=False, ) result = timeline.run(user_id="deepset_ai") documents = result["documents"] ``` Set `include_replies=True` for replies. Enable parent tweets only when reply context matters. Choose search for many accounts and timelines for one account. ## Understand Haystack document fields Each tweet becomes one Haystack `Document`. Tweet text becomes `Document.content`. Stable fields become metadata. | Document field | Stored tweet value | | - | - | | `content` | Tweet text | | `meta.endpoint` | Search or timeline route | | `meta.id`, `meta.url` | Tweet ID and canonical URL | | `meta.created_at`, `meta.lang` | Timestamp and language | | `meta.conversation_id`, `meta.in_reply_to_*` | Conversation and parent fields | | `meta.is_reply`, `meta.is_quote_status` | Reply and quote flags | | `meta.like_count`, `meta.retweet_count`, `meta.reply_count` | Likes, reposts, and replies | | `meta.quote_count`, `meta.view_count`, `meta.bookmark_count` | Quotes, views, and bookmarks | | `meta.author` | Author ID, username, name, and verified flag | Missing fields stay absent. Never treat missing metrics as 0. The `links` output contains each available `meta.url`. ## Keep evidence in RAG citations Store tweet IDs and canonical URLs before embedding tweet text. This keeps evidence after ranking or joining. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} citation_rows = [] for document in documents: tweet_id = document.meta.get("id") tweet_url = document.meta.get("url") if tweet_id and tweet_url: citation_rows.append( { "tweet_id": tweet_id, "url": tweet_url, "created_at": document.meta.get("created_at"), "author": document.meta.get("author"), } ) ``` Require supplied URLs for citations. Reject URLs absent from retrieved documents. Keep `conversation_id` for reply threads. ### Treat tweet text as untrusted context Tweets can contain prompt injection and unsafe URLs. Never treat tweet text as a system instruction. Keep tweets separate from instructions and tool permissions. Limit retrieval by topic and time. Keep tweet IDs, authors, timestamps, and URLs. Require citations. Review sensitive conclusions. Likes and reposts rank results. They do not prove accuracy. Treat outputs from large language models (LLMs) as proposals, not evidence. ## Index tweets or retrieve them live Choose the pipeline pattern that matches freshness requirements. > [card] Live retrieval > > Search during each question for recent tweets and active events. > [card] Indexed corpus > > Store embeddings for repeated research across stable windows. Expect current results, not guaranteed real time delivery. Keep tweet records separate from embeddings. Use `meta.id` for deduplication. ## Paginate without duplicate tweets Both components return `has_more` and `next_cursor`. Keep the request unchanged. Treat cursors as opaque strings. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} search = XquikTweetSearch(top_k=100, query_type="Latest") page = search.run(query="haystack ai") documents_by_tweet_id = {} while True: for document in page["documents"]: tweet_id = document.meta.get("id") if tweet_id: documents_by_tweet_id[tweet_id] = document if not page["has_more"] or not page["next_cursor"]: break page = search.run( query="haystack ai", cursor=page["next_cursor"], ) documents = list(documents_by_tweet_id.values()) ``` Save each cursor after its documents. Never edit a cursor. Deduplicate on `Document.meta["id"]`. ## Run Haystack pipelines asynchronously Haystack 3 uses one `Pipeline` class. Both Xquik components expose `run_async()`. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import asyncio from haystack import Pipeline from haystack_integrations.components.websearch.xquik import XquikTweetSearch async def search_tweets(): pipeline = Pipeline() pipeline.add_component( "twitter_search", XquikTweetSearch(top_k=25, query_type="Latest"), ) return await pipeline.run_async( {"twitter_search": {"query": "haystack agents"}} ) result = asyncio.run(search_tweets()) ``` Use async runs in web servers. Use sync runs for scripts and scheduled jobs. ## Handle every documented error The integration raises `httpx.HTTPStatusError`. Branch on the canonical status before retrying. | Status | Meaning | Action | | - | - | - | | `400` | Invalid request | Fix it. Do not retry unchanged. | | `401` | Invalid API key | Add a valid API key. | | `402` | Account action needed | Check the account balance. | | `404` | Timeline user not found | Check the username or user ID. | | `424` | X retrieval dependency failed | Retry with bounded backoff. | | `429` | Rate limit exceeded | Back off before retrying. | | `502` | X retrieval error | Retry up to the configured limit. | ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import httpx from haystack_integrations.components.websearch.xquik import XquikTweetSearch search = XquikTweetSearch(top_k=20, max_retries=3) try: result = search.run(query="haystack ai") except httpx.HTTPStatusError as error: status = error.response.status_code if status in {400, 401, 402, 404}: raise RuntimeError(f"Fix Xquik request before retrying: HTTP {status}") from error if status in {424, 429, 502}: raise RuntimeError(f"Retry Xquik request with backoff: HTTP {status}") from error raise ``` Record status codes, never credentials. Cap retries to prevent unbounded agent loops. ## Pipeline handoff Use this shape when Haystack hands off results. The receiver can be a vector store, evaluation job, queue, CSV export, or dashboard. > [card] Document rows > > Store content, tweet IDs, URLs, timestamps, authors, and public metrics. > [card] Citation links > > Join each canonical URL to `meta.id`. > [card] Pagination checkpoint > > Store the request, options, `has_more`, and `next_cursor`. > [card] Failure branch > > Store each HTTP status with its pipeline run ID. Keep handoff records separate from embeddings. Later runs can refresh tweets without rebuilding the pipeline. ## Haystack component or direct REST API Does your pipeline already return `Document` objects? Add these components directly. They normalize tweet text, metadata, URLs, and pagination. Use direct Xquik REST routes for followers, following, replies, quotes, and reposts. They also cover lists, communities, media, trends, monitors, approved writes, and extra query options. Both approaches use the same Xquik contracts. Components only support tweet search and user timelines. ## Migrate to Haystack 3 Haystack 3 replaces `AsyncPipeline` with `Pipeline`. Call `await pipeline.run_async(...)` for concurrent execution. Keep `meta.id` as the tweet identity. Test with `haystack-ai==3.0.0` before upgrading. Check the [official migration guide](https://docs.haystack.deepset.ai/docs/migration) for other changes. ## Common Haystack X (Twitter) API questions ### What is Haystack AI? Haystack links search, RAG, and AI agents inside Python pipelines. ### How does the X (Twitter) API search tweets? It accepts queries, filters, ordering, and cursors. Xquik returns tweets and citation URLs. ### What is a Twitter search API Python workflow? Install both packages. Run `XquikTweetSearch`, then process documents, links, and cursors. ### How does an API Twitter search workflow keep cursors? Save `next_cursor` after each page. Reuse every filter. ### How does the X (Twitter) API search tweets by keyword? Pass keywords, phrases, hashtags, accounts, or filters. Choose `Latest` or `Top`. ### Haystack AI vs LangChain, which fits Twitter RAG? Choose Haystack for `Document` pipelines. Choose LangChain for its retrievers and tools. ### Where is the Haystack AI GitHub integration? The [Xquik Haystack repository](https://github.com/Xquik-dev/xquik-haystack) contains the package and offline tests. ### Can a Haystack AI agent publish tweets? No. This integration reads searches and timelines. Use the write API for approved tweets. ### Does this require a Haystack Enterprise Platform? No. Run the open-source components in your Haystack setup. ## Source and contracts * [Xquik Haystack repository](https://github.com/Xquik-dev/xquik-haystack) * [Xquik Haystack PyPI package](https://pypi.org/project/xquik-haystack/) * [Haystack 3.0 release](https://github.com/deepset-ai/haystack/releases/tag/v3.0.0) * [Search Tweets API](/api-reference/x/search-tweets) * [Get User Timeline API](/api-reference/x/user-tweets) # Hermes tweet for Hermes Agent X (Twitter) tools Source: https://docs.xquik.com/guides/hermes-tweet Install Hermes Tweet for Hermes Agent. Search tweets, export followers and replies, and monitor X (Twitter) accounts. Run approved actions through Xquik. > For the complete documentation index, see [llms.txt](/llms.txt). Hermes Tweet is Xquik's native Hermes Agent Twitter plugin. It provides a structured X (Twitter) automation toolset. The plugin adds catalog-guided X (Twitter) tools to the Hermes Agent runtime. The Python package includes read tools, optional action tools, and 2 slash commands. It also bundles a reusable Hermes Twitter skill. That reusable skill explains supported tweet and profile workflows. Use Hermes Tweet for X (Twitter) search, profiles, followers, replies, monitors, and approved actions. Every live call starts from the bundled OpenAPI catalog. This design helps Hermes choose documented methods, paths, parameters, and response shapes. Each AI agent starts with catalog discovery. It then executes only a matching tool call. ## Why add X (Twitter) tools to Hermes Agent Hermes Agent handles planning, memory, tools, and long-running workflows. Hermes Tweet adds focused X (Twitter) API access through Xquik. The plugin exposes 102 agent-callable endpoints. Those endpoints cover tweets, profiles, timelines, followers, following, replies, media, monitors, and webhooks. Hermes Tweet separates discovery, reads, and approved actions. This separation reduces guessed routes and unintended writes. Use the plugin for these Hermes Agent Twitter tasks. * Search tweets by keyword, phrase, hashtag, or account. * Read tweet details, replies, quotes, and engagement counts. * Inspect profiles, timelines, followers, following, and mentions. * Export followers, following accounts, or tweet replies. * Monitor accounts or keywords and deliver webhook events. * Draft, post, reply, like, repost, follow, or send DMs. The read tool keeps complete JSON payloads. It does not drop tweet, profile, media, or pagination fields. ## Prerequisites * Python `3.11` or newer * Hermes Agent with plugin support * [Xquik API key](/x-api-quickstart) Hermes exposes pip plugins through the `hermes_agent.plugins` entry-point group. Enable each third-party plugin before loading it. ## Install For an existing Hermes Agent install, use the plugin installer. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} hermes plugins install Xquik-dev/hermes-tweet --enable ``` Hermes records plugin enablement in `~/.hermes/config.yaml`. The Hermes home directory is `~/.hermes`. Hermes prompts for `XQUIK_API_KEY` during an interactive install and stores it in `~/.hermes/.env`. Non-interactive installs skip the prompt. Set the key in the process environment or `~/.hermes/.env` before calling `tweet_read`. When you manage package installation yourself, use the published PyPI package. Install it directly into the Hermes Python environment. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} uv pip install --python ~/.hermes/hermes-agent/venv/bin/python hermes-tweet hermes plugins enable hermes-tweet ``` If your Hermes Python environment includes `pip`, this path is also valid. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} ~/.hermes/hermes-agent/venv/bin/python -m pip install hermes-tweet hermes plugins enable hermes-tweet ``` The current package version is `0.1.12`. The plugin name is `hermes-tweet`, and the Python entry point is `hermes-tweet = hermes_tweet`. ## Configure Set your Xquik API key before starting Hermes. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export XQUIK_API_KEY="xq_..." ``` For persistent Hermes sessions, add the key to `~/.hermes/.env`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} XQUIK_API_KEY=xq_... ``` You can also set these optional environment variables. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export XQUIK_BASE_URL="https://xquik.com" export HERMES_TWEET_ENABLE_ACTIONS="false" ``` Keep `HERMES_TWEET_ENABLE_ACTIONS=false` for unattended sessions. Enable actions only for workflows with an explicit approval step. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export HERMES_TWEET_ENABLE_ACTIONS="true" ``` Hermes may already be running after you edit `~/.hermes/.env`. If it is, do this before calling `tweet_read`. Run `/reload` in an interactive CLI session, or restart gateway and cron sessions. New agent runs read the updated environment after restart. ## Tools > [card] tweet_explore > > Search the bundled Xquik endpoint catalog without making an API call. Use it before every live endpoint call. > [card] tweet_read > > Call catalog-listed read-only endpoints after you configure `XQUIK_API_KEY`. > [card] tweet_action > > Call write-like or private endpoints only when `HERMES_TWEET_ENABLE_ACTIONS=true`. Start with `tweet_explore`. Discover the method, path, parameters, and response shape before any endpoint call. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use tweet_explore to find the endpoint for user lookup, then call tweet_read for @username. ``` ## Hermes Agent Twitter search Start a tweet search with a concrete question. Ask `tweet_explore` for the catalog route before making a live call. For keyword searches, use `GET /api/v1/x/tweets/search`. Pass a specific `q` value and a bounded `limit`. Useful queries combine a topic with intent. Examples include product feedback, support complaints, launches, hiring, or competitor mentions. Return fields needed by the next workflow step. Typical fields include tweet IDs, text, authors, timestamps, metrics, media, and entities. Keep `next_cursor` whenever `has_next_page` is true. Continue only when the workflow needs another page. Do not treat every matching tweet as equally relevant. Filter results by the task's topic, author, language, date, or engagement criteria. For a tweet search agent, summarize patterns after collecting the selected pages. Keep source tweet IDs beside each conclusion. ## Profiles, followers, following, and replies Hermes Tweet can inspect an account before starting a larger export. Use catalog-listed reads for profiles, timelines, followers, following, and mentions. For small lists, use the matching read endpoint. Follow the returned cursor until the requested result count is complete. For bulk work, use the extraction workflow. Available extraction types include `follower_explorer`, `following_explorer`, and `reply_extractor`. Estimate each extraction before creating it. Confirm the target username, tweet ID, result limit, format, and expected scope. After approval, create the extraction with `tweet_action`. Poll its status with `tweet_read` until the job becomes terminal. Export completed results as CSV, JSON, or XLSX. Retain stable tweet or user IDs for later joins. A Twitter follower export supports audience analysis and CRM enrichment. A following export lists accounts that the target follows. A reply export supports conversation analysis, support triage, and giveaway review. Never infer sentiment from usernames alone. ## Monitors and webhook delivery Use an account monitor for new posts from selected profiles. Use a keyword monitor for matching tweets across X. Create monitors only after confirming the target and cadence. Register a webhook only after reviewing its receiver URL. Store the webhook secret outside Hermes transcripts. Verify `X-Xquik-Signature` against the exact raw request body. Store `deliveryId` and `streamEventId` for deduplication. Return `2xx` for duplicates you already accepted. Monitor events can trigger summaries, alerts, CRM updates, or research queues. Keep each downstream action separately approved. ## Approved Twitter actions Hermes Tweet keeps `tweet_action` unavailable by default. Enable it only for workflows that can change state. Before every action, review the method, path, payload, account, and expected effect. Require explicit approval for the exact request. Supported actions cover tweets, replies, likes, reposts, follows, DMs, profiles, media, communities, and lists. Use a unique `Idempotency-Key` for durable write actions. Store the returned action ID and status URL. Poll while `terminal` is false. Retry only when `safeToRetry` is true. For tweet media, pass public HTTPS image or MP4 URLs in `media`. For DM media, upload first and pass its `mediaId`. Keep full DM bodies out of shared outputs. Return only the fields needed for confirmation. ## Workflow handoffs Use `tweet_explore` first. Then choose `tweet_read` for public reads. Or choose `tweet_action` for approved jobs that create or change state. > [card] Tweet search read > > Use `tweet_read` with `GET /api/v1/x/tweets/search`, a concrete `q`, and a > bounded `limit`. `tweet_read` returns tweet IDs, text, authors, timestamps, and metrics. > [card] Follower export action > > Use `tweet_action` to estimate and create `follower_explorer`. Then use > `tweet_read` to poll the job and export CSV, JSON, or XLSX results. > [card] Monitor webhook action > > Use `tweet_explore` with `include_actions true` to find monitor and webhook > endpoints. Then use `tweet_action` for `POST /api/v1/monitors` or > `POST /api/v1/monitors/keywords` and `POST /api/v1/webhooks` only after > approval. Store the webhook `secret` in a secret manager. In receivers, > verify `X-Xquik-Signature`. Store `deliveryId` and `streamEventId`. Return > `2xx` for accepted duplicates. Keep endpoint signing values, raw request > body, raw signature, and full headers out. That covers Hermes transcripts and > shared workflow outputs. > [card] Media tweet or DM action > > Use public media URLs in `media` for tweet or reply actions. Store the > durable action `id`, `status`, `billing`, `result`, and `statusUrl`. Poll > with `tweet_read` while `terminal` is false. For DM attachments, upload > media first. Pass one returned `mediaId` in `media_ids`, then store the DM > action. Keep full DM bodies out of shared outputs and leave > `reply_to_message_id` unset. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use tweet_explore to find tweet search endpoints. Use tweet_read for GET /api/v1/x/tweets/search with q "AI agents". Set limit 25. Return tweet id, text, author username, createdAt, and engagement counts. ``` ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use tweet_explore with include_actions true to find follower export endpoints. Estimate follower_explorer for @username with resultsLimit 10000. Create the job with tweet_action only after approval. Poll /api/v1/extractions/{id}, then export CSV, JSON, and XLSX with tweet_read. ``` ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use tweet_explore with include_actions true to find monitor and webhook endpoints. Create an account monitor or keyword monitor with tweet_action only after approval. Register the receiver URL with tweet_action for POST /api/v1/webhooks. Store the webhook secret in a secret manager. Verify X-Xquik-Signature, store deliveryId and streamEventId, and return 2xx for accepted duplicates. Keep endpoint signing values and raw request bodies out of Hermes transcripts. Also exclude raw signatures and full headers from shared workflow outputs. ``` ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use tweet_explore with include_actions true to find media write endpoints. For a tweet or reply, call tweet_action for POST /api/v1/x/tweets. Set media to public HTTPS image or MP4 URLs, or media_ids to uploaded IDs. Never send both. For tweet_action, send a unique Idempotency-Key. Store id, status, billing, result, and statusUrl. Poll with tweet_read while terminal is false. Retry only when safeToRetry is true, using a new key. For a DM attachment, call tweet_action for POST /api/v1/x/media first. Then call POST /api/v1/x/dm/{userId} with one media_ids value. Leave reply_to_message_id unset. Return the complete action record. Read the confirmed resource ID from result.id. Keep full DM bodies out of shared outputs. ``` ## Runtime diagnostics For scriptable checks, use `hermes tools list`. Bare `hermes tools` opens the interactive tool UI and requires a TTY. The list command reports plugin toolsets. Confirm `hermes-tweet` appears before testing calls. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} hermes tools list ``` Run a non-mutating one-shot probe after you enable the plugin. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} hermes -z "Use tweet_explore, then read /api/v1/x/trends. Do not call tweet_action." --toolsets hermes-tweet ``` Expect this behavior. * `tweet_explore` can inspect catalog endpoints without an API key. * Without `XQUIK_API_KEY`, a non-mutating Hermes probe exposes `tweet_explore` only. * After configuration and restart, `tweet_read` can read `/api/v1/x/trends`. * `tweet_action` stays hidden or disabled unless `HERMES_TWEET_ENABLE_ACTIONS=true`. * `/xstatus` and `/xtrends` appear in the Hermes plugin command registry. Hermes one-shot prompts do not dispatch `/xstatus` as an interactive slash command. Verify slash commands in an active CLI or gateway session. Use `hermes -z` for tool-call probes. Non-interactive installs cannot prompt for credentials. Set `XQUIK_API_KEY` in the process environment or `~/.hermes/.env`. ## Slash commands > [card] /xstatus > > Show Xquik account, subscription, and usage status. Run it in an active Hermes CLI or gateway session. > [card] /xtrends > > Show current X (Twitter) trends from the plugin command registry. ## Safety model Hermes Tweet reads auth from environment variables and injects it at request time. The model does not receive the API key as a tool argument. The plugin blocks dashboard-only administrative endpoints from the catalog. It also blocks billing, credits, support, API-key, and reauthentication endpoints. Private reads and write-like endpoints use `tweet_action`. The tool stays hidden unless `HERMES_TWEET_ENABLE_ACTIONS=true`. For unattended jobs, keep action tools disabled and use only `tweet_explore` plus `tweet_read`. ## API coverage Hermes Tweet includes 102 agent-callable Xquik endpoints. OpenAPI generates the catalog. The catalog includes MPP-tagged read endpoints at fixed prices. > [card] Public reads > > Tweet search, tweet lookup, user lookup, timelines, articles, and trends. > [card] Private reads > > Account status, connected accounts, usage, and events. > [card] Monitoring > > Account monitors, keyword monitors, events, and webhooks. > [card] Workflows > > Extractions, giveaway draws, exports, compose, drafts, and styles. > [card] Actions > > Tweet, reply, like, retweet, follow, DM, profile, media, and communities. ## Local development For local plugin development, regenerate the bundled catalog from the Xquik OpenAPI contract. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python scripts/build_catalog.py ../xquik/openapi.yaml ``` Run that command from the `hermes-tweet` repository after the Xquik OpenAPI file changes. ## Verify After installing, enabling, and setting `XQUIK_API_KEY`, run this command. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} /xstatus ``` For scriptable diagnostics, list the plugin toolset. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} hermes tools list ``` Then test a read workflow. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use tweet_explore to find X trends, then use tweet_read to return current trends. ``` For action workflows, require an explicit draft and approval step before enabling `tweet_action`. ## Troubleshooting > [card] Tools missing > > Run `hermes plugins enable hermes-tweet`, then confirm `hermes-tweet` appears in `hermes tools list`. > [card] Auth fails > > Confirm you export `XQUIK_API_KEY` in the same environment that starts Hermes. Or store it in `~/.hermes/.env`. > [card] Env reload > > Run `/reload` in the interactive CLI, or restart gateway and cron sessions. > [card] Action tool hidden > > Set `HERMES_TWEET_ENABLE_ACTIONS=true` only for approved action workflows. > [card] Endpoint missing > > Regenerate the catalog from the current Xquik OpenAPI file in local development. > [card] Risky writes > > Keep `HERMES_TWEET_ENABLE_ACTIONS=false` and use read tools only. ## Hermes Agent Twitter FAQ ### What is Hermes Agent? Hermes Agent is an open-source agent runtime from Nous Research. It supports tools, skills, plugins, memory, scheduled work, and gateway sessions. Hermes Tweet extends that runtime with Xquik's X (Twitter) API tools. It does not replace Hermes Agent itself. ### How do I install Hermes tweet? Install the GitHub package with `hermes plugins install Xquik-dev/hermes-tweet --enable`. This command installs and enables the plugin. You can also install `hermes-tweet` from PyPI. Install it inside Hermes' Python environment, then enable the plugin. Restart Hermes after changing environment variables. Run `hermes tools list` before testing a live Twitter workflow. ### Is Hermes tweet a Hermes Agent skill or plugin? Hermes Tweet is an executable Hermes Agent plugin. It registers `tweet_explore`, `tweet_read`, and `tweet_action`. The package also bundles a Hermes skill. That skill teaches endpoint discovery, read selection, approvals, and secret handling. A skill supplies operating guidance. The plugin supplies the Python tools that make API calls. ### How does Hermes Agent search X (Twitter)? Hermes first calls `tweet_explore` with the search goal. The catalog returns a matching method, route, parameters, and response shape. Hermes then calls `tweet_read` for `GET /api/v1/x/tweets/search`. The `q` parameter contains the keyword, phrase, hashtag, or account query. The result can include tweets, authors, timestamps, engagement metrics, media, and pagination fields. The exact payload follows the Xquik API response. ### Can Hermes Agent export Twitter followers? Yes. Use `tweet_explore` to find `follower_explorer`, then estimate the requested result count. Create the extraction only after approval. Poll the extraction and export the completed followers as CSV, JSON, or XLSX. The same workflow supports `following_explorer`. Choose it when the task needs accounts followed by a profile. ### Can Hermes Agent export tweet replies? Yes. Use `reply_extractor` for a bounded reply export. Confirm the target tweet ID and result limit before creation. Store tweet IDs, author IDs, timestamps, reply text, and available metrics. Keep cursors or job status for reproducible collection. Use the exported replies for support triage, conversation research, or giveaway review. Apply project-specific privacy and retention rules. ### Can Hermes Agent monitor X (Twitter) accounts? Yes. Account monitors watch selected profiles. Keyword monitors watch matching tweets. Send monitor events to a verified webhook receiver. Deduplicate events before triggering alerts or downstream actions. ### Does Hermes tweet need X developer credentials? No. It needs no X developer credentials. Hermes Tweet authenticates with an Xquik API key. Keep `XQUIK_API_KEY` in the Hermes runtime environment. Never pass that key through a model-visible tool argument. ### Hermes Agent vs OpenClaw, which plugin should I use? Choose Hermes Tweet for Hermes Agent. Choose TweetClaw for OpenClaw. Hermes Tweet is a Python entry-point plugin. TweetClaw is an npm plugin for OpenClaw. Both use the Xquik API contract. Both start with catalog discovery before live Twitter calls. Do not install both for one runtime. Pick the plugin that matches the agent host. ### Is Hermes tweet an MCP server? No. Hermes Tweet runs inside Hermes Agent and registers native Python tools. Use the [Xquik MCP server](/mcp/overview) when your client supports MCP. Use Hermes Tweet for native Hermes plugin loading. ### Why are Hermes tweet tools missing? Confirm installation with `hermes plugins`. Enable the plugin with `hermes plugins enable hermes-tweet`. Then run `hermes tools list`. Confirm the `hermes-tweet` toolset appears. Restart Hermes after configuration changes. Check the startup output for a plugin registration failure. An open Hermes Agent issue reports some import-time failures can remain cached. Restart after fixing the registration error. ### Where is Hermes tweet on GitHub? The official repository is [Xquik-dev/hermes-tweet](https://github.com/Xquik-dev/hermes-tweet). It contains source, tests, release notes, security policy, and plugin metadata. Use the repository issue tracker for reproducible plugin defects. Use these docs for supported Xquik workflows and API routes. ## References * [Hermes Tweet GitHub repo](https://github.com/Xquik-dev/hermes-tweet) * [Hermes Tweet on PyPI](https://pypi.org/project/hermes-tweet/) * [Hermes Agent plugin docs](https://hermes-agent.nousresearch.com/docs/user-guide/features/plugins) * [TweetClaw for OpenClaw](/guides/tweetclaw) * [API Reference](/api-reference/overview) * [MCP Server](/mcp/overview) # LangChain X (Twitter) API agent with MCP & LangGraph Source: https://docs.xquik.com/guides/langchain Build LangChain and LangGraph X (Twitter) API agents for tweet search, profiles and followers. They add monitors, exports, and reviewed actions through MCP. > For the complete documentation index, see [llms.txt](/llms.txt). Build a LangChain X (Twitter) API agent through Xquik's MCP server. Search tweets, inspect profiles, export followers, replay monitor events, and review X (Twitter) actions. This LangChain X (Twitter) API integration helps when building agents for Twitter. It keeps tweet IDs, timestamps, cursors, and route errors as typed values. ## Why use LangChain with an X (Twitter) API? LangChain connects Xquik tools to models, retrievers, databases, and application services. LangGraph adds durable state, resumable jobs, and human approval. Choose a narrow route for each Twitter agent task. | Agent task | Xquik route | Keep for the next step | | - | - | - | | Search tweets | `GET /api/v1/x/tweets/search` | Query, tweet IDs, authors, `created`, and cursor | | Inspect a profile | `GET /api/v1/x/users/{id}` | User ID, username, biography, and follower count | | Export followers | `POST /api/v1/extractions` | Extraction ID, status, poll URL, and export state | | Watch keywords | `POST /api/v1/monitors/keywords` | Monitor ID, event types, and next billing time | | Replay monitor events | `GET /api/v1/events` | Event IDs, `has_more`, and `next_cursor` | | Post or reply | The matching X write route | Tweet ID, action ID, status, and charged credits | Use LangChain for short tool-calling conversations. Use LangGraph when work must resume after failures, approvals, or process restarts. Both use the same MCP tools and normalized response contract. ## LangChain X (Twitter) API prerequisites * Python 3.10 or later * An [Xquik API key](/x-api-quickstart) beginning with `xq_` * A LangChain-supported model with tool and structured-output support * A connected X account for private reads or write actions Public X reads do not require X Developer credentials. Authenticate with Xquik. Connect an X account only when the selected route requires it. This supplies an X (Twitter) API for Python agents through one MCP connection. Authenticate this MCP server with an Xquik API key. Do not send OAuth 2.0 or an OAuth token. Keep credentials outside user context, prompts, and agent memory. ## Install the Python packages Install compatible minor ranges. This avoids silent breaking changes. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install --upgrade \ "langchain>=1.3,<1.4" \ "langchain-mcp-adapters>=0.3,<0.4" \ langchain-anthropic \ python-dotenv ``` Model Context Protocol (MCP) powers LangChain MCP support. LangChain MCP support comes from `langchain-mcp-adapters`. This open-source adapter loads tool schemas from configured MCP server connections. MCP clients turn model tool calls into authenticated HTTP requests. ### Separate MCP clients, servers, and model credentials LangChain runs the MCP client. Xquik runs the MCP server. The client loads tool definitions before the first API call. The server validates each route, HTTP method, query, body, and Xquik API key. Use an OpenAI API key only with a compatible model provider. Keep every model credential separate from the Xquik key. Never send either credential through prompts, user context, tool arguments, or saved handoffs. Store secrets outside source control. ```bash .env theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} XQUIK_API_KEY=xq_YOUR_KEY_HERE ANTHROPIC_API_KEY=sk-ant-... ``` Add `.env` and generated handoff files to `.gitignore`. ```text .gitignore theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} .env xquik-*-handoff.json ``` ## How to use the X (Twitter) API in Python with LangChain Use Pydantic for the final handoff. Do not rename a text response to `.json`. Validated output rejects missing tweet IDs and malformed cursors. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import asyncio import os from pathlib import Path from typing import Literal from dotenv import load_dotenv from langchain.agents import create_agent from langchain_mcp_adapters.client import MultiServerMCPClient from pydantic import BaseModel class TweetRow(BaseModel): tweet_id: str text: str author_username: str | None = None created: int | None = None url: str | None = None class TweetSearchHandoff(BaseModel): query: str route_used: str tweets: list[TweetRow] has_more: bool next_cursor: str | None = None stop_reason: Literal[ "complete", "requested_limit", "cursor_stalled", "page_cap", ] async def main() -> None: load_dotenv() client = MultiServerMCPClient( { "xquik": { "transport": "http", "url": "https://xquik.com/mcp", "headers": {"x-api-key": os.environ["XQUIK_API_KEY"]}, }, } ) tools = await client.get_tools() agent = create_agent( model="anthropic:claude-sonnet-4-6", tools=tools, response_format=TweetSearchHandoff, system_prompt=( "Use Xquik for Twitter API requests. Preserve exact IDs and cursors. " "Use GET /api/v1/x/tweets/search. Never invent missing tweet fields." ), ) result = await agent.ainvoke( { "messages": [ { "role": "user", "content": ( "Search 25 recent tweets about LangChain MCP. " "Return the query, route, tweet rows, cursor state, " "and an explicit stop reason." ), } ] } ) handoff = result["structured_response"] Path("xquik-langchain-handoff.json").write_text( handoff.model_dump_json(indent=2), encoding="utf-8", ) asyncio.run(main()) ``` Wait for `result = await`, then read `structured_response`. `MultiServerMCPClient` loads the `docs`, `search`, `execute`, and `whoami` tools. The client is stateless by default. Save every cursor, job ID, and write status externally. The `execute` tool runs a bounded sandbox function. That function calls `xquik.request(path, { method, body, query })`. The sandbox injects authentication. Use `search` first when the agent does not know a route or parameter. Each call uses the documented Xquik route and response fields. ## Keep the MCP response contract MCP returns normalized snake_case fields and Unix-second timestamps. A REST `createdAt` field becomes `created`, not `created_at`. Keep source values before applying an application-specific schema. Search and list responses use `has_more` and `next_cursor`. Reuse the same query and filters on every page. Pass `next_cursor` as `cursor` for tweets, profiles, followers, replies, timelines, communities, and lists. Events, draws, and extraction pages use `cursor`. Radar pages use `after`. Draft pages use `afterCursor`. Treat each cursor as opaque. Stop pagination when one condition becomes true. * The agent collects the requested total. * `has_more` becomes `false`. * `next_cursor` is missing. * `next_cursor` repeats. * The agent reaches the configured page cap. An empty page can still have `has_more: true`. Continue when the cursor advances. Deduplicate tweets and users by their stable `id` values. MCP tool output has a 24,000-character limit. Project only the required fields. Choose extraction exports for complete-row workflows. ## Keep a resumable Twitter agent handoff Conversation history is not a reliable job database. Store the values needed for retries, pagination, exports, and downstream tools. > [card] Tweet search rows > > Store `tweet_id`, `text`, `author_username`, `created`, `url`, `has_more`, > `next_cursor`, and the original query. > [card] User profile rows > > Store source `id` as `user_id`. Keep `username`, `name`, `description`, > `followers`, `verified`, and `profile_picture`. > [card] Follower exports > > Store the source user, extraction ID, status, and poll URL. Also store the > export state and requested file format. > [card] Tweet replies > > Store the root tweet ID, reply IDs, parent IDs, cursor state, and coverage > diagnostics. Keep nested replies separate. > [card] Monitor events > > Store `monitor_id`, `event_id`, `type`, `occurred_at`, `has_more`, and > `next_cursor`. Use the next cursor as `cursor`. > [card] Webhook delivery > > Store `webhook_id`, `delivery_id`, and `stream_event_id`. Keep the one-time > webhook secret in a secret manager. > [card] Write actions > > Store `tweet_id` or `write_action_id`. Keep `status`, `charged_credits`, > `poll`, and the idempotency key. > [card] Media attachments > > For tweets, pass public URLs in `media` or uploaded IDs in `media_ids`. > DMs take exactly 1 uploaded `media_id`. Keep API keys, webhook secrets, headers, and raw signatures outside agent state. Do not place private messages or full request bodies in shared traces. ## Build X (Twitter) API error handling Do not let the model guess whether a failed request should retry. Match every HTTP status code before choosing the next action. A 400 Bad Request indicates invalid route parameters or unsupported fields. | Status | Meaning | LangChain agent decision | | - | - | - | | `400` | Invalid route parameters or unsupported fields | Fix the request before retrying | | `401` | Missing or invalid authentication | Stop and replace the Xquik credential | | `402` | Subscription or credit action required | Report choices and request explicit confirmation | | `424` | Upstream dependency failure or incomplete replies | Keep partial rows and inspect `error.retryable` | | `429` | Rate limit reached | Respect `error.retry_after`, then back off | | `502` | Temporary upstream failure | Apply bounded backoff to safe read retries | Errors contain `error.type`, `error.code`, and `error.message`. Some errors add `error.retryable` or `error.retry_after`. Store these fields with the job. Keep exact error messages for operators. Record where the error occurred. Server errors may permit bounded retries for safe reads. Client errors require a corrected request or credential. Test edge cases such as repeated cursors, expired keys, and empty pages. Also test partial reply trees. A `402` never authorizes a purchase. Report available payment choices. Wait for an explicit decision before any supported account checkout action. ## Add human approval to X (Twitter) actions Read-only agents can search tweets and inspect public profiles automatically. Write-enabled agents need a review boundary before posting or replying. Xquik exposes reads and writes through one aggregate `execute` tool. Interrupt every `execute` call in a write-capable agent. Review the proposed call before approving it. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from langchain.agents import create_agent from langchain.agents.middleware import HumanInTheLoopMiddleware from langgraph.checkpoint.memory import InMemorySaver agent = create_agent( model="anthropic:claude-sonnet-4-6", tools=tools, middleware=[ HumanInTheLoopMiddleware( interrupt_on={ "xquik": { "allowed_decisions": ["approve", "reject"], } } ) ], checkpointer=InMemorySaver(), ) config = { "configurable": { "thread_id": "xquik-twitter-agent-job-001", } } pending = await agent.ainvoke( { "messages": [ { "role": "user", "content": "Draft a reply, but never post without my approval.", } ] }, config=config, ) ``` `InMemorySaver` suits local development only. Use a persistent LangGraph checkpointer in production. Resume with the same `thread_id` after approval. Reject any action with an unexpected route, account, target, text, or media. ## Build durable LangGraph Twitter workflows A LangGraph Twitter agent should separate discovery, review, execution, and storage. Separating these stages prevents duplicate charged actions during recovery. ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} flowchart LR A["Explore the Twitter API route"] --> B["Search tweets or load a profile"] B --> C["Validate IDs, fields, and cursor"] C --> D{"Write action needed?"} D -->|"No"| E["Persist the typed handoff"] D -->|"Yes"| F["Request human approval"] F -->|"Approve"| G["Execute once with idempotency"] F -->|"Reject"| E G --> E ``` Save graph state after each external call. Store the last completed node, route, request fingerprint, response IDs, cursor, and retry count. Store write idempotency keys before execution. Never retry a pending write by creating a new action. Poll its returned status. Apply bounded backoff to safe reads only when the contract permits it. ## Connect multiple MCP servers A LangChain MCP server entry defines its transport, URL, and headers. Name each server uniquely. This keeps multiple MCP servers distinct inside the agent. Prefix tool names when another MCP server exposes similar operations. This prevents the model from choosing the wrong search or publishing tool. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} client = MultiServerMCPClient( { "xquik": { "transport": "http", "url": "https://xquik.com/mcp", "headers": {"x-api-key": os.environ["XQUIK_API_KEY"]}, }, "knowledge": { "transport": "http", "url": "https://knowledge.example.com/mcp", }, }, tool_name_prefix=True, ) ``` Give the Xquik agent only the tools required for its current job. Smaller tool sets improve route selection and reduce accidental actions. ## Tested LangChain compatibility Xquik checked these versions on August 2, 2026. | Package | Checked version | Supported range in this guide | | - | - | - | | Python | 3.10 or later | `>=3.10` | | `langchain-mcp-adapters` | 0.3.0 | `>=0.3,<0.4` | | `langchain` | 1.3.14 | `>=1.3,<1.4` | | `langgraph` | 1.2.10 | Installed through LangChain constraints | Pin exact versions in production lockfiles. Re-test structured output, approval, and checkpointer behavior before upgrading a minor range. ## LangChain X (Twitter) API questions ### Can LangChain call the X (Twitter) API? Yes. Load Xquik through `langchain-mcp-adapters`. The agent can call eligible tweet, profile, follower, monitor, extraction, and X action routes. ### Can LangChain scrape tweets with Python? Yes. Call `GET /api/v1/x/tweets/search` through MCP. Keep each tweet ID, text, author, `created` timestamp, URL, and pagination cursor. ### What does "Python API Twitter" mean? "Python API Twitter" reverses the usual Python X (Twitter) API search phrase. Python runs LangChain, and LangChain calls Xquik through MCP. The agent can search tweets, inspect profiles, export followers, and review X (Twitter) actions. ### What does LangChain MCP add to a Twitter agent? LangChain MCP converts remote operations into model-callable tools. Xquik adds tweet search, profile lookup, follower exports, monitors, and reviewed actions. ### Can LangChain post tweets through MCP? Yes. Connect the target X account first. Require human approval and keep the idempotency key. Store the returned tweet or write-action ID. ### How do I authenticate with the X (Twitter) API using Python? Send an Xquik API key in the MCP `x-api-key` header. You need no X Developer keys. Some private reads and writes require a connected Twitter account. ### Should I use LangChain or LangGraph for tweet search? Use LangChain for a short search and typed handoff. Use LangGraph for paginated searches, approvals, checkpoints, durable retries, or scheduled monitoring. ### How does a LangChain agent paginate Twitter results? Save `has_more` and `next_cursor`. Send the cursor with unchanged filters. Stop on completion, limits, or a stalled cursor. ### How do I prevent an agent from posting automatically? Interrupt every `execute` tool call in write-capable agents. Approve the exact route, account, target, text, and media before execution. ### How do I post a tweet using Python with LangChain? Ask the agent to use the matching X write route. Review the exact text, account, media, and idempotency key. Approve the tool call once. ### How do I handle X (Twitter) API rate limits in Python? Read `error.retry_after` from `429` responses. Wait for that interval. Retry safe read requests with bounded backoff. Never recreate a pending write. ### How should a Python X (Twitter) API agent save results? Validate a Pydantic schema first. Store typed tweet IDs, fields, cursors, errors, and job status. Never save conversational prose as JSON. ### Can a LangGraph agent export Twitter followers? Yes. Create an extraction, store its ID, and poll its status. Export only after completion. Store the source user and requested format together. ### Can LangChain monitor Twitter keywords continuously? Yes. Create a monitor and webhook, then store their IDs. Replay missed events through `GET /api/v1/events` using `cursor` pagination. Monitor events are asynchronous. Xquik does not guarantee real-time delivery. ## Next steps * Review the [MCP tool contract](/mcp/tools). * Follow the [agent handoff checklist](/mcp/agent-handoff). * Build a [tweet search workflow](/guides/tweet-scraper-csv-export). * Add [monitor and webhook delivery](/guides/brand-monitoring-workflow). * Compare [X (Twitter) API alternatives](/twitter-api-alternatives). Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp. # Make.com Twitter integration for X API automation Source: https://docs.xquik.com/guides/make Build Make Twitter automation for tweet search, followers, posts, and webhooks. Handle X (Twitter) API errors. Connect profiles, replies, and monitors. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik supports a Make.com Twitter integration without an X Developer app. Build tweet searches, profile lookups, follower exports, scheduled posts, and monitor alerts. The same integration supports replies, trends, extraction jobs, and signed webhooks. The 2025 decommissioning removed Make's native X app. A private Make custom app keeps each scenario focused and authentication testable. Teams can later decide whether public app review fits their distribution needs. ## Make alternative or Make add-on Xquik doesn't build workflows, so it doesn't replace Make. Keep Make for triggers, branching and app steps. Add Xquik when a workflow needs X (Twitter) data or X (Twitter) actions. That covers tweet search, follower exports, posts and monitor events. ## Choose a Make Twitter automation pattern A Make Twitter automation should start with one clear trigger. Use schedules for recurring tweet searches, trends, or follower exports. Instant webhook delivery applies to replies, quotes, reposts, and new tweets. Use polling when an extraction job can finish after the scenario ends. Build a Make scenario automation around one bounded Xquik operation. Then route normalized tweet or profile fields to each destination. This structure keeps the automation workflow observable and easier to retry. The HTTP module supports a limited private prototype. A private custom app suits reusable actions and consistent error handling. Both approaches can call the same documented API endpoints. ## Build a Make.com API integration A Make.com API integration uses an Xquik API key for authentication. It does not require X OAuth or a native Twitter account connection. The Make custom app stores the key inside an encrypted connection field. Use `/account` to validate API keys without changing tweets or profiles. Place the base URL, authentication header, and sanitization rules centrally. Focused modules should cover tweets, users, followers, monitors, and webhooks. A Make Twitter integration should return small, stable output bundles. Avoid passing complete API responses into Slack, Sheets, or a CRM. The Make API integration should retain IDs, cursors, timestamps, and status fields. Treat the Make X (Twitter) API layer as a private integration boundary. The integration platform can then support drag-and-drop scenario assembly. This step-by-step structure keeps every module focused on one result. ## Prerequisites * [Xquik API key](/x-api-quickstart) * Make organization with Custom Apps access * HTTPS Make webhook URL for instant monitor-event scenarios * Optional Slack, Sheets, Airtable, or CRM module for downstream steps ## App shape > [card] Connection > > Use an API key parameter named `apiKey` and inject it as `x-api-key`. > [card] Base URL > > Call Xquik REST modules from `https://xquik.com/api/v1`. > [card] Modules > > Start with Search Tweets, Get Tweet, Get User, Get Trends, and Create Tweet. Start with Create Extraction, Create Monitor, Create Webhook, and Make an API Call too. > [card] Triggers > > Support Monitor Event instant webhooks and Extraction Completed polling. > [card] Error handling > > Map `401`, `402`, `429`, and `5xx` to short scenario messages. Make custom apps split this into a connection, base request settings, and modules. They can also add webhook components. Use Xquik's `/account` endpoint as the connection test. That endpoint fits because it validates the API key without mutating data. ## Connection Create a connection parameter that stores the API key as a password field. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} [ { "name": "apiKey", "label": "Xquik API Key", "type": "password", "required": true, "editable": true, "help": "Create an API key in the Xquik dashboard." } ] ``` Use `GET /account` to validate the connection. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "url": "https://xquik.com/api/v1/account", "method": "GET", "headers": { "x-api-key": "{{parameters.apiKey}}" }, "response": { "metadata": { "type": "email", "value": "{{body.email}}" }, "error": { "message": "{{body.message || body.error || 'Xquik authentication failed.'}}" } }, "log": { "sanitize": ["request.headers.x-api-key"] } } ``` ## Base request pattern Use one base request pattern for JSON modules. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "baseUrl": "https://xquik.com/api/v1", "headers": { "x-api-key": "{{connection.apiKey}}", "content-type": "application/json" }, "response": { "error": { "message": "{{body.message || body.error || 'Xquik request failed.'}}" } }, "log": { "sanitize": ["request.headers.x-api-key"] } } ``` Handle status codes consistently. > [card] 401 authentication > > Authentication failed. Check the Xquik API key. > [card] 402 billing state > > Subscription or credits required. Update billing in Xquik. > [card] 429 rate limit > > Rate limited. Respect the `Retry-After` header before retrying. > [card] 5xx transient > > Xquik service unavailable. Retry with exponential backoff. ## Control rate limiting and error handling Read each endpoint contract before configuring retries. Xquik documents status codes per route, not as universal responses. * A `400` response means invalid request fields. Correct the module mapping first. * A `401` response means invalid authentication. Replace the API key. * A `402` response means a billing requirement. Add credits or update the subscription first. * A `404` response means a missing tweet, profile, monitor, or webhook. * A `424` response means a dependency failure. Retry safe reads with bounded backoff. * A `429` response means rate limiting. Wait for the `Retry-After` header before retrying. * A `502` response means a temporary upstream failure. Retry safe reads after a capped backoff. Never retry a write only because its HTTP status appears temporary. Inspect the returned `safeToRetry` field for every write action. Use a new idempotency key only when the contract permits another attempt. Make webhooks can queue bursts before a scenario processes them. Set a scenario rate limit that matches the destination's capacity. Enable sequential processing when bundle order matters. Use incomplete executions for recoverable failures that need operator review. ## Starter modules > [card] Search tweets > > Search module. Call `GET /x/tweets/search` with `q`. Use `cursor` for page loops and keep `limit` on bounded resumes. > [card] Get tweet > > Action module. Call `GET /x/tweets/{id}` with a tweet ID. > [card] Get user > > Action module. Call `GET /x/users/{id}` with a user ID or username. > [card] Get trends > > Search module. Call `GET /x/trends` with optional `woeid` and `count`. > [card] Create tweet > > Action module. Call `POST /x/tweets` with account, text, and optional public media URLs. > [card] Create extraction > > Action module. Call `POST /extractions` with `toolType`, query fields, and result limit. > [card] Create monitor > > Action module. Call `POST /monitors` with username and event types. > [card] Create webhook > > Action module. Call `POST /webhooks` with callback URL and event types. > [card] Make an API call > > Universal module. Accept any `/api/v1` path for endpoints that have no module yet. This example shows Search Tweets module communication. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "url": "/x/tweets/search", "method": "GET", "qs": { "q": "{{parameters.q}}", "cursor": "{{parameters.cursor}}" }, "response": { "iterate": "{{body.tweets}}", "output": { "id": "{{item.id}}", "text": "{{item.text}}", "authorUsername": "{{item.author.username}}", "url": "{{item.url}}" } } } ``` Add a bounded-pull variant that sends `limit`. If `body.has_next_page` is `true`, send `body.next_cursor` as `cursor`. Keep the same `q`, filters, and `limit` on that request. ## Output handoff Make response handling lets search modules `iterate` over `body.tweets`. Meanwhile, `body` stays available for output, wrapper, and pagination fields. Emit tweet bundles from `item`. Downstream modules may need another request. If so, carry setup IDs, write status, and page cursors in scenario state. Use snake_case keys for data-store rows even when the API response uses camelCase. > [card] Tweet search page > > Store `q`, each `tweet_id`, `text`, `author_username`, `created_at`, `has_next_page`, and `next_cursor`. > [card] User profile rows > > Store source `id` as `user_id`, plus `username`, `name`, `followers`, `verified`, and `profile_picture`. For user-list modules, carry `has_next_page` and `next_cursor`. > [card] Trend rows > > Store each trend `name`, `rank`, `query`, and `description`. Keep `body.count`, `body.woeid`, and the selected region in scenario state. > [card] Tweet or reply write > > Send a unique `Idempotency-Key`. Store the returned action. Poll `status_url` while `terminal` is false. Retry only when `safe_to_retry` is true, using a new key. > [card] Media attachments > > For tweets or replies, pass public URLs in `media` or uploaded IDs in `media_ids`. Store `tweet_id` or `write_action_id`. For DMs, upload first and pass one `media_id` in `media_ids`. Store the DM `message_id` and leave `reply_to_message_id` unset. > [card] Monitor and webhook setup > > Store monitor `id`, `username`, `xUserId`, `eventTypes`, `isActive`, and `nextBillingAt`. Store webhook `id`, `url`, `eventTypes`, and the one-time `secret`. For Make storage rows, map production `deliveryId` to `delivery_id` for receiver retry deduplication. Map `streamEventId` to `stream_event_id` when one monitor event should process once across endpoint changes. > [card] Extraction jobs > > Store `id`, `tool_type`, and `status` from `POST /extractions`. Poll `GET /extractions/{id}`, then carry `has_more` and `next_cursor`. > [card] Webhook event deduplication > > Store `deliveryId` for endpoint-level retry deduplication. Store `streamEventId` when one monitor event must process once across receiver changes. > [card] Stored event replay > > Call `GET /api/v1/events` with `cursor` when a scenario needs replay. Map `id` to `event_id`, `monitorId` to `monitor_id`, and `monitorType` to `monitor_type`. Map `occurredAt` to `occurred_at`, `hasMore` to `has_more`, and `nextCursor` to `next_cursor`. > [card] Receiver acceptance > > Return `2xx` after accepting duplicate `deliveryId` or `streamEventId`. Treat endpoint signing values, raw request body, raw signature, and full headers as private. Exclude them from scenario logs, data stores, Slack messages, CRM rows, and retry queues. ## Instant trigger for monitor events Use a dedicated Make webhook for monitor events. Register that webhook URL in Xquik. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "url": "https://xquik.com/api/v1/webhooks", "method": "POST", "body": { "url": "{{webhook.url}}", "eventTypes": ["tweet.new", "tweet.reply", "tweet.quote", "tweet.retweet"] } } ``` Then create or confirm the monitor. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "url": "https://xquik.com/api/v1/monitors", "method": "POST", "body": { "username": "username", "eventTypes": ["tweet.new", "tweet.reply", "tweet.quote", "tweet.retweet"] } } ``` Map webhook output fields for downstream modules. > [card] Event type > > Map `eventType` to route `tweet.new`, `tweet.reply`, `tweet.quote`, and `tweet.retweet` events. > [card] Delivery ID > > Map `deliveryId` as the per-endpoint idempotency key for retries. > [card] Stream event ID > > Map `streamEventId` when one monitor event should process once across endpoint changes. > [card] Occurred at > > Map `occurredAt` as the event timestamp. > [card] Username > > Map `username` for account monitor events. > [card] Tweet ID > > Map `data.id` as the tweet identifier. > [card] Text > > Map `data.text` as the tweet body. > [card] Author username > > Map `data.author.userName` when present. Use `username` as the monitored-account fallback. Keep the webhook secret returned by Xquik. The scenario can include a verification step before routing. If it does, verify `x-xquik-signature` with that secret before sending alerts. ## Polling trigger when an extraction completes Use a polling trigger when users want bulk results without webhook setup. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "url": "/extractions", "method": "GET", "qs": { "status": "completed", "limit": 25 }, "response": { "iterate": "{{body.extractions}}", "uid": "{{item.id}}", "output": { "id": "{{item.id}}", "status": "{{item.status}}", "toolType": "{{item.toolType}}", "createdAt": "{{item.createdAt}}", "completedAt": "{{item.completedAt}}" } } } ``` Fetch the job detail with `GET /extractions/{id}` and loop through `nextCursor` when `hasMore` is true. ## Recipes ### Social listening to Slack > [card] Monitor event trigger > > Start from the Xquik Monitor Event instant trigger for `tweet.new`, `tweet.reply`, `tweet.quote`, and `tweet.retweet`. > [card] Topic filter > > Filter on `eventType`, `username`, and `data.text` before routing alerts. > [card] Slack message > > Create a Slack message from `data.text`, `data.id`, `data.author.userName`, and `occurredAt`. > [card] Deduplication store > > Upsert by `deliveryId` per endpoint. Use `streamEventId` when one monitor event should fan out once across endpoint changes. ### Daily topic research to sheets > [card] Schedule trigger > > Run the scenario on a daily schedule for repeatable topic research. > [card] Search tweets > > Call Xquik Search Tweets with `q`. Use `cursor` for page loops and keep `limit` on bounded resumes. > [card] Iterator > > Iterate over `tweets` and pass one tweet bundle to each downstream module. > [card] Sheet row > > Append `id`, `author.username`, `text`, `createdAt`, `likeCount`, and `retweetCount`. ### Bulk extraction to CRM > [card] Start run > > Use a scheduler or manual trigger to start the bulk extraction. > [card] Create extraction > > Call Xquik Create Extraction with `toolType` and the required target fields. > [card] Wait or poll > > Wait before polling, or reuse the Extraction Completed polling trigger. > [card] Get extraction > > Call `GET /extractions/{id}` until `job.status` is `completed` or `failed`. > [card] CRM upsert > > Upsert by user `id`, then follow `hasMore` and `nextCursor` for additional result pages. ## Automate focused Twitter workflows Tweet search automation can collect posts matching a brand or topic query. Filter by author, timestamp, language, or engagement before sending alerts. Store tweet IDs so repeated searches do not create duplicate messages. A Twitter monitor webhook can route new tweets and replies right away. Verify its signature before parsing the request body. Deduplicate deliveries before posting to Slack or updating a CRM. Use follower pages for bounded exports to Google Sheets. Use extraction jobs for larger follower or following exports. Keep profile IDs because usernames can change. Social media automation should keep publishing under human control. Send every scheduled tweet and reply through an approval queue. Review text, links, media, and the target account before posting tweets. Do not automate unsolicited replies, follows, or direct messages. ## Make.com Twitter integration questions ### How do I connect the X (Twitter) API to Make? Use a private Make custom app or the HTTP module. Authenticate each Xquik request with the `x-api-key` header. Start with one read endpoint before adding writes or webhooks. ### Does Make.com still have a native Twitter integration? The native X app became unavailable in Make during 2025. Xquik remains available through a private app or the Make HTTP module. This approach avoids a native Twitter integration dependency. ### How can I schedule tweets automatically? Create a scheduled scenario that prepares one draft payload. Send the draft through an approval step before publishing. Use an idempotency key and inspect the returned write status. ### How do I build a Twitter webhook in Make? Register a Make webhook URL with Xquik. Choose the required monitor event types during webhook registration. Verify signatures, reject stale requests, and deduplicate event IDs. ### Can Make automate Twitter search without coding? Yes. Install the private Xquik app, then configure its search module. Map the query, filters, limit, and cursor through the scenario builder. The scenario can append matching tweets to Sheets without custom code. ### How do I automate replies based on keywords? Search recent replies or receive monitored account events. Filter each tweet with explicit terms and safety rules. Send the proposed reply to an approval queue before publishing. ### How do I connect Twitter activity to a CRM? Receive a verified monitor event, then fetch its author profile. Upsert the CRM record by the immutable X (Twitter) user ID. Keep the triggering tweet URL with the profile fields. ### Which Twitter automation tool fits Make scenarios? Use Xquik when scenarios need tweets, profiles, followers, or monitor webhooks. Use Make for scheduling, routing, approvals, and destination integrations. Together, they form a focused X (Twitter) API integration. ## Make and Xquik sources * [Make custom app base configuration](https://developers.make.com/custom-apps-documentation/app-components/base) * [Make connection validation guidance](https://developers.make.com/custom-apps-documentation/best-practices/connections) * [Make community decommissioning notice](https://community.make.com/t/make-is-officially-decommissioning-x-formerly-twitter-app/77497) * [Make webhook documentation](https://help.make.com/webhooks) * [Make scenario scheduling](https://help.make.com/schedule-a-scenario) * [Xquik webhook verification](/webhooks/overview) ## Test checklist * Connection test rejects invalid API keys with a clear `401` message. * Every module sanitizes `x-api-key` in logs. * Search modules return arrays and stable IDs for Make deduplication. * The instant trigger must map `tweet.new`, `tweet.reply`, `tweet.quote`, and `tweet.retweet`. * Extraction polling stops when the API returns no new completed jobs. * A `429` test confirms that retry timing follows `Retry-After`. * The Universal module accepts any `/api/v1` path but still injects the API key. ## Next steps * Read [Webhooks](/webhooks/overview) for payload shape and retries. * Read [Extraction Workflow](/guides/extraction-workflow) for job creation and pagination. * Use [Zapier](/guides/zapier) or [Pipedream](/guides/pipedream) when the team prefers code-backed workflow components. # Mastra AI Twitter MCP agent guide for TypeScript Source: https://docs.xquik.com/guides/mastra Build a Mastra agent for tweet search, followers, monitors, and approved X (Twitter) actions. Add typed MCP workflows, pagination, errors, and handoffs. > For the complete documentation index, see [llms.txt](/llms.txt). Build a Mastra AI Twitter MCP agent through Xquik's remote MCP server. This Mastra Twitter agent searches tweets, profiles, replies, followers, and monitors. It keeps every tweet ID, profile ID, cursor, and job ID. This Mastra AI tutorial combines agent tools, one typed workflow, and a strict handoff. Xquik provides the X (Twitter) MCP server and documented API endpoints. Mastra controls the AI model, tool call, approval, and agent workflows. ## Why use the Mastra AI agent framework with an X (Twitter) API? Mastra is an open-source TypeScript framework for building AI applications. The Mastra AI agent framework adds tools, routing, memory, and workflows. Use an X API agent when a model must choose related operations. Use REST for fixed routes, scheduled exports, or predictable latency. | Boundary | Mastra control | Twitter agent result | | - | - | - | | Remote MCP | `MCPClient` | Connect tweet, profile, follower, and monitor tools | | Final response | Zod `structuredOutput` | Reject malformed rows and cursor state | | Per-call tools | `listToolsets()` | Isolate each user's Xquik key | | X actions | `requireToolApproval` | Pause before the `execute` tool runs | | Tool errors | `onToolError: "throw"` | Keep failed MCP results | | Cleanup | `disconnect()` | Close remote sessions | ## Mastra X (Twitter) API prerequisites * Node.js 22.13 or later * An [Xquik API key](/x-api-quickstart) beginning with `xq_` * A model-provider key supported by Mastra * A connected X account for private reads or writes Public reads need no X Developer credentials. Authenticate through Xquik. ## Install the Mastra AI SDK and MCP support Install the tested Mastra AI SDK packages and Zod. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npm install "@mastra/core@^1.55" "@mastra/mcp@^1.15" zod ``` Store secrets outside source control. ```bash .env theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} XQUIK_API_KEY=xq_YOUR_KEY_HERE OPENAI_API_KEY=YOUR_OPENAI_KEY ``` ```text .gitignore theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} .env xquik-*-handoff.json ``` Run `npm run dev` in a generated Mastra project. Then inspect agent calls in Mastra Studio. ## Build a Mastra AI agent example for tweet search Define the final handoff before creating the agent. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { writeFile } from "node:fs/promises"; import { Agent } from "@mastra/core/agent"; import { createStep, createWorkflow } from "@mastra/core/workflows"; import { MCPClient } from "@mastra/mcp"; import { z } from "zod"; const tweetRowSchema = z.object({ tweet_id: z.string(), text: z.string(), author_username: z.string().nullable(), created: z.number().int().nullable(), url: z.string().url().nullable(), }); const handoffSchema = z.object({ query: z.string(), route_used: z.literal("GET /api/v1/x/tweets/search"), tweets: z.array(tweetRowSchema), has_more: z.boolean(), next_cursor: z.string().nullable(), pages_fetched: z.number().int().positive(), stop_reason: z.enum(["complete", "requested_limit", "cursor_stalled"]), }); const mcp = new MCPClient({ servers: { xquik: { url: new URL("https://xquik.com/mcp"), requestInit: { headers: { "x-api-key": process.env.XQUIK_API_KEY!, }, }, onToolError: "throw", }, }, timeout: 60_000, }); try { const agent = new Agent({ id: "xquik-tweet-search-agent", name: "Xquik Tweet Search Agent", instructions: [ "Use Xquik for Twitter API requests.", "Use GET /api/v1/x/tweets/search.", "Preserve exact tweet IDs, created timestamps, and cursors.", "Never invent missing tweet fields.", "Stop when the requested limit is reached.", "Stop if the server repeats a cursor.", ].join(" "), model: "openai/gpt-5", tools: await mcp.listTools(), }); const searchStep = createStep({ id: "search-twitter", inputSchema: z.object({ query: z.string().min(1) }), outputSchema: handoffSchema, execute: async ({ inputData }) => { const result = await agent.generate(`Search 50 latest tweets for: ${inputData.query}`, { structuredOutput: { schema: handoffSchema }, }); return handoffSchema.parse(result.object); }, }); const tweetResearchWorkflow = createWorkflow({ id: "xquik-tweet-research", inputSchema: z.object({ query: z.string().min(1) }), outputSchema: handoffSchema, }) .then(searchStep) .commit(); const run = await tweetResearchWorkflow.createRun(); const workflowResult = await run.start({ inputData: { query: "Mastra AI MCP" }, }); if (workflowResult.status !== "success") { throw new Error(`Tweet workflow ended with ${workflowResult.status}.`); } await writeFile( "xquik-mastra-handoff.json", JSON.stringify(workflowResult.result, null, 2), "utf8", ); } finally { await mcp.disconnect(); } ``` `listTools()` suits static agent construction. `listToolsets()` groups tools by server for each call. The client tries Streamable HTTP for URL servers. The MCP runtime returns normalized snake_case fields through `xquik.request()`. It normalizes `createdAt` to the Unix-second field `created`. Keep the Zod schema aligned with that contract. ## Run a Mastra AI workflow for tweet research The `inputSchema: z.object(...)` declaration validates every query. The `outputSchema` protects the final handoff. Mastra core workflows chain steps with `.then()` and finish with `.commit()`. `createRun()` creates isolated state. Store each successful handoff immediately. A registered agent can also run the workflow through a Mastra instance. ## Search tweets with precise operators Keep the exact `q` in every checkpoint. | Search intent | Example `q` | | - | - | | Framework posts | `"Mastra" MCP` | | One timeline | `from:mastra_ai since:2026-07-01 until:2026-08-01` | | Popular TypeScript posts | `"Twitter API" TypeScript lang:en min_faves:25` | | Questions | `"tweet search agent" ? -filter:retweets` | Use `queryType=Latest` for time-ordered research. Pass `next_cursor` unchanged. Stop when `has_more` becomes false. Also stop when a cursor repeats. ## Require approval for Twitter actions Xquik exposes one `execute` tool. It can run authorized reads and writes. Require human-in-the-loop approval when the key permits writes. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const approvedMcp = new MCPClient({ servers: { xquik: { url: new URL("https://xquik.com/mcp"), requestInit: { headers: { "x-api-key": process.env.XQUIK_API_KEY! }, }, requireToolApproval: ({ toolName }) => toolName === "execute", onToolError: "throw", }, }, }); ``` Show the route, method, arguments, and X account before approval. Never treat MCP annotations as an authorization boundary. They are server-provided hints. > [!WARNING] > > `@mastra/core` 1.55.0 predates the declined-call fix in > [PR #20487](https://github.com/mastra-ai/mastra/pull/20487). Do not enable > writes on that release. Upgrade after a stable fix. Then prove declined > calls never execute. Use a guest `paid_reads` key for a firm read-only boundary. See [guest wallets](/guides/guest-wallets) for its exact scope. ## Expose discovery without execution Filter `listTools()` when an agent should only inspect endpoint schemas. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tools = await mcp.listTools(); const discoveryTools = Object.fromEntries( Object.entries(tools).filter(([name]) => name.endsWith("_explore")), ); const discoveryAgent = new Agent({ id: "xquik-route-discovery-agent", name: "Xquik Route Discovery Agent", instructions: "Inspect Twitter API routes. Never execute an operation.", model: "openai/gpt-5", tools: discoveryTools, }); ``` The `search` tool returns routes, methods, parameters, and response fields. It does not call X. Adding `execute` enables every key-authorized operation. ## Use a Mastra AI MCP client for each user Create one client after resolving the tenant identity. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { Agent } from "@mastra/core/agent"; import { MCPClient } from "@mastra/mcp"; async function runTenantRequest(prompt: string, userApiKey: string) { const tenantMcp = new MCPClient({ id: crypto.randomUUID(), servers: { xquik: { url: new URL("https://xquik.com/mcp"), requestInit: { headers: { "x-api-key": userApiKey }, }, requireToolApproval: true, onToolError: "throw", }, }, }); const agent = new Agent({ id: "tenant-twitter-agent", name: "Tenant Twitter Agent", instructions: "Preserve tweet IDs, profile IDs, cursors, and job IDs.", model: "openai/gpt-5", }); try { return await agent.generate(prompt, { toolsets: await tenantMcp.listToolsets(), }); } finally { await tenantMcp.disconnect(); } } ``` Never share keys across tenants. Keep keys outside prompts, traces, and handoffs. Supply a unique client `id` for otherwise identical settings. ## Forward dynamic headers safely Use custom `fetch` when request context selects a tenant key. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const mcp = new MCPClient({ servers: { xquik: { url: new URL("https://xquik.com/mcp"), fetch: async (url, init) => { const headers = new Headers(init?.headers); headers.set("x-api-key", await secretStore.getXquikKey()); return fetch(url, { ...init, headers }); }, onToolError: "throw", }, }, }); ``` The `secretStore` object represents your existing secret manager. Never send its key to the model. Keep `forwardInstructions` disabled for untrusted servers. ## Store a resumable Twitter agent handoff Store validated identifiers outside the model transcript. > [card] Tweet search rows > > Store `tweet_id`, `text`, `author_username`, `created`, `url`, `has_more`, `next_cursor`, and the original `q`. > [card] Follower exports > > A Twitter follower scraper API handoff keeps `user_id`, `username`, `followers`, `has_more`, and `next_cursor`. > [card] Monitor events > > Store `monitor_id`, `event_id`, `type`, `occurred_at`, and replay cursors. > [card] Extraction jobs > > Store `extraction_id`, `status`, `poll`, and `export_after_complete`. > [card] Approved X actions > > Store `tweet_id`, `write_action_id`, `status`, and `poll`. Never resend pending writes. > [card] Webhook deliveries > > Store `webhook_id`, `delivery_id`, and `stream_event_id`. Protect the secret. Store the validated `result.object`, not free-form `result.text`. ## Handle X (Twitter) API errors and rate limits Match each documented status before retrying. | Status | Meaning | Agent action | | - | - | - | | `400` | The search query is missing or invalid | Fix `q` | | `401` | Guest authentication cannot complete this request | Provide a key or connect X | | `402` | The account lacks credits | Request account action | | `424` | The upstream X dependency failed | Apply bounded backoff | | `429` | The X (Twitter) API rate limit applies | Keep the cursor and wait | | `502` | The X dependency returned an invalid response | Retry later | Keep `onToolError: "throw"`. It throws on MCP `isError` results. Never restart pagination after `429`. Read each route before designing retry logic. ## Verify Mastra package compatibility Xquik checked these stable versions on August 3, 2026. | Package | Checked version | Requirement | | - | - | - | | `@mastra/core` | 1.55.0 | Node.js 22.13 or later | | `@mastra/mcp` | 1.15.0 | `@mastra/core` below 2.0 | | `@modelcontextprotocol/sdk` | 1.30.0 | Installed through Mastra | | `zod` | 4.4.3 | `^3.25` or `^4` | `@mastra/mcp` 1.15.0 predates the concurrent reconnect fix in [PR #20530](https://github.com/mastra-ai/mastra/pull/20530). Avoid parallel recovery through one client. Test reconnects before every upgrade. ## Mastra AI MCP frequently asked questions ### What are the main Mastra AI MCP features? The integration combines typed agent tools, workflows, approval, and MCP. It supports tweets, profiles, followers, monitors, webhooks, and writes. ### How does Mastra AI MCP compare with other agent frameworks? Choose Mastra for TypeScript-first agent workflows and Zod contracts. Choose direct REST for fixed routes. Xquik supports both paths. ### What must a Twitter agent system enforce? Require bounded queries, typed outputs, exact IDs, cursor checkpoints, and rate limiting. Isolate credentials and approve every write. ### Which Mastra AI examples does this tutorial include? It covers MCP discovery, tweet search, workflows, approval, errors, tenant isolation, and durable handoffs. ### What is a Mastra AI MCP client? The Mastra AI MCP client uses Xquik's remote tools. A Mastra AI MCP server publishes local tools. ### How do I search tweets with TypeScript? Call `GET /api/v1/x/tweets/search`. Supply `q`, `queryType`, and `limit`. Keep `tweet_id`, `created`, and `next_cursor`. ### Can a Mastra agent export Twitter followers? The Twitter follower scraper API returns profiles and cursors. Use the [followers API](/api-reference/x/followers) for bounded pages. Use extraction jobs for CSV, JSON, or XLSX exports. ### Can Mastra monitor tweets in real time? Monitors store matching events between agent calls. Replay events by cursor. Use signed webhooks when the receiver needs immediate delivery. ### Can a Mastra AI agent post tweets and replies? Yes, after connecting X. Do not enable writes on affected Mastra releases. Test approval rejection before production. ### How should a Mastra agent handle Twitter rate limits? Treat `429` separately from dependency failures. Save the cursor and completed tweet IDs. Resume after reset guidance. # X (Twitter) media upload for tweets & DMs by API Source: https://docs.xquik.com/guides/media-upload-workflow Upload images, GIFs, WebP, AVIF, or MP4 by file or URL. Use mediaUrl for tweets and replies, or mediaId for one DM attachment. Includes exact API steps. > For the complete documentation index, see [llms.txt](/llms.txt). This workflow returns an uploaded media ID for tweets, replies, and direct messages. It also returns a hosted media URL for tweet `media` arrays. Use it when a product, support, CRM, or AI agent system needs either. Xquik accepts local files with `multipart/form-data` and HTTPS media URLs with `application/json`. You may already have public image URLs or a public MP4 video URL. If so, skip `POST /x/media` for a tweet or reply. Pass those URLs in the `media` array on `POST /x/tweets`. Send up to 4 images or exactly 1 MP4 video up to 100 MB. Use `POST /x/media` to host local files, check generated URLs, or get a `mediaId`. **Need to post an MP4 tweet?** If the MP4 is already a public HTTPS URL, skip upload. In that case call [Create Tweet](/api-reference/x-write/create-tweet) with `media: ["https://example.com/video.mp4"]`. For a local file, call `POST /x/media` first. Then pass the returned `mediaId` in `media_ids` on `POST /x/tweets`. ## When to use this workflow > [card] Upload a local file > > Upload a local image, GIF, or MP4 with `POST /x/media` and `multipart/form-data`. > [card] Upload generated media > > Upload AI-generated media from a URL with `POST /x/media` and `application/json`. > [card] Post tweets with public media URLs > > Pass the URLs directly in the `media` array on `POST /x/tweets`. > [card] Post tweets with media uploaded through Xquik > > Pass returned `mediaId` values in the `media_ids` array on `POST /x/tweets`. > [card] Post tweet replies with uploaded media > > Pass `media_ids` plus `reply_to_tweet_id` on `POST /x/tweets`. > [card] Send a DM with uploaded media > > Pass returned `mediaId` as the only item in `media_ids` on `POST /x/dm/{userId}`. ## Data you get > [card] Media ID > > `mediaId` is the uploaded media ID for tweet `media_ids` and one-item DM `media_ids` arrays. Media IDs are valid for 24 hours after upload. > [card] Tweet media URL > > `mediaUrl` is the public media URL for tweet `media` arrays. > [card] Upload confirmation > > `success` is `true` after upload completes. > [card] Tweet confirmation > > `POST /x/tweets` returns `tweetId` after Xquik confirms the media tweet or reply. ## End-to-end media handoff Use one checkpoint object after upload and the downstream tweet, reply, or DM write. Tweets and replies use the uploaded `mediaId` in `media_ids`. They can also take public `mediaUrl` values in `media`. DMs use the uploaded `mediaId` as the only `media_ids` item. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "workflow": "media_upload_handoff", "upload": { "endpoint": "/api/v1/x/media", "account": "myxhandle", "source_type": "url", "source": "https://example.com/image.png", "media_id": "1893726451023847424", "media_url": "https://media.xquik.com/uploads/1893726451023847424.png", "media_id_expires_in_hours": 24, "success": true }, "tweet_post": { "endpoint": "/api/v1/x/tweets", "account": "myxhandle", "media_ids": ["1893726451023847424"], "tweet_id": "1895432178065391234", "success": true, "charged_credits": "32" }, "reply_post": { "endpoint": "/api/v1/x/tweets", "account": "myxhandle", "reply_to_tweet_id": "1893704267862470862", "media": ["https://media.xquik.com/uploads/1893726451023847424.png"], "tweet_id": "1895432178065391235", "write_status": "posted" }, "dm_send": { "endpoint": "/api/v1/x/dm/44196397", "account": "myxhandle", "recipient_user_id": "44196397", "media_ids": ["1893726451023847424"], "message_id": "1893726451029384192", "success": true }, "field_boundary": { "tweet_id_field": "media_ids", "tweet_id_value": "mediaId", "tweet_url_field": "media", "tweet_url_value": "mediaUrl", "dm_media_field": "media_ids[0]", "dm_media_value": "mediaId", "forbidden_tweet_pair": ["media", "media_ids"] }, "audit_row": { "record_type": "media_upload_handoff", "source_endpoint": "/api/v1/x/media", "account": "myxhandle", "media_id": "1893726451023847424", "media_url": "https://media.xquik.com/uploads/1893726451023847424.png", "tweet_id": "1895432178065391234", "message_id": "1893726451029384192", "handoff_format": "jsonl" }, "handoff_state": "store_media_id_for_tweets_and_dms" } ``` > [card] Upload checkpoint > > Store returned `mediaId`, `mediaUrl`, `success`, source URL or filename, and the upload endpoint. > [card] Tweet media checkpoint > > Store `media_ids` or the public `mediaUrl` in `media`. Also store the returned `tweetId`, `chargedCredits`, and optional `writeActionId`. > [card] Reply media checkpoint > > Store `reply_to_tweet_id`, `media_ids` or public `mediaUrl`, returned `tweetId`, and pending confirmation state when present. > [card] DM ID checkpoint > > Store exactly one uploaded `mediaId` in `media_ids`, plus returned `messageId` and recipient ID. > [card] Field boundary > > Reject tweet handoffs that put uploaded media IDs in `media`. Also reject those that send both `media` and `media_ids`. > [card] Audit row > > Store upload, tweet, reply, and DM IDs together. Downstream systems can then reconcile each media path. ## Step 1. Upload media by URL AI agents, MCP clients, or workflow tools may hold generated image or MP4 URLs. If Xquik should validate and host one, use JSON URL upload. Some tweet-only workflows already have public image URLs or exactly 1 public MP4 URL. The MP4 can be up to 100 MB. For those workflows, call `POST /x/tweets` directly with `media`. The URL must use HTTPS and resolve to a public address. It must return a supported media content type within 30 seconds. It must stay under the 15,728,640-byte URL download cap. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/media \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle", "url": "https://example.com/image.png" }' | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "mediaId": "1893726451023847424", "mediaUrl": "https://media.xquik.com/uploads/1893726451023847424.png", "success": true } ``` ### URL upload checklist > [card] HTTPS URL > > Non-HTTPS URLs return `422 media_download_failed`. > [card] Public host > > Xquik rejects private or reserved IP targets. > [card] Supported content type > > Xquik accepts AVIF, GIF, JPEG, PNG, WebP, and MP4. > [card] Size cap > > Larger URL downloads than 15,728,640 bytes return `422 media_download_failed`. > [card] 30-second response window > > Slow origins can time out before upload starts. ## Step 2. Post a tweet or reply with mediaUrl or mediaId `POST /x/tweets` accepts public media URLs in `media`. Send up to 4 images or exactly 1 MP4 video up to 100 MB. Use the `mediaUrl` returned by `POST /x/media`. Text-only tweet or reply writes cost 30 credits. Attached media adds 2 credits per started MB across all files. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle", "text": "Product update with a new screenshot.", "media": ["https://media.xquik.com/uploads/1893726451023847424.png"] }' | jq ``` To post a media reply, send the same `media` URL array and add `reply_to_tweet_id`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle", "text": "Here is the requested screenshot.", "reply_to_tweet_id": "1893704267862470862", "media": ["https://media.xquik.com/uploads/1893726451023847424.png"] }' | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweetId": "1895432178065391234", "success": true } ``` Store the action `id`, `request.hash`, `billing`, `result`, original `mediaUrl`, and parent `reply_to_tweet_id`. Poll [Get write action status](/api-reference/x-write/get-write-action-status) while `terminal` is `false`. Retry only when `safeToRetry` is `true`, using a new `Idempotency-Key`. To skip the URL, send the returned `mediaId` in `media_ids` instead. Send up to 4 image IDs or exactly 1 video ID within 24 hours. Never send `media` and `media_ids` together. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle", "text": "Product update with a new screenshot.", "media_ids": ["1893726451023847424"] }' | jq ``` ## Step 3. Send a DM with mediaId `POST /x/dm/{userId}` accepts one uploaded media ID in `media_ids`. Use the `mediaId` returned by `POST /x/media`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/dm/44196397 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "account": "myxhandle", "text": "Here is the requested image.", "media_ids": ["1893726451023847424"] }' | jq ``` DMs accept exactly one uploaded media item. Send no `media_ids` field for text-only DMs. Store `message_id`, `media_id`, recipient, account, and send status in shared handoff rows. Keep full DM body text in private systems only. ### JSON Lines handoff For queues, CRM syncs, warehouse loads, or agent memory, write to `xquik-media-handoff.jsonl`. Write one record per upload and downstream write. #### Media upload row ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "media_upload", "account": "myxhandle", "source": "https://example.com/image.png", "media_id": "1893726451023847424", "media_url": "https://media.xquik.com/uploads/1893726451023847424.png", "media_id_expires_in_hours": 24, "tweet_media_field": "media", "dm_media_field": "media_ids[0]", "handoff_format": "jsonl" } ``` #### Tweet or reply row ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "tweet_media_post", "account": "myxhandle", "tweet_id": "1895432178065391234", "reply_to_tweet_id": "1893704267862470862", "media_url": "https://media.xquik.com/uploads/1893726451023847424.png", "write_status": "posted", "handoff_format": "jsonl" } ``` #### DM media row ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "dm_media_send", "account": "myxhandle", "recipient_user_id": "44196397", "message_id": "1893726451029384192", "media_id": "1893726451023847424", "write_status": "sent", "handoff_format": "jsonl" } ``` Use `media_id` for tweet and reply `media_ids`, or `media_url` for their `media` arrays. Use `media_id` for the single DM `media_ids` item. ## Step 4. Upload a local file Use multipart upload when your app has the file bytes. Supported formats are AVIF, GIF, JPEG, PNG, WebP, and MP4. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/media \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -F "account=myxhandle" \ -F "file=@/path/to/image.png" | jq ``` For MP4 files longer than 140 seconds, add `is_long_video=true`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/media \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -F "account=myxhandle" \ -F "file=@/path/to/video.mp4" \ -F "is_long_video=true" | jq ``` ## Cost and error handling Upload media costs 10 credits per upload call. Posting a tweet or reply is a separate 30-credit create-tweet call before media surcharges. Sending the DM is a separate 10-credit write call. > [card] Invalid input > > Status `400`. Error `invalid_input`. Check `account`, file type, file presence, URL presence, and `is_long_video`. > [card] Billing or credits > > Status `402`. Errors `no_subscription` or `insufficient_credits`. Subscribe or top up credits before retrying. > [card] Reconnect account > > Status `403`. Error `account_needs_reauth`. Reconnect the X account from the dashboard. > [card] Media download failed > > Status `422`. Error `media_download_failed`. Use an HTTPS URL that returns a supported media file. Or switch to multipart upload. > [card] Media ID not found > > Status `400`. Error `media_not_uploaded`. Upload the file again from the posting account, then post within 24 hours. > [card] Rate limit or temporary failure > > Status `429` or `503`. Retry with exponential backoff and respect `Retry-After` when present. ## Handoff checklist > [card] Tweet workflow > > Save `mediaId` and pass it to `POST /x/tweets` in `media_ids`, or pass `mediaUrl` in `media`. > [card] Reply workflow > > Save the parent tweet ID, `mediaId` or `mediaUrl`, returned `tweetId`, and any `writeActionId`. > [card] DM workflow > > Save `mediaId` and pass it to `POST /x/dm/{userId}` as one `media_ids` item. > [card] JSON Lines > > Store upload, tweet, reply, or DM handoff rows in `xquik-media-handoff.jsonl` with `media_id` and `media_url`. > [card] Agent workflow > > JSON URL upload validates or hosts a generated URL, or returns a DM > `mediaId`. Use it only when the agent needs one of those. For tweet-only public URLs, pass > them directly to `POST /x/tweets`. > [card] File workflow > > Prefer multipart upload when your app owns the file bytes. > [!NOTE] > > **Related.** [Upload Media](/api-reference/x-write/upload-media) · [Create Tweet](/api-reference/x-write/create-tweet) · [Send Direct Message](/api-reference/x-write/send-dm) # Microsoft Agent Framework Twitter MCP Python guide Source: https://docs.xquik.com/guides/microsoft-agent-framework Build a Microsoft Agent Framework Twitter MCP agent for tweet search and followers. It adds monitors, exports, and approved X (Twitter) actions in Python. > For the complete documentation index, see [llms.txt](/llms.txt). Use this Microsoft Agent Framework tutorial to build a Twitter MCP agent. This Microsoft Agent Framework Python example connects to Xquik's remote MCP server. Search tweets, inspect profiles, export followers, and replay monitors. Review X (Twitter) actions before execution. Keep every tweet ID, profile ID, cursor, and job identifier unchanged. Connect the Microsoft Agent Framework MCP server client through Streamable HTTP. ## Why use the Microsoft AI agent framework with an X (Twitter) API? The Microsoft open-source agent framework provides agents, sessions, tools, middleware, and workflows. It supports Python and .NET. Use this Microsoft AI agent framework when Microsoft chat clients fit your stack. These parts support single-agent tasks and multi-agent systems. Xquik publishes X (Twitter) API operations through 4 MCP tools. They are `docs`, `search`, `execute`, and `whoami`. Use each boundary for one responsibility. | Boundary | Framework control | Twitter agent benefit | | - | - | - | | Remote MCP | `MCPStreamableHTTPTool` | Connect agents to tweet, profile, follower, and monitor routes | | Final response | Pydantic `response_format` | Reject malformed tweet rows and pagination state | | Tenant context | `header_provider` | Resolve one Xquik key for each agent run | | X actions | MCP `approval_mode` | Pause before the shared `execute` tool runs | | Agent handoff | `AgentSession` and typed models | Keep IDs without copying whole transcripts | | Tool scope | `allowed_tools` | Expose documentation, contract search, or execution tools | Choose it for Python services requiring model-selected tool calls. Choose direct REST for fixed jobs without model choices. ## Microsoft Agent Framework getting started * Python 3.10 or later * An [Xquik API key](/x-api-quickstart) beginning with `xq_` * An LLM provider key supported by Microsoft Agent Framework * Connect an X account for private reads or X write actions Public X reads do not require X Developer credentials. Authenticate with Xquik. Connect an X account only when the route requires it. Keep provider keys and Xquik keys in separate environment variables. Version 1.13.0 protects initialization requests and later tool invocations. Pin it when building AI agents with tenant credentials. Choose only AI models supported by the configured chat client. ## Install Microsoft Agent Framework MCP support Install the tested Python release. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install "agent-framework==1.13.0" ``` Store secrets outside source control. ```bash .env theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} XQUIK_READ_ONLY_API_KEY=xq_YOUR_PAID_READS_KEY XQUIK_API_KEY=xq_YOUR_WRITE_CAPABLE_KEY OPENAI_API_KEY=YOUR_OPENAI_KEY OPENAI_CHAT_MODEL=gpt-5 ``` ```text .gitignore theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} .env xquik-*-handoff.json ``` ## Microsoft Agent Framework Python example for tweet search Define the handoff before creating the agent. This example uses Model Context Protocol (MCP) tool calls. The framework parses the final response into the Pydantic model. Use a guest `paid_reads` key for this autonomous example. Never give an unattended research agent a write-capable key. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import asyncio import os from pathlib import Path from typing import Literal from agent_framework import Agent, MCPStreamableHTTPTool from agent_framework.openai import OpenAIChatClient from pydantic import BaseModel class TweetRow(BaseModel): tweet_id: str text: str author_username: str | None created: int | None url: str | None class TweetSearchHandoff(BaseModel): query: str route_used: Literal["GET /api/v1/x/tweets/search"] tweets: list[TweetRow] has_more: bool next_cursor: str | None pages_fetched: int stop_reason: Literal[ "complete", "requested_limit", "cursor_stalled", ] async def main() -> None: xquik_mcp = MCPStreamableHTTPTool( name="xquik-twitter-api", url="https://xquik.com/mcp", description="Search tweets, profiles, followers, monitors, and exports.", allowed_tools=["docs", "search", "execute"], header_provider=lambda kwargs: { "x-api-key": kwargs["xquik_api_key"], }, ) async with Agent( client=OpenAIChatClient(model=os.environ["OPENAI_CHAT_MODEL"]), name="xquik_tweet_search_agent", instructions=( "Use GET /api/v1/x/tweets/search. " "Preserve exact tweet IDs, created timestamps, and cursors. " "Never invent missing tweet fields. " "Stop at the requested limit. Stop if a cursor repeats." ), tools=xquik_mcp, ) as agent: result = await agent.run( "Search 50 latest tweets about Microsoft Agent Framework MCP.", options={"response_format": TweetSearchHandoff}, function_invocation_kwargs={ "xquik_api_key": os.environ["XQUIK_READ_ONLY_API_KEY"], }, ) if not isinstance(result.value, TweetSearchHandoff): raise RuntimeError("Tweet handoff invalid. Inspect the agent response.") Path("xquik-microsoft-agent-handoff.json").write_text( result.value.model_dump_json(indent=2), encoding="utf-8", ) asyncio.run(main()) ``` `allowed_tools` names the available remote tools. The agent receives only `docs`, `search`, and `execute` from Xquik's MCP server. The agent framework import loads `Agent` and `MCPStreamableHTTPTool`. Agent framework agents use only the selected Xquik MCP tools. `response_format` asks the model for the Pydantic shape. Read the validated object from `result.value`. Never store `result.text` as a typed handoff. The MCP runtime returns normalized snake_case fields through `xquik.request()`. It normalizes `createdAt` to the Unix-second field `created`. Keep the Pydantic model aligned with that contract. ## Search tweets with focused queries Send a precise `q` to the tweet search route. Keep it in the handoff. | Search intent | Example `q` | | - | - | | Framework discussions | `"Microsoft Agent Framework" MCP` | | One account's timeline | `from:Microsoft since:2026-07-01 until:2026-08-01` | | Popular Python posts | `"Twitter API" Python lang:en min_faves:25` | | Questions without reposts | `"tweet search agent" ? -filter:retweets` | | Customer support mentions | `@brand (help OR issue) -filter:retweets` | | Exact tweet | A numeric Tweet ID or X status URL | Use `queryType=Latest` for chronological monitoring. Use `Top` for engagement-ranked research. See the [tweet search API contract](/api-reference/x/search-tweets). Pass `next_cursor` back unchanged. Never rebuild a cursor. Stop when `has_more` becomes false. Also stop when a cursor repeats. Continue through an empty page when `has_more` remains true. Deduplicate resumed results by `tweet_id`. ## Add human-in-the-loop approval for Twitter actions Xquik exposes one `execute` tool. It runs routes authorized by the API key. Tool-name checks cannot distinguish routes inside `execute`. Apply approval to `execute` whenever a key authorizes writes. Ask a human in the loop to inspect every write-capable request. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from agent_framework import Agent, MCPStreamableHTTPTool, Message approved_mcp = MCPStreamableHTTPTool( name="xquik-twitter-api", url="https://xquik.com/mcp", allowed_tools=["docs", "search", "execute"], approval_mode={ "never_require_approval": ["search"], "always_require_approval": ["execute"], }, header_provider=lambda kwargs: { "x-api-key": kwargs["xquik_api_key"], }, ) async with Agent( client=OpenAIChatClient(model=os.environ["OPENAI_CHAT_MODEL"]), name="approved_xquik_agent", instructions="Show exact routes and arguments before every Xquik request.", tools=approved_mcp, ) as agent: session = agent.create_session() run_options = {"response_format": TweetSearchHandoff} run_context = {"xquik_api_key": os.environ["XQUIK_API_KEY"]} result = await agent.run( "Search tweets about Python Twitter MCP agents.", session=session, options=run_options, function_invocation_kwargs=run_context, ) while result.user_input_requests: responses = [] for request in result.user_input_requests: if request.function_call is None: responses.append( request.to_function_approval_response(approved=False) ) continue print("Function:", request.function_call.name) print("Arguments:", request.function_call.arguments) answer = await asyncio.to_thread(input, "Approve this call? [y/N] ") responses.append( request.to_function_approval_response( approved=answer.strip().lower() == "y" ) ) result = await agent.run( Message(role="user", contents=responses), session=session, options=run_options, function_invocation_kwargs=run_context, ) ``` Show the route, method, arguments, text, and selected X account. Reject any request whose method, arguments, text, or account changed. For public research, a guest `paid_reads` key supplies a hard read-only boundary. It exposes only eligible paid-read routes. Review [guest wallet permissions](/guides/guest-wallets) before granting autonomous access. ## Scope Microsoft Agent Framework tools for discovery Expose only `search` when an agent should inspect endpoint schemas. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} discovery_mcp = MCPStreamableHTTPTool( name="xquik-route-discovery", url="https://xquik.com/mcp", allowed_tools=["search"], header_provider=lambda kwargs: { "x-api-key": kwargs["xquik_api_key"], }, ) ``` This configuration cannot execute X (Twitter) API operations. Adding `execute` enables every operation authorized by the key. Use `search` before an unfamiliar operation. It returns routes, parameters, and response fields. Discovery never executes an X operation. ## Authenticate the Microsoft Agent Framework MCP client Resolve one Xquik key for every run. Pass it through runtime context. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} def tenant_headers(kwargs: dict[str, object]) -> dict[str, str]: tenant_id = str(kwargs["tenant_id"]) return {"x-api-key": secret_store.get_xquik_key(tenant_id)} tenant_mcp = MCPStreamableHTTPTool( name="tenant-xquik-twitter-api", url="https://xquik.com/mcp", allowed_tools=["docs", "search", "execute"], header_provider=tenant_headers, ) async with Agent( client=OpenAIChatClient(model=os.environ["OPENAI_CHAT_MODEL"]), name="tenant_twitter_agent", instructions="Preserve exact profile IDs and usernames.", tools=tenant_mcp, ) as tenant_agent: result = await tenant_agent.run( "Look up the profile for microsoft.", function_invocation_kwargs={"tenant_id": authenticated_tenant_id}, ) ``` The `secret_store` represents your existing secret manager. Never include the returned key in prompts, sessions, handoffs, or logs. Microsoft Agent Framework 1.13.0 applies runtime headers during initialization and tool calls. It limits those headers to matching-origin requests. Create an isolated `httpx.AsyncClient` for each authenticated origin. ## Build Microsoft multi-agent framework workflows Teams evaluating a Microsoft multi-agent framework should isolate every agent's tools. Give only the researcher access to Twitter MCP. Pass its validated handoff to a tool-free reviewer. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} researcher = Agent( client=client, name="tweet_researcher", instructions="Return validated tweet rows and pagination state.", tools=xquik_mcp, ) reviewer = Agent( client=client, name="tweet_reviewer", instructions="Analyze only supplied tweets. Preserve every tweet_id.", ) research = await researcher.run( "Search latest tweets about Python agent frameworks.", options={"response_format": TweetSearchHandoff}, function_invocation_kwargs={"xquik_api_key": tenant_api_key}, ) if not isinstance(research.value, TweetSearchHandoff): raise RuntimeError("Tweet research invalid. Stop the handoff.") review = await reviewer.run(research.value.model_dump_json()) ``` The reviewer receives no MCP tools. These multi-agent workflows prevent unauthorized X (Twitter) API execution. The reviewer cannot fetch unrelated tweets or post X (Twitter) actions. ## Handle tweet search errors and rate limits The tweet search contract documents these responses. Handle each status independently. | Status | Meaning | Agent action | | - | - | - | | `400` | The search query is missing or invalid | Fix `q`. Do not retry unchanged | | `401` | Authentication cannot complete this request | Provide an Xquik key or connect X | | `402` | The account lacks credits | Stop and request account action | | `424` | The upstream X dependency failed | Retry with bounded backoff | | `429` | The X (Twitter) API rate limit applies | Wait for reset guidance, then resume the cursor | | `502` | The X dependency returned an invalid response | Retry later without changing IDs | Do not restart pagination after `429`. Keep `next_cursor` and completed tweet IDs. Deduplicate by `tweet_id` after recovery. POST and DELETE routes document different statuses. Derive retry behavior from each route's documented statuses. See [error handling](/guides/error-handling). ## Store Microsoft Agent Framework workflow handoffs > [card] Tweet search rows > > Store `tweet_id`, `text`, `author_username`, `created`, `url`, `has_more`, `next_cursor`, and the original `q`. > [card] Profile and follower rows > > Store source `id` as `user_id`. Also store `username`, `name`, `followers`, `verified`, and `profile_picture`. Store `has_more`, `next_cursor`, and the source lookup. > [card] Monitor and webhook state > > Store `monitor_id`, `event_types`, `next_billing_at`, `webhook_id`, and `url`. Keep the one-time webhook `secret` in a secret manager. > [card] Stored event replay > > Store `event_id`, `type`, `monitor_id`, `occurred_at`, `has_more`, `next_cursor`, and the requested `cursor` value. > [card] Follower export jobs > > Store `extraction_id`, `status`, `poll`, and `export_after_complete`. Poll before loading CSV, JSON, or XLSX rows. > [card] Tweets and replies > > Store `tweet_id` or `write_action_id`, `reply_to_tweet_id`, `status`, `charged_credits`, and `poll`. Never resend a pending write. ## Choose MCP or the direct REST API | Requirement | Microsoft Agent Framework with MCP | Direct REST API | | - | - | - | | Natural-language tweet research | Strong fit | Write route selection yourself | | Microsoft agent sessions | Native fit | Add session orchestration | | Strict scheduled follower export | Extra model step | Strong fit | | Human-approved tweet posting | Function approval flow | Build approval state yourself | | Predictable latency and cost | Less predictable | More predictable | | Typed final handoff | Pydantic `response_format` | SDK or Pydantic model | Use MCP for real-time research across related X (Twitter) API operations. Use REST for fixed routes, scheduled exports, or latency-sensitive services. ## Migrate older Microsoft Agent Framework code Use current 1.13 APIs. Several preview-era examples use removed names. Microsoft Agent Framework succeeds Semantic Kernel and AutoGen. | Preview-era pattern | Current pattern | | - | - | | Preview agent class | `Agent(...)` | | Legacy client keyword | `client=` | | Legacy model identifier | Provider client's `model=` | | Dedicated streaming method | `run(..., stream=True)` | | Prompt-only JSON | Pydantic `response_format` and `result.value` | | Static shared auth headers | `header_provider` and `function_invocation_kwargs` | Current releases also scope runtime MCP headers to matching origins. Keep the framework updated for those authentication fixes. ## Verified Python package versions Xquik checked these versions on August 3, 2026. | Package | Checked compatible version | Supported range used here | | - | - | - | | `agent-framework` | 1.13.0 | `==1.13.0` | | `agent-framework-core` | 1.13.0 | Installed by the meta-package | | `agent-framework-openai` | 1.12.0 | Installed by the meta-package | | `mcp` | 1.29.0 | `>=1.24,<2` | | `pydantic` | 2.13.4 | `>=2,<3` | Pin a tested release. Review Microsoft Agent Framework release notes before widening the range. ## Microsoft Agent Framework X (Twitter) API questions ### Does Microsoft Agent Framework support MCP? Yes. Python agents connect through `MCPStreamableHTTPTool`. Xquik publishes `docs`, `search`, `execute`, and `whoami` at `https://xquik.com/mcp`. ### Is Microsoft Agent Framework an alternative to MCP? No. Microsoft Agent Framework runs agents and workflows. MCP standardizes remote tool access. This guide uses both layers together. ### How do I connect Microsoft Agent Framework to an X (Twitter) API? Create `MCPStreamableHTTPTool` with the Xquik MCP URL. Resolve the `x-api-key` header through `header_provider`. Pass the tool to `Agent.tools`. ### How does Microsoft Agent Framework MCP authentication work? Xquik reads the `x-api-key` header. Resolve it through `header_provider` for each run. Pass its value through `function_invocation_kwargs`. ### Does the Xquik MCP server require OAuth? No. Xquik uses an API key. Do not add OAuth for this MCP server. Other MCP servers can require OAuth. ### Where is the Microsoft Agent Framework documentation? Microsoft Learn documents agents, MCP tools, sessions, approvals, and workflows. This guide applies those APIs to Xquik's Twitter operations. ### What does the Microsoft Agent Framework SDK provide? The SDK provides agents, chat clients, sessions, middleware, tools, and typed workflows. Xquik supplies remote Twitter operations through MCP. ### How do I search tweets with a Python agent? Ask the agent to call `GET /api/v1/x/tweets/search`. Supply an exact `q`, `queryType`, and limit. Keep `tweet_id`, `created`, and `next_cursor`. ### Can Microsoft Agent Framework post tweets and replies? Yes. Connect an X account first. Apply approval to every `execute` request. Validate the selected account, text, reply ID, and media. See [create tweet](/api-reference/x-write/create-tweet) for the exact contract. ### How do I handle X (Twitter) API rate limits in Python? Treat `429` separately from dependency errors. Save the cursor and completed tweet IDs. Resume after reset guidance. Never retry in a tight loop. ### Can a Microsoft agent export Twitter followers? Yes. Use the [followers API](/api-reference/x/followers) for paginated profile rows. Use an extraction job for larger CSV, JSON, or XLSX exports. ### Can the agent monitor tweets without repeated searches? Yes. Create an account or keyword monitor. Replay stored events by cursor. Verify signatures and deduplicate deliveries before connecting a webhook. ### Can the agent triage customer support mentions? Yes. Search brand mentions or create an account monitor. Keep tweet IDs before classifying urgency. Keep every reply behind human approval. ### Does tool filtering make the X (Twitter) API read-only? Only when `allowed_tools` contains `search` without `execute`. The `execute` tool can run every operation authorized by its API key. ### Why does my MCP agent lose authentication between calls? Pass runtime values through `function_invocation_kwargs` on every resumed run. Keep one `AgentSession` during approvals. Never store the key in session state. # n8n Twitter node for X API automation & webhooks Source: https://docs.xquik.com/guides/n8n Build n8n Twitter workflows for tweet search, follower exports, monitors, and webhooks. Add media posts, AI agents, and cursor-safe handoffs through Xquik. > For the complete documentation index, see [llms.txt](/llms.txt). Build an n8n Twitter node workflow with Xquik. Search tweets, export followers, monitor accounts, publish media, and run AI agents. This n8n Twitter integration uses HTTP Request, Webhook, and MCP Client Tool nodes. Xquik does not require an X Developer app. Xquik uses one API key and the REST base URL `https://xquik.com/api/v1`. ## Choose an n8n Twitter integration Use n8n's built-in X node for supported tweet, list, user, and DM operations. Xquik's n8n X (Twitter) API adds wider reads, exports, monitors, webhooks, and MCP tools. The [Xquik community node](https://www.npmjs.com/package/n8n-nodes-xquik) searches tweets and users. It also reads trends and checks follows. Use an HTTP Request node for every other Xquik endpoint. ## n8n alternative or n8n add-on Xquik doesn't build workflows, so it doesn't replace n8n. Keep n8n for triggers, branching and app steps. Add Xquik when a workflow needs X (Twitter) data or X (Twitter) actions. That covers tweet search, follower exports, posts and monitor events. ## Prerequisites * [Xquik API key](/x-api-quickstart) * n8n Cloud or self-hosted n8n * An HTTPS n8n webhook URL for monitor recipes * Optional Slack and Google Sheets credentials for the recipes below ## API key credential Create a reusable n8n credential for Xquik. > [card] Authentication > > Select Header Auth for the HTTP Request credential. > [card] Header name > > Set the header name to `x-api-key`. > [card] Header value > > Paste your Xquik API key as the credential value. Use that credential in every HTTP Request node that calls `https://xquik.com/api/v1`. ## Community node blueprint If you package Xquik as a community node, ship only core X tasks first. Share reusable templates through the n8n community. Keep credentials outside exported workflow JSON. Use custom code nodes only for signature checks or bounded transforms. > [card] Credential > > Create an `Xquik API Key` credential and inject it as `x-api-key`. > [card] Base URL > > Point every REST action at `https://xquik.com/api/v1`. > [card] Request helper > > Support `GET`, `POST`, `PATCH`, `DELETE`, JSON bodies, structured errors, and `Retry-After` backoff. > [card] Resources > > Start with Tweet, User, Trends, Extraction, Monitor, and Webhook resources. > [card] Actions > > Ship Get Tweet, Search Tweets, Get User, and Get Trends first. Ship Create Tweet, Create Extraction, Create Monitor, and Create Webhook first too. > [card] Sources > > Add Monitor Event Webhook and Extraction Completed Polling sources. Handle each of these response classes. > [card] 400 invalid input > > Copy the Xquik `error` and `message` fields into the failed item. > [card] 401 authentication > > Ask the user to check the Header Auth credential and `x-api-key` value. > [card] 402 billing state > > Route to subscription or credit setup before retrying the node. > [card] 429 rate limit > > Read `Retry-After` from response headers and wait before retrying. > [card] 5xx transient > > Enable n8n Retry on Fail with exponential backoff, then fail the item. ## Result handoff An Edit Fields node can follow each HTTP Request node. Use one when the next node only needs stable handoff fields. Keep raw responses out of Slack messages, Sheets rows, and retry queues. Use snake_case storage keys for handoff rows even when direct API responses use camelCase. > [card] Tweet search page > > Store request `q`. Map each tweet `id`, `text`, `author.username`, and `createdAt` to `tweet_id`, `text`, `author_username`, and `created_at`. Keep `has_next_page` and `next_cursor` for page loops. > [card] User profile rows > > Store source `id` as `user_id`. Also store `username`, `name`, `followers`, `verified`, and `profile_picture`. Store `has_next_page`, `next_cursor`, and the lookup or search input. > [card] Trend rows > > Store each trend `name`, `rank`, `query`, and `description`. Keep response `count`, `woeid`, and the requested region with the workflow run. > [card] Tweet or reply write > > Send a unique `Idempotency-Key`. Store `id`, `status`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. > [card] Media attachments > > For tweets or replies, pass public URLs in `media` or uploaded IDs in `media_ids`. Never send both. For DMs, upload first and pass 1 `media_id` in `media_ids`. Store the DM `message_id` and leave `reply_to_message_id` unset. > [card] Monitor and webhook setup > > Store monitor `id`, `username`, `xUserId`, `eventTypes`, `isActive`, and `nextBillingAt`. Store webhook `id`, `url`, `eventTypes`, and one-time `secret`. For storage rows, map production `deliveryId` to `delivery_id` for receiver retry deduplication. Map `streamEventId` to `stream_event_id` when one monitor event should process once across endpoint changes. > [card] Webhook event deduplication > > Store `deliveryId` for receiver retry deduplication. Store `streamEventId` when one monitor event should process once across endpoint changes. > [card] Stored event replay > > Call `GET /events` with `cursor` when a workflow needs replay. Map `id` to `event_id`, `monitorId` to `monitor_id`, and `monitorType` to `monitor_type`. Map `occurredAt` to `occurred_at`, `hasMore` to `has_more`, and `nextCursor` to `next_cursor`. > [card] Receiver acceptance > > Return `2xx` after accepting duplicate `deliveryId` or `streamEventId`. Treat endpoint signing values, raw request body, raw signature, and full headers as private. Exclude them from n8n executions, data stores, Slack messages, Sheets rows, and retry queues. > [card] Extraction job > > Before batch loops fetch detail rows, store `id` as `extraction_id` and `toolType` as `tool_type`. Also store `status`, `has_more`, and `next_cursor` before those loops. ## Recipe 1. AI agent X research with MCP Use this recipe to integrate AI agents with Xquik. The agent can search live tweets, summarize trends, inspect profiles, and compare follower activity. **1. Add an AI agent node** Create an AI Agent workflow with your preferred chat model. **2. Add an MCP client tool** Set Server Transport to `HTTP Streamable`. Set MCP Endpoint URL to `https://xquik.com/mcp`. Set Authentication to `Header Auth`. Create or select a Header Auth credential. Set Name to `x-api-key` and Value to your Xquik API key. **3. Prompt the agent** Have the agent use Xquik for X (Twitter) search, trends, lookups, and extraction planning. > [!NOTE] > > The MCP Client Tool also supports `MCP OAuth2`. This recipe uses Header Auth for unattended workflows with an n8n credential. Start with this agent system prompt. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use Xquik for every X research request. Search tweets, inspect accounts, fetch trends, and cite the returned post URLs. Prefer small, targeted searches before broad extraction jobs. ``` Then try this example user prompt. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Find recent posts about AI agents in fintech, group them by theme, and list 5 accounts worth monitoring. ``` The MCP server exposes `docs` for documentation and `search` for endpoint discovery. It also exposes `execute` for authenticated calls. One agent loop can select an endpoint and request current API data. ## Recipe 2. Monitor to Slack Use this when a Slack channel should receive activity from monitored accounts. That activity is new tweets, replies, quotes, or retweets. ### Workflow shape > [card] Webhook trigger > > Receive Xquik monitor events on the production Webhook URL. > [card] Create webhook > > Use HTTP Request to call `POST /webhooks` with the Webhook Trigger URL. > [card] Create monitor > > Use HTTP Request to call `POST /monitors` for the username and event types. > [card] Format alert > > Use Set to build Slack text from `data`, with `username` as fallback. > [card] Post alert > > Send the formatted message to Slack after the webhook and monitor exist. ### Create webhook Call this once during setup, using the production URL from your n8n Webhook Trigger. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "method": "POST", "url": "https://xquik.com/api/v1/webhooks", "headers": { "x-api-key": "={{$credentials.xquikApi.apiKey}}" }, "body": { "url": "={{$node['Webhook Trigger'].webhookUrl}}", "eventTypes": ["tweet.new", "tweet.reply", "tweet.quote", "tweet.retweet"] } } ``` ### Create monitor ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "method": "POST", "url": "https://xquik.com/api/v1/monitors", "headers": { "x-api-key": "={{$credentials.xquikApi.apiKey}}" }, "body": { "username": "username", "eventTypes": ["tweet.new", "tweet.reply", "tweet.quote", "tweet.retweet"] } } ``` ### Slack message Use a Set node before Slack. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} {{$json.eventType}} from @{{$json.data.author?.userName || $json.username}} {{$json.data.text}} https://x.com/{{$json.data.author?.userName || $json.username}}/status/{{$json.data.id}} ``` Webhook tweet fields live under `data`. Use `data.author.userName` when present. `username` is the monitored-account fallback. Keep the webhook secret returned by Xquik. Verify `x-xquik-signature` before sending Slack messages. Use custom verification code when your plan supports it. ## Recipe 3. Extraction to Google Sheets Use this when a team needs bulk results in a spreadsheet. The results can be follower, reply, quote, media, list, community, or search results. ### Workflow shape > [card] Schedule trigger > > Run daily or hourly exports. Execute manually while testing. > [card] Create extraction > > Use HTTP Request to call `POST /extractions` and store the returned `id`. > [card] Wait before polling > > Pause before the first status check so the extraction can start. > [card] Fetch results > > Use HTTP Request to call `GET /extractions/{id}` and read `job.status`. > [card] Gate completed jobs > > Use IF to continue only when `job.status` is `completed`. > [card] Append rows > > Use Google Sheets Append Row with the mapped result fields below. ### Create extraction ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "method": "POST", "url": "https://xquik.com/api/v1/extractions", "headers": { "x-api-key": "={{$credentials.xquikApi.apiKey}}" }, "body": { "toolType": "tweet_search_extractor", "searchQuery": "AI agents lang:en", "resultsLimit": 500 } } ``` Store the returned `id` for the polling step. ### Poll results ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "method": "GET", "url": "https://xquik.com/api/v1/extractions/{{$json.id}}", "headers": { "x-api-key": "={{$credentials.xquikApi.apiKey}}" }, "query": { "limit": "1000" } } ``` Map these fields into Google Sheets. > [card] Tweet ID > > Map to `id`. > [card] Author > > Map to `author.username`. > [card] Text > > Map to `text`. > [card] Created at > > Map to `createdAt`. > [card] Likes > > Map to `likeCount`. > [card] Reposts > > Map to `retweetCount`. > [card] URL > > Build from `https://x.com/{author.username}/status/{id}`. For jobs larger than 1,000 rows, loop while `hasMore` is `true`. On each loop, pass `cursor` with the `nextCursor` value. ## Useful REST actions > [card] Get tweet > > Read one or more posts with `GET /x/tweets?ids=`. > [card] Search tweets > > Run X query searches with `GET /x/tweets/search?q=`. > [card] Get user > > Fetch an X profile with `GET /x/users/{id}`. > [card] Get trends > > Read regional X (Twitter) trends with `GET /x/trends`. > [card] Create tweet > > Publish text or media posts with `POST /x/tweets`. > [card] Create extraction > > Start bulk export jobs with `POST /extractions`. > [card] Create monitor > > Watch accounts or keywords with `POST /monitors`. > [card] Create webhook > > Register signed delivery URLs with `POST /webhooks`. ## Testing checklist * Use the n8n Test Step action on each HTTP Request node. * Confirm every request includes `x-api-key`. * Confirm monitor webhooks use the production webhook URL, not the test URL. * Send a test event from [Test Webhook](/api-reference/webhooks/test). * For extraction jobs, poll until `completed` before writing to Sheets. * On `429`, wait for the `Retry-After` header before retrying. ## n8n Twitter automation questions ### How do I connect n8n to Twitter? Create Header Auth with `x-api-key`. Select it on every Xquik request. ### How does n8n Twitter search work? Call the tweet-search endpoint. Store the query and cursor for every page. ### Can n8n post to Twitter? Treat each n8n Twitter post as approved. Send `Idempotency-Key`, then poll the returned action. ### Can n8n scrape Twitter? An n8n Twitter scraper should call documented endpoints. Never make n8n scrape Twitter pages. API responses keep stable IDs and cursors. ### How does n8n X (Twitter) media upload work? Tweet and reply writes accept public URLs or up to 4 uploaded media IDs. DMs require one uploaded media ID. ### How do I monitor Twitter mentions in n8n? Build an n8n Twitter monitoring workflow with a monitor and production webhook. Verify every signature before routing tweets. ### Can I build an n8n Twitter bot or n8n Twitter agent? An n8n Twitter bot needs approval before writes. An n8n Twitter agent can search tweets, profiles, trends, and followers through MCP. ### Can self-hosted n8n use Xquik? Yes. Allow outbound HTTPS. Monitor recipes also need a public HTTPS webhook. ### How do I troubleshoot an n8n X (Twitter) connection? Check the base URL, Header Auth, and `x-api-key`. Use the production webhook. Reselect edited credentials. Recreate them if access still fails. ### Which n8n Twitter template should I build first? Start with tweet search and cursor storage. Add exports or monitors next. ## Next steps * Read [Webhooks](/webhooks/overview) for payload and retry behavior. * Read [Extraction Workflow](/guides/extraction-workflow) for pagination and export patterns. * Use [MCP Tools](/mcp/tools) when building AI Agent workflows. # No-code Twitter automation with webhooks & exports Source: https://docs.xquik.com/guides/no-code-workflow-handoff Connect Xquik monitor webhooks, extraction jobs, tweet search pages, and follower exports to Zapier, Make, Pipedream, n8n, Sheets, CRM, and queue workflows. > For the complete documentation index, see [llms.txt](/llms.txt). Build no-code Twitter automation for tweets, replies, followers, profiles, and team alerts. Use monitor webhooks for fresh events. Use direct reads for small pages. Use extraction jobs for large exports. This no code API integration pattern keeps cursors and event IDs. Choose Twitter automation tools by freshness, row count, and approval needs. API integration automation can save time when every API call commits its checkpoint. A Twitter webhook workflow should verify each event before routing. Use an automated tool only for bounded reads or approved writes. Keep REST API calls idempotent around retries. Store secrets outside workflow history. ## Choose a Twitter automation outcome | Outcome | Best path | Required checkpoint | | - | - | - | | Alert on new tweets or replies | Account monitor webhook | `streamEventId` | | Track keyword or brand matches | Keyword monitor webhook | `streamEventId` | | Add tweet search rows to Sheets | Direct read pages | `next_cursor` | | Export followers or following to CRM | Extraction job | Job ID and `nextCursor` | | Repair events after receiver downtime | Stored event replay | `nextCursor` | | Audit failed webhook deliveries | Delivery log | `deliveryId` | Choose the path from the required freshness and row count. Do not poll a webhook workflow. Do not build a bulk export from repeated page-one reads. ## Pick the handoff path > [card] Monitor event webhooks > > Use `POST /api/v1/monitors` or `POST /api/v1/monitors/keywords`, then > `POST /api/v1/webhooks`. Do this when the workflow needs fresh account or > keyword events. > [card] Bulk export jobs > > Use `POST /api/v1/extractions`, poll `GET /api/v1/extractions`, then > export CSV, JSON, or XLSX when the workflow needs many rows. > [card] Direct read pages > > Use `GET /api/v1/x/tweets/search` or follower pages when the workflow owns > the cursor loop. The workflow must also be able to store `next_cursor`. > [card] Replay and repair > > Use `GET /api/v1/events` and `GET /api/v1/webhooks/{id}/deliveries` after > receiver downtime, failed steps, or queue backpressure. ### Webhook or polling? Use webhooks for fresh events. Poll only durable extraction jobs. Use direct reads for bounded operator searches. Store each cursor before the next page. > [!WARNING] > > Never use repeated polling as a substitute for monitor webhooks. It creates > duplicate tweet reads and weaker recovery checkpoints. ## Monitor event trigger Choose the monitor first. Point its webhook at the no-code receiver. Test the webhook before routing alerts to Slack, Sheets, CRM, or queues. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/xquik/no-code-receiver", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks/15/test \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Build the receiver in this order. 1. Capture the raw request body and signature headers. 2. Verify the timestamp, nonce, HMAC, and 5-minute tolerance. 3. Reject repeated nonces within that same window. 4. Store `deliveryId` and `streamEventId` before routing. 5. Queue the normalized event, then return `2xx`. Xquik signs `..` with HMAC-SHA256. Read `X-Xquik-Timestamp`, `X-Xquik-Nonce`, and `X-Xquik-Signature` first. Follow [Webhook Signature Verification](/webhooks/verification). > [!WARNING] > > Some visual webhook triggers parse JSON before exposing request bytes. Route > those triggers through a small verified receiver. Forward only verified > fields into the visual workflow. Use `deliveryId` for endpoint retries. Use `streamEventId` across receivers. ### Map the monitor payload Production monitor events include these stable fields. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "tweet.new", "schemaVersion": 1, "deliveryId": "502", "streamEventId": "9002", "occurredAt": "2026-05-24T20:33:00.000Z", "username": "customer_handle", "data": { "id": "1893704267862470862", "text": "A matched public tweet", "author": { "id": "987654321", "userName": "customer_handle" } } } ``` Branch on `eventType`. Store `data.id`, `data.text`, and `data.author.id`. Keyword events can include `query`. Account events can include `username`. Test deliveries stop before CRM or alert steps. ## Bulk export trigger Use extraction jobs for files, large batches, or repeatable job receipts. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/extractions?status=completed&limit=25" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/extractions/77777/export?format=csv" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -o xquik-export.csv ``` Store `job.id`, `job.toolType`, `job.status`, `hasMore`, and `nextCursor` first. Use this extraction sequence. 1. Create the extraction and store its returned `id`. 2. Poll that job until `job.status` becomes `completed`. 3. Route terminal failures to an operator. 4. Page results or download CSV after completion. 5. Store `nextCursor` after each destination write. Read job status before exporting. Resume failures from their committed cursor. Use [X (Twitter) API Export Formats](/guides/response-formats-exports) for CSV, JSON, XLSX, Markdown, PDF, and TXT. Use it for pagination limits too. ## Direct read loop Use direct reads for small pages with persistent cursor storage. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/search?q=xquik%20min_faves%3A10&limit=50" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/username/followers?pageSize=200" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Store `has_next_page` and `next_cursor`. Pass `next_cursor` as `cursor` only when another page exists. Stop on repeated cursors or missing IDs. Commit rows and `next_cursor` together. Upsert on tweet ID or X (Twitter) user ID. ### Choose direct reads by task > [card] Tweet search > > Search keywords, hashtags, authors, dates, and engagement filters. Store > each tweet ID before requesting another page. > [card] Followers > > Export follower IDs, usernames, names, bios, and public metrics. Upsert on > the stable X (Twitter) user ID. > [card] Following > > Export accounts followed by a public profile. Keep source profile and > collection time beside each relationship. > [card] Replies and mentions > > Store reply tweet IDs, parent tweet IDs, author IDs, and timestamps. Keep > the endpoint cursor with the same filters. ## Shared checkpoint Store one stable checkpoint before alerts, CRM, spreadsheets, or classification. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "workflow_id": "xquik-no-code-q2", "handoff_lane": "instant_monitor", "delivery_id": "502", "stream_event_id": "9002", "event_type": "tweet.new", "tweet_id": "1893704267862470862", "user_id": "987654321", "retry_key": "delivery_id:502", "event_dedupe_key": "stream_event_id:9002", "replay_route": "GET /api/v1/events?monitorId=42&cursor={nextCursor}", "received_at": "2026-05-24T20:33:00.000Z" } ``` Store IDs as strings. Keep secrets, raw bodies, signatures, and headers out of workflow history. ### Store the workflow checkpoint Update rows and their cursor in one transaction or idempotent platform step. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "workflow_id": "xquik-no-code-q2", "monitor": { "last_stream_event_id": "9002", "next_event_cursor": "9003" }, "direct_read": { "route": "/api/v1/x/tweets/search", "query": "xquik min_faves:10", "next_cursor": "DAABCgAB" }, "extraction": { "job_id": "77777", "status": "completed", "next_cursor": "1001" }, "updated_at": "2026-05-24T20:33:05.000Z" } ``` Scope checkpoints by endpoint, filters, monitor, job, and destination. ## Platform notes > [card] [Zapier](/guides/zapier) > > Use REST Hooks for monitor events. Zapier polling triggers do not fetch > additional result pages automatically. > [card] [Make](/guides/make) > > Use a custom app with webhook triggers and data stores. It also has > iterators and a universal API call module. Keep cursors in a Data Store > between runs. > [card] [Pipedream](/guides/pipedream) > > Pipedream Data Store writes are not transactional. Restrict each key to one > worker. > [card] [n8n](/guides/n8n) > > Use HTTP Request nodes, webhook triggers, and workflow state. Use them for > replay, cursor, and deduplication checkpoints. Use persistent state in > production. Use API integration automation for repeatable routing. Zapier Twitter automation and Make Twitter automation support visual steps. Pipedream Twitter automation supports code steps. An n8n Twitter node connects HTTP actions. Each guide includes pre-built HTTP patterns for complex workflows. ## Cost and retry notes > [!TIP] > > Active account and keyword monitors check every 1 second. They cost 30 credits > per active monitor-hour. The rate includes event storage and webhook delivery. > [!TIP] > > Xquik meters direct tweet search and follower pages by returned rows. Store > cursors so retries do not restart from page 1. Extraction jobs return `202` with `id`, `toolType`, and `status`. Poll job detail or list completed jobs before exporting rows. ## Handle webhook retries and missed events Webhook deliveries retry with backoff for up to 30 days. Return `2xx` for events your workflow skips. Webhook health exposes `deliveryStatus`, `consecutiveFailures`, and `failureHardCap`. `needs_attention` does not stop retries. A delivery still failing after 30 days shows `exhausted`. Use this repair sequence. 1. Inspect `GET /api/v1/webhooks/{id}/deliveries`. 2. Find `failed` and `exhausted` rows. 3. Join each `streamEventId` to the stored event. 4. Fix the receiver. 5. Call the resume endpoint. It starts sending waiting and rejected deliveries at once. 6. Replay only event IDs your workflow never stored. A paused webhook holds each waiting delivery until its 30 days end. Events expire 30 days after Xquik creates them. Use `monitorId` or `keywordMonitorId` during replay. Store each `nextCursor`. ## Handle no-code API errors > [accordion] 400 invalid input > > Request rejected. Check the route, body, query, cursor, and selected format. > [accordion] 401 authentication > > API key rejected. Replace the credential and rerun the failed step. > [accordion] 402 payment required > > Credits required. Add credits or subscribe, then resume from the checkpoint. > [accordion] 404 resource not found > > Resource missing. Verify the monitor, webhook, extraction, tweet, or user ID. > [accordion] 429 rate limited > > Rate limited. Respect the retry delay and keep the current cursor. > [accordion] 502 or 503 dependency failure > > Upstream unavailable. Retry from the same idempotent checkpoint. Never convert an error body into a tweet or follower row. Branch on HTTP status before mapping successful response fields. ## Keep Twitter automation safe * Store the Xquik API key in the platform credential store. * Store the webhook secret in a separate secret field. * Never place secrets in URLs, Sheets, CRM rows, or messages. * Treat tweet text and profile bios as untrusted input. * Require human approval before posting replies or direct messages. * Upsert tweets by tweet ID and profiles by X (Twitter) user ID. * Record workflow version, route, filters, and collection time. * Remove raw webhook bytes after signature verification. No-code tools simplify orchestration. They do not remove API limits, consent, security, or destination retention requirements. ## No-code Twitter automation frequently asked questions ### How do I choose the best X (Twitter) automation tools? Require signature access, durable cursor storage, HTTP status branches, and write approvals. Reject tools that hide signatures or lose IDs between runs. ### How do I automate Twitter without code? Create an account or keyword monitor. Send signed events to a verified webhook. Map tweet fields into Slack, Sheets, CRM, or a queue. Store both idempotency IDs before running destination actions. ### How does Zapier Twitter automation work? Use an Xquik REST Hook for monitor events. Use API request actions for tweet search, follower pages, extraction jobs, and delivery checks. Keep the API key inside Zapier authentication fields. ### How do I connect n8n to an X (Twitter) API? Create a Header Auth credential with `x-api-key`. Call Xquik through HTTP Request nodes. Receive monitor events through a Webhook node. Store cursors and event IDs outside one workflow execution. ### How does Pipedream Twitter automation work? Pipedream Twitter automation uses HTTP triggers and code steps. Verify monitor signatures before mapping tweets into downstream actions. ### Should Twitter automation use webhooks or polling? Use webhooks for fresh tweet, reply, quote, repost, or keyword events. Poll durable extraction jobs. Use direct reads for operator-triggered page requests. ### How do I stop duplicate Twitter alerts? Verify the signature first. Store `deliveryId` for delivery retries. Store `streamEventId` when one monitor event should run once across webhook changes. ### How do I recover missed Twitter events? Inspect failed deliveries. Page stored events with the correct monitor filter. Join failed `streamEventId` values to event IDs. Reprocess only missing IDs. ### Can I export Twitter followers to sheets or CRM? Yes. Use follower pages for bounded workflows. Use extraction jobs for large exports. Store X user IDs as strings and use them as upsert keys. ### Can a workflow export accounts I follow? Yes. Use the following endpoint or a matching extraction job. Store the source profile, followed X (Twitter) user ID, collection time, and pagination cursor. ### Can no-code Twitter automation post replies? Use the documented write endpoint through the platform's HTTP module. Add an approval step before the request. Store the returned write action ID. ### How do Twitter automated posts work without code? Use a schedule trigger to prepare the post. Treat automated Twitter posts as approved write jobs. Call the create-tweet API endpoint only after approval. Store the returned action ID and final tweet ID. Never resend a pending write. ### How can I schedule tweets without coding? Use the no-code platform's scheduler to schedule tweets. Use Xquik only for the approved write request. Store the selected Twitter account and publish time. ### Can Twitter automation reply to keywords? Create a keyword monitor first. Send matching tweets into an approval queue. Publish a reply only after a person reviews the text and target tweet. ### How do I automate Twitter hashtag research? Search the hashtag with date, language, and engagement filters. Store tweet IDs in Google Sheets or CRM. Review the research before posting anything. ### Are Twitter automation tools safe? They are safe with vaulted credentials, approved writes, and capped retries. Keep API keys in the platform vault. Never turn untrusted tweet text into instructions. ### Should I send automated DMs to new followers? No. Avoid unsolicited direct messages. Use the DM endpoint only for approved, expected conversations. Store the message ID after a successful send. ### Does no-code automation bypass X (Twitter) API limits? No. Every read, monitor, extraction, and write follows its documented contract. Use cursors, batching, and idempotency to avoid wasteful duplicate requests. ## Next steps > [card] [Brand monitoring](/guides/brand-monitoring-workflow) > > Build account and keyword monitor workflows with signed webhooks and replay. > [card] [Extraction workflow](/guides/extraction-workflow) > > Create extraction jobs, fetch paginated results, and export files. > [card] [Webhook testing](/guides/twitter-webhook-testing) > > Verify signed test deliveries before accepting production events. > [card] [Response formats](/guides/response-formats-exports) > > Choose CSV, JSON, XLSX, PDF, or paginated JSON for downstream tools. # Xquik open source docs, MIT license & OpenSSF Source: https://docs.xquik.com/guides/open-source-assurance Audit Xquik's open source API documentation, MIT license, REUSE metadata, OpenSSF evidence, security reporting, CI checks, and safe contribution steps. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik publishes its API documentation source under the MIT License. You can inspect, test, fork, and improve these docs. This license does not make the hosted Xquik platform open source. It does not grant rights to Xquik brands either. Use this page to verify the exact boundary. It covers documentation, OpenAPI, SDKs, security reporting, dependencies, and OpenSSF evidence. ## Distinguish the public sources > [card] Documentation source > > The [xquik-docs repository](https://github.com/Xquik-dev/xquik-docs) uses the MIT License. It contains MDX pages, `docs.json`, tests, and build policy. > [card] OpenAPI contract > > The public [`openapi.yaml`](https://github.com/Xquik-dev/xquik-docs/blob/main/openapi.yaml) describes REST paths, parameters, schemas, and responses. > [card] SDK source > > Published SDKs use separate repositories. Start from the [SDK documentation](/sdks) or browse the [Xquik-dev organization](https://github.com/Xquik-dev). > [card] Hosted Xquik service > > This repository does not license the API, dashboard, workers, or private platform code. Public documentation and a public API contract do not expose a hosted service's implementation. They let developers audit the promised interface instead. ## Inspect the open source API documentation **1. Read the repository license** Review [`LICENSE`](https://github.com/Xquik-dev/xquik-docs/blob/main/LICENSE). It grants the standard MIT permissions for this repository's source. **2. Check SPDX coverage** Review [`REUSE.toml`](https://github.com/Xquik-dev/xquik-docs/blob/main/REUSE.toml) and [`LICENSES/MIT.txt`](https://github.com/Xquik-dev/xquik-docs/blob/main/LICENSES/MIT.txt). REUSE metadata assigns an SPDX license and copyright statement to committed files. **3. Inspect the public contract** Compare endpoint pages with [`openapi.yaml`](https://github.com/Xquik-dev/xquik-docs/blob/main/openapi.yaml). Confirm methods, parameters, request bodies, and every response status. **4. Review change history** Inspect commits and pull requests. Read discussions, checks, approvals, and resolved review threads before trusting a change. **5. Run the same checks** Clone the repository. Install the lockfile without lifecycle scripts. Run the documented verification commands. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} git clone https://github.com/Xquik-dev/xquik-docs.git cd xquik-docs bun run install:frozen bun run install:licenses bun run check:all ``` Run commands against a reviewed commit. A passing local build does not prove the hosted platform uses that commit. ## Understand what each check proves > [card] Dependency policy > > `lint:packages` requires exact versions in `package.json`. `audit` scans the lockfile with OSV-Scanner. It rejects known vulnerabilities and package licenses outside the allowed list. > [card] Response contract > > `check:response-examples` compares every API response widget with the canonical OpenAPI status set. > [card] Documentation tests > > `test` checks metadata, navigation, contracts, accessibility, agent readability, and protected content invariants. > [card] Mintlify validation > > `docs:validate` validates the OpenAPI document and Mintlify build. `docs:links` rejects broken internal links. > [card] Repository licensing > > `check:licenses` verifies SPDX coverage using the pinned, patched Comply checker. Installation verifies its source checksum. The repository keeps applicable license texts and third-party notices. > [card] Security automation > > `bun run check:all` runs the required local checks. This repository runs no GitHub Actions. Review local validation evidence for the exact commit before release. These controls provide reproducible evidence. They cannot guarantee zero vulnerabilities. They also do not disclose private platform code. ## Understand the OpenSSF badge scope OpenSSF assigns badges to FLOSS projects. A shared project site does not automatically need a separate badge. See the official [project terminology](https://www.bestpractices.dev/en/criteria_discussion#terminology). `xquik-docs` supports multiple independently released projects. It has no separate badge entry today. Create one if this repository independently releases software. The [organization evidence register](https://github.com/Xquik-dev/.github/blob/main/OPENSSF.md) maps standalone projects to live bestpractices.dev entries. Open each entry for its current status and evidence. Do not copy dated percentages into a permanent claim. Passing does not mean Silver or Gold. Each level adds criteria. Read the [current Gold criteria](https://www.bestpractices.dev/en/criteria/2) before evaluating a project. ## Review current OpenSSF gaps The public evidence register identifies human requirements separately from automated checks. It currently tracks these areas. * Maintainer and release continuity after one member becomes unavailable * A bus factor supported by public role and contribution evidence * Significant work from unassociated human contributors * A scoped human security review for each affected project Automated scans can support a human review. They cannot replace the reviewer. Open pull requests also cannot prove a default-branch control. Do not claim Gold until each project has verified public evidence. Recheck badge entries after evidence reaches their default branches. ## Apply the MIT license correctly The MIT License lets you use, copy, modify, merge, and publish this documentation source. It also permits distribution. Keep its copyright and permission notice. The repository-wide REUSE annotation applies MIT metadata to committed files. Third-party packages still retain their own licenses. Review the dependency policy before redistributing a complete development environment. The docs license does not cover the Xquik product, brand, or hosted platform. It also does not promise self-hosting instructions for the service. Hosted API access follows each route's authentication, payment, and account requirements. Start with the [X (Twitter) API quickstart](/x-api-quickstart) for authenticated requests. ## Contribute to the API documentation **1. Choose one verifiable change** Fix a contract error, example, broken link, accessibility issue, or unclear workflow. Avoid search-only pages and unsupported claims. **2. Follow the contribution guide** Read [`CONTRIBUTING.md`](https://github.com/Xquik-dev/xquik-docs/blob/main/CONTRIBUTING.md). Match its writing, OpenAPI, dependency, and MDX rules. **3. Add regression coverage** Protect corrected contracts, metadata, navigation, or content with the nearest test. **4. Run every check** Run the complete command block above. Fix failures before requesting review. **5. Sign and submit** Add the Developer Certificate of Origin sign-off. Open one focused pull request against `main`. **6. Resolve review feedback** Address every applicable comment. Wait for required checks and an independent approval. Use `git commit --signoff` for the DCO trailer. The shared [review policy](https://github.com/Xquik-dev/.github/blob/main/REVIEWING.md) defines approval expectations. ## Report documentation security issues privately Use [GitHub private vulnerability reporting](https://github.com/Xquik-dev/xquik-docs/security/advisories/new) for security findings. Email [support@xquik.com](mailto:support@xquik.com) with the subject `Security report` if GitHub is unavailable. Do not open a public issue for authentication, webhook, contract, or credential vulnerabilities. Remove API keys, tokens, cookies, and personal information from every sample. The docs security scope covers this Mintlify site and dangerous contract errors. Product vulnerabilities follow the routing in the [security reporting guide](/security). ## Open source API documentation questions ### Is the Xquik API open source? The documentation, OpenAPI contract, and listed SDK repositories are public. The hosted Xquik platform is not open source. ### Can I self-host Xquik from this repository? No. This repository builds documentation. It does not contain the hosted API, dashboard, workers, or private platform code. ### Can I fork the Xquik documentation? Yes. Follow the MIT License and keep its notice. Do not imply affiliation or endorsement. ### Is the public OpenAPI file the server source? No. `openapi.yaml` defines the supported public interface. It does not contain server implementation code. ### Does xquik-docs have an OpenSSF badge? No separate entry exists. The repository is a shared project site for independently released projects. ### Where can I verify current OpenSSF status? Use the organization evidence register. Then open each linked bestpractices.dev entry for live status. ### How do I report a vulnerability? Use private vulnerability reporting. Never publish secrets or exploitable details in an issue or pull request. ## Evidence sources * [xquik-docs repository](https://github.com/Xquik-dev/xquik-docs) * [MIT License](https://github.com/Xquik-dev/xquik-docs/blob/main/LICENSE) * [OpenSSF evidence register](https://github.com/Xquik-dev/.github/blob/main/OPENSSF.md) * [OpenSSF project terminology](https://www.bestpractices.dev/en/criteria_discussion#terminology) * [Contribution guide](https://github.com/Xquik-dev/xquik-docs/blob/main/CONTRIBUTING.md) * [Security policy](https://github.com/Xquik-dev/xquik-docs/blob/main/SECURITY.md) * [Shared review policy](https://github.com/Xquik-dev/.github/blob/main/REVIEWING.md) Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp. # Pipedream automation for X (Twitter) API & webhooks Source: https://docs.xquik.com/guides/pipedream Build Pipedream workflow automation for tweet search, follower exports, Twitter monitors, signed webhooks, scheduled reads, and approved posts through Xquik. > For the complete documentation index, see [llms.txt](/llms.txt). Build a Pipedream Twitter integration for searches, profiles, monitors, and approved posts. Xquik supplies one REST API and one API key for every workflow. The initial package contains 1 app file, 8 actions, and 2 sources. Add another action after workflows repeatedly need the same HTTP request. ## Pipedream alternative or Pipedream add-on Xquik doesn't build workflows, so it doesn't replace Pipedream. Keep Pipedream for triggers, branching and app steps. Add Xquik when a workflow needs X (Twitter) data or X (Twitter) actions. That covers tweet search, follower exports, posts and monitor events. ## Choose a Pipedream automation pattern Pipedream Workflows combine one trigger with actions or code steps. An HTTP trigger receives signed Xquik monitor events. A schedule trigger starts tweet search automation or extraction polling. An RSS trigger can start an approved publishing queue. Choose a private component for actions shared by multiple team members. Choose a custom JavaScript step for one custom API integration. The workflow uses prebuilt actions for Slack, Google Sheets, and CRM handoffs. Keep one output per workflow, such as tweet alerts, profile rows, or approved posts. Pipedream workflow automation becomes fragile when unrelated jobs share one trigger. Split searches, monitor events, follower exports, and approved writes. These boundaries create small, testable paths. Separate workflows expose each job's errors and rate limits. This Pipedream automation platform can replace manual tasks like copying tweets. It should never hide approval for tweets, replies, or direct messages. Review every write payload before the workflow sends it. This guide calls Xquik routes directly. It does not require Pipedream's native Twitter integration. ## Build a serverless X (Twitter) API integration This serverless API integration runs without a dedicated workflow server. Start every Xquik request at `https://xquik.com/api/v1`. Send the API key through the `x-api-key` header. Pipedream secret props should contain all API keys. Step exports, logs, and error messages must exclude these keys. `GET /x/tweets/search` supports each scheduled Twitter automation workflow. Keep the query, filters, limit, and opaque cursor between pages. Destinations should store tweet IDs after accepting each row. This order prevents skipped tweets after partial failures. `GET /x/users/{id}` returns the profile fields required for enrichment. Export usernames, follower counts, verification state, and profile images. Use `POST /extractions` when exports require multiple API pages. Poll the returned job until it reaches a terminal status. Custom JavaScript automation can read `steps.trigger.event` after a trigger. HTTP events include method, body, headers, path, query, and URL fields. Later steps receive tweet IDs, text, usernames, cursors, and destination keys. Never export signing secrets, raw signatures, or complete request headers. A shared request helper keeps API integrations consistent. It should normalize statuses, summaries, cursors, and retry instructions. Name every step after its concrete output. Examples include `search_tweets`, `normalize_profiles`, and `send_slack_alert`. ## Prerequisites * [Xquik API key](/x-api-quickstart) * Pipedream account * Node.js supported by the current Pipedream CLI * Pipedream CLI installed and signed in ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npm install -g @pipedream/cli pd login ``` ## Component shape > [card] App > > `components/xquik/app/xquik.app.ts` > [card] Auth > > API key prop injected as `x-api-key`. > [card] Base URL > > `https://xquik.com/api/v1` > [card] Actions > > Read actions are Get Tweet, Search Tweets, Get User, and Get Trends. Create actions are Create Tweet, Create Extraction, Create Monitor, and Create Webhook. > [card] Sources > > Monitor Event Webhook and Extraction Completed Polling. > [card] Shared helper > > JSON requests, structured Xquik errors, and `Retry-After` handling. ## App file Create the shared app component first. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { axios } from "@pipedream/platform"; export default { type: "app", app: "xquik", propDefinitions: { apiKey: { type: "string", label: "Xquik API Key", secret: true, }, }, methods: { async request($, config, apiKey) { return axios($, { ...config, baseURL: "https://xquik.com/api/v1", headers: { "content-type": "application/json", "x-api-key": apiKey, ...(config.headers || {}), }, }); }, }, }; ``` Add `apiKey: { propDefinition: [xquik, "apiKey"] }` to each action and source that calls `xquik.request`. Use `GET /account` as the first authentication check. It verifies the API key without changing an X account. ## Shared error handling Wrap requests so every action and source reports the same remediation. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} function xquikErrorMessage(status: number, body: unknown, headers: Record) { if (status === 401) return "Authentication failed. Check the Xquik API key."; if (status === 402) return "Subscription or credits required. Update billing in Xquik."; if (status === 429) { const retryAfter = headers["retry-after"]; return retryAfter ? `Rate limited. Retry after ${retryAfter} seconds.` : "Rate limited. Retry after the cooldown period."; } if (typeof body === "object" && body !== null && "message" in body) { return String((body as { message: unknown }).message); } return "Xquik request failed."; } ``` Call the helper once per request. Export a short `$summary` so each workflow run stays scannable. ## Control errors, retries, and rate limits Route each documented Xquik status before a Pipedream step exports anything. A `400` response means the request needs different fields. A `401` response means the API key failed authentication. A `402` response requires a subscription or credit change. A `404` response identifies a missing tweet, profile, monitor, or job. A `424` response reports an upstream dependency failure. A `429` response means the workflow exceeded a rate limit. A `502` response reports a temporary retrieval failure. Read `Retry-After` when the response includes it. Automatic retries should exclude `400`, `401`, `402`, and `404`. Safe reads can retry `424`, `429`, or `502` with bounded backoff. Write retries must follow the returned `safeToRetry` field. Send a new idempotency key only when the contract permits another attempt. Use Pipedream concurrency controls for fixed workflow execution limits. Concurrency limits do not replace endpoint rate limits. Place search and profile actions behind one shared throttle policy. Place tweet and reply writes behind a separate approval queue. Store a page cursor only after downstream processing succeeds. The workflow can rerun a failed page and upsert by tweet or profile ID. This strategy protects Slack alerts, CRM rows, and warehouse loads. ## Starter actions > [card] Get tweet > > Call `GET /x/tweets/{id}` and return one tweet. > [card] Search tweets > > Call `GET /x/tweets/search` and return an array of tweets. > [card] Get user > > Call `GET /x/users/{id}` and return one user. > [card] Get trends > > Call `GET /x/trends` and return a trend list. > [card] Create tweet > > Call `POST /x/tweets` and return created tweet metadata. > [card] Create extraction > > Call `POST /extractions` and return the job ID and status. > [card] Create monitor > > Call `POST /monitors` and return the monitor ID and status. > [card] Create webhook > > Call `POST /webhooks` and return the webhook ID and signing secret. This example shows a Search Tweets action. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import xquik from "../../app/xquik.app"; export default { key: "xquik-search-tweets", name: "Search Tweets", description: "Search recent X posts with Xquik.", version: "0.0.1", type: "action", props: { xquik, apiKey: { propDefinition: [xquik, "apiKey"] }, q: { type: "string", label: "Query" }, limit: { type: "integer", label: "Limit", optional: true, default: 25 }, }, async run({ $ }) { const data = await this.xquik.request( $, { method: "GET", url: "/x/tweets/search", params: { q: this.q, limit: this.limit }, }, this.apiKey, ); $.export("$summary", `Found ${(data.tweets || []).length} tweets.`); return data.tweets || []; }, }; ``` ## Result handoff Pipedream exports and source metadata pass stable fields between workflow steps. Destinations should receive normalized fields, not complete API responses. > [card] Search tweets action > > Export `tweet_count`, `has_more`, and `next_cursor`. Return tweet rows with `tweet_id`, `text`, `author_username`, `created_at`, and optional `url`. > [card] User profile action > > Export `user_id`, `username`, `name`, `followers`, `verified`, and `profile_picture`. Return one profile row for `GET /x/users/{id}`. > [card] Trend rows > > Export `trend_count` and `woeid`. Return trend rows with `name`, `rank`, `query`, and `description`. Keep the selected region with workflow event metadata. > [card] Tweet or reply write > > Send a unique `Idempotency-Key`. Export `id`, `status`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. > [card] Media attachments > > For tweets or replies, pass public URLs in `media` or uploaded IDs in `media_ids`. Export `tweet_id` or `write_action_id`. For DMs, upload first and pass one `media_id` in `media_ids`. Export the DM `message_id` and leave `reply_to_message_id` unset. > [card] Monitor and webhook setup > > Export monitor `id`, `username`, `xUserId`, `eventTypes`, `isActive`, and `nextBillingAt`. Export webhook `id`, `url`, `eventTypes`, and one-time `secret`. For Pipedream data stores, map production `deliveryId` to `delivery_id` for receiver retry deduplication. Map `streamEventId` to `stream_event_id` when one monitor event should process once across endpoint changes. > [card] Monitor event source > > Emit `deliveryId` for endpoint-level retry deduplication. Emit `streamEventId` for event-level deduplication across endpoint changes, and `occurredAt` as `ts`. > [card] Stored event replay > > Call `GET /api/v1/events` with `cursor` when a workflow needs replay. Export `event_id`, `type`, `monitor_id`, `monitor_type`, `occurred_at`, `has_more`, and `next_cursor`. > [card] Receiver acceptance > > Return `2xx` after accepting duplicate `deliveryId` or `streamEventId`. Treat endpoint signing values, raw request body, raw signature, and full headers as private. Exclude them from step exports, logs, and data stores. Also exclude them from Slack messages, CRM rows, and retry queues. > [card] Extraction polling source > > Emit completed job `id`, `tool_type`, and `status`. Fetch detail rows and carry `has_more` plus `next_cursor` into warehouse batches. ## Source 1. Monitor event webhook This source delivers immediate tweet, reply, quote, and repost alerts. Setup follows these steps. 1. Pipedream creates an HTTP endpoint for the source. 2. The source calls `POST /webhooks` with that endpoint and selected event types. 3. The user creates or selects an Xquik monitor. 4. Each webhook payload emits one event with a stable ID. Map the payload fields like this. > [card] Event ID > > Map Pipedream `id` to `streamEventId` for event-level deduplication, or `deliveryId` for endpoint-level deduplication. > [card] Event type > > Map `eventType` to route `tweet.new`, `tweet.reply`, `tweet.quote`, and `tweet.retweet` events. > [card] Occurred at > > Map `occurredAt` as the event timestamp. > [card] Username > > Map `username` for account monitor events. > [card] Tweet ID > > Map `data.id` as the tweet identifier. > [card] Text > > Map `data.text` as the tweet body. > [card] Author username > > Map `data.author.userName` when present. Use `username` as the monitored-account fallback. Keep the webhook secret returned by Xquik and verify `x-xquik-signature` before emitting events. ## Build event-driven Twitter workflows Event driven workflows start when Xquik delivers a monitor event. Account monitors can identify new tweets, replies, quotes, and reposts. Keyword monitors can identify matching tweets without repeated broad searches. Verify HMAC against the exact request body before parsing JSON. Reject stale timestamps and reused nonces before starting downstream steps. Use `deliveryId` for endpoint retry deduplication. Use `streamEventId` for event deduplication across endpoint changes. Pipedream data stores can retain these identifiers with expiration times. Their operations are not atomic transactions. Design every CRM upsert and Slack notification for repeated delivery. Return `2xx` after accepting an already processed event. Real-time synchronization should keep the event timestamp and monitor ID. Separate filters should route replies, quotes, and reposts. This separation gives marketing campaigns and support teams clearer alerts. A Twitter monitor webhook should send only verified event fields downstream. Keep raw bodies and signature headers out of workflow exports. Use stored event replay when a destination recovers after downtime. ## Source 2. Extraction completed polling Use this when teams want batch jobs without webhook setup. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export default { key: "xquik-extraction-completed", name: "Extraction Completed", description: "Emit completed Xquik extraction jobs.", version: "0.0.1", type: "source", props: { xquik, apiKey: { propDefinition: [xquik, "apiKey"] }, timer: { type: "$.interface.timer", default: { intervalSeconds: 900 } }, }, async run() { const data = await this.xquik.request( this, { method: "GET", url: "/extractions", params: { status: "completed", limit: 25 }, }, this.apiKey, ); for (const job of data.extractions || []) { this.$emit(job, { id: job.id, summary: `Extraction ${job.id} completed`, ts: Date.parse(job.completedAt || job.updatedAt || job.createdAt), }); } }, }; ``` ## Recipes ### Search tweets to Slack > [card] Schedule trigger > > Run the workflow on the reporting cadence. > [card] Xquik search tweets > > Call the Search Tweets action and return recent matching posts. > [card] Engagement filter > > Keep only tweets that meet the minimum engagement threshold. > [card] Slack send message > > Send the selected tweet text, author, and link to the channel. ### Monitor events to CRM > [card] Monitor event source > > Receive Xquik monitor events from the webhook source. > [card] Event type filter > > Route `tweet.new`, `tweet.reply`, `tweet.quote`, and `tweet.retweet` events separately. > [card] Get user enrichment > > Enrich the event with the Get User action before CRM routing. > [card] CRM upsert > > Upsert by user ID to avoid duplicate account records. ### Extraction to warehouse > [card] Create extraction > > Start the extraction job with `POST /extractions`. > [card] Extraction completed source > > Poll for completed jobs before loading rows downstream. > [card] Fetch extraction detail > > Fetch the completed extraction detail and result rows. > [card] Warehouse destination > > Send normalized rows to the warehouse destination. ## Automate focused Twitter workflows Use tweet search automation for scheduled brand, topic, or competitor searches. Send matched tweets to Slack only after an engagement filter passes. The deduplication step uses persisted tweet IDs to suppress repeated alerts. Use monitor events for near-real-time lead generation signals. Enrich the author profile before creating a CRM record. Upsert by X (Twitter) user ID, not a mutable username. Each CRM record should include the triggering tweet URL. Use bounded follower pages for Google Sheets exports. Use extraction jobs when exports exceed one bounded page. Load completed rows in batches and keep the next cursor. Use scheduled tasks for regional trends and recurring tweet searches. Keep schedule frequency within documented X (Twitter) API rate limits. Record the search window so later runs avoid overlapping results. Send every blog post and scheduled tweet through an approval queue. An RSS item can create a draft payload. A reviewer should approve its text, links, and target account. The final action can then publish with an idempotency key. These automation tools should reduce repetitive copying. They should not automate unsolicited replies, follows, or direct messages. ## Test coverage Add focused tests before sharing the component package. > [card] Auth injection > > Every request includes `x-api-key` and never logs the key. > [card] Invalid key > > `401` produces "Authentication failed. Check the Xquik API key." > [card] Rate limit > > `429` includes `Retry-After` when present. > [card] Search action > > Returns an array with stable tweet IDs. > [card] Create webhook > > Sends callback URL and selected event types. > [card] Webhook source > > Emits one event per payload with a stable ID. > [card] Polling source > > Emits only completed extraction jobs. Run component tests and publish privately first. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npm test pd publish components/xquik/actions/search-tweets/search-tweets.ts ``` ## Pipedream Twitter automation questions ### What is Pipedream automation? Pipedream automation connects triggers, API calls, code, and cloud applications. Xquik adds tweet, profile, follower, monitor, and publishing operations. ### How do I set up Pipedream workflow automation? Create one trigger, add an Xquik action, then test its output. Add the destination only after the Xquik response is stable. ### How do I connect a Twitter webhook to custom code? Use an HTTP source or trigger that keeps the exact request body. Verify HMAC, timestamp, and nonce before running custom code. ### Which trigger fits tweet search automation? Use a schedule for periodic searches. Use a monitor webhook for near-real-time account or keyword events. ### Can Pipedream connect Twitter events to cloud apps? Pipedream can send verified events to Slack, Sheets, CRMs, or warehouses. Each handoff should normalize tweet and profile fields. ### How do serverless API integrations handle rate limits? Honor `Retry-After`, cap concurrency, and retry only safe operations. Store cursors after the destination confirms success. ### Can Pipedream run scheduled Twitter tasks? Pipedream can schedule searches, trend reads, and extraction polling. Place tweet publishing behind a separate human approval step. ### How do Pipedream CRM integrations avoid duplicate leads? CRM integrations should upsert profiles by X (Twitter) user ID. Deduplicate monitor events by `streamEventId` before creating CRM activity. ### Does this Pipedream Twitter guide need a native Twitter app? The component calls Xquik's REST API with an Xquik API key. The workflow does not depend on a native Twitter app. ### When should I create a private Pipedream component? Create one when team members repeat the same authenticated request. Use inline code for a single experimental workflow. ### How should Pipedream store webhook deduplication keys? Store delivery and event IDs separately with suitable expiration times. Keep downstream writes idempotent because store operations are not transactional. ### What are common Pipedream Twitter automation use cases? Common cases include searches, profile enrichment, follower exports, and monitor alerts. Other cases include trend reports, extraction loads, and approved posts. ## Pipedream and Xquik sources * [Pipedream Workflows](https://pipedream.com/docs/workflows) * [Pipedream HTTP requests](https://pipedream.com/docs/workflows/building-workflows/http) * [Pipedream workflow triggers](https://pipedream.com/docs/workflows/building-workflows/triggers) * [Pipedream components](https://pipedream.com/docs/components) * [Pipedream data stores](https://pipedream.com/docs/workflows/data-management/data-stores) * [Pipedream workflow errors](https://pipedream.com/docs/workflows/building-workflows/errors) * [Pipedream concurrency and throttling](https://pipedream.com/docs/workflows/building-workflows/settings/concurrency-and-throttling) ## Next steps * Read [API Reference](/api-reference/overview) for auth, rate limits, and errors. * Read [Webhooks](/webhooks/overview) for payload shape and retries. * Read [Extraction Workflow](/guides/extraction-workflow) for job creation and result pagination. * Choose Make or Zapier when the team wants no-code scenario builders. # Twitter search pipeline with Python & Prefect Source: https://docs.xquik.com/guides/prefect Build scheduled Twitter search, profile, timeline, and trend workflows in Python with Prefect. Paginate tweet and user pages, then retry failures. See examples. > For the complete documentation index, see [llms.txt](/llms.txt). Prefect is an open-source workflow orchestrator for Python code. This Prefect Python tutorial schedules X (Twitter) API Python reads through Xquik. It builds a Prefect Python workflow orchestration pipeline for tweets, profiles, timelines, and trends. Use [`prefect-xquik`](https://github.com/Xquik-dev/prefect-xquik) for repeatable tweet searches, profile lookups, timeline refreshes, and trend checks. Use it for scheduled X (Twitter) API reads in Python. This Prefect Python library gives you typed credentials and 6 read-only tasks. This collection is not a general Prefect Python SDK. The collection is read-only. It provides 6 asynchronous Prefect tasks. Each task returns the canonical Xquik JSON response as a Python dictionary. You can track Python functions as data pipelines with Prefect. Prefect flows wrap normal Python code with retries, schedules, and state tracking. Prefect offers run history, deployment controls, and execution environments for each data workflow. The Prefect UI shows every created task and flow state in real time. > [card] Search tweets > > Search keywords, hashtags, accounts, dates, and X query operators. > [card] Look up tweets > > Fetch one public tweet from its numeric ID. > [card] Search profiles > > Find public X accounts by name, username, or topic. > [card] Look up profiles > > Retrieve one public profile by username or user ID. > [card] Refresh timelines > > Fetch recent tweets with optional replies and parent context. > [card] Track trends > > Retrieve worldwide or regional trending topics by WOEID. Use this collection for research, enrichment, dashboards, alerts, and indexing. Use direct REST, SDK, or MCP calls for writes, monitors, webhooks, and exports. ## Install a verified Prefect release Use Python 3.10 or newer. Pin the verified source tag and Prefect release. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install \ "prefect==3.4.25" \ "importlib-metadata==8.7.0" \ "prefect-xquik @ https://github.com/Xquik-dev/prefect-xquik/archive/refs/tags/v0.1.7.tar.gz" ``` You can install `prefect-xquik` 0.1.8 or earlier releases from PyPI. Use the tested `v0.1.7` source pin with Prefect 3. It also uses the canonical Xquik API base URL. Tag `v0.1.8` only changes package maintenance. It also requires newer Prefect releases. The explicit `importlib-metadata` pin fixes Prefect's clean Python 3.12 CLI import. Prefect documents the upstream issue in [#22011](https://github.com/PrefectHQ/prefect/issues/22011) and [#22137](https://github.com/PrefectHQ/prefect/issues/22137). Use the tested pins above for production. Use a separate sandbox for compatibility checks. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m venv .venv-prefect-compat source .venv-prefect-compat/bin/activate python -m pip install -U prefect prefect-xquik prefect server start ``` Keep the server running. Open another shell and activate the same environment. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} source .venv-prefect-compat/bin/activate prefect config set PREFECT_API_URL="http://127.0.0.1:4200/api" prefect block register -m prefect_xquik ``` PowerShell users should activate `.venv-prefect-compat\Scripts\Activate.ps1` instead. Run `pip install -U prefect` only inside this sandbox. Run `prefect server start` before registering the block. Keep the tested pins above for this integration. Treat Prefect and the collection as separate Python packages. ## Store the Xquik API key Create an [Xquik API key](/x-api-quickstart). Store it inside an `XquikCredentials` block. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from prefect_xquik import XquikCredentials credentials = XquikCredentials( api_key="xq_YOUR_KEY_HERE", base_url="https://xquik.com/api/v1", api_contract="2026-04-29", timeout_seconds=30, ) credentials.save("xquik", overwrite=True) ``` Prefect blocks store typed configuration across flows and deployments. The API key uses Pydantic `SecretStr`. Prefect hides its value in normal block rendering. Never place API keys in deployment YAML, flow parameters, logs, or repositories. Limit block access to deployments that require Xquik reads. ## Understand the Prefect Python runtime Prefect runs ordinary Python functions. The `@flow` decorator creates a tracked flow run. The `@task` decorator creates task state with optional retries. Configure retries per task or through a nonzero global default. The `from prefect import flow, task` statement imports both decorators. A dynamic workflow can branch from returned tweets, profiles, or trends. Prefect does not require YAML files for Python flows. Use Python code for branches, loops, and task dependencies. Store the local profile name or server URL in environment variables. Store Xquik keys in `XquikCredentials` for deployed flows. ## Choose the right Prefect task > [card] search_tweets > > Calls `GET /x/tweets/search`. Accepts `query`, `cursor`, `limit`, `query_type`, `since_time`, and `until_time`. > [card] get_tweet > > Calls `GET /x/tweets/{id}`. Pass one numeric tweet ID. > [card] search_users > > Calls `GET /x/users/search`. Accepts a profile query and optional cursor. > [card] get_user > > Calls `GET /x/users/{id}`. Accepts usernames with or without `@`. > [card] get_user_tweets > > Calls `GET /x/users/{id}/tweets`. Supports replies, parent tweets, and cursors. > [card] get_trends > > Calls `GET /x/trends`. Accepts `woeid` and a count from 1 through 50. `search_tweets` limits each request to 200 tweets. `get_trends` limits each request to 50 topics. The collection validates these ranges before sending a request. ## Build a Twitter automation flow in Python This flow searches recent Prefect posts and normalizes tweet rows. It keeps IDs, authors, timestamps, metrics, URLs, and pagination state. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from __future__ import annotations from datetime import datetime, timedelta, timezone from typing import Any, Optional from prefect import flow, task from prefect_xquik import XquikCredentials, search_tweets @task async def normalize_tweet_page( page: dict[str, Any], ) -> list[dict[str, Any]]: rows: list[dict[str, Any]] = [] for tweet in page.get("tweets", []): if not isinstance(tweet, dict): continue author = tweet.get("author") rows.append( { "tweet_id": tweet.get("id"), "text": tweet.get("text"), "created_at": tweet.get("createdAt"), "url": tweet.get("url"), "author": author if isinstance(author, dict) else {}, "like_count": tweet.get("likeCount"), "repost_count": tweet.get("retweetCount"), "reply_count": tweet.get("replyCount"), } ) return rows @flow(name="Xquik Twitter Search") async def social_signal_flow( since_time: Optional[str] = None, until_time: Optional[str] = None, ) -> dict[str, Any]: if (since_time is None) != (until_time is None): raise ValueError("Pass both time boundaries or neither boundary") if since_time is None and until_time is None: window_end = datetime.now(timezone.utc) window_start = window_end - timedelta(hours=1) since_time = window_start.isoformat().replace("+00:00", "Z") until_time = window_end.isoformat().replace("+00:00", "Z") credentials = XquikCredentials.load("xquik") page = await search_tweets( credentials, query='"workflow orchestration" lang:en -filter:retweets', query_type="Latest", since_time=since_time, until_time=until_time, limit=100, ) rows = await normalize_tweet_page(page) return { "tweet_rows": rows, "has_more": page.get("has_next_page", False), "next_cursor": page.get("next_cursor"), } ``` Run it with explicit ISO 8601 boundaries. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import asyncio result = asyncio.run( social_signal_flow( since_time="2026-08-01T00:00:00Z", until_time="2026-08-02T00:00:00Z", ) ) ``` The timestamps define a reproducible search window. Store them beside every run checkpoint. ## Write focused tweet search queries Narrow each search to avoid irrelevant rows. > [card] Exact phrase > > Use `"workflow orchestration"` for an exact phrase. > [card] Account filter > > Use `from:PrefectIO` for tweets from one account. > [card] Hashtag search > > Use `#prefect #python` for matching hashtags. > [card] Engagement floor > > Use `prefect min_faves:10` for a like threshold. > [card] Date window > > Use `since:` and `until:` dates inside a query. > [card] Exclude reposts > > Use `-filter:retweets` when original posts matter. Use `query_type="Latest"` for chronological monitoring. Use `query_type="Top"` for engagement-ranked discovery. Rankings can change. Store tweet IDs. ## Schedule the Twitter search pipeline Use `.serve()` for a long-running local process. Add a cron schedule and timezone. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from prefect.schedules import Cron if __name__ == "__main__": social_signal_flow.serve( name="xquik-social-signals", schedule=Cron("0 * * * *", timezone="UTC"), ) ``` The scheduled flow derives the previous hour on every run. Pass explicit boundaries for backfills. Use a work-pool deployment for Docker, Kubernetes, or serverless workers. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} prefect deploy social_signal_flow.py:social_signal_flow \ --name xquik-social-signals \ --pool production ``` Prefect schedules create flow runs. Workers execute those runs. Confirm that the selected work pool has an active worker. ## Paginate tweet and profile results Cursor pagination continues large searches without guessing page numbers. Keep the original request unchanged. Pass only the returned cursor. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from typing import Any, Optional from prefect import flow from prefect_xquik import XquikCredentials, search_tweets @flow async def collect_tweet_pages(query: str) -> list[dict[str, Any]]: credentials = XquikCredentials.load("xquik") rows_by_id: dict[str, dict[str, Any]] = {} cursor: Optional[str] = None while True: page = await search_tweets( credentials, query=query, query_type="Latest", limit=100, cursor=cursor, ) for tweet in page.get("tweets", []): if isinstance(tweet, dict) and tweet.get("id"): rows_by_id[str(tweet["id"])] = tweet cursor_value = page.get("next_cursor") has_more = bool(page.get("has_next_page", False)) if not has_more or not cursor_value: break cursor = str(cursor_value) return list(rows_by_id.values()) ``` Do not decode cursors. Treat them as opaque strings. Store each cursor after storing its page. Resume from that checkpoint after a worker restart. Use the same pattern with `search_users` and `get_user_tweets`. Keep `query`, `query_type`, `limit`, replies, and timestamps unchanged. ## Make scheduled runs idempotent Scheduled windows can overlap. Workers can also retry completed requests. Prevent duplicate downstream rows with stable identifiers. > [card] Tweet identity > > Upsert tweet rows by `id`. Do not use text as a key. > [card] Profile identity > > Upsert profile rows by numeric user `id`. > [card] Window checkpoint > > Store `since_time`, `until_time`, query, and ordering. > [card] Cursor checkpoint > > Store `has_next_page` and `next_cursor` after each committed page. Keep tweet rows, profile rows, trend rows, and checkpoints separate. This simplifies retries and schema changes. ## Retry only transient failures Prefect supports retry delays, jitter, and conditional retries. Do not retry invalid inputs or billing failures unchanged. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from prefect_xquik import XquikError, search_tweets def retry_transient_xquik_error(_task, _task_run, state) -> bool: try: state.result() except XquikError as error: return error.status_code is None or error.status_code in {424, 429, 502} return False search_recent_tweets = search_tweets.with_options( name="Search Recent Tweets", retries=4, retry_delay_seconds=[5, 15, 45, 120], retry_jitter_factor=0.5, retry_condition_fn=retry_transient_xquik_error, ) ``` Add jitter so scheduled tasks avoid synchronized retries. The collection does not expose response headers on `XquikError`. Use conservative delays for `429`, or call REST directly when header-aware handling matters. ## Route every documented error `XquikError` exposes a sanitized message, optional `status_code`, and raw `response_text`. Do not store the raw response. Store the status, task run ID, endpoint, and safe error category. > [card] 400 Invalid request > > Fix missing queries, invalid limits, or malformed input. Do not retry unchanged. > [card] 401 Authentication > > Load a valid Xquik API key from the credentials block. > [card] 402 Account action > > Resolve subscription or credits before the next scheduled run. > [card] 404 Not found > > Check tweet IDs, usernames, and user IDs. Search routes omit this status. > [card] 424 Dependency failure > > Retry with bounded backoff. Stop after the configured attempt cap. > [card] 429 Rate limit > > Slow the schedule and retry with jittered delays. > [card] 502 Retrieval failure > > Retry transient X retrieval failures with a cap. > [card] Network failure > > Retry bounded connection failures when `status_code` is absent. These statuses cover all 6 collection endpoints. Do not add undocumented statuses to route-specific retry rules. ## Control concurrency and rate limits Multiple schedules can overlap and share one API key. Create one global rate limit with slot decay. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} prefect gcl create xquik-read-rate --limit 500 --slot-decay-per-second 500 ``` Acquire one shared slot before every Xquik read. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from prefect.concurrency.asyncio import rate_limit async def acquire_xquik_read_slot() -> None: await rate_limit("xquik-read-rate", occupy=1, strict=True) ``` Await this helper before `search_tweets`, `get_tweet`, and `search_users`. Also await it before `get_user`, `get_user_tweets`, and `get_trends`. Use a separate Prefect concurrency limit for in-flight task runs. Concurrency limits only cap active work. They do not set request frequency. Keep retry policies aligned with [Xquik rate-limit guidance](/guides/rate-limits). Read endpoints share a 500 per 1s user bucket. Treat this as one shared capacity limit. Use one limit across tweet search, profile lookup, timelines, and trends. Make every task use that same account limit. Slow low-priority refreshes before delaying interactive reads. ## Build profile and timeline workflows Use `search_users` when a name or topic can match multiple accounts. Use `get_user` when you already know the username or user ID. `get_user_tweets` retrieves one account's recent timeline. Set `include_replies=True` for conversations. Set `include_parent_tweet=True` when reply context matters. Normalize profiles into stable fields. * `id` * `username` * `name` * `followers` * `following` * `verified` * `profilePicture` Normalize tweets separately. Keep `id`, `text`, `author`, `createdAt`, metrics, and `url`. ## Build regional trend alerts `get_trends(credentials, woeid=1, count=30)` returns worldwide trends. Pass another valid WOEID for a region. Store each trend's `name`, `rank`, `query`, and `description` when present. Store response `woeid` and `count` with the alert batch. Trends are discovery signals, not verified facts. Validate important topics through tweet search before alerting customers. ## Result handoff > [card] Tweet pages > > Store `tweets`, `has_next_page`, and `next_cursor`. Normalize tweets before loading a warehouse or dashboard. > [card] User pages > > Store `users`, `has_next_page`, and `next_cursor`. Keep numeric user IDs as primary keys. > [card] Trend batches > > Store `trends`, `count`, and `woeid`. Keep each trend's rank. > [card] Failure records > > Store status, endpoint, task run ID, attempt count, and safe error category. Do not pass raw dictionaries directly into alerts or generators. Define compact row contracts first. Keep row fields stable when API responses add fields. ## Prefect collection or direct Xquik API Choose `prefect-xquik` for its 6 supported reads. It provides blocks, async calls, validation, and task metadata. Use direct REST, a generated SDK, or MCP for these jobs. * Tweet, reply, quote, repost, like, follow, or DM actions * Follower and following exports * Tweet replies, quotes, reposts, lists, and communities * Monitors, signed webhooks, and stored event replay * CSV, JSON, XLSX, Markdown, or PDF extraction jobs * Request filters absent from the 6 Prefect tasks Keep writes behind explicit approval. Store confirmed IDs before retrying any write action. ## Common Prefect X (Twitter) API questions ### What is Prefect Python? Prefect orchestrates Python functions as tracked flows and tasks. It adds schedules, retries, state, logs, and deployment controls without replacing Python syntax. ### What does this Python Prefect tutorial cover? It builds a Prefect Python pipeline for scheduled Twitter searches and timeline reads. The flow keeps tweets, cursors, time windows, and documented errors. ### How does a Twitter search API Python flow work? The flow calls `search_tweets` with a query and time window. It normalizes tweet IDs, text, authors, metrics, URLs, and pagination fields. ### Is this Twitter automation Python workflow read-only? Yes. The Prefect Python API collection reads tweets, profiles, timelines, and trends. Send approved writes through separate REST, SDK, or MCP routes. ### Is `prefect-xquik` a Prefect Python SDK? No. You get 6 asynchronous read tasks. Use Xquik SDKs when a workflow needs broader REST coverage. ### Which Prefect Python version should I install? Use Python 3.10 or newer with the tested Prefect 3.4.25 pin. Validate newer Prefect releases before changing production dependencies. ### Where is the Prefect Python GitHub collection? The [prefect-xquik repository](https://github.com/Xquik-dev/prefect-xquik) contains the package, examples, tests, and release tags. Check source changes before upgrading your pinned deployment. ### Python Prefect vs airflow, which fits Twitter search? Pick Prefect when Python control flow and task retries matter. Choose Airflow when your team already runs DAG-based schedules. Either system still needs cursor, idempotency, and rate-limit controls. ### How do I automate Twitter search with Python? Install `prefect-xquik`, register `XquikCredentials`, then schedule `search_tweets`. Use explicit time windows and cursor checkpoints. ### Can Prefect schedule X (Twitter) profile and timeline reads? Yes. Use `get_user` for profiles and `get_user_tweets` for recent timelines. Enable replies only when needed. ### Can the Prefect collection post tweets? No. The 6 tasks are read-only. Use Xquik REST, SDK, or MCP routes for approved writes. ### How do I handle X (Twitter) API rate limits in Prefect? Await the shared rate limiter before all 6 tasks. Retry `429` with jittered delays and a hard attempt cap. Keep concurrency limits separate. ### How do I prevent duplicate tweets across scheduled runs? Enforce a unique tweet ID constraint. Upsert rows or ignore conflicts during overlapping runs. Save time windows and cursors after each committed page. ### Should I use Prefect or cron for Twitter automation? Use cron for one simple local script. Use Prefect for retries, blocks, schedules, workers, run history, and deployment controls. ### Where should I store the Xquik API key? Store it in an `XquikCredentials` block. Never pass it as a flow parameter. ## Source and next steps * [prefect-xquik source](https://github.com/Xquik-dev/prefect-xquik) * [prefect-xquik v0.1.7](https://github.com/Xquik-dev/prefect-xquik/releases/tag/v0.1.7) * [prefect-xquik on PyPI](https://pypi.org/project/prefect-xquik/) * [Prefect schedules](https://docs.prefect.io/v3/concepts/schedules) * [Prefect task retries](https://docs.prefect.io/v3/how-to-guides/workflows/retries) * [Tweet Search API](/api-reference/x/search-tweets) * [User Timeline API](/api-reference/x/user-tweets) * [Rate Limits](/guides/rate-limits) * [Error Handling](/guides/error-handling) # Pydantic AI MCP X (Twitter) API agent for Python Source: https://docs.xquik.com/guides/pydantic-ai Build a Pydantic AI X (Twitter) API agent for typed tweet search and profiles. It adds followers, monitors, exports, and reviewed actions through MCP. > For the complete documentation index, see [llms.txt](/llms.txt). Build a Pydantic AI X (Twitter) API agent through Xquik's MCP server. Search tweets, inspect profiles, export followers, and replay monitor events. Review every proposed post, reply, like, repost, follow, and direct message. Validate every durable handoff with a Pydantic model. ## Why use Pydantic AI with an X (Twitter) API? Pydantic AI combines model tool calls with typed Python output. Xquik supplies the X (Twitter) API routes through 4 MCP tools. They are `docs`, `search`, `execute`, and `whoami`. Each Pydantic AI control covers one boundary. | Boundary | Pydantic AI control | Twitter agent benefit | | - | - | - | | MCP connection | `MCP` capability | Keep credentials and tracing in your process | | Final response | Pydantic `output_type` | Reject malformed tweet rows and cursors | | Tool catalog | `.defer_loading()` | Hide unused MCP tools until discovery | | Write actions | `.approval_required()` | Pause before posting, replying, or following | | MCP naming | `.prefixed()` | Prevent tool collisions across servers | | Connection lifecycle | `async with agent` | Reuse one MCP session across related calls | Use one typed agent for tweet search, profile enrichment, or follower exports. Use another agent for monitor processing. Keep each agent focused. ## Pydantic AI X (Twitter) API prerequisites * Python 3.10 or later * An [Xquik API key](/x-api-quickstart) beginning with `xq_` * A Pydantic AI-supported model with tool calling * A connected X account for private reads or write actions Public X reads do not require X Developer credentials. Authenticate with Xquik. Connect an X account only when the selected route requires it. This supplies an X (Twitter) API for Python agents through one MCP connection. Send the `x-api-key` header. Do not send bearer tokens or access tokens. ## Install Pydantic AI MCP support Install the current stable Pydantic AI 2.x line. Keep FastMCP below 4 until Pydantic AI adds MCP SDK v2 support. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install --upgrade \ "pydantic-ai-slim[anthropic,mcp]>=2.22,<2.23" \ "fastmcp-slim>=3.3,<4" \ python-dotenv ``` The explicit FastMCP range prevents an MCP SDK v2 prerelease from entering the environment. Remove that cap only after Pydantic AI adds FastMCP 4 support. This Pydantic AI MCP Streamable HTTP setup keeps execution inside Python. This Pydantic AI MCP server connection uses the Xquik endpoint. Keep the MCP URL HTTPS-only. It authenticates with the `x-api-key` header. After setup, run it inside a local Python process. Store secrets outside source control. ```bash .env theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} XQUIK_API_KEY=xq_YOUR_KEY_HERE ANTHROPIC_API_KEY=sk-ant-... ``` ```text .gitignore theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} .env xquik-*-handoff.json ``` ## Build a Pydantic AI MCP example for tweet search Define the final tweet-search handoff before creating the agent. Pydantic AI validates the model output against this schema. To import `Agent` from Pydantic AI, use `from pydantic_ai import Agent`. Use type hints for every durable handoff field. Start the async example with `import asyncio`. The `typing` import supplies `Literal` for finite stop reasons. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import asyncio import os from pathlib import Path from typing import Literal from dotenv import load_dotenv from pydantic import BaseModel from pydantic_ai import Agent from pydantic_ai.capabilities import MCP class TweetRow(BaseModel): tweet_id: str text: str author_username: str | None = None created: int | None = None url: str | None = None class TweetSearchHandoff(BaseModel): query: str route_used: str tweets: list[TweetRow] has_more: bool next_cursor: str | None = None stop_reason: Literal["complete", "requested_limit", "cursor_stalled"] async def main() -> None: load_dotenv() xquik_mcp = MCP( "https://xquik.com/mcp", headers={"x-api-key": os.environ["XQUIK_API_KEY"]}, allowed_tools=["docs", "search", "execute"], ) agent = Agent( "anthropic:claude-sonnet-4-6", capabilities=[xquik_mcp], output_type=TweetSearchHandoff, instructions=( "Use Xquik for Twitter API requests. Preserve exact IDs and cursors. " "Use GET /api/v1/x/tweets/search. Never invent missing tweet fields." ), ) result = await agent.run( "Search 25 recent tweets about Pydantic AI MCP. " "Return the query, route, tweet rows, cursor state, " "and an explicit stop reason." ) Path("xquik-pydantic-ai-handoff.json").write_text( result.output.model_dump_json(indent=2), encoding="utf-8", ) asyncio.run(main()) ``` `MCP` is Pydantic AI's primary MCP entry point. The connection runs locally unless you configure another execution mode. Headers, hooks, and traces remain inside your Python process. The URL selects Streamable HTTP. The allowed list contains only the public `docs`, `search`, and `execute` tools. Model Context Protocol (MCP) turns Xquik routes into model-callable tools. Pydantic builds JSON schemas from `output_type`. Use explicit keyword arguments for `headers`, `allowed_tools`, `capabilities`, and `output_type`. Pydantic AI opens and closes the connection for you. Enter `async with agent` when several runs should share one connection. The agent discovers `docs`, `search`, and `execute`. Discover route requirements before selecting an unfamiliar endpoint. The Xquik sandbox invokes `xquik.request(...)` with validated route values. Xquik injects authentication separately. ## Validate X (Twitter) API fields before storage MCP returns normalized snake_case fields. Date-time values use Unix seconds. Map REST `createdAt` to `created`, never `created_at`. Keep these source fields unchanged. * Tweet rows keep `id`, `text`, `author`, `created`, and `url`. * Profile rows keep `id`, `username`, `name`, `description`, and `followers`. * Page state keeps `has_more` and `next_cursor`. * Errors keep `error.type`, `error.code`, and `error.message`. * Write receipts keep `tweet_id`, `write_action_id`, and `charged_credits`. Map source `id` to `tweet_id` or `user_id` only in your output model. Never cast large IDs to floating-point numbers. Search and list routes return `has_more` and `next_cursor`. Pass `cursor` for tweet, profile, follower, reply, timeline, community, and list pagination. Keep the original query and filters unchanged. Events, draws, and extraction pages use `cursor`. Radar pages use `after`. Draft pages use `afterCursor`. Treat every cursor as opaque. Continue through an empty page when `has_more` stays true. Stop when no cursor exists. Stop after the server repeats a cursor. Return `cursor_stalled` with the number of collected rows. MCP output has a 24,000-character limit. Project only required fields. Use extraction exports when the workflow must store every complete row. ## Build a typed Twitter agent handoff Conversation text cannot safely resume a Python X (Twitter) API job. Store the validated fields required by the next worker. > [card] Tweet search > > Store the query, route, tweet IDs, authors, `created`, URLs, `has_more`, > `next_cursor`, and stop reason. > [card] Profile lookup > > Store `user_id`, `username`, `name`, `description`, `followers`, > `verified`, and `profile_picture`. > [card] Follower export > > Store the source user, extraction ID, status, and poll URL. Also store the > requested format and export completion state. > [card] Reply collection > > Store the root tweet ID, reply IDs, parent IDs, cursor state, and coverage > diagnostics. Keep nested replies separate. > [card] Monitor replay > > Store `monitor_id`, `event_id`, `type`, `occurred_at`, `has_more`, and > `next_cursor`. Send the next cursor as `cursor`. > [card] Webhook delivery > > Store `webhook_id`, `delivery_id`, and `stream_event_id`. Keep the webhook > secret in a secret manager. > [card] Write receipt > > Store `tweet_id` or `write_action_id`, `status`, `charged_credits`, `poll`, > and the idempotency key. > [card] Media attachment > > For tweets, pass public URLs in `media` or uploaded IDs in `media_ids`. > DMs take exactly 1 uploaded `media_id`. Keep API keys, headers, webhook secrets, and raw signatures outside agent output. Never place private messages in shared traces. ## Reuse the MCP connection safely Wrap related calls in `async with agent`. One session fetches 2 tweet-search pages. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async def collect_two_search_pages() -> None: async with agent: first_page = await agent.run( "Search 25 tweets about Pydantic AI MCP. Preserve the next cursor." ) cursor = first_page.output.next_cursor if not first_page.output.has_more or cursor is None: Path("xquik-pydantic-ai-page-1.json").write_text( first_page.output.model_dump_json(indent=2), encoding="utf-8", ) return second_page = await agent.run( f"Continue tweet search for {first_page.output.query!r}. " f"Use this exact cursor: {cursor!r}. Preserve IDs and cursor state." ) Path("xquik-pydantic-ai-page-2.json").write_text( second_page.output.model_dump_json(indent=2), encoding="utf-8", ) ``` One local MCP session connects as one identity. Do not share one session across users with different Xquik keys. Give every credential its own request-scoped MCP capability. ## Require approval before X (Twitter) actions Read-only agents can search tweets automatically. Write-capable agents need a human decision before every X action. Review posts, replies, likes, reposts, follows, and direct messages. Xquik exposes all API calls through one aggregate `execute` tool. Review and approve each validated Xquik tool invocation. Leave `search` available without approval. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from pydantic import BaseModel from pydantic_ai import Agent, DeferredToolRequests, DeferredToolResults from pydantic_ai.mcp import MCPToolset class ActionReceipt(BaseModel): route_used: str tweet_id: str | None = None write_action_id: str | None = None status: str charged_credits: int | None = None xquik = MCPToolset( "https://xquik.com/mcp", headers={"x-api-key": os.environ["XQUIK_API_KEY"]}, ) reviewed_xquik = xquik.approval_required( lambda _ctx, tool_def, _args: tool_def.name == "execute" ) write_agent = Agent( "anthropic:claude-sonnet-4-6", toolsets=[reviewed_xquik], output_type=[ActionReceipt, DeferredToolRequests], instructions="Never execute an X action without explicit approval.", ) pending = await write_agent.run( "Draft a reply to tweet 123. Do not post before approval." ) if isinstance(pending.output, DeferredToolRequests): approvals: dict[str, bool] = {} for call in pending.output.approvals: decision = input(f"Approve {call.tool_name} with {call.args}? [y/N] ") approvals[call.tool_call_id] = decision.strip().lower() == "y" completed = await write_agent.run( message_history=pending.all_messages(), deferred_tool_results=DeferredToolResults(approvals=approvals), ) ``` Inspect the sandbox code before approval. Confirm the route, method, account, target ID, text, media, and idempotency key. Reject unexpected arguments. The CLI displays every validated tool request. Replace it with your application's review screen when needed. Do not use `approve_all=True` when the agent can write to X. Store the approval decision and tool call ID with the resulting action receipt. ## Build X (Twitter) API error handling Treat error messages as typed error handling inputs. | Status | Meaning | Pydantic AI decision | | - | - | - | | `400` | Invalid parameters or unsupported fields | Correct the request before retrying | | `401` | Invalid Xquik authentication | Stop and replace the credential | | `402` | Subscription or credit action required | Report choices and request confirmation | | `424` | Dependency failure or incomplete replies | Keep partial rows and inspect retryability | | `429` | X (Twitter) API rate limit reached | Respect `error.retry_after` and back off | | `502` | Temporary upstream failure | Retry safe reads with a bounded policy | A `402` never authorizes a purchase. Show the available payment choices. Wait for explicit confirmation before any supported account checkout action. Never recreate a pending write after a timeout. Poll the returned action ID. Retry only safe reads when `error.retryable` permits it. ## Defer and prefix MCP tools Xquik exposes only 4 tools. Deferred loading is optional for one Xquik connection. Use it when several servers create a larger tool catalog. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} xquik = MCPToolset( "https://xquik.com/mcp", headers={"x-api-key": os.environ["XQUIK_API_KEY"]}, ) agent = Agent( "anthropic:claude-sonnet-4-6", toolsets=[xquik.defer_loading()], ) ``` Prefix tools when another server also exposes `docs`, `search`, `execute`, or `whoami`. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} twitter_tools = MCPToolset( "https://xquik.com/mcp", headers={"x-api-key": os.environ["XQUIK_API_KEY"]}, ).prefixed("twitter") agent = Agent( "anthropic:claude-sonnet-4-6", toolsets=[twitter_tools], ) ``` The resulting names become `twitter_docs`, `twitter_search`, `twitter_execute`, and `twitter_whoami`. Update any approval predicate after adding a prefix. ## Choose Pydantic AI MCP or the REST API MCP and REST solve different integration problems. MCP adds a discoverable tool layer over documented X (Twitter) API routes. | Requirement | Choose | Reason | | - | - | - | | A model selects tweet or profile operations | Pydantic AI MCP | The agent discovers `docs`, `search`, and `execute` | | Application code calls one known route | REST API | The request stays deterministic | | A human must review an X action | Pydantic AI MCP | Deferred tool approval pauses execution | | A scheduled follower export runs without a model | REST API | The job needs no model decision | | A typed agent hands work to Python | Pydantic AI MCP | `output_type` validates the handoff | Xquik validates the sandbox route, method, query, and body. Pydantic validates the final typed handoff. Keep both layers. Each layer enforces a separate boundary. ## Tested Pydantic AI compatibility Xquik checked these versions on August 3, 2026. | Package | Checked version | Supported range in this guide | | - | - | - | | Python | 3.10 or later | `>=3.10` | | `pydantic-ai-slim` | 2.22.0 | `>=2.22,<2.23` | | `fastmcp-slim` | 3.4.5 | `>=3.3,<4` through the `mcp` extra | [Pydantic AI issue 6661](https://github.com/pydantic/pydantic-ai/issues/6661) tracks FastMCP 4 and MCP SDK v2 support. Use the stable FastMCP 3.x line until that compatibility work ships. ## Pydantic AI X (Twitter) API questions ### Does Pydantic AI support MCP? Yes. Install the `mcp` extra and create an `MCP` capability. Xquik uses the recommended Streamable HTTP transport. ### What is the difference between Pydantic AI tools and MCP? Your Python application registers local Pydantic AI tools. MCP tools come from a connected server and can change independently. Xquik publishes `docs`, `search`, `execute`, and `whoami` through MCP. ### Is Pydantic AI better than LangChain for a Twitter agent? Choose Pydantic AI for typed Python handoffs. Choose [LangChain and LangGraph](/guides/langchain) for durable graph orchestration. Both can call the same Xquik MCP tools. ### Can Pydantic AI call the X (Twitter) API? Yes. MCP exposes eligible routes for tweets, profiles, followers, monitors, extractions, and X (Twitter) actions. Authenticate with an Xquik API key. ### Can Pydantic AI scrape tweets with Python? Yes. Call `GET /api/v1/x/tweets/search` through the MCP tools. Keep tweet IDs, authors, `created`, URLs, `has_more`, and `next_cursor`. ### How do I validate X (Twitter) API JSON with Pydantic? Pass a `BaseModel` as the agent's `output_type`. Call `model_dump_json()` before storing each validated output. Never print `result.output` into logs or files. Validate `result.output` before storage. Never save conversational text as JSON. ### How can I use Pydantic with AI model validation effectively? Model tweet IDs and cursors as strings. Mark a field optional only when its route omits that field. Use `Literal` for finite stop reasons. Prefer typed Pydantic models. Validate before storage, queues, exports, or handoff. ### Why avoid a str return? A structured result keeps tweet IDs, cursors, stop reasons, and errors. A plain string cannot prove field completeness or types. ### How do I import agent from Pydantic AI? Use `from pydantic_ai import Agent`. Import `BaseModel` from `pydantic` and `Literal` from `typing`. Keep these imports separate from application tools. ### Does a Pydantic AI Twitter agent need X developer keys? No. Use an Xquik API key. Some private reads and write actions also require a connected X account. ### How do I post a tweet with Pydantic AI? Use the matching X write route through `execute`. Validate and approve each requested X write operation. Store the idempotency key and returned action ID. ### How do I handle X (Twitter) API rate limits in Python? Read `error.retry_after` from a `429` response. Wait for that interval. Apply bounded backoff when retrying safe read requests. ### How do I paginate tweet search in Pydantic AI? Store `has_more` and `next_cursor` in the output model. Reuse unchanged filters. Stop on completion, limits, or a stalled cursor. ### Can a Pydantic AI agent export Twitter followers? Yes. Create an extraction, store its ID, and poll its status. Export only after completion. Save the source user and format together. ### Can Pydantic AI monitor Twitter keywords? Yes. Create a monitor and webhook. Store both identifiers together. Replay missed events through `GET /api/v1/events` with `cursor` pagination. Monitor delivery is asynchronous and cannot guarantee real-time events. ## Next steps * Read the [official Pydantic AI MCP client guide](https://pydantic.dev/docs/ai/mcp/client/). * Review the [MCP tool contract](/mcp/tools). * Follow the [agent handoff checklist](/mcp/agent-handoff). * Build a [tweet search workflow](/guides/tweet-scraper-csv-export). * Add [monitor and webhook delivery](/guides/brand-monitoring-workflow). * Compare [X (Twitter) API alternatives](/twitter-api-alternatives). Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp. # Fix X (Twitter) rate limit exceeded & 429 errors Source: https://docs.xquik.com/guides/rate-limits Understand Xquik X (Twitter) API rate limits, recover from 429 errors, and honor Retry-After. Pace tweet and follower requests, and resume cursor exports. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik applies fixed-window X (Twitter) API rate limits per Xquik account. These limits protect tweet reads, Xquik resources, and connected X accounts. Standard API keys for one account share the same buckets. Separate read, change, and X action buckets reset independently. > [!NOTE] > > **Standard limits.** 500 reads per second, 6,000 changes per minute, and 120 > X actions per minute. After `429`, wait for `Retry-After` before retrying. ## X (Twitter) API rate limits at a glance | Rate-limit signal | Meaning | Client action | | - | - | - | | 500 reads per second | `GET`, `HEAD`, and `OPTIONS` share one account bucket. | Pace tweet, profile, follower, reply, and event reads below 500 requests per second. | | 6,000 changes per minute | Other methods on Xquik resources share one bucket. | Queue monitor, webhook, key, and extraction changes below 6,000 requests per minute. | | 120 X (Twitter) actions per minute | Actions through a connected X account share one bucket. | Queue posts, likes, follows, and DMs below 120 requests per minute. | | `429 Too Many Requests` | An Xquik tier or action limit blocked the request. | Read the error code before choosing a retry delay. | | `Retry-After` header | The response supplies a wait in seconds. | Pause that bucket for the supplied duration. | | `retryAfter` or `retryAfterMs` | The JSON body supplies a retry duration. | Use the documented unit before resuming work. | > [card] Read bucket > > `GET`, `HEAD`, and `OPTIONS` allow 500 requests per 1 second. > [card] Change bucket > > `POST`, `PUT`, `PATCH`, and `DELETE` on Xquik resources allow 6,000 requests per 60 seconds. > [card] X action bucket > > Actions through a connected X account allow 120 requests per 60 seconds. These include posts, likes, follows, DMs, uploads, and profile edits. This keeps your X accounts safe. The listed request count succeeds inside each window. The next request receives `429 rate_limit_exceeded`. Its message names the limit and the wait. A read burst does not count against changes. A change burst does not count against X (Twitter) actions. ### Action-specific X (Twitter) API limits Some actions add a narrower bucket. That bucket applies beside the method tier. | Action | Route | Additional limit | Recovery | | - | - | - | - | | Follow or remove follower | `POST /x/users/{id}/follow` and `POST /x/users/{id}/remove-follower` | 20 actions per minute and 400 per day, shared | Track both counts. Wait for `Retry-After` after `429`. | | Connect or reconnect X account | `POST /x/accounts` and `POST /x/accounts/{id}/reauth` | 10 failed logins per 15 minutes, raised by each account you connect, and 5 per X account | Wait the returned remaining seconds. The maximum wait is 900 seconds. | | Login cooldown | Account connection and reauthentication | Dynamic cooldown from the login attempt | Use `retryAfterMs` or `Retry-After`. | The follow bucket protects connected X accounts from rapid automation. It also covers follower removal. Reaching 400 actions blocks more attempts. Track the daily count instead of retrying every minute. ## How the fixed window works Xquik uses fixed-window counters. It does not use a token bucket. The first counted request starts that bucket's window. **1. Start the window** The first request starts a 1-second or 60-second window. **2. Count every request** Each request increments its read, change, or X action counter. **3. Reject the overflow** Requests above the bucket limit receive `429 Too Many Requests`. **4. Reset the counter** The complete counter resets when its fixed window expires. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Read bucket: 500 requests per 1 second 0.000s First GET starts the window 0.600s Request 500 succeeds 0.700s Request 501 returns 429 with Retry-After: 1 1.000s The bucket resets 1.001s The next GET succeeds ``` The window starts with your first request. It does not follow wall-clock seconds. An early retry does not extend the existing window. It still returns `429`. Always follow the response instead of guessing the reset time. ## Read a 429 rate-limit response An Xquik tier limit returns a structured JSON error. It also returns `Retry-After` in seconds. ```http theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} HTTP/1.1 429 Too Many Requests Retry-After: 1 Content-Type: application/json { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 } ``` | Response field | Unit | Meaning | | - | - | - | | HTTP status `429` | None | A request limit or cooldown blocked the request. | | `Retry-After` | Seconds | Minimum wait before retrying that operation. | | `retryAfter` | Seconds | JSON copy of the Xquik tier wait. | | `retryAfterMs` | Milliseconds | Login cooldown wait for account connection flows. | | `error` | String | The exact reason, such as `rate_limit_exceeded`. | Standard read throttles return `Retry-After: 1`. Standard change and X action throttles return up to `Retry-After: 60`. Account connection returns the remaining window. A login cooldown returns its own remaining duration. ### Retry-After does not always mean rate limited Inspect the status and error code together. | Status or code | Meaning | Correct action | | - | - | - | | `429 rate_limit_exceeded` | You exhausted the Xquik request bucket. | Wait for `Retry-After`, then retry once. | | `429 x_rate_limited` | X throttled a connected account write. | Wait for `Retry-After` when present. Otherwise, back off. | | `429 x_daily_limit` | The connected X account reached a daily write limit. | Wait 24 hours before reusing that account. | | `422 x_automation_refused` | X refused a write that looked automated. | Send the next request now. Waiting does not help. | | `429 login_cooldown` | A connection attempt triggered a cooldown. | Wait `retryAfterMs` or `Retry-After`. | | `502 x_api_rate_limited` | The read service was throttled upstream. | Retry in a few minutes with bounded backoff. | | `402 insufficient_credits` | The account cannot fund the requested results. | Add credits or request fewer tweets, followers, or replies. | | `202` with `Retry-After` | A durable write remains active. | Poll `statusUrl`. Do not resend the write. | | `503` with `Retry-After` | A temporary write or service state needs time. | Follow `safeToRetry`, `nextAction`, and the header. | Read [API Error Handling](/guides/error-handling) before retrying writes. An idempotency key prevents duplicate submission. It does not make every retry safe. ## Xquik limits versus official X API limits The phrase "Twitter API limits" can describe 2 separate systems. Xquik enforces the account buckets documented above. X also enforces upstream limits for connected accounts and service access. | Limit owner | Typical scope | Client-visible signal | | - | - | - | | Xquik | Account plus HTTP method tier | `429 rate_limit_exceeded` and `Retry-After` | | Xquik action guard | Follow, follower removal, connection, or login | `429` with an action-specific error or cooldown | | X write service | Connected X account and write action | `x_rate_limited` or `x_daily_limit` | | X (Twitter) read service | Upstream tweet, profile, follower, or reply access | Default v1 can return `502 x_api_rate_limited` | Official X API rate limits vary by endpoint and authentication context. They can apply per app, user token, or endpoint. See [X API rate limits](https://docs.x.com/x-api/fundamentals/rate-limits) for the current official tables. Do not copy official X (Twitter) limits into an Xquik client limiter. Use the Xquik values on this page. Handle upstream codes separately. ## Recover from API rate limit exceeded Use bounded retries for idempotent reads. Keep cursor state before waiting. Never run an unbounded retry loop. **1. Classify the response** Check the HTTP status and exact `error` value. **2. Read the server delay** Prefer `Retry-After`. Fall back to `retryAfter` or `retryAfterMs`. **3. Keep the same read checkpoint** Keep the query, filters, limit, and cursor. **4. Wait with jitter** Add a small random delay after the required wait. **5. Retry a bounded number** Stop after 3 attempts. Return the final error to the caller. ### Node.js 429 recovery This helper retries `GET` requests only. It does not retry writes. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const MAX_ATTEMPTS = 3; function retryDelayMs(response, body) { const headerSeconds = Number.parseInt(response.headers.get("Retry-After") ?? "", 10); if (Number.isFinite(headerSeconds) && headerSeconds > 0) { return headerSeconds * 1_000; } if (Number.isFinite(body.retryAfter) && body.retryAfter > 0) { return body.retryAfter * 1_000; } if (Number.isFinite(body.retryAfterMs) && body.retryAfterMs > 0) { return body.retryAfterMs; } return 1_000; } async function getJsonWithRateLimit(url) { for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt += 1) { const response = await fetch(url, { headers: { "x-api-key": process.env.XQUIK_API_KEY }, }); if (response.status !== 429) { if (!response.ok) { throw new Error(`Request failed with HTTP ${response.status}`); } return response.json(); } const body = await response.json().catch(() => ({})); if (attempt === MAX_ATTEMPTS) { throw new Error(body.error ?? "rate_limit_exceeded"); } const jitterMs = Math.floor(Math.random() * 250); const waitMs = retryDelayMs(response, body) + jitterMs; await new Promise((resolve) => setTimeout(resolve, waitMs)); } } ``` The header wins when both values exist. Jitter spreads simultaneous workers. The 3-attempt cap prevents a stalled queue from hiding an outage. ## Resume tweet exports after 429 Tweet searches return `has_next_page` and `next_cursor`. Store the completed page and next cursor atomically. Do not advance the cursor after a failed request. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const baseUrl = "https://xquik.com/api/v1/x/tweets/search"; let cursor; while (true) { const url = new URL(baseUrl); url.searchParams.set("q", "from:example launch"); url.searchParams.set("queryType", "Latest"); url.searchParams.set("limit", "100"); if (cursor) url.searchParams.set("cursor", cursor); const page = await getJsonWithRateLimit(url); // Commit unique tweets[].id values and next_cursor together. await storeTweetPageAndCursor(page.tweets, page.next_cursor); if (!page.has_next_page || !page.next_cursor) break; cursor = page.next_cursor; } ``` Keep `q`, `queryType`, filters, and `limit` unchanged while resuming. Deduplicate stored tweets by `tweets[].id`. A repeated page then remains harmless. See [Request-Efficient API Usage](/guides/request-efficient-api-usage#store-cursor-checkpoints) for more checkpoint patterns. ### Cursor recovery checklist | Checkpoint | Save after success | Reuse after 429 | | - | - | - | | Search query | Exact `q` string | Yes | | Sort order | Exact `queryType` | Yes | | Filters | Author, date, media, language, and engagement filters | Yes | | Page size | Exact `limit` | Yes | | Incoming cursor | Cursor used for the blocked page | Yes | | Returned cursor | `next_cursor` from the completed page | Only after storing that page | | Tweet identity | Every `tweets[].id` | Use for deduplication | ## Pace requests before 429 Leave headroom below each documented limit. Headroom absorbs network timing and work from other API keys. It also protects shared serverless workers. ### Use a shared Node.js limiter This Bottleneck configuration reserves 10% read headroom. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import Bottleneck from "bottleneck"; const readLimiter = new Bottleneck({ reservoir: 450, reservoirRefreshAmount: 450, reservoirRefreshInterval: 1_000, maxConcurrent: 5, }); const response = await readLimiter.schedule(() => fetch("https://xquik.com/api/v1/x/tweets/search?q=launch&limit=100", { headers: { "x-api-key": process.env.XQUIK_API_KEY }, }), ); ``` One in-memory limiter coordinates only one process. Use a shared queue across multiple servers, functions, or containers. ### Rate-limiting libraries > [card] Node.js libraries > > Use [bottleneck](https://github.com/SGrondin/bottleneck) for shared queues, > or [p-limit](https://github.com/sindresorhus/p-limit) for concurrency caps. > [card] Python library > > Use [ratelimit](https://github.com/tomasbasham/ratelimit) with > `pip install ratelimit`. > [card] Go library > > Use [rate](https://pkg.go.dev/golang.org/x/time/rate) with > `go get golang.org/x/time/rate`. A client scheduler can use another algorithm. Keep its output below Xquik's fixed-window limits. Configure one coordinator per Xquik account. ## Reduce X (Twitter) API requests The limit counts requests, not returned tweets or followers. Use each endpoint's largest suitable page size. One 100-tweet page uses one read request. One request per tweet would use 100 read requests. > [accordion] Use cursor pagination > > Request a full page. Store `next_cursor`, then continue the same query. > Never restart from page one after a recoverable `429`. > [accordion] Batch IDs where supported > > Batch tweet or profile IDs through the documented batch endpoints. > One batch request uses fewer read slots than individual lookups. > [accordion] Use webhooks instead of polling > > Let monitors deliver matching tweets through signed webhooks. > Use event reads for backfills, reconciliation, and missed delivery checks. > [accordion] Cache stable profile fields > > Cache names, usernames, profile images, and account settings. > Refresh them on a schedule that matches your product needs. > [accordion] Centralize worker concurrency > > Multiple API keys do not multiply a standard account's limits. > Route every worker through one account-aware queue. > [accordion] Separate read and write queues > > Use different queues for reads, writes, and deletes. > This matches the independent server buckets. ## Monitor API throttling Record enough context to explain each `429`. Never log API key values. | Metric or log field | Why it matters | | - | - | | HTTP method and route | Identifies the exhausted method bucket. | | `error` code | Separates Xquik limits from upstream X throttling. | | `Retry-After` | Confirms the required pause. | | Attempt count | Detects unbounded retry behavior. | | Worker concurrency | Shows whether parallel jobs share excessive load. | | Query and cursor hash | Connects a retry to the same tweet export page. | | Completed tweet count | Confirms progress before throttling. | A rising Xquik `429` rate usually means excessive local concurrency. A rising `x_api_rate_limited` count indicates a different upstream condition. Keep those alerts separate. ## X (Twitter) API rate-limit questions ### What does API rate limit exceeded mean? The client sent more requests than one active window allows. Xquik returns `429 rate_limit_exceeded` for its own exhausted bucket. Wait for `Retry-After`, then retry the same idempotent read. ### How long does an X (Twitter) API rate limit last? Xquik read windows last 1 second. Write and delete windows last 60 seconds. Connection safety windows last 15 minutes. Login cooldowns use dynamic waits. Official X endpoint windows differ from these Xquik limits. ### Why am I rate limited below 500 reads? All standard keys for one Xquik account share the read bucket. Another worker, function, or server may consume the remaining requests. Centralize scheduling and reserve headroom below 500 requests per second. ### Do multiple API keys increase my rate limit? No. Standard API keys resolve to the same Xquik account buckets. Use separate keys for access control, rotation, and auditability. Do not use them to bypass request limits. ### Does retrying early reset the window? No. An early retry does not extend or reset the fixed window. It still returns `429` until the original window expires. ### Does a rate-limited request consume tweet credits? An Xquik tier rejection happens before the endpoint performs its work. It does not collect new tweets, followers, profiles, or replies. Successful pages completed before the rejection keep their normal charges. ### Should I retry a tweet write after 429? First inspect `error`, `statusUrl`, `terminal`, and `safeToRetry`. Poll an active durable action instead of resending it. Use a new idempotency key only when `safeToRetry` is `true`. ### How do I avoid X (Twitter) API rate limits? Use larger pages, cursor checkpoints, batch routes, caches, and signed webhooks. Share one limiter across workers. Keep separate queues for each method bucket. > [card] [Search tweets](/api-reference/x/search-tweets) > > Search tweets with filters, page limits, and cursor recovery. > [card] [Error handling](/guides/error-handling) > > Classify billing, validation, dependency, and write lifecycle errors. > [card] [Pagination](/guides/request-efficient-api-usage#store-cursor-checkpoints) > > Keep tweet, follower, reply, and extraction cursors safely. # Read Twitter Replies on X without an Account Source: https://docs.xquik.com/guides/read-twitter-replies-without-account Read Twitter replies on X without an X account. Paste a public post URL, sort the replies by Relevance, Latest or Likes, then export them to CSV, Excel or JSON. > For the complete documentation index, see [llms.txt](/llms.txt). You can read replies to a public X (Twitter) post without an X account. Paste the post URL into the [X (Twitter) Replies Viewer](https://xquik.com/en/twitter-replies). You sign in to Xquik, not to X. ## Read the replies to a post **1. Copy the post URL** Copy the URL of the public post whose replies you want. **2. Paste it into the replies viewer** Open the [X (Twitter) Replies Viewer](https://xquik.com/en/twitter-replies) and paste the URL. **3. Pick a sort and a count** Pick Relevance, Latest or Likes under Sort. Then pick how many replies you want. **4. Press Extract Replies** Xquik lists the replies with their authors. Export CSV, Excel, JSON or Markdown. ## Sort the replies | Sort | What comes first | | - | - | | Relevance | The replies X ranks highest | | Latest | The newest replies | | Likes | The most liked replies | Each row is 1 reply to the post. It shows the reply text and its author. It adds the reply's likes, reposts and replies. ## Read replies questions ### Do I need an X account to read replies? No. The replies viewer reads public posts without your X account. You need an Xquik account to run it. ### How do I see the replies to a tweet? Paste the post URL and press Extract Replies. Xquik lists the replies with their authors. ### What does each reply include? Each row holds the reply text, its author and engagement counts. ### Can I export tweet replies? Yes. Download them as CSV, Excel, JSON or Markdown. ### Can I read a whole thread the same way? Yes. Read [Twitter thread unroll](/guides/twitter-thread-unroll) to list a whole conversation. > [card] [Twitter thread unroll](/guides/twitter-thread-unroll) > > Read a whole conversation from 1 post URL. > [card] [Reply export](/guides/tweet-replies-export) > > Export replies through the API, with credit estimates. > [card] [Pricing & billing](/guides/billing) > > Credits per result, plans, and top-ups. # X (Twitter) API pagination, batching & tweet exports Source: https://docs.xquik.com/guides/request-efficient-api-usage Paginate X (Twitter) API tweets, timelines, followers, and search. Batch IDs, prevent duplicates, resume cursors, manage retries, and export CSV, JSON, or XLSX. > For the complete documentation index, see [llms.txt](/llms.txt). Use this X (Twitter) API pagination guide for tweets, profiles, followers, and exports. Choose one matching route. Save every returned ID and cursor. Resume that checkpoint instead of repeating completed pages. > [!NOTE] > > In short, batch known IDs. Use profile timelines for one account. > Search tweets for keywords. Use extractions for saved CSV, JSON, or XLSX. ## Choose the smallest X (Twitter) API route The smallest matching route reduces duplicate tweets and unnecessary requests. Do not force every job through Twitter advanced search. | Collection job | Route | Page control | Required account | | - | - | - | - | | Fetch known tweet IDs | `GET /x/tweets` | As many IDs as fit in 1 URL | No connected X account | | Fetch known user IDs | `GET /x/users/batch` | As many IDs as fit in 1 URL | No connected X account | | Get tweets by one user | `GET /x/users/{id}/tweets` | `pageSize` and `cursor` | No connected X account | | Search tweets by keyword | `GET /x/tweets/search` | `limit` and `cursor` | No connected X account | | Export followers or following | `GET /x/users/{id}/followers` or `/following` | `pageSize` and `cursor` | No connected X account | | Read the home feed | `GET /x/timeline` | `cursor` and `seenTweetIds` | Connected X account | | Save a durable file | `POST /extractions` | `resultsLimit`, then `cursor` | Depends on the selected tool | Check each route before reusing a parameter name. X (Twitter) API endpoints do not share one page-size parameter. > [card] Known tweet IDs > > Use `GET /api/v1/x/tweets?ids=...` for many comma-separated tweet IDs in one request. > [card] Known user IDs > > Use `GET /api/v1/x/users/batch?ids=...` for many comma-separated user IDs in one request. > [card] One profile timeline > > Use `GET /api/v1/x/users/{id}/tweets` for one user's profile timeline. Pass a username or numeric X (Twitter) user ID. > [card] Keyword or advanced search > > Use `GET /api/v1/x/tweets/search` for keywords, hashtags, operators, date filters, and advanced search pages. > [card] Authenticated home timeline > > Use `GET /api/v1/x/timeline` for the connected account's home timeline. Pass `cursor` and optional `seenTweetIds`. > [card] Saved file export > > Use `POST /api/v1/extractions/estimate`, `POST /api/v1/extractions`, and `GET /api/v1/extractions/{id}/export` for CSV, JSON, or XLSX. ## Batch known tweet or profile IDs Batch known IDs before starting a cursor loop. One batch accepts as many comma-separated IDs as fit in 1 URL. Duplicate user IDs keep only their first position. ```bash Tweets theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets?ids=1893710452812718080,1893704267862470862" \ -H "x-api-key: xq_YOUR_KEY_HERE" ``` ```bash Users theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/batch?ids=44196397,783214" \ -H "x-api-key: xq_YOUR_KEY_HERE" ``` Keep the submitted ID list beside each response. Match returned tweets or profiles by their stable string IDs. Retry only tweet IDs missing from the completed response. Batch profile responses expose reconciliation fields. Inspect `requested_count`, `processed_count`, and `returned_count`. Retry `failed_ids` now & `unprocessed_ids` after adding credits. Skip `unavailable_ids`, which have no profile on X. Batch lookups are single-page requests. Do not send an empty `next_cursor` into another batch request. ## Match Twitter search, timeline & feed intent These routes can return similar tweet objects. Their collection intent remains different. > [card] Profile timeline > > Use `/x/users/{id}/tweets` for one account's posts. Add `includeReplies` > when replies belong in the result. > [card] Tweet search > > Use `/x/tweets/search` for keywords, hashtags, operators, dates, or > engagement filters. > [card] Home timeline > > Use `/x/timeline` for one connected account's ranked home feed. > It is not a keyword search route. Use profile timelines for complete account-oriented collection. Use tweet search when the query meaning matters most. Use home timelines for feed-style inboxes or routing. Keep `q`, filters, dates, and `queryType` unchanged across pages. ## Use the correct page-size parameter Page-size names vary across Xquik routes. Copy the parameter from that endpoint's API reference. | Route family | Request parameter | Range or behavior | | - | - | - | | Tweet search | `limit` | 1 to 10,000 tweets. Default 20 | | User tweets and replies | `pageSize` | Automatic 1 to 10,000. Standard 1 to 100. Default 20 | | Followers and following | `pageSize` | Automatic 20 to 10,000. Standard 20 to 200. Default 200 | | Home timeline | None | The source controls each page size | | Extraction results | `limit` | 1 to 1,000 stored rows. Default 100 | A requested size is an upper bound. Filters, source availability, or credits can reduce returned rows. Continue while the response says another page exists. Cursors chain pages with no total row limit. A single read can reach 100,000 rows and more. For example, 10 followers pages of 10,000 return 100,000 profiles. Larger pages reduce HTTP calls. Smaller pages reduce memory and checkpoint loss after failures. Choose the largest size your worker can safely store atomically. ## Use extraction jobs for saved files Use extractions for durable Twitter scraper API jobs. They support saved results and repeatable file handoffs. **1. Estimate** Send the planned tool, target, and `resultsLimit`. Review the estimate before creating the job. **2. Create** Call `POST /api/v1/extractions`. Store its job `id`, `status`, and poll path. **3. Poll JSON** Poll `GET /api/v1/extractions/{id}` until completion. Pass `nextCursor` back through `cursor` for more stored rows. **4. Export** Download CSV, JSON, Markdown, Markdown document, PDF, TXT, or XLSX. Check the export page's row and format limits first. Direct routes suit live application pages. Extractions suit durable exports, analysts, and asynchronous workflows. | Need | Prefer direct API | Prefer extraction | | - | - | - | | Show one live page | Yes | No | | Resume a short cursor loop | Yes | Optional | | Download CSV or XLSX | No | Yes | | Save a durable job record | No | Yes | | Stream more rows than a file cap | Yes, or stored result pages | Use stored result pages | Store the export format, job ID, row count, and completion state. Do not call the export route before the job completes. ## Store cursor checkpoints Store the request and response cursor together. Treat each cursor as an opaque string. Never decode, trim, or construct one. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "route": "/api/v1/x/tweets/search", "query": "from:username webhook OR SDK", "query_type": "Latest", "limit": 100, "cursor_sent": null, "has_next_page": true, "next_cursor": "DAACCgACGRElMJcAAA", "unique_tweet_count": 93, "last_saved_tweet_id": "1893710452812718080", "collected_at": "2026-08-02T20:30:00Z" } ``` Most X reads return `next_cursor` and accept `cursor`. Stored extraction pages return `nextCursor` and accept `cursor`. Events and draws also accept `cursor`. Radar accepts `after`. Drafts accept `afterCursor`. The normalized REST contract uses `has_more` and `next_cursor`. Each route still keeps its documented request parameter. Write the rows and checkpoint in one database transaction. Advance only after the row write succeeds. Keep the previous checkpoint until validating its replacement. ## Implement a bounded tweet search loop This TypeScript example keeps query intent across cursor pages. It also stops repeated cursors and duplicate tweet rows. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} type Tweet = { id: string; text?: string; }; type TweetPage = { tweets: Tweet[]; has_next_page: boolean; next_cursor?: string; }; type SearchCheckpoint = { cursor_sent: string | null; next_cursor: string | null; page_number: number; unique_tweet_count: number; }; type SearchCollectionResult = { complete: boolean; next_cursor: string | null; unique_tweet_count: number; }; async function collectTweetSearch( apiKey: string, query: string, savePage: (tweets: Tweet[], checkpoint: SearchCheckpoint) => Promise, ): Promise { const seenTweetIds = new Set(); const seenCursors = new Set(); let cursor = ""; for (let pageNumber = 1; pageNumber <= 50; pageNumber += 1) { const params = new URLSearchParams({ limit: "100", q: query, queryType: "Latest", }); if (cursor !== "") { params.set("cursor", cursor); } const response = await fetch(`https://xquik.com/api/v1/x/tweets/search?${params}`, { headers: { "x-api-key": apiKey }, }); if (!response.ok) { throw new Error(`Tweet search failed with ${response.status}`); } const page = (await response.json()) as TweetPage; const uniqueTweets = page.tweets.filter((tweet) => { if (seenTweetIds.has(tweet.id)) { return false; } seenTweetIds.add(tweet.id); return true; }); const nextCursor = page.next_cursor || null; if ( page.has_next_page && nextCursor !== null && (nextCursor === cursor || seenCursors.has(nextCursor)) ) { throw new Error("Pagination stopped because the cursor repeated"); } await savePage(uniqueTweets, { cursor_sent: cursor || null, next_cursor: nextCursor, page_number: pageNumber, unique_tweet_count: seenTweetIds.size, }); if (!page.has_next_page) { return { complete: true, next_cursor: null, unique_tweet_count: seenTweetIds.size, }; } if (nextCursor === null) { return { complete: false, next_cursor: null, unique_tweet_count: seenTweetIds.size, }; } seenCursors.add(nextCursor); cursor = nextCursor; } return { complete: false, next_cursor: cursor, unique_tweet_count: seenTweetIds.size, }; } ``` Move status-specific recovery outside this collection function. Resume only after correcting the failed condition. ## Guard high-volume X (Twitter) API pagination Bound every high-volume tweet scraper loop. A filter can produce an empty page before later matches. An empty page does not prove pagination finished. **1. Bound the run** Set maximum rows, pages, elapsed time, and expected credits. **2. Deduplicate rows** Store tweets by tweet ID. Store profiles by user ID. **3. Follow advancing cursors** Continue while the response reports more pages. Permit empty pages when the cursor advances, filtered or not. **4. Stop stalled pagination** Stop when the next cursor is missing, unchanged, or previously seen. **5. Store after each page** Save both cursors, unique rows, and the last stable ID. Schedule multiple accounts or searches fairly. Fetch one bounded page slice from each stream. Then resume deeper cursors in later rounds. One large timeline should not block every other target. For agent calls, return counts or bounded field projections. API MCP output is limited to 24,000 characters. Use REST, SDKs, or exports for every complete row. ## Resume recurring tweet collection Do not restart recurring searches from their first page. Save the last accepted tweet timestamp and stable ID. For time-based searches, pass `sinceTime` and `untilTime`. Use a small overlap between runs. Then deduplicate overlapping tweets by tweet ID. For recurring account or keyword checks, consider monitors. Signed webhooks push each selected monitor event. The events API supports replay and reconciliation. Keep separate checkpoints for each route and query. Changing filters creates a different result stream. Never reuse a cursor after changing its query. The [official X pagination guide](https://docs.x.com/x-api/fundamentals/pagination) confirms 2 rules. Pagination tokens are opaque. Short pages can still have successors. Xquik applies both rules through its documented cursor fields. ## Recover without losing the cursor Use the HTTP status before deciding whether to retry. | Status | Meaning for this workflow | Correct next action | | - | - | - | | `400` | A parameter or query is invalid | Fix the request. Do not retry unchanged. | | `401` | Authentication failed | Replace or correct the credential. | | `402` | Credits cannot fund the requested work | Add credits or reduce future work. Resume the saved cursor. | | `404` | The requested user, tweet, or job is unavailable | Record the missing target. Stop that stream. | | `424` | An upstream dependency failed | Retry the same saved cursor with bounded backoff. | | `429` | A request bucket or cooldown was exceeded | Wait for `Retry-After`. Retry the same cursor. | | `502` | The X (Twitter) read dependency failed | Retry the same cursor with capped exponential backoff. | Never advance the checkpoint after a failed response. Never charge a failed page to the unique-row count. Record partial completion when a retry budget expires. ## Control credits, requests & memory Estimate work before starting large exports. Multiply expected unique rows by the route's documented result cost. Track rate limits & credits separately. Requested rows can exceed affordable rows. A paid endpoint can return a smaller page. Zero affordable paid results return `402 insufficient_credits`. Use these controls before every large run. * Maximum unique tweets or profiles. * Maximum cursor pages. * Maximum elapsed time. * Maximum expected credits. * Maximum retry attempts per cursor. * Maximum in-memory rows before flushing. See [X (Twitter) API rate limits](/guides/rate-limits) for request pacing. See [pricing and billing](/guides/billing) for metered result rules. ## Avoid unnecessary media work Pass public media URLs directly when creating tweets. One public MP4 URL can also use the `media` field. Do not upload already public tweet media first. Upload media when a direct message needs a `mediaId`. DM writes accept one item in `media_ids`. Keep tweet media URLs separate from DM media IDs. ## X (Twitter) API pagination questions ### How do I paginate X (Twitter) API tweets? Read `has_next_page` and save `next_cursor`. Send that value as the next request's `cursor`. Stop only when the response reports no next page. ### Can I get every tweet in one API request? No. Collection routes return bounded pages. A response holds up to 10,000 rows. Follow `next_cursor` for 100,000 rows and more, or run an extraction job. ### Why did the API return fewer tweets than requested? Page size is an upper bound. Filters, source availability, and remaining credits can reduce results. Continue whenever `has_next_page` remains true. ### How do I get tweets by one user efficiently? Use `GET /x/users/{id}/tweets` with `pageSize` and `cursor`. Add `includeReplies=true` only when replies belong in scope. Use search when keywords or advanced filters define the job. ### Should I use a cursor or a timestamp? Use cursors within one continuous collection run. Use timestamps to define windows between recurring runs. Apply a small overlap and deduplicate by tweet ID. ### How do I prevent duplicate tweets across pages? Store every tweet ID in a unique index. Track cursors separately from tweet IDs. Reject repeated cursors before requesting another page. ### Should I use direct API pages or a Twitter export? Use direct pages for live application responses. Use extractions for durable CSV, JSON, or XLSX handoffs. Use stored extraction pages when streaming beyond file limits. ## Efficient X (Twitter) API usage checklist * Choose the route matching IDs, users, search, feed, or export intent. * Batch known tweet or user IDs, as many as fit in 1 URL. * Keep exact filters throughout every cursor run. * Store rows and checkpoints atomically. * Count unique IDs instead of raw array lengths. * Continue through short or empty pages when cursors advance. * Stop missing, unchanged, or repeated cursors. * Bound pages, rows, time, credits, retries, and memory. * Use `resultsLimit` for extraction estimates and jobs. * Resume the same cursor after recoverable errors. * Use monitors and webhooks for recurring checks. * Keep tweet media URLs separate from uploaded DM media IDs. > [card] [Tweet search API](/api-reference/x/search-tweets) > > Search tweets by keywords, dates, authors, media, or engagement. > [card] [Extraction workflow](/guides/extraction-workflow) > > Estimate, create, poll, paginate, and export durable jobs. > [card] [Rate limits](/guides/rate-limits) > > Pace requests and recover from `429` responses safely. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) # X (Twitter) API CSV, JSON & XLSX export formats Source: https://docs.xquik.com/guides/response-formats-exports Export tweets, followers, following, replies, profiles, and draw rows through JSON pages or CSV, JSON, XLSX, Markdown, PDF, and TXT files with checkpoints. > For the complete documentation index, see [llms.txt](/llms.txt). Choose the output shape before wiring a worker, dashboard, spreadsheet, or archive. Xquik gives you live JSON pages for endpoint calls. It also gives you saved JSON pages for extraction jobs. It adds file exports for downstream tools and draw exports for giveaway audits. This guide covers Xquik API result files. It does not download tweet images or videos. It also does not export your private X (Twitter) account archive. Read [Read Data Richness](/guides/tweet-profile-api-fields) before choosing columns downstream. It lists every optional tweet, profile, and media field. The export endpoint selects a file format. Filter or select columns downstream. ## Choose the output shape > [card] Live JSON page > > Use endpoints such as `GET /api/v1/x/tweets/search`, > `GET /api/v1/x/users/{id}/tweets`, and > `GET /api/v1/x/users/{id}/followers`. Use them when your app needs fresh API > results and endpoint-specific cursors. > [card] Saved JSON rows > > Use `GET /api/v1/extractions/{id}?limit=1000&cursor={nextCursor}` when a > saved extraction job holds the data. The response includes `job`, > `results`, `hasMore`, and optional `nextCursor`. > [card] File export > > Use `GET /api/v1/extractions/{id}/export?format=csv` when a downstream > tool needs a downloaded file. Supported formats are `csv`, `json`, `xlsx`, > `md`, `md-document`, `pdf`, and `txt`. > [card] Draw export > > Use `GET /api/v1/draws/{id}/export?format=csv&type=winners` when you need > giveaway winners or entry rows. Set `type` to `winners` or `entries`. ## Output decision map > [card] App UI > > Call the live JSON endpoint. Store the endpoint cursor with the filters that > produced the page. > [card] Worker or queue > > Read saved extraction pages and append JSON Lines. Resume with `cursor` when > `hasMore` is true. > [card] CRM or spreadsheet > > Download CSV for simple imports, or XLSX when analysts need a workbook. > [card] Archive or report > > Download JSON for replay and Markdown or TXT for text archives. Download PDF > for a shareable report file. ## Match the format to the handoff Choose a format from the next consumer's exact requirements. Do not convert a file twice when Xquik already returns the required format. Use a live JSON page when code needs fresh data. That means tweets, followers, following rows, replies, profiles, or media fields. Keep the documented endpoint cursor with the same request filters. Use saved extraction JSON pages when a worker needs incremental processing. Append each completed page to JSON Lines through an idempotent sink. Use the extraction ID and requested `cursor` value as the page key. Store the page and its `nextCursor` in one atomic commit. A retry must replace or skip an existing page key. It must not append duplicate tweets, followers, or replies. Use a JSON file when an application needs one structured download. The export contains the documented columns for that extraction tool. Store the extraction ID, tool type, and selected filters beside the file. Use CSV for CRM or spreadsheet imports. CSV exports include one header row. They also neutralize spreadsheet formula prefixes in result cells. Use XLSX when analysts need an Excel workbook. People may need a readable review file instead of an import file. If so, use Markdown, PDF, or TXT. ## Pagination and cursor map Direct X API pages expose endpoint-specific cursor fields such as `has_next_page` and `next_cursor`. Keep the same query filters between requests. Only change the cursor parameter documented on that endpoint. Extraction result pages use `hasMore` and `nextCursor`. Pass `nextCursor` back as `cursor`. Use `limit` up to `1000`. The default is `100`. File exports include every row in 1 download. A PDF above 10,000 rows comes as a ZIP of PDF parts. Use extraction JSON pages or JSON Lines to process larger jobs incrementally. To work through results as you go, page them through `GET /api/v1/extractions/{id}`. Keep `cursor`, `hasMore`, and `nextCursor` in one checkpoint. Never continue from the downloaded file's last visible value. The file endpoint returns every row ordered by result ID. ## Format map > [card] CSV > > Use it for spreadsheet imports and CRM uploads. The response content type is > `text/csv; charset=utf-8`. > [card] JSON file > > Use it for replay, durable archives, and application handoffs. The file is a > JSON array containing the extraction tool's documented columns. The > response content type is `application/json; charset=utf-8`. > [card] XLSX > > Use it for analysts who need a workbook. The response content type is > `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`. > [card] Markdown > > Use it for docs and text review. `md` returns a Markdown table. > `md-document` returns numbered sections with labeled fields. Both return > `text/markdown; charset=utf-8`. > [card] PDF > > Use it for a shareable report snapshot. The response content type is > `application/pdf`, or `application/zip` for PDF parts above 10,000 rows. > [card] TXT > > Use it for plain text archives. The response content type is > `text/plain; charset=utf-8`. ## Download and validate an export Use the server filename from `Content-Disposition`. `curl` can apply that filename without parsing the header yourself. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl --fail --location --remote-header-name --remote-name \ "https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=csv" \ -H "x-api-key: xq_YOUR_KEY_HERE" ``` Validate these properties before handing the file to another system. 1. Require HTTP `200`. 2. Match `Content-Type` to the requested format. 3. Store the `Content-Disposition` filename. 4. Reject an unexpectedly empty file. 5. Parse the selected format before marking the handoff complete. 6. Record the parsed row count and extraction ID. 7. Calculate a local checksum when an audit requires one. Do not assume a filename proves the format. Verify the response header and parser result. Never print CSV, JSON, XLSX, PDF, or TXT bytes to shared logs. ## Handoff checkpoint Store enough context to resume a job and verify filters later. Also store enough to download the right format later. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "source": "xquik.response_formats", "extraction_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "detail_path": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890?limit=1000", "export_paths": { "csv": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=csv", "json": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=json", "xlsx": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=xlsx" }, "pagination": { "limit": 1000, "after": "990200", "hasMore": true, "nextCursor": "991200" }, "download": { "requested_format": "csv", "expected_content_type": "text/csv; charset=utf-8", "server_filename": "extraction-follower_explorer-2026-08-02.csv", "parsed_rows": 5000, "local_sha256": "calculated-after-download" }, "draw_export_path": "/api/v1/draws/f4bd00a2-7b4e-4e59-8e1b-72e2c9f12345/export?format=csv&type=winners", "next_action": "poll_until_completed_then_download" } ``` Your workflow calculates `local_sha256` after download. Xquik does not return that field in the export response. ## Handle export failures * For `400 invalid_format`, use one of the 7 documented format values. * For `401 unauthenticated`, replace the missing or invalid credential. * For `404 not_found`, verify the extraction or draw ID belongs to the account. * For `429 rate_limit_exceeded`, wait for `Retry-After` before downloading again. For draw exports, also validate `type=winners` or `type=entries`. Do not retry an unchanged `400`, `401`, or `404` request. Retry `429` after the documented delay. ## X (Twitter) API export questions ### How do I export X (Twitter) API results to CSV? Run an extraction for tweets, followers, following rows, replies, or profiles. After completion, request its export endpoint with `format=csv`. ### Can I export tweets as JSON? Yes. Use live JSON pages for incremental processing. Use `format=json` for one saved extraction file with every row. ### Should I use CSV or JSON for Twitter results? Use CSV for CRM and spreadsheet imports. Use JSON for applications, replay, and structured result fields. Choose before building the downstream parser. ### When should I use XLSX instead of CSV? Use XLSX when analysts need an Excel workbook. Use CSV when another system expects a simple delimited import. ### Can I export more than 100,000 rows? Yes. File exports include every row. To resume a large job, process saved JSON pages and append JSON Lines. Then continue from `cursor`. ### Why does a large PDF come as a ZIP? Each PDF file holds up to 10,000 rows. A larger export comes as 1 ZIP of PDF parts. You still get every row. Choose CSV, JSON, XLSX, Markdown, or TXT for 1 file. ### What is the difference between `md` and `md-document`? `md` returns a Markdown table. `md-document` returns numbered result sections with labeled fields. Both use the Markdown response content type. ### Does this download X (Twitter) images or videos? No. This guide exports documented result fields. Use returned media URLs when your workflow separately processes tweet images or videos. ### Does this export my private X (Twitter) account archive? No. These endpoints export Xquik extraction or draw results. Use X's account archive process for your private account archive. ## Safety checklist > [!TIP] > > Do not print downloaded export bytes to shared logs. > [!TIP] > > Store the `Content-Disposition` filename if your workflow needs stable file > names. Validate `format` before making the request. Invalid formats return a 400 error. Store the job ID, tool type, filters, and cursor with the downstream task. Also store the chosen export path with it. ## Next steps > [card] [Extraction workflow](/guides/extraction-workflow) > > Build saved extraction jobs, poll results, and export finished rows. > [card] [Export extraction](/api-reference/extractions/export) > > Download saved extraction rows as CSV, JSON, XLSX, Markdown, PDF, or TXT. > [card] [Export draw](/api-reference/draws/export) > > Download giveaway winners or entries. > [card] [Follower export CRM](/guides/follower-export-crm) > > Move follower data into CSV and CRM workflows. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) > [accordion] Related timeline, bookmark & notification APIs > > * Account feeds > * [Home timeline](/api-reference/x/timeline) · [Notifications](/api-reference/x/notifications) · [Mentions](/api-reference/x/user-mentions) > * Saved and private > * [Bookmarks](/api-reference/x/bookmarks) · [Bookmark folders](/api-reference/x/bookmark-folders) · [DM history](/api-reference/x/dm-history) # Search tweets by date with Twitter advanced search Source: https://docs.xquik.com/guides/search-tweets-by-date Search tweets by date with the since and until operators of Twitter advanced search. Copy tested queries, then export a date range through Xquik's API. > For the complete documentation index, see [llms.txt](/llms.txt). To search tweets by date, add `since:` and `until:` to an X (Twitter) search. Both take a day, written YYYY-MM-DD. Xquik reads both as UTC days. `since:` keeps posts sent from 00:00 UTC that day. `until:` excludes its own day. It keeps posts sent before 00:00 UTC that day. On x.com, date search may show a different window, depending on your location. For an exact window, use `since_time:` and `until_time:`. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from:NASA since:2026-09-01 until:2026-10-01 ``` That search returns posts by NASA from September 2026. Xquik keeps the full, tested list of [Twitter advanced search operators](https://github.com/Xquik-dev/x-twitter-advanced-search). ## Search tweets by date on X **1. Open advanced search** Open [x.com/search-advanced](https://x.com/search-advanced), or use the search box on X. **2. Add your words and dates** Type your words, then add `since:` and `until:`. For an exact window, use `since_time:` and `until_time:` instead. **3. Pick Latest or Top** Pick Latest for the newest posts first, or Top for the most popular posts. ## Date operators | Operator | What it does | Example | | - | - | - | | `since:` | Posts sent on or after the UTC day. | `from:NASA since:2026-10-01` | | `until:` | Posts sent before the UTC day. | `from:NASA until:2026-01-01` | | `until:YYYY-MM-DD_HH:MM:SS_UTC` | Posts sent before the exact UTC time. | `from:NASA until:2026-01-01_00:00:00_UTC` | | `since_time:` | Posts sent at or after a Unix time in seconds. | `from:NASA since_time:1767225600` | | `until_time:` | Posts sent before a Unix time in seconds. | `from:NASA until_time:1767225600` | | `within_time:` | Posts from the last period, such as 2d for 2 days. | `nasa within_time:2d` | The operator list ran each of these examples on X on 2026-10-13. ## Dated searches to copy | You want | Search | | - | - | | Posts by an account in 1 month | `from:NASA since:2026-09-01 until:2026-10-01` | | Popular posts on 1 day | `nasa min_faves:1000 since:2026-10-01 until:2026-10-02` | | Replies to an account in 1 week | `to:NASA since:2026-10-01 until:2026-10-08` | | Media posts from the last 2 days | `nasa filter:media within_time:2d` | ## Export tweets from a date range X shows results on screen only. To keep them, run the same query through Xquik. * In the [Tweet Searcher](https://xquik.com/en/twitter-advanced-search), paste the query and choose a result limit. Export CSV, XLSX, JSON or Markdown from there. * Through the REST API, send the query in `q` to [Search tweets](/api-reference/x/search-tweets). The `sinceDate` and `untilDate` parameters also take UTC days. `untilDate` includes its own day. * On Apify, Xquik's [X Tweet Scraper](https://apify.com/xquik/x-tweet-scraper) takes the same query. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G "https://xquik.com/api/v1/x/tweets/search" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ --data-urlencode "q=from:NASA since:2026-09-01 until:2026-10-01" \ --data-urlencode "limit=100" ``` Each returned tweet costs 1 credit, USD 0.00015 with pay-as-you-go credits. Xquik bills only the rows it returns, so an empty search costs nothing. ## Search by date questions ### How do I search tweets by date? Add `since:` and `until:` to a search on X (Twitter). For example, search `from:NASA since:2026-09-01 until:2026-10-01`. ### Does until include its own day? No. In Xquik, `until:` excludes its own day. It keeps posts sent before 00:00 UTC that day. The `untilDate` parameter of Xquik's search API includes its own day. ### Why does x.com show other posts for the same dates? Xquik always reads `since:` and `until:` as UTC days. On x.com, date search sometimes reads them in your location's time zone instead. In that case, x.com also keeps posts from the `until:` day. For the same exact window on both, use `since_time:` and `until_time:` with Unix seconds. ### Can I search old tweets by date? Yes. Set `since:` and `until:` to the days you want. Both take any UTC day. ### How do I export tweets from a date range? Run the query in Xquik's Tweet Searcher or through the search API. The X Tweet Scraper on Apify can also run it. Each returned tweet costs 1 credit. > [card] [Search operators](https://github.com/Xquik-dev/x-twitter-advanced-search) > > Every tested Twitter advanced search operator, with 1 example each. > [card] [Search tweets API](/api-reference/x/search-tweets) > > Query parameters, filters, cursors, and response fields. > [card] [Tweet export](/guides/tweet-scraper-csv-export) > > Export search results to CSV with the API or an SDK. > [card] [Pricing & billing](/guides/billing) > > Credits per result, plans, and top-ups. # How to See Your Twitter Likes on X and Export Them Source: https://docs.xquik.com/guides/see-twitter-likes See your Twitter likes on your X profile, then search or export them. X keeps likes private, so only you can read your own. Export to CSV, Excel, JSON or PDF. > For the complete documentation index, see [llms.txt](/llms.txt). To see your Twitter likes, open your profile on X and tap Likes. X shows your likes only to you, so nobody else can open that tab. ## See your likes on X **1. Open your profile** Sign in to X and open your own profile. **2. Tap Likes** The Likes tab lists the posts you liked. ## Search or export your likes The [X (Twitter) Likes Viewer](https://xquik.com/en/twitter-likes-viewer) lists your liked posts in 1 place. You can search, sort and export them there. **1. Connect your X account** The viewer reads only the X account you connect. **2. Type your username** The viewer lists the posts you liked. **3. Export the list** Save it as CSV, Excel, JSON, Markdown, PDF or plain text. Each row is 1 post you liked. It shows the text, the author, the post date and any media. It adds the likes, reposts, replies and views. ## Twitter likes questions ### Are Twitter likes private? Yes. X shows your likes only to you. Other people can't open your likes tab. ### Can I see someone else's Twitter likes? No. X keeps each account's likes private. The likes viewer reads only the account you connect. ### Can I export my Twitter likes? Yes. Export them to CSV, Excel, JSON, Markdown, PDF or plain text. ### Can I see who liked my own tweet? Yes. X shows the likers of a post to its author. Read [how to see who liked my tweet](/guides/see-who-liked-my-tweet). > [card] [See who liked my tweet](/guides/see-who-liked-my-tweet) > > List the accounts that liked a post you wrote. > [card] [Pricing & billing](/guides/billing) > > Credits per result, plans, and top-ups. # How to See Who Liked My Tweet on X (Twitter) Source: https://docs.xquik.com/guides/see-who-liked-my-tweet See who liked your tweet on X (Twitter). X shows likers only to the author, so connect the account that posted it. Export each liker's profile to CSV or JSON. > For the complete documentation index, see [llms.txt](/llms.txt). Only the author of a post can see who liked it on X. To list the likers, connect your X account. Then paste the post URL into [See Who Liked Your Tweet](https://xquik.com/en/see-who-liked-a-tweet). ## List the accounts that liked your tweet **1. Connect the account that posted it** X shows likers only to the author, so Xquik reads them through your account. **2. Paste the post URL** Open [See Who Liked Your Tweet](https://xquik.com/en/see-who-liked-a-tweet) and paste the URL. **3. Export the list** Save the accounts as CSV, Excel, JSON or Markdown. Each row is 1 account that liked the post. It shows the username, display name and profile photo. It adds the follower count, following count and verified status. ## Who liked my tweet questions ### Can you see who liked a tweet? Only the author can. X hides the likers from everyone else. ### Why can't I see everyone who liked my tweet? X hides some likers, even from the author. The like count can be higher than the list. Xquik returns the likers X shows you. ### Can I see who liked someone else's tweet? No. X shows likers only to the author. For someone else's post, read its [replies](/guides/read-twitter-replies-without-account) or its [reposts](/guides/see-who-retweeted-a-tweet). ### Do I need X API keys? No. Xquik reads the likers for you. Connect your X account and paste the tweet URL. > [card] [See who retweeted a tweet](/guides/see-who-retweeted-a-tweet) > > List the accounts that reposted any public post. > [card] [See your Twitter likes](/guides/see-twitter-likes) > > List and export the posts you liked. > [card] [Pricing & billing](/guides/billing) > > Credits per result, plans, and top-ups. # How to See Who Retweeted a Tweet on X (Twitter) Source: https://docs.xquik.com/guides/see-who-retweeted-a-tweet See who retweeted a tweet on X (Twitter) with no X account. Paste the post URL, list each reposting account with its profile data, then export the list to CSV. > For the complete documentation index, see [llms.txt](/llms.txt). To see who retweeted a tweet, open [See Who Retweeted an X (Twitter) Post](https://xquik.com/en/repost-extractor). Paste the post URL and press Extract Reposters. Xquik lists the accounts that reposted it. ## List the accounts that retweeted a post **1. Copy the post URL** Copy the URL of the public post on X. **2. Paste it and press Extract Reposters** Open [See Who Retweeted an X (Twitter) Post](https://xquik.com/en/repost-extractor) and paste the URL. **3. Export the list** Save the accounts as CSV, Excel, JSON or Markdown. Each row is 1 account that reposted the post. It shows the username, bio and location. It adds the follower count, following count and verified badge. ## Who retweeted questions ### What is a retweet? X now calls a retweet a repost. It shares a post with your followers as it is. It adds no text of its own. ### Do I need an X account to see who retweeted? No. Xquik reads public posts without your X account. You need an Xquik account to run it. ### Does it include quote tweets? No. It lists plain reposts. ### Why does X hide some reposters? X leaves out protected and suspended accounts. Their reposts don't show in public lists. ### Can I see who liked the same tweet? Only if you wrote it. Read [how to see who liked my tweet](/guides/see-who-liked-my-tweet). > [card] [See who liked my tweet](/guides/see-who-liked-my-tweet) > > List the accounts that liked a post you wrote. > [card] [Twitter comment & retweet picker](/guides/twitter-comment-retweet-picker) > > Pick winners from the replies or reposts of a post. > [card] [Pricing & billing](/guides/billing) > > Credits per result, plans, and top-ups. # Strands Agents Twitter MCP guide for Python Source: https://docs.xquik.com/guides/strands-agents Connect Strands Agents to the Xquik X Twitter data API over MCP. Search tweets, read profiles, export followers and monitor accounts from a Python agent. > For the complete documentation index, see [llms.txt](/llms.txt). This guide connects a Strands Agents Python agent to Xquik's X Twitter data API. The agent can search tweets, read profiles, export followers and monitor accounts. Strands is the MCP client, and Xquik hosts the server. ## Strands Agents prerequisites * Python 3.10 or later * An [Xquik API key](/x-api-quickstart) beginning with `xq_` * Xquik credits, because Xquik has no free plan * A model provider that Strands supports * A connected X account for private reads or writes Public reads need no X Developer credentials. Authenticate through Xquik. ## Install Strands Agents and MCP support ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python -m pip install --upgrade "strands-agents>=1.63" "mcp>=2.3" ``` Set your key in the shell. Keep it out of source control. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export XQUIK_API_KEY=xq_YOUR_KEY_HERE ``` ## Connect Strands Agents to Xquik `MCPClient` opens the remote connection. Pass your key in the `Authorization` header. The read timeout gives long `execute` calls time to finish. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import os import httpx2 from mcp.client.streamable_http import streamable_http_client from strands import Agent from strands.tools.mcp import MCPClient XQUIK_API_KEY = os.environ["XQUIK_API_KEY"] xquik = MCPClient( lambda: streamable_http_client( "https://xquik.com/mcp", http_client=httpx2.AsyncClient( headers={"Authorization": f"Bearer {XQUIK_API_KEY}"}, timeout=httpx2.Timeout(30, read=300), ), ) ) with xquik: agent = Agent(tools=xquik.list_tools_sync()) agent("Find the 5 latest posts about AI agents on X and summarize them.") ``` Keep the agent call inside the `with` block. The block closes the connection when it ends. ## Xquik MCP tools in Strands Agents | Tool | What it does | Cost | | - | - | - | | `docs` | Searches the Xquik documentation | Free | | `search` | Runs your agent's JavaScript to find an API operation | Free | | `execute` | Runs your agent's JavaScript to call the API | The called route's price | | `whoami` | Shows the Xquik account the connection uses | Free | Both `search` and `execute` run on Xquik's servers. The agent should call `search` first, then `execute`. Searches and extractions charge only for delivered, unique, filter-matching results. An active monitor costs 30 credits an hour while it runs. ## Keep X (Twitter) actions behind review `execute` can run every operation your key allows. That includes posts, DMs and metered bulk jobs. To limit an agent to discovery, leave `execute` out of its tool list. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} with xquik: tools = [ tool for tool in xquik.list_tools_sync() if tool.tool_name != "execute" ] agent = Agent(tools=tools) ``` ## Related Strands Agents resources * [MCP overview](/mcp/overview) * [Strands Agents documentation](https://strandsagents.com/docs/) * [Xquik MCP repository](https://github.com/Xquik-dev/xquik-mcp) # Supabase X (Twitter) API with pg_cron & webhooks Source: https://docs.xquik.com/guides/supabase Call the X (Twitter) API from Supabase Edge Functions, SQL, and pg_cron. Receive signed webhook events in Postgres, stored once and verified. See examples. > For the complete documentation index, see [llms.txt](/llms.txt). Supabase is a Postgres platform with Edge Functions, Vault, and pg_cron. This guide brings the X (Twitter) API into a Supabase project through Xquik. You read tweets and profiles from SQL and schedule reads with pg_cron. You also run actions from row inserts. Signed X (Twitter) webhook events land in a Postgres table, each one stored once. [`xquik-supabase`](https://github.com/Xquik-dev/xquik-supabase) is a ready Supabase project. Clone it and start it with 1 command. Xquik does not require an X Developer app. > [card] Typed calls in Edge Functions > > The `x-twitter-scraper` SDK gives typed calls to every public operation. > [card] SQL calls > > `xquik.call` and `xquik.rows` reach every public operation from SQL. > [card] Foreign tables > > Each public JSON read is a Postgres table through Supabase Wrappers. > [card] Schedules > > `xquik.schedule` runs any operation on a pg_cron schedule. > [card] Actions from rows > > Insert a row into `xquik_actions` and the action runs. > [card] Signed events > > The `xquik-webhook` Edge Function verifies each event and stores it once. > [card] Key in Vault > > SQL reads the API key from Vault. It never sits in a table. ## Start the project locally Create an [Xquik API key](/x-api-quickstart). Install Docker, then clone the project. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} git clone https://github.com/Xquik-dev/xquik-supabase.git cd xquik-supabase XQUIK_API_KEY=xq_YOUR_KEY_HERE XQUIK_WEBHOOK_SECRET=YOUR_WEBHOOK_SECRET npx supabase start ``` `supabase start` applies the migrations and serves the Edge Functions. The key goes to Vault for SQL and to the Edge Function secrets. The webhook secret goes to the receiver. The CLI also reads both values from a `.env` file in the project root. ## Call the X (Twitter) API with the TypeScript SDK `createXquik` in `_shared/xquik.ts` creates the typed SDK client from `XQUIK_API_KEY`. Import it from any function in `supabase/functions`. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { createXquik } from "../_shared/xquik.ts"; const xquik = createXquik(); Deno.serve(async () => { const profile = await xquik.x.users.retrieve("NASA"); const page = await xquik.x.tweets.search({ q: "from:NASA", limit: 20 }); return Response.json({ profile, tweets: page.tweets }); }); ``` Each SDK method maps to 1 [API reference](/api-reference/overview) operation. Your editor completes parameters and response fields. ## Read Twitter data with SQL `xquik.call` sends 1 operation and returns its JSON response. Pass the operation ID from the API reference and a JSON object of parameters. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select xquik.call('getUser', '{"id": "NASA"}'); ``` `xquik.rows` returns the response list as 1 row per item. Use it for search, timelines, and other list operations. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select tweet->>'id' as id, tweet->>'text' as text from xquik.rows('searchTweets', '{"q": "from:NASA", "limit": 20}') as tweet; ``` Path parameters such as `{id}` fill from the JSON object. The rest go in the query string for `GET` and `DELETE`. Otherwise they go in the JSON body. A failed call raises an error with Xquik's `error` and `message` fields. The `xquik.operations` table lists every operation these functions accept. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select operation_id, method, path from xquik.operations order by path; ``` Only the `service_role` and the database owner can run `xquik` functions. Browser clients with the anon key cannot reach them. ## Query Twitter data as foreign tables Each public read that answers with JSON is also a foreign table. Each table is in the `xquik` schema. The tables use the OpenAPI wrapper of [Supabase Wrappers](https://supabase.com/docs/guides/database/extensions/wrappers/overview). Each table takes its name from the operation ID in snake case. So `getUser` becomes `xquik.get_user`. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select attrs->>'name' as name, attrs->>'followers' as followers from xquik.get_user where id = 'NASA'; select attrs->>'id' as id, attrs->>'text' as text from xquik.search_tweets where q = 'from:NASA' limit 20; ``` * Path and query parameters are columns. An `=` filter sends the value. * Quote mixed-case parameter names, as in `where "pageSize" = 50`. * `attrs` holds each row as JSON. * A SQL `limit` clause stops paging early. A `"limit"` filter only sets the rows per call. A query reads at most 10 pages. * Raise the page cap with `alter server xquik_server options (set max_pages '50')`. * `xquik.export_draw` and `xquik.export_extraction` request `format=json`, so they return JSON rows instead of a file. * An update can rebuild a table. A view on that table then stops the migration with Postgres's dependency error. Drop the view, run the migration and create the view again. Query the tables as `postgres`. The SQL editor, cron jobs, and direct database connections use that role. The event stream and support attachment downloads have no table. Use the `xquik-webhook` receiver or an Edge Function for them. ## Schedule X (Twitter) API reads with pg_cron `xquik.schedule` creates a pg_cron job that sends 1 operation on a cron schedule. Run it again with the same job name to change the job. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select xquik.schedule( 'nasa-timeline', '*/15 * * * *', 'getUserTweets', '{"id": "NASA"}' ); ``` Each run adds a row to `public.xquik_actions`. The `xquik-collect` job copies each finished response into that row every 10 seconds. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select id, status, http_status, response->'tweets' from public.xquik_actions where operation_id = 'getUserTweets' order by id desc limit 5; ``` Remove a schedule with `cron.unschedule`. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select cron.unschedule('nasa-timeline'); ``` ## Run actions from row inserts Insert a row into `public.xquik_actions` to run an operation. A trigger sends it as the row goes in. So the row lands as `sent`. Then `xquik-collect` marks it `succeeded` or `failed`. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} insert into public.xquik_actions (operation_id, params) values ('getUser', '{"id": "NASA"}'); ``` `xquik.enqueue` does the same insert and returns the action ID. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select xquik.enqueue('getTrends', '{"woeid": 1}'); ``` Actions and schedules run `GET`, `POST`, and `DELETE` operations. Run `PUT` and `PATCH` operations with `xquik.call`. An app, a trigger, or a Supabase Database Webhook can add these rows. The table has row level security with no policies. Insert from your server with the service role key. ## Receive signed Twitter webhook events The `xquik-webhook` Edge Function receives Xquik monitor events. It verifies each signature and stores each event once in `public.xquik_events`. Create a monitor for an account. Then point a webhook at the function URL. A monitor bills while it is active, as [Billing](/guides/billing) explains. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select xquik.call( 'createMonitor', '{"username": "NASA", "eventTypes": ["tweet.new", "tweet.reply"]}' ); select xquik.call( 'createWebhook', '{"url": "https://YOUR_PROJECT_REF.supabase.co/functions/v1/xquik-webhook", "eventTypes": ["tweet.new", "tweet.reply"]}' ); ``` The webhook response returns `secret` only once. Store it as an Edge Function secret, then send a test delivery. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npx supabase secrets set XQUIK_WEBHOOK_SECRET=YOUR_WEBHOOK_SECRET ``` ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select xquik.call('testWebhook', '{"id": "YOUR_WEBHOOK_ID"}'); ``` Read stored events in the order they happened. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select event_type, occurred_at, payload->'data'->>'text' as text from public.xquik_events order by occurred_at, stream_event_id; ``` The function answers each delivery with 1 status. | Delivery | Status | Stored | | - | - | - | | Signed event | `200` | Once | | Retry or duplicate of a stored event | `200` | No | | `webhook.test` | `200` | No | | Stale timestamp, bad signature, reused nonce | `401` | No | | Any method other than `POST` | `405` | No | | Signed body that is not an Xquik event | `200` | No | | Database write failed | `503` | No | A `503` makes Xquik retry the delivery later. ## Handle webhook edge cases The function handles each case below. Keep the behavior when you edit it. > [card] No Supabase JWT check > > Xquik sends no Supabase JWT, so the default check answers `401`. The > project sets `verify_jwt = false` for `xquik-webhook`. The HMAC signature > authenticates each delivery instead. > [card] Raw body > > The function verifies the raw request bytes before it parses JSON. > Re-serialized JSON can change bytes and fail the check. > [card] Milliseconds > > `X-Xquik-Timestamp` is Unix time in milliseconds. A value in seconds looks > decades old and fails the 5-minute window. > [card] Fast 2xx > > Xquik waits 10 seconds for a `2xx`. The function stores the event and > answers. Put slow work in `onEvent`, which runs after the response. > [card] Signed retries > > A retry keeps the body, `deliveryId`, and `streamEventId`. It gets a new > timestamp, nonce, and signature, so it passes the nonce check. > [card] Dedupe on streamEventId > > `stream_event_id` is the primary key of `xquik_events`. A retry or a > second webhook adds no second row. > [card] Order by occurredAt > > Deliveries can arrive in any order. Sort by `occurred_at`, then > `stream_event_id`. An index covers that order. > [card] Test alert > > `webhook.test` has no `deliveryId` or `streamEventId`. The function > answers `200` and stores nothing. > [card] Several URLs > > Each webhook has its own secret. Put every secret in > `XQUIK_WEBHOOK_SECRET`, separated by commas. > [card] Secret rotation > > Create a new webhook for the same URL and add its secret. Delete the old > webhook, then remove its secret. > [card] No secrets in logs > > The function never logs the secret, the signature, or the headers. Keep > them out of any logging you add. > [card] Nonce cleanup > > The `xquik-nonce-cleanup` job deletes nonces older than 10 minutes. It > runs every 5 minutes. [Signature verification](/webhooks/verification) explains the signing string and the replay window. ## Deploy to a hosted Supabase project Link the clone to your project and push the migrations. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npx supabase link --project-ref YOUR_PROJECT_REF npx supabase db push npx supabase functions deploy npx supabase secrets set XQUIK_API_KEY=xq_YOUR_KEY_HERE XQUIK_WEBHOOK_SECRET=YOUR_WEBHOOK_SECRET ``` `functions deploy` reads `verify_jwt = false` for `xquik-webhook` from `supabase/config.toml`. Then store the API key in Vault from the SQL editor. ```sql theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} select vault.create_secret('xq_YOUR_KEY_HERE', 'xquik_api_key'); ``` The SQL functions read the key from Vault. The Edge Functions read it from their secrets. ## Common Supabase X (Twitter) API questions ### How do I call the X (Twitter) API from an Edge Function? Call `createXquik()` from `_shared/xquik.ts`. Then call any SDK method, such as `xquik.x.users.retrieve("NASA")`. ### Can I call the X (Twitter) API from Postgres? Yes. Run `xquik.call` for 1 JSON response or `xquik.rows` for 1 row per item. ### Can I query the X (Twitter) API as a Postgres table? Yes. Each public read that answers with JSON is a foreign table. Each table is in the `xquik` schema, such as `xquik.search_tweets`. Filter with `=` on its parameter columns. ### How do I schedule X (Twitter) API reads in Supabase? Run `xquik.schedule` with a job name, a cron schedule, and an operation ID. Results land in `public.xquik_actions`. ### Why does my Supabase webhook function return 401? The Supabase JWT check rejects the delivery before your code runs. Deploy `xquik-webhook` with `verify_jwt = false`. A wrong secret also returns `401`. ### Where do I find the webhook secret? The Create Webhook response returns it once. Store it with `supabase secrets set XQUIK_WEBHOOK_SECRET`. ### Does a retried delivery create a duplicate row? No. The function stores each `streamEventId` once and answers `200` for repeats. ### Is this Supabase X (Twitter) login? No. This guide reads X (Twitter) data and receives X events. Use Supabase Auth for sign-in with X. ## Source and next steps * [xquik-supabase source](https://github.com/Xquik-dev/xquik-supabase) * [TypeScript SDK](/sdks/typescript) * [Webhooks overview](/webhooks/overview) * [Signature verification](/webhooks/verification) * [Tweet Search API](/api-reference/x/search-tweets) * [Rate Limits](/guides/rate-limits) * [Error Handling](/guides/error-handling) # Twitter audience discovery with follower exports Source: https://docs.xquik.com/guides/target-audience-discovery-workflow Find Twitter audience segments with user search, follower exports, following pages, verified followers, batch enrichment, and CSV or JSON handoff steps. > For the complete documentation index, see [llms.txt](/llms.txt). Use this workflow when a job needs a scored audience list. That means a sales, research, community, or marketing job. The job can start with a topic, brand, creator, or competitor account. Key every row by X (Twitter) user ID. Exports, CRMs, agents, and warehouse loads can then deduplicate later. This workflow produces public profile and relationship evidence. It does not create an X Ads custom audience. It also does not return private emails, purchase behavior, age, or gender. ## Define the audience question Start with one decision your audience list must support. Examples include finding relevant creators, qualifying public profiles, or comparing follower communities. Keep the question beside every exported row. Choose a source that matches that decision. * User search finds public profiles matching a name, handle, or topic. * Followers show who follows a selected public account. * Following shows which accounts a selected profile follows. * Verified followers isolate returned profiles with X verification. * Tweet search confirms public conversation around a selected topic. Do not treat every follower as a qualified prospect. A follower relationship proves one public connection. It does not prove role, budget, intent, or permission to contact that person. ## Pick the discovery path > [card] Keyword seeds > > Use `GET /api/v1/x/users/search?q={query}` or `people_search` to find > candidate profiles by name, handle, or topic. > [card] Follower expansion > > Use `follower_explorer` or `GET /api/v1/x/users/{id}/followers` to collect > people who already follow one seed account. > [card] Following expansion > > Use `following_explorer` or `GET /api/v1/x/users/{id}/following` to collect > accounts one seed profile follows. > [card] Verified segment > > Use `verified_follower_explorer` or > `GET /api/v1/x/users/{id}/verified-followers` when you score verified accounts > separately. ## Seed accounts Start with a query when you do not already have exact handles. Store the search query, rank, user ID, username, follower count, verification state, and cursor. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/search?q=ai%20founder" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` If the seed list comes from another system, enrich it before expanding the list. Each enrich request takes as many numeric user IDs as fit in 1 URL. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/batch?ids=44196397,987654321" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Prefer numeric X user IDs as stable keys. Usernames and display names can change. Store the latest username as an attribute, not the CRM primary key. Keep `seed_query`, `seed_user_id`, `seed_username`, and `seed_rank` together. That evidence explains why each follower or following row entered the audience. ## Expand the audience Use extraction jobs when the output needs estimate, retry, audit, and file download handoff. Use direct JSON pages when the app needs the freshest page now. > [card] Saved followers > > `POST /api/v1/extractions/estimate`, then `POST /api/v1/extractions` with > `toolType: "follower_explorer"`. > [card] Saved following > > Use `toolType: "following_explorer"` with `targetUsername` and optional > `resultsLimit`. > [card] Saved people search > > Use `toolType: "people_search"` with `searchQuery` for reusable profile > search exports. > [card] Saved verified followers > > Use `toolType: "verified_follower_explorer"` for a reusable verified > follower export. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "toolType": "follower_explorer", "targetUsername": "username", "resultsLimit": 5000 }' | jq ``` Export the completed job for a CRM, sheet, or warehouse. Do it when the audience list is ready. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/extractions/77777/export?format=csv" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -o target-audience.csv ``` ## Direct JSON pages Use direct pages when the app owns the loop and checkpoint state. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/username/followers?pageSize=200" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/username/following?pageSize=200" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/users/44196397/verified-followers" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Store `has_next_page` and `next_cursor` with the seed account and route. Pass `next_cursor` back as `cursor` only when `has_next_page` is true. Save a checkpoint after every completed page. Include the route, seed user ID, input cursor, and next cursor. Also include the page size and collection time. Retry from the last saved next cursor after a worker restart. Stop when `has_next_page` is false or `next_cursor` is empty. Also stop when a cursor repeats. Never share one cursor between followers and following routes. ## Combine audience sources Union sources when broad discovery matters. Intersect sources when stronger relationship evidence matters. Always join on numeric X (Twitter) user ID. These source combinations are useful. * Followers of several relevant creators reveal shared audience members. * Following lists reveal accounts your seed profiles chose. * User search plus followers validates a topic match and relationship. * Verified followers plus tweet search validates verification and activity. * Batch user enrichment refreshes profile fields before CRM upserts. Store one evidence row per source relationship. Build one normalized candidate row after collection. This keeps multiple reasons for the same candidate. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "candidate_user_id": "987654321", "source_count": 3, "sources": ["followers:44196397", "followers:123456789", "search:ai founder"], "matched_queries": ["ai founder"], "matching_tweet_ids": ["1893704267862470862"] } ``` ## Score rows Create one normalized row per candidate before enrichment or outreach. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "audience_id": "ai-founder-q2", "seed_source": "GET /api/v1/x/users/search", "seed_query": "ai founder", "seed_user_id": "44196397", "candidate_user_id": "987654321", "candidate_username": "username", "display_name": "Xquik", "follower_count": 2400, "following_count": 430, "verified": true, "verified_type": "Business", "profile_image_url": "https://pbs.twimg.com/profile_images/xquik.jpg", "bio": "X automation platform", "location": "San Francisco", "source_route": "GET /api/v1/x/users/{id}/followers", "page_cursor": null, "matched_at": "2026-05-24T19:51:00.000Z" } ``` Score with fields Xquik already returns. Use follower count, following count, verification state, verification type, bio, and location. Also use profile image, account creation date, media count, website URL, and protected-account state. Use written, task-specific qualification rules. Store every rule result beside the final decision. Avoid one unexplained audience score. > [card] Relationship evidence > > Count distinct seed accounts, source routes, and matched search queries. > [card] Profile evidence > > Evaluate returned bio, location, verification, and public profile counts. > [card] Conversation evidence > > Keep matching tweet IDs, creation times, replies, reposts, and likes. > [card] Qualification decision > > Store `qualified`, `qualification_reasons`, and the ruleset version. Do not invent missing profile attributes. A blank location is unknown, not a failed location match. A missing verification type is not a personal account classification. A large follower count does not prove topical relevance. ## Validate active conversation Use tweet search when a candidate segment must be active around a topic. That activity must come before it enters a campaign, CRM list, or agent queue. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/search?q=ai%20founder%20min_faves%3A10&verifiedOnly=true" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Store tweet IDs separately from audience rows. Do not overwrite the candidate profile row with the latest matching tweet. Use returned tweet fields for public conversation evidence. Store tweet text, author ID, and creation time when returned. Also store reply count, repost count, like count, and quote count when returned. Keep the search query and cursor beside each page. Separate profile qualification from tweet qualification. A profile can match your audience even when no recent tweet matches. A matching tweet can also come from a profile that fails your audience rules. ## Build a Twitter lead generation handoff Treat the exported file as a public-profile research list. Apply your consent, privacy, and outreach rules before contacting anyone. Xquik does not supply private email addresses or private messages through this workflow. Use numeric X (Twitter) user ID for CRM upserts. Keep these concrete columns. * `x_user_id` * `x_username` * `display_name` * `bio` * `location` * `follower_count` * `following_count` * `verified` * `verified_type` * `source_count` * `source_seed_ids` * `matched_queries` * `matching_tweet_ids` * `qualified` * `qualification_reasons` * `collected_at` * `ruleset_version` Keep public profile facts separate from your internal sales fields. Do not overwrite `bio`, `location`, or follower counts with CRM notes. Refresh public fields by X (Twitter) user ID and keep prior collection timestamps. ## Measure Twitter audience insights Calculate insights only from collected public profiles and tweets. Report the sample size, collection time, seed accounts, query, and missing-field counts. These measurements are useful. * Shared followers across selected seed accounts * Followers versus following source counts * Verified and unverified profile counts * Returned profile locations without inferred geography * Bio terms found in returned descriptions * Recent matching authors and tweet counts * Reply, repost, like, and quote totals for matching tweets These measurements describe the collected sample. They do not represent every X user or private demographic attribute. Keep that limitation in dashboards, AI summaries, and client reports. ## Handle audience collection failures * For `400`, correct the query, user ID, username, or page parameter. * For `401`, replace the missing or invalid credential. * For `402`, top up credits before resuming the saved cursor. * For `404`, verify the seed account or requested profile still resolves. * For `424`, retry the temporary read-service dependency failure. * For `429`, wait for `Retry-After` before requesting another page. * For `502`, retry the temporary read-service failure later. Retry `424`, `429`, and `502` with capped backoff. Do not restart from page one. Resume from the last committed cursor. Never retry `400`, `401`, `402`, or `404` without changing the request or account state. ## Twitter audience discovery questions ### How do I find my target audience on Twitter? Start with topic searches or relevant seed accounts. Expand their followers or following lists. Then qualify profiles with returned fields and matching tweets. ### How do I analyze a competitor's Twitter followers? Export that public account's followers. Keep the competitor's numeric X (Twitter) user ID as the seed. Deduplicate candidates by their own numeric X user IDs. ### Can I export Twitter followers to CSV? Yes. Run a `follower_explorer` extraction, wait for completion, then export CSV. Use direct JSON pages when your application owns pagination and checkpoints. ### What is the difference between followers and following? Followers chose to follow the seed account. Following lists accounts the seed profile chose. Keep these relationship directions separate in every row. ### Can Xquik return Twitter audience demographics? No. This workflow returns documented public profile and tweet fields. Do not infer private age, gender, email, purchase behavior, or other demographics. ### How do I build a Twitter lead list? Collect public profiles, keep source evidence, and apply explicit qualification rules. Export only the fields your CRM needs. Apply consent and outreach requirements outside this collection workflow. ### How do I prevent duplicate audience profiles? Use numeric X (Twitter) user ID as the unique key. Store usernames as mutable profile fields. Keep every source relationship in separate evidence rows. ### How do I keep audience exports current? Refresh profile fields by numeric X (Twitter) user ID. Keep `collected_at` on every snapshot. Never overwrite historical evidence without retaining its timestamp. ## Cost and retry notes > [!TIP] > > Estimate extraction jobs before running large follower, following, verified > follower, or people search exports. > [!TIP] > > Xquik meters direct JSON pages by returned user or tweet rows. Low credit > balances can return smaller pages or `402 insufficient_credits`. Treat cursors as opaque route checkpoints. They are not stable profile IDs. ## Next steps > [card] [Search users](/api-reference/x/search-users) > > Find seed profiles by topic, name, or handle. > [card] [Export followers](/guides/follower-export-crm) > > Build CSV, JSON, or XLSX follower files for CRM and warehouse handoff. > [card] [Get following](/api-reference/x/following) > > Page accounts followed by one seed profile. > [card] [Batch users](/api-reference/x/batch-users) > > Enrich as many numeric user IDs as fit in 1 URL. > [accordion] Related follower, list & community APIs > > * Profiles > * [Search users](/api-reference/x/search-users) > * [Search autocomplete](/api-reference/x/search-autocomplete) > * [Get user](/api-reference/x/twitter-profile-lookup) > * [Batch users](/api-reference/x/batch-users) > * Followers > * [Followers](/api-reference/x/followers) > * [Following](/api-reference/x/following) > * [Follower IDs](/api-reference/x/follower-ids) > * [Following IDs](/api-reference/x/following-ids) > * [Creator subscriptions](/api-reference/x/user-subscriptions) > * [Affiliates](/api-reference/x/user-affiliates) > * [Similar accounts](/api-reference/x/user-similar) > * [Translate bio](/api-reference/x/user-bio-translation) > * [User insights](/api-reference/x/user-engagement-insights) > * [Verified followers](/api-reference/x/verified-followers) > * [Followers you know](/api-reference/x/followers-you-know) > * [Check follower](/api-reference/x/check-follower) > * Lists > * [Search lists](/api-reference/x/search-lists) > * [User lists](/api-reference/x/user-lists) > * [List memberships](/api-reference/x/user-list-memberships) > * [List details](/api-reference/x/list-details) > * [List members](/api-reference/x/list-members) > * [List followers](/api-reference/x/list-followers) > * Communities > * [Find](/api-reference/x/community-find) > * [Popular](/api-reference/x/community-popular) > * [Topics](/api-reference/x/community-topics) > * [Suggested](/api-reference/x/community-suggested) > * [Details](/api-reference/x/community-info) > * [Members](/api-reference/x/community-members) > * [Member search](/api-reference/x/community-member-search) > * [Moderators](/api-reference/x/community-moderators) > * [Timeline](/api-reference/x/community-tweets) > * [Media](/api-reference/x/community-media) > * [Keyword search](/api-reference/x/community-search) > * [Tweets search](/api-reference/x/community-tweets-search) # Twitter trends API guide by region & WOEID Source: https://docs.xquik.com/guides/trends Find ranked X (Twitter) trends by WOEID region and keep each query and rank. Then search matching tweets with cursor pagination. Includes exact API steps. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik returns ranked X (Twitter) trends for 12 supported WOEID regions. Use each trend's `query` with [Search Tweets](/api-reference/x/search-tweets) to collect matching posts. Use this Twitter trends guide for regional topic discovery and monitoring. Each call returns one current snapshot. Add `at` for a past one, or read a range with [Get trends history](/api-reference/x/trends-history). ## Choose the trends endpoint Use `GET /api/v1/trends` for the top-level Twitter Trends API response. It returns `trends`, `total`, and `woeid`. Use `GET /api/v1/x/trends` for the equivalent X API route. It returns `trends`, `count`, and `woeid`. Keep one response shape throughout each client. This prevents `total` and `count` from becoming competing fields in stored snapshots. ## Regions Use these WOEIDs in `woeid` for `GET /trends` or `GET /x/trends`. Omit `woeid` or pass `1` for worldwide trends. > [card] Global & Americas > > * `1` - Worldwide > * `23424977` - United States > * `23424775` - Canada > * `23424900` - Mexico > * `23424768` - Brazil > [card] Europe > > * `23424975` - United Kingdom > * `23424969` - Turkey > * `23424950` - Spain > * `23424829` - Germany > * `23424819` - France > [card] Asia > > * `23424856` - Japan > * `23424848` - India `GET /x/trends` also takes the WOEID of any other place X offers trends for. [List trend locations](/api-reference/x/trend-locations) returns every place with its WOEID. You can name the place instead. Send `country=TR`, or `location=Istanbul` for a town. The response returns the place it read as `location`. ## Read a regional trends snapshot When you call `GET /api/v1/trends`, Xquik fetches the latest trending topics for the requested WOEID. Xquik caches results briefly. Each trend includes a `name`, optional `description`, optional `rank`, and optional `query` string. Rich responses can also include `promotedContent`, `tweetVolume`, and `url`. Use `name` as the visible topic or hashtag. Use `rank` for regional ordering. Use `query` for a follow-up tweet search. Fall back to `name` when `query` is missing. Treat `tweetVolume` as an optional estimate. Keep `null` and missing values. Never replace them with 0. A missing estimate does not mean nobody posted about the topic. **Response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "woeid": 23424977, "total": 30, "trends": [ { "name": "#AI", "description": "Artificial Intelligence discussions", "rank": 1, "query": "#AI" } ] } ``` The `count` query parameter controls how many trends to return. The default is `30`. Valid values are `1` through `50`. ## Compare Twitter topic trends over time Xquik keeps a Twitter trends archive. It stores 1 list per place every 5 minutes, from 2026-10-13 02:20 UTC on. It keeps each list for 25 months. Send `at` to `GET /x/trends` to read what was trending on Twitter yesterday. Or send it to read the list from any stored time. [Get trends history](/api-reference/x/trends-history) returns a range, 1 stored list per step. Each list has its own `capturedAt`. `at`, `from`, and `to` also take a span back from now. Examples are `24h` or `7d`. A daily schedule can send `at=24h` and read yesterday on every run. To keep your own copy, save each regional response on your schedule. Store these fields for every snapshot. * `captured_at` is your UTC collection timestamp. * `woeid` is the requested region. * `name` is the visible topic or hashtag. * `query` is the recommended tweet-search expression. * `rank` is the current regional position. * `description` is the optional topic context. * `tweetVolume` is the optional public-post estimate. * `promotedContent` is the optional promotion identifier. Compare normalized `name` values within the same WOEID. Track `first_seen`, `last_seen`, `current_rank`, `previous_rank`, and `best_rank`. Keep every snapshot immutable. Derived movement can change when late jobs arrive. An absent topic only left the requested result slice. It may still appear below your selected `count`. Increase `count` before treating absence as a meaningful change. ## Build a multi-region Twitter trends monitor Choose only the regions that match your market. Poll each WOEID independently. Store the WOEID beside every trend row. Never compare ranks across regions as if they share one list. Use `woeid=1` for a worldwide snapshot. Use country WOEIDs for regional comparisons. Xquik supports the 12 WOEIDs listed above. Unsupported country or city identifiers return `400 invalid_input`. A practical monitor follows this sequence. 1. Request the same `count` for each chosen WOEID. 2. Save the raw regional snapshot before enrichment. 3. Compare each topic with its previous regional rank. 4. Filter topics against your campaign or research scope. 5. Search tweets only for relevant topic queries. 6. Store matching tweets with the originating WOEID and rank. 7. Alert only after your movement or relevance rule passes. This sequence keeps unrelated trends out of tweet searches. It also records why every topic entered a dashboard, alert, or AI summary. ## Search tweets behind a trend Fetch the top trend for a region, then search for tweets about it. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # 1. Get top trend TREND=$(curl -s "https://xquik.com/api/v1/trends?woeid=23424977&count=1" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ | jq -r '.trends[0].query') # 2. Search tweets about it curl -G "https://xquik.com/api/v1/x/tweets/search" \ --data-urlencode "q=$TREND" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const API_KEY = "xq_YOUR_KEY_HERE"; const headers = { "x-api-key": API_KEY }; // 1. Get top trend const trendsRes = await fetch("https://xquik.com/api/v1/trends?woeid=23424977&count=1", { headers, }); const trendsData = await trendsRes.json(); const query = trendsData.trends[0].query; // 2. Search tweets about it const searchRes = await fetch( `https://xquik.com/api/v1/x/tweets/search?q=${encodeURIComponent(query)}`, { headers }, ); const searchData = await searchRes.json(); console.log(searchData); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests API_KEY = "xq_YOUR_KEY_HERE" headers = {"x-api-key": API_KEY} # 1. Get top trend trends_res = requests.get( "https://xquik.com/api/v1/trends", params={"woeid": 23424977, "count": 1}, headers=headers, ) query = trends_res.json()["trends"][0]["query"] # 2. Search tweets about it search_res = requests.get( "https://xquik.com/api/v1/x/tweets/search", params={"q": query}, headers=headers, ) print(search_res.json()) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "encoding/json" "fmt" "io" "log" "net/http" "net/url" ) const apiKey = "xq_YOUR_KEY_HERE" func main() { // 1. Get top trend req, err := http.NewRequest("GET", "https://xquik.com/api/v1/trends?woeid=23424977&count=1", nil) if err != nil { log.Fatal(err) } req.Header.Set("x-api-key", apiKey) resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } var trends struct { Trends []struct { Query string `json:"query"` } `json:"trends"` } json.Unmarshal(body, &trends) // 2. Search tweets about it searchURL := "https://xquik.com/api/v1/x/tweets/search?q=" + url.QueryEscape(trends.Trends[0].Query) req2, err := http.NewRequest("GET", searchURL, nil) if err != nil { log.Fatal(err) } req2.Header.Set("x-api-key", apiKey) resp2, err := http.DefaultClient.Do(req2) if err != nil { log.Fatal(err) } defer resp2.Body.Close() body2, err := io.ReadAll(resp2.Body) if err != nil { log.Fatal(err) } fmt.Println(string(body2)) } ``` The trend response supplies a raw search expression such as `#AI`. `--data-urlencode` and `URLSearchParams` encode that expression once. Do not manually encode it before using these examples. Search results provide the tweets behind a selected topic. Keep each tweet's ID, author, text, metrics, and creation time. Store the originating trend name, WOEID, rank, and collection timestamp beside those tweets. Use cursor pagination when you need more than one search page. Stop when the response has no next cursor. Also stop when a cursor repeats. ## Handle trend request failures Handle each documented status before scheduling another regional request. * For `400`, use one of the 12 supported WOEIDs. * For `401`, replace the missing or invalid credential. * For `402`, top up credits or use an eligible paid read. * For `424`, retry the temporary read-service dependency failure. * For `429`, wait for `Retry-After` before retrying. * For `502`, retry the temporary read-service failure later. Use capped exponential backoff for `424`, `429`, and `502` responses. Do not retry `400`, `401`, or `402` without changing the request or account state. ## Twitter trends API questions ### What is a WOEID in the Twitter trends API? WOEID means Where On Earth ID. It selects one supported geographic trend list. Use `1` for Worldwide. Use a listed country code for regional trends. ### How do I get Twitter trends by country? Call either trends endpoint with that country's supported WOEID. Save the returned WOEID with every rank. This prevents regional rows from mixing. ### Can I get historical Twitter trends? Yes, from 2026-10-13 02:20 UTC on. Send `at` to `GET /x/trends` for 1 past moment, or call `GET /x/trends/history` for a range. Each list states the time Xquik read it. Earlier trends are not available. ### How do I find tweets behind a trending topic? Pass the trend's `query` to [Search Tweets](/api-reference/x/search-tweets). Use `name` only when `query` is missing. Paginate the matching tweet results. ### Does every trend include a public-post estimate? No. `tweetVolume` can be missing or `null`. Keep that state in storage. Use rank movement as a separate regional signal. ### Can I request city-level Twitter trends? No. Xquik accepts Worldwide and 11 listed country WOEIDs. An unsupported city WOEID returns `400 invalid_input`. ### How many trending topics can I request? Request `1` through `50` topics. The default is `30`. ### Which endpoint should a new client use? Choose the response shape your client already uses. `/trends` returns `total`. `/x/trends` returns `count`. Both return ranked trends for one WOEID. ### Is Xquik the official X (Twitter) trends API? No. Xquik is an independent third-party service. It is not affiliated with X Corp. This guide documents Xquik endpoints and response fields. ## Next steps > [card] [Trends API reference](/api-reference/trends/list) > > Full endpoint reference with query parameters and response schema. > [card] [Billing & usage](/guides/billing) > > Subscription pricing, credits, and per-operation costs. # X API troubleshooting for tweets, exports & webhooks Source: https://docs.xquik.com/guides/troubleshooting Fix API key, credit, rate-limit, cursor, tweet lookup, follower export, write-action, extraction, monitor, and webhook delivery errors. Follow exact steps. > For the complete documentation index, see [llms.txt](/llms.txt). This page lists common issues, error codes, and fixes. If it does not cover your problem, contact [support@xquik.com](mailto:support@xquik.com). ## Error codes ### 401 Unauthenticated The API key or OAuth token is missing, invalid, expired, or revoked. Check the following items. * **API key header.** Send `x-api-key: xq_...` or `Authorization: Bearer xq_...`. * **OAuth header.** Send `Authorization: Bearer `. OAuth clients normally manage this automatically. * **Key format.** Must start with `xq_`. If it doesn't, you're using the wrong value. * **Key revoked.** Revoked keys return 401 immediately. Generate a new key from the dashboard. * **OAuth token expired.** Let the MCP client refresh the token. Reconnect Xquik if refresh fails. * **API key management auth.** Listing, creating, pausing, and revoking keys require a same-origin dashboard session. API keys and OAuth bearer tokens cannot manage keys. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # Correct curl https://xquik.com/api/v1/account \ -H "x-api-key: xq_your_api_key_here" # Wrong - missing header curl https://xquik.com/api/v1/account ``` ### 403 paused API key `api_key_paused` means this key is paused. Resume it on the [API keys page](https://dashboard.xquik.com/en/api-keys), and the next request goes through. Pausing never deletes the key or its settings. ### 403 insufficient scope `insufficient_scope` means the key lacks a scope this route needs. `requiredScope` names it. Add it on the [API keys page](https://dashboard.xquik.com/en/api-keys), then retry. ### 403 IP not allowed `ip_not_allowed` means the key has an IP allowlist without the calling IP. The message names that IP. Add it on the [API keys page](https://dashboard.xquik.com/en/api-keys), or call from a listed IP. An empty list allows any IP. ### 401 authentication or 402 payment required Anonymous non-MPP paid reads return `401` with a Bearer challenge and guest wallet action. Direct MPP reads return `402` with a Payment challenge and the same action. Account or guest credit failures also return `402`. The failed request creates no checkout. Try these fixes. * For account keys, check `GET /api/v1/account` and use only the advertised account payment action * For guest keys, check [guest wallet status](/api-reference/guest-wallets/status). Then use only the advertised guest top-up action * For the direct MPP operations, complete the MPP challenge. You can also ask the user to confirm a guest wallet amount * For the other guest-eligible reads, authenticate. You can also ask the user to confirm a guest wallet amount * Use [Estimate Extraction](/api-reference/extractions/twitter-scraping-cost-estimator) to see the credit cost before running extractions Ask the user to choose an option and amount before creating checkout. Never trigger checkout, top-up, or subscription automatically after `401` or `402`. ### Monitor credits Monitor slots are unlimited. Active monitors cost 30 credits per hour. They require available credits while enabled. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "insufficient_credits", "message": "Insufficient credits" } ``` Try these fixes. * Pause an unused account monitor with `PATCH /api/v1/monitors/{id}` and `{ "isActive": false }` * Pause an unused keyword monitor with `PATCH /api/v1/monitors/keywords/{id}` and `{ "isActive": false }` * Delete an unused monitor. Poll the returned `statusUrl` until it returns `404`. * Check current monitor billing with `GET /api/v1/account`, which shows `monitorsUsed` and `monitorBilling` ### 403 API key budget reached The call doesn't fit what's left of the key's monthly credit budget. It never ran and cost nothing. A read with a `limit` needs that many results' price left. A write needs its price plus 20 credits left. Other keys on the account keep working. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "api_key_budget_reached", "message": "This API key reached its monthly credit budget. Raise or remove it at dashboard.xquik.com/api-keys, or wait for the next UTC month." } ``` Try these fixes. * Raise or remove `monthlyBudgetCredits` with [Update API key](/api-reference/api-keys/update). The next call works. * Wait for the next UTC month, when the key's spend starts again at 0. * Compare `monthlySpentCredits` across keys with [List API keys](/api-reference/api-keys/list) to find unexpected usage. ### 429 Too many requests You've exceeded the API rate limit. The API uses fixed windows per tier. > [card] Read > > `GET`, `HEAD`, and `OPTIONS` share 500 requests per 1 second. > [card] Change > > Other methods on Xquik resources share 6,000 requests per 60 seconds. > [card] X action > > Actions through a connected X (Twitter) account share 120 requests per 60 seconds. Try these fixes. * Respect `Retry-After`. Otherwise start at 1 second, add jitter, and stop after 3 retries. * Requests sent before the fixed window resets keep returning `429` until `Retry-After` elapses. * Check the `Retry-After` header for the server-recommended wait time. * Use webhooks instead of polling. They push detected events without repeated event-list calls. * Batch your logic. Fetch events once per minute instead of once per second. See the [Rate Limits](/guides/rate-limits) guide for backoff code examples. ### 502/503 Read service busy or unavailable The read service is temporarily unavailable or busy. This is usually transient. Try these fixes. * Respect `Retry-After` when present, then retry the request * If no `Retry-After` header is present, retry after 5 to 10 seconds * Use exponential backoff (see [Error Handling](/guides/error-handling)) * After 5 minutes of errors, the read service may have an outage The same applies to draws. So do tweet, profile, follower, reply, timeline, community and list endpoints under `/api/v1/x/*`. ## Common questions ### Webhooks not arriving? Webhook delivery can fail without a visible error. Check each item. 1. **Webhook is active.** Verify `isActive: true` and `deliveryStatus: "active"` via `GET /api/v1/webhooks`. Paused webhooks do not receive deliveries. 2. **HTTPS required.** Xquik rejects HTTP endpoints. Your URL must start with `https://`. 3. **Response time.** Respond with `2xx` within 10 seconds, even for events you skip. Slower responses and rejections count as failures. A failure can delay new deliveries by up to 15 minutes. 4. **Check deliveries.** Call `GET /api/v1/webhooks/{id}/deliveries` to see delivery status, attempt count, and error messages. 5. **Correlate source events.** Call `GET /api/v1/events/{id}` with the stored `streamEventId`. 6. **Local testing.** If using ngrok or a tunnel, verify it's running and the URL is current. Ngrok URLs change on restart (free plan). 7. **Needs attention.** `needs_attention` means 200 failed checks in a row. Xquik keeps retrying. Fix the receiver, then call `POST /api/v1/webhooks/{id}/resume`. It starts sending waiting deliveries at once. 8. **Event type mismatch.** Your webhook must subscribe to the event types your monitors produce. A webhook listening for `tweet.new` won't receive `tweet.reply` events. > **Tip.** See the [Webhook Testing](/guides/twitter-webhook-testing) guide for a step-by-step local setup with ngrok. ### Monitor not tracking events? If your monitor is active but no events appear, check these items. * **Check `isActive`.** Confirm via `GET /api/v1/monitors/{id}` that `isActive` is `true`. Paused monitors don't track. * **Event propagation delay.** Events take seconds to minutes to appear depending on X API latency. This is normal. * **Event types.** Verify your monitor's `eventTypes` array includes the type you expect. A monitor tracking only `["tweet.new"]` won't capture replies or retweets. * **Account activity.** The monitored X account must post content matching your event types. No posts means no events. * **Pagination.** If listing events, check `hasMore` in the response. Older events may be on subsequent pages. ### How do I replay stored monitor events? Call `GET /api/v1/events?monitorId={id}&limit=50` for account monitors, or `GET /api/v1/events?keywordMonitorId={id}&limit=50` for keyword monitors. Then process each event once. If `hasMore` is `true`, store `nextCursor` and pass it as `cursor` next time. Add `eventType` when you need to separate tweets, replies, quotes, or profile changes. ### Write action still pending? Inspect the durable action returned by the write. * Store `id`, `request.hash`, `account`, `target`, `billing`, and `statusUrl` * Poll `statusUrl` while `terminal` is `false` * Respect `Retry-After`, `pollAfterMs`, and `nextAction` * Retry only when `safeToRetry` is `true`, using a new `Idempotency-Key` * Verify the result before retrying when `nextAction.type` is `verify_result` ### How do I check my usage? Call `GET /api/v1/account`. The `creditInfo` object shows your balance. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "creditInfo": { "balance": "42500", "lifetimePurchased": "140000", "lifetimeUsed": "97500", "autoTopupEnabled": false } } ``` * `creditInfo.balance` shows the remaining credits available for metered calls * At a `balance` of `0`, Xquik rejects metered calls. A credit top-up or an auto top-up ends that * Auto top-up stops after 3 declined charges in a row. Update your card in the dashboard to restart it. * With exchange rates over 3 ECB working days old, non-USD auto top-ups skip. Nothing is charged. The dashboard billing page also charts usage. See [Billing & Usage](/guides/billing) for credit costs and billing. ### Can I use the API without a subscription? Yes. Full account metered operations work while enough available credits remain. Choose the access boundary. * **Guest wallet.** Prepay the eligible paid-read routes through a confirmed USD 10 to 250 hosted checkout. * **MPP.** Pay per request on fixed-price GET operations without an account or API key. * **Full account.** Use available account credits for writes, monitors, extractions, draws, and connected-account reads. Webhooks and account management are free. Subscribe for monthly credits or top up from the [dashboard billing page](https://dashboard.xquik.com/en/account?tab=subscription). Remaining credits stay usable after a plan ends. ### How do I connect an AI agent? Xquik has 2 MCP servers. Choose based on what the agent needs to do. > [card] Search docs > > Connect `https://docs.xquik.com/mcp`. It is read-only and requires no auth. > [card] Run API actions > > Connect `https://xquik.com/mcp`. Full credentials expose every JSON or text route. Guest `paid_reads` keys expose the eligible paid-read routes. Follow these setup steps. 1. For docs search, add `https://docs.xquik.com/mcp`. 2. For account actions, use a full API key or OAuth login. Prefer OAuth when the client supports browser authorization. 3. For guest reads, activate a guest key through direct REST. Then authenticate MCP with that key. Guest wallet creation, status, and top-up are never executable through MCP. These are the current client paths. * **OAuth 2.1.** Claude.ai, Claude Desktop, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, and OpenCode. Gemini CLI, GitHub Copilot CLI, Cline and Qwen Code also use it. So do Pi, Goose and Codex CLI * **API-key only.** Roo Code's archived final release has no MCP OAuth provider * **Older Pi.** Builds without `pi mcp` require an upgrade or a tested adapter See [Docs MCP server](/mcp/docs-mcp) for docs search. See [MCP Server overview](/mcp/overview) for account actions. The [MCP Tools](/mcp/tools) reference has the tool details. ### MCP OAuth does not open or shows an unknown application Use this checklist. 1. Enter `https://xquik.com/mcp` as the exact server URL. 2. Remove any manually entered client ID or client secret unless your client requires preregistration. 3. Remove and re-add the connector to restart OAuth discovery. 4. Start login from the MCP client. Do not open `/api/auth/google` directly. 5. Allow the browser to return to the client's exact callback URL. Xquik publishes all required discovery documents. * Protected resource metadata is at `https://xquik.com/.well-known/oauth-protected-resource/mcp` * Authorization server metadata is at `https://xquik.com/.well-known/oauth-authorization-server` * The agent-readable auth guide is at `https://xquik.com/auth.md` Xquik supports CIMD and DCR. Let the client use its documented registration flow. Claude selects CIMD when authorization metadata advertises support and the public `none` authentication method. Otherwise it can use DCR. ChatGPT app creators choose CIMD or DCR during setup. If a URL-form `client_id` fails, check its public HTTPS metadata URL. It must include an explicit path. A trailing `/` is sufficient. It must return JSON without a redirect. Repeat the exact URL in `client_id`. List the callback in `redirect_uris`. ### How do I export extraction results? Call `GET /api/v1/extractions/{id}/export?format=csv`. Other formats are `json`, `xlsx`, `md`, `md-document`, `pdf`, and `txt`. The response is a file download. Exports work like this. * Exports include every row. A PDF above 10,000 rows comes as a ZIP of PDF parts * Available formats are CSV, JSON, Markdown, Markdown Document, PDF, TXT, and XLSX See [Export Extraction](/api-reference/extractions/export) for column details and code examples. ## Still stuck? * [Authentication](/api-reference/authentication) covers API key format, header requirements, and dual auth details. * [Error Handling](/guides/error-handling) covers error codes, retry strategies, and graceful degradation. * [Billing & Usage](/guides/billing) covers pricing, credits, and per-operation costs. # Tweet metadata, profile & media API field guide Source: https://docs.xquik.com/guides/tweet-profile-api-fields Map X (Twitter) API fields for tweets, profiles, media, replies, metrics, IDs, and cursors. It covers exports, REST, SDK, MCP, and Actor responses with JSON. > For the complete documentation index, see [llms.txt](/llms.txt). Use this guide to get tweet metadata from Xquik responses. It maps X (Twitter) API fields for tweets, user profiles, media files, and replies. In short, treat IDs as strings. Keep reply, quote, and repost relationships separate. This Twitter metadata guide focuses on public fields X supplies. Xquik keeps every documented public field supplied for supported reads. Core fields remain stable. Optional fields appear only when X supplies them. The [API reference](/api-reference/overview) defines exact REST and SDK types. Each API response must follow those documented types. The X (Twitter) API response fields below match that public contract. The MCP contract normalizes names for agent use. Most fields use `snake_case`. REST `createdAt` becomes MCP `created`. It does not become `created_at`. ## Choose the object before mapping fields | Need | Primary object | Stable join key | | - | - | - | | Tweet text and engagement | Tweet | `id` | | Reply or thread relationship | Tweet | `conversationId` and `inReplyToId` | | Quote context | `quoted_tweet` | Nested tweet `id` | | Repost context | `retweeted_tweet` | Nested tweet `id` | | Author profile | `author` | Author `id` | | Image, video, or GIF | `media[]` | `mediaKey` or media `id` | | Pagination | Page envelope | Returned cursor | Do not flatten every object into one unversioned row. Nested tweets and authors have their own IDs. Store those IDs before building joins. To return only some of these fields, send `fields` or `omit`. See [Choose fields](/guides/choose-response-fields). ## Field presence rules > [card] Required fields > > Tweet objects require `id`, `text`, and documented engagement counts. > Profile objects require `id`, `username`, and `name`. > [card] Optional fields > > The API omits optional fields when X does not supply them. Absence is not an > empty string, false value, or 0 count. > [card] String IDs > > Keep tweet, user, media, conversation, and reply IDs as strings. Large IDs > can lose precision in spreadsheet or JavaScript number types. > [card] Count snapshots > > Likes, replies, reposts, quotes, views, bookmarks, followers, and following > counts can change after collection. Store `collected_at` downstream. > [!WARNING] > > A 0 tweet metric can mean X did not report that count. `unknownCounts` names > each count X left out, so treat those as unknown. ## Tweet fields Every tweet includes its ID, text, metrics, and available author profile. These optional fields hold additional X metadata. Core tweet fields group into these roles. * Identity and publishing fields are `id`, `type`, `url`, `createdAt`, `lang`, and `source`. * Text fields are `text`, `displayTextRange`, `textHighlights`, `entities`, and `contentDisclosure`. * Reply fields are `isReply`, `isLimitedReply`, `conversationId`, `conversationControl`, `limitedActions`, `unmentionedUserIds`, `inReplyToId`, `inReplyToUserId`, `inReplyToUsername`, and `parentTweet`. * Quote and repost context fields are `isQuoteStatus`, `quoted_tweet`, `quotedTweetId`, `retweeted_tweet`, and `isNoteTweet`. * For retweets, `isRetweet` is `true` and `text` carries the original post in full. Their `retweeted_tweet` holds the original. * For pinning, `isPinned` marks the post the author pinned to their profile. * Related data fields are `author`, `media`, `reactionContext`, `retweetCount`, `replyCount`, `likeCount`, `quoteCount`, `viewCount`, and `bookmarkCount`. | Field | Description | | - | - | | `article` | X Article metadata | | `card` | Link card metadata | | `cashtagAttachments` | Price charts attached for cashtags, with range & candles | | `communityId` | Community ID | | `communityName` | Community name, when X sends it | | `communityNote` | Community Note text, links, icons, and style | | `communityUnavailable` | Why X shows no Community for the post, with X's reason | | `coordinates` | Author-published point, with longitude before latitude | | `edit` | Edit history and remaining state | | `authorUnavailable` | X's reason code and notice text for a missing author | | `exclusiveContent` | Subscriber-only post creator and subscribe link | | `grokShareAttachment` | Public Grok share content and links | | `grokTranslatedPost` | Grok's translation of the post, as X shows it | | `hasCommunityNotes` | Whether X holds Community Notes on the post, shown or not | | `geo` | Author-published point, with latitude before longitude | | `interstitial` | X's notice over the post, such as a public interest notice | | `isTranslatable` | Translation availability | | `jetfuelAttachment` | Interactive attachment metadata | | `liveEventContext` | The live event the post belongs to, such as an election | | `noteTweet` | Long-form content and inline media | | `parentTweet` | The post a reply answers, with `includeParentTweet=true` | | `place` | Tagged place metadata | | `postCta` | Public post action metadata | | `possiblySensitive` | X sensitivity state | | `previousCounts` | Pre-edit engagement counts | | `quotedTweetPermalink` | The quoted post's link, kept when X withholds that post | | `quotedTweetUnavailable` | Why X shows no quoted post, such as Suspended or Protected | | `reactionContext` | Referenced public post and user | | `sportsContext` | Game, team, score, and schedule details attached to a post | | `softIntervention` | The label X shows when it limits a post's reach | | `scopes` | Sanitized public scope metadata | | `subscriberBadge` | Subscriber badge on a reply, with the creator's account ID | | `tombstone` | Unavailable tweet metadata | | `unavailableAuthorId` | The author's ID when X withholds the author's profile | | `unknownCounts` | Each count X did not send, which reads 0 | | `unknownFields` | Each field X did not send, such as a stub post's text | | `viewState` | X view-state metadata | Tweets also include available entities, disclosures, nested tweets, and media. ### Tweet metadata example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "1893704267862470862", "text": "A public tweet with a reply and media.", "createdAt": "2026-05-24T20:32:58.000Z", "url": "https://x.com/example/status/1893704267862470862", "lang": "en", "isReply": true, "isNoteTweet": false, "isQuoteStatus": false, "isRetweet": false, "conversationId": "1893600000000000000", "inReplyToId": "1893690000000000000", "inReplyToUserId": "987654321", "inReplyToUsername": "parent_author", "retweetCount": 8, "replyCount": 3, "likeCount": 42, "quoteCount": 2, "viewCount": 1500, "bookmarkCount": 4, "author": { "id": "123456789", "username": "example", "name": "Example Account" }, "media": [ { "mediaUrl": "https://pbs.twimg.com/media/example.jpg", "type": "photo", "url": "https://x.com/example/status/1893704267862470862/photo/1", "altText": "Product dashboard with a tweet search result" } ] } ``` The example illustrates field placement. Read the endpoint response for actual values. Never copy example IDs into a production join. ### Map replies, quotes, and reposts Join replies to `inReplyToId`. Keep `conversationId` for the root conversation. Join quotes and reposts to each nested tweet ID. Keep original tweets separate from outer repost records. `reactionContext` identifies the public post and user tied to a reaction. Its nested user holds public data only. `reactionContext.reactedToPost` holds that post when available. It can arrive with only its ID, author & edit history. Then `unknownFields` lists `text`, and the other flags are missing. > [card] Direct reply > > Join `inReplyToId` to the parent tweet. Keep `conversationId` for the full > thread. > [card] Quote > > Join `quoted_tweet.id` to the quoted tweet. Attribute quote text to the > outer tweet. > [card] Repost > > Join `retweeted_tweet.id` to the original tweet. Do not merge their metric > snapshots. > [card] Note tweet > > Keep `noteTweet.inlineMedia` positions with long-form text and formatting. ### Repost timestamps Tweet repost records include `retweetedAt` as a UTC ISO 8601 timestamp. It is `null` when unavailable and omitted for original posts. `retweeted_tweet.createdAt` remains the original post's creation date. [Get retweeters](/api-reference/x/retweeters#retweet-timestamps) supports `includeRetweetTimestamp=true`. It adds each repost's time and makes the call take longer. Profile rows remain present when timestamps are unavailable, with `retweetedAt: null`. Profile `createdAt` remains the account creation date. ### Interpret tweet engagement fields `likeCount`, `replyCount`, `retweetCount`, `quoteCount`, `viewCount`, and `bookmarkCount` are count snapshots. They can change after collection. `unknownCounts` lists each count X did not send for a post, such as `["bookmarkCount"]`. Those counts read 0, so store them as unknown. The field is left out when X sent every count. The names match the response's key style. With `xquik-api-contract: 2026-04-29`, the list reads `["bookmark_count"]`. Posts from before X counted views list `viewCount`. So do new posts until they have views. Store `tweet_id`, every count, and `collected_at` in one snapshot row. Compare snapshots with the same tweet ID. Do not overwrite history when measuring growth. `previousCounts` can hold pre-edit engagement counts. `edit` can describe edit history. Keep both objects when analyzing edited tweets. ### Map entities and content labels Read `entities` for URLs, mentions, hashtags, and other parsed text markers. Read `displayTextRange` before slicing rendered text. Keep the original tweet text beside any normalized tokens. Read `textHighlights` on a search row for the `text` ranges that match the search. Each range counts code points of `text`. The list is empty when X marks nothing. Read `contentDisclosure` for documented content labels. Read `possiblySensitive` for the returned sensitivity state. Never infer either field when it is absent. ## Profile fields Every profile includes `id`, `username`, and `name`. Counts, verification, images, bios, and other metadata appear when X supplies them. Core profile fields group into these roles. * Identity fields are `id`, `username`, `name`, and `createdAt`. * Bio fields are `description`, `profile_bio`, `grokTranslatedBio`, `location`, and `url`. * Audience fields are `followers` and `following`. * Activity fields are `statusesCount`, `mediaCount`, and `favouritesCount`. * Verification fields are `verified`, `isVerified`, `isBlueVerified`, and `verifiedType`. * Image fields are `profilePicture`, `profilePictureOriginal`, `coverPicture`, and `profileBannerUrl`. `profilePicture` is 48 by 48 pixels & `profilePictureOriginal` is the full size image. * Access fields are `protected`, `unavailable`, and `unavailableReason`. * Safety fields are `possiblySensitive`, `withheldInCountries`, and `withheldScope`. * Automation fields are `isAutomated` and `automatedBy`. * Feature fields are `hasCustomTimelines`, `isTranslator`, and `communityRole`. * The pinned content field is `pinnedTweetIds`. Treat `author` as the user object for each returned tweet. Store the user profile using its stable `id`. A profile page can change its username, name, bio, and images. Keep pinned tweet IDs as strings. | Field | Description | | - | - | | `accountBasedIn` | Observed account location metadata | | `accountBasedInUnavailable` | X withheld the account location | | `accountBasedInAccurate` | False when X notes the location may be inaccurate | | `connectedVia` | How the account first connected to X | | `connectedViaAccurate` | False when X notes that country may be inaccurate | | `affiliateUsername` | Handle of the organization it is affiliated with | | `usernameChanges` | Username change count and latest change time | | `birthdate` | Public parts of the birthday | | `email` | First email on the profile, lowercased | | `contactInfo` | Emails, phones & links the account publishes | | `listedCount` | Public lists that include the profile | | `fastFollowersCount` | Followers X (Twitter) counts as fast followers | | `normalFollowersCount` | Followers minus fast followers | | `subscribersCount` | Accounts subscribed to its paid Subscriptions | | `defaultProfile` | Whether the profile keeps X's default theme | | `defaultProfileImage` | Whether the profile keeps X's default avatar | | `geoEnabled` | Whether the profile may add a location to posts | | `hasExtendedProfile` | Whether it filled X's extended fields | | `isTranslationEnabled` | Whether it turned on X's translation of its posts | | `advertiserAccountType` | X Ads type, either `none` or `promotable_user` | | `advertiserAccountServiceLevels` | X Ads services it uses, such as `analytics` | | `businessProfileState` | Business profile state, either `none` or `enabled` | | `verificationReason` | X's text on why the profile is verified, with links | | `affiliatesHighlightedLabel` | Affiliate label metadata | | `businessAccountAffiliatesCount` | Business affiliate count | | `creatorSubscriptionsCount` | Creator subscription count | | `professional` | Professional profile metadata | | `hasGraduatedAccess` | Graduated access state | | `hasHiddenSubscriptionsOnProfile` | Hidden subscription state | | `highlightsInfo` | Profile highlights metadata | | `identityVerification` | ID check & when X (Twitter) verified it, as a time or a year | | `isProfileTranslatable` | Profile translation availability | | `parodyCommentaryFanLabel` | Parody or fan label | | `profileDescriptionLanguage` | Detected bio language | | `profileImageShape` | Profile image shape | | `profileInterstitialType` | Profile interstitial type | | `profileSortEnabled` | Profile sorting state | | `profileTranslatorType` | Profile translator type | | `redirectsToUsername` | Handle x.com sends the profile's visitors to | | `superFollowEligible` | Subscription eligibility | | `superFollowsUserProfileActive` | Active subscription profile state | | `tipJar` | Public creator support handles | | `workExperience` | Public work history entries shown on the profile | Rows hold public data only. Use dedicated write routes or X for account state. ### Twitter profile API example ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "9876543210", "username": "example_user", "name": "Example User", "description": "Developer building tweet monitoring tools.", "followers": 12500, "following": 420, "statusesCount": 8600, "mediaCount": 730, "verified": true, "isBlueVerified": false, "isVerified": true, "verifiedType": "Business", "profilePicture": "https://pbs.twimg.com/profile_images/example.jpg", "coverPicture": "https://pbs.twimg.com/profile_banners/example.jpg", "location": "London", "createdAt": "2018-04-12T10:30:00.000Z", "protected": false, "pinnedTweetIds": ["1893704267862470862"] } ``` Use `id` as the profile join key. Usernames can change. Display names are not unique. Keep the observed username and collection time beside each snapshot. ### Interpret profile counts Use `followers` for the returned follower count. Use `following` for accounts the profile follows. Use `statusesCount` for the returned post count. Use `mediaCount` for posts containing media. Do not calculate follower growth from one response. An account monitor's `profile.followers.changed` event reports count changes, at most once a minute. Otherwise, store dated profile snapshots. Compare the same X (Twitter) user ID across collection times. ### Keep verification fields separate Keep `verified`, `isVerified`, `isBlueVerified`, and `verifiedType` as distinct fields. X can return different verification signals. Do not collapse them into one custom boolean. `identityVerification` and `affiliatesHighlightedLabel` provide separate profile metadata. Keep those objects when present. ### Handle protected or unavailable profiles Use `protected` for the returned privacy state. Use `unavailable` and `unavailableReason` for unavailable profiles. Do not replace omitted profile fields with invented values. Keep `withheldInCountries` and `possiblySensitive` when returned. These fields describe public response state. They do not grant access to hidden content. ### Handle a withheld account location `accountBasedIn` holds the country or region X shows for the account. It is `null` when X shows no label. Sometimes the label is not available yet. The profile then has `accountBasedInUnavailable: true` & no `accountBasedIn`. Treat that as unknown, not as no label. It can appear on a later request. ## Media fields Media rows keep their URL and type. These optional fields add detail. The X (Twitter) media API field section covers returned photos, videos, and GIFs. Store media files only when returned URLs and availability allow it. Every media object includes `mediaUrl`, `type`, and `url`. | Field | Description | | - | - | | `adultContent` | Adult content state | | `allowDownload` | Download permission | | `altText` | Accessibility text | | `aspectRatio` | Video aspect ratio | | `availabilityStatus` | Media availability state | | `availabilityReason` | Media availability reason | | `description` | Media description | | `displayUrl` | Display URL | | `durationMillis` | Video duration | | `editedWithNativeEditor` | Edited in X's own editor before posting | | `embeddable` | Embedding availability | | `expandedUrl` | Expanded media URL | | `faceRects` | Detected face rectangles | | `focusRects` | Crop focus rectangles | | `grokImageAnnotation` | Prompt of a Grok image | | `grokPostId` | Related Grok post ID | | `graphicViolence` | Graphic violence state | | `height` | Media height | | `id` | Media ID | | `indices` | Source-text indices | | `mediaKey` | X media key | | `monetizable` | Monetization state | | `otherSensitiveContent` | Other sensitive content state | | `sizes` | Available image sizes | | `sourceStatusId` | Source tweet ID | | `sourceUserId` | Source user ID | | `sourceUser` | Account that first posted copied media | | `tags` | Tagged users | | `title` | Media title | | `videoVariants` | Video encodings and bitrates | | `visitSiteUrl` | Public destination URL | | `watchNowUrl` | Public media action URL | | `width` | Media width | ### Map photos, videos, and GIFs Read `type` before selecting a media workflow. Supported values are `photo`, `video`, and `animated_gif`. Keep the original type with every media row. Use `mediaUrl` as the returned preview URL. Use `url` as the X media link. Use `expandedUrl` and `displayUrl` only when present. Keep `altText` for accessibility. Keep `width`, `height`, and `aspectRatio` for layout. Keep `durationMillis` for video duration. `videoVariants` can contain multiple encodings and bitrates. Keep the complete array when another service selects playback quality. Do not invent a missing variant. Use `allowDownload` and `availabilityStatus` when returned. Check both before a media handoff. A media object does not guarantee permanent file availability. ### Store a media join row ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweet_id": "1893704267862470862", "media_id": "1912345678901234567", "media_key": "3_1912345678901234567", "media_type": "video", "media_url": "https://pbs.twimg.com/ext_tw_video_thumb/example.jpg", "x_media_url": "https://x.com/example/status/1893704267862470862/video/1", "duration_millis": 18400, "alt_text": "Short product demonstration", "collected_at": "2026-05-24T20:33:00.000Z" } ``` Create one row per media object. Join it back through `tweet_id`. Keep all variants in a child table or structured column. ## Reply coverage Reply coverage depends on X. X can hide, rank, or omit counted replies. Omit `mode` for automatic maximum direct-reply coverage with pagination. Pass each `next_cursor` back unchanged as `cursor`. This keeps the standard response shape and billing. Use `GET /api/v1/x/tweets//replies?mode=complete&limit=25000`. Complete mode adds nested replies and detailed diagnostics. Direct replies match `inReplyToId` to the requested tweet. Keep `nested_replies` separate. Trust `diagnostic.complete` instead of row count. Complete mode answers `200` when `diagnostic.complete` is `true` or rows reach `limit`. A `sinceTime` or `untilTime` window covered to its end also answers `200`. Otherwise HTTP 424 `replies_incomplete` returns the collected rows and coverage diagnostic. Inspect `coveragePercentage` and `recommendedFallback`. Disclose that reply coverage depends on X. ### Store reply relationships Keep these fields for each collected reply. * `id` for the reply tweet * `inReplyToId` for the direct parent * `conversationId` for the thread root * `author.id` for the reply author * `createdAt` for ordering * `nested_replies` for separately returned descendants Do not infer a direct parent from array position. Use `inReplyToId`. Keep `nested_replies` separate from direct replies when measuring first-level coverage. ## Twitter API pagination fields Tweet, profile, follower, reply, list, and timeline routes can return page envelopes. Keep each endpoint's documented field names. REST read pages commonly return `has_next_page` and `next_cursor`. Pass the returned cursor back as `cursor`. Stop when `has_next_page` is false. Extraction result pages return `hasMore` and `nextCursor`. Pass `nextCursor` back as `cursor`. Do not mix REST cursors with extraction cursors. Commit rows and their next cursor together. A retry must upsert by tweet ID, user ID, or media ID before advancing. ## Field mapping handoff ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "schema": "xquik.tweet_profile_fields.v1", "source_route": "GET /api/v1/x/tweets/1893704267862470862", "tweet_key": "id", "profile_key": "author.id", "media_key": "media[].mediaKey", "reply_parent_key": "inReplyToId", "conversation_key": "conversationId", "quote_key": "quoted_tweet.id", "repost_key": "retweeted_tweet.id", "count_fields": [ "likeCount", "replyCount", "retweetCount", "quoteCount", "viewCount", "bookmarkCount" ], "ids_as_strings": true, "optional_field_policy": "preserve_absence", "collected_at": "2026-05-24T20:33:00.000Z" } ``` Use this checkpoint when building CSV, warehouse, search-index, or CRM rows. Keep nested JSON when flattening would erase relationships. ## Interface mapping | Interface | Field style | Contract | | - | - | - | | REST API | Mostly `camelCase` | `quoted_tweet`, `retweeted_tweet`, and `profile_bio` are documented exceptions | | Generated SDKs | Language-native names | Generated OpenAPI models | | MCP | Normalized | Most names use `snake_case`. REST `createdAt` becomes MCP `created` | | Apify Actors | Configurable | Dataset schemas and Actor READMEs | ### Read Actor diagnostics Interrupted extraction keeps available data and adds a free `partial` diagnostic. Read the `diagnostics` output and `run-report` before retrying unfinished targets. Diagnostic records use `resultType: "diagnostic"` and never count as billable results. | Field | Meaning | | - | - | | `status` | Extraction outcome, such as `partial` or `zero-output` | | `message` | Explanation of the extraction outcome | | `availableResults` | Accepted data rows the run kept | | `failedTargets` | Targets that failed during extraction | | `retryable` | Whether retrying unfinished work is appropriate | | `nextAction` | Suggested recovery step | `SUCCEEDED` and HTTP 200 confirm run completion and response delivery. They do not prove complete extraction. Check the diagnostic and report together. Keep any other platform status accurate when investigating interrupted runs. > [!NOTE] > > Xquik omits unavailable optional fields. It never invents missing X values. ### Keep interface names explicit Do not assume one casing rule covers every field. REST uses mostly camel case. The documented nested exceptions keep their public names. Generated SDKs expose language-native models from OpenAPI. Use the generated property names for that SDK version. Do not hand-convert them from REST. MCP tools normalize most response names for agents. REST `createdAt` becomes MCP `created`. Actor datasets follow each Actor's documented output mode. ## Avoid tweet metadata mapping errors > [accordion] Large IDs become rounded numbers > > Precision lost. Store tweet, user, conversation, reply, and media IDs as > strings. Do this before spreadsheet or JavaScript processing. > [accordion] Missing optional fields become false or zero > > Meaning changed. Keep field absence. Add a separate downstream default > only when the consumer requires one. > [accordion] Reply and conversation IDs are merged > > Relationship lost. Keep `inReplyToId` for the parent. Keep > `conversationId` for the root. > [accordion] Quote and repost metrics are combined > > Counts misattributed. Keep outer and nested tweet IDs in separate rows. > [accordion] Profile growth uses usernames as keys > > History split. Use the stable X (Twitter) user ID. Store the observed username as an > attribute. > [accordion] REST and MCP timestamps share one field name > > Mapping failed. Map REST `createdAt` and MCP `created` explicitly. ## Tweet metadata and profile API questions ### How do I get tweet metadata? Call the route matching your tweet, timeline, profile, or reply task. Read the returned API response through its documented schema. Keep IDs, counts, relationships, and cursors without inventing missing fields. ### Which X (Twitter) API fields should I store? Start with IDs, text, timestamps, authors, engagement counts, media, and relationships. Add optional fields only when X supplies them. Store collection time beside mutable counts. ### Which X (Twitter) API user fields identify a profile? Use `id` as the stable profile key. Keep `username`, `name`, bio, images, verification, followers, and following. Record collection time beside changing profile counts. ### How do I read X (Twitter) API response fields? Follow each Xquik route's response schema in the API reference. Use the field names documented for each interface. Apply only documented mappings between REST, SDK, MCP, and Actor names. ### How do I read X (Twitter) API pagination fields? X (Twitter) API pagination uses the response envelope documented for each route. Read `has_next_page` with `next_cursor` for REST pages. Read `hasMore` with `nextCursor` for extraction result pages. Never mix cursors between those response envelopes. ### What metadata does a tweet include? A tweet includes its ID, text, counts, URL, language, and relationship fields. It can also include author, media, entities, labels, and edit objects. Article, place, coordinates, geo, quote, repost, and Note Tweet objects can also appear. ### How do I find a tweet ID? Read the response `id` field. Keep it as a string. Use it for lookups, joins, deduplication, exports, and engagement snapshots. ### What is a Twitter conversation ID? `conversationId` identifies the root tweet for the returned conversation. `inReplyToId` identifies one reply's direct parent. Keep both fields. ### How do I know whether a tweet is a reply? Check `isReply`. Then read `inReplyToId`, `inReplyToUserId`, and `inReplyToUsername` when present. ### How do quotes differ from reposts? Quotes can add new outer tweet text and `quoted_tweet` context. Reposts expose original context through `retweeted_tweet`. Keep both tweet IDs separate. ### Which fields contain Twitter engagement metrics? Use `likeCount`, `replyCount`, `retweetCount`, `quoteCount`, `viewCount`, and `bookmarkCount`. Store collection time because these counts can change. ### Does the Twitter profile API include follower counts? Yes. Read `followers` and `following` when supplied. For growth tracking, use an account monitor's `profile.followers.changed` event. It fires at most once a minute. ### Why is a tweet or profile field missing? The field is optional and X did not supply it for that response. Keep the absence. Never replace it with an invented value. ### How do I get tweet media metadata? Read the tweet's `media` array. Use `type`, URLs, dimensions, alt text, duration, availability, and video variants when present. ### Can I export tweet metadata to CSV? Yes. Flatten selected scalar fields and keep stable IDs. Store nested author, media, quote, and repost objects separately. Use linked rows or JSON columns. ### Do REST, SDK, MCP, and actor fields match exactly? They share the documented contract but can expose different field naming. Follow the OpenAPI model, MCP response shape, or Actor dataset schema directly. ## Sports context `sportsContext` appears when X attaches game details to a post. It includes `gameId`, `league`, `title`, `url`, `state`, and `statusText` when available. `scheduledAtMs` keeps the source's numeric or string Unix timestamp in milliseconds. Each `competitors` entry can include `teamId`, `name`, `abbreviation`, and `score`. `color` contains the team display color. `isActive` and `isWinner` describe the competitor. Both keep `false` values. `logoUrl` and `darkLogoUrl` provide team images for light and dark backgrounds. IDs and score display values remain strings. A score of `"0"` remains valid. Missing fields stay omitted. These values describe the captured response, not live score updates. ## Live events `liveEventContext` appears when a post belongs to a live event, such as an election. It includes the event's `title`, `url`, and `imageUrl` when available. `url` opens the event's page on X. ## Reach labels `softIntervention` appears when X (Twitter) limits who sees a post. It includes `displayType`, such as `Fosnr`, & `engagementNudge`. `text` holds the label's `text`, its `rtl` direction & its links in `entities`. `url` links to X's page that explains the label, with its `urlType`. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) # Export Twitter replies with a scraper API guide Source: https://docs.xquik.com/guides/tweet-replies-export Export Twitter replies through a scraper API. Estimate credits, paginate reply rows, and save CSV, JSON, or XLSX files with exact Xquik API steps and errors. > For the complete documentation index, see [llms.txt](/llms.txt). Export Twitter replies as CSV, JSON, or XLSX with `reply_extractor`. With `auto` or `complete`, results include nested replies too. Reply results exclude ancestors and unrelated conversation branches, including thread collection. Set `includeOriginalPost` to include the target itself. Use `resultsLimit` to cap results. Use the live replies API for current pages with authors and engagement counts. An incomplete run keeps partial rows and reports `pagination_safety_limit`. ## When to use this workflow > [card] Spreadsheet export > > Use `reply_extractor` plus CSV or XLSX export when analysts need reply rows. > [card] App ingestion > > Use `reply_extractor` plus paginated JSON results for queues, CRMs, or warehouses. > [card] Moderation queue > > Before you store, hide, label, or route replies, use the direct replies API. Pair it with JSON Lines rows. > [card] Latest page > > Use `GET /x/tweets/{id}/replies` when you only need the newest reply page. > [card] Cost control > > Estimate first, then cap results with `resultsLimit`. ## Data you get > [card] Reply author > > User ID, username, display name, follower count, verified state, and profile image. > [card] Reply tweet > > Tweet ID, tweet text, and tweet created time. > [card] Engagement > > Likes, reposts, replies, quotes, views, and bookmarks. > [card] Metadata > > Language, source app, and conversation ID. For extraction jobs, `GET /extractions/{id}` returns `job`, `results`, `hasMore`, and `nextCursor`. Each reply row includes `xUserId`, `xUsername`, `xDisplayName`, `tweetId`, `tweetText`, `tweetCreatedAt`, and `createdAt`. Rows also include optional `enrichmentData` fields. Examples are `likeCount`, `replyCount`, `repostCount`, `quoteCount`, `viewCount`, `bookmarkCount`, `conversationId`, `lang`, and `source`. ## End-to-end reply export handoff Store one checkpoint for the target tweet. That checkpoint carries it through estimate, job creation, JSON pagination, and file export. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "workflow": "reply_export", "request": { "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500 }, "estimate": { "estimatedResults": 1200, "creditsRequired": "1200", "creditsAvailable": "77000", "allowed": true, "source": "replyCount" }, "create_receipt": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "toolType": "reply_extractor", "status": "running", "poll_path": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890" }, "json_pages": { "limit": 1000, "page_cursor": null, "next_cursor": "990200", "has_more": true }, "export_paths": { "csv": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=csv", "json": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=json", "xlsx": "/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=xlsx" }, "normalized_row": { "parent_tweet_id": "1893704267862470862", "reply_tweet_id": "1893710452812718080", "reply_text": "Thanks for the update.", "reply_created_at": "2026-05-01T10:05:00.000Z", "reply_author_id": "44196397", "reply_author_username": "username", "conversation_id": "1893704267862470862", "export_format": "csv" }, "handoff_state": "poll_until_completed_then_export" } ``` > [card] Estimate checkpoint > > Keep the estimate response with `targetTweetId`. > A successful count lookup sets `source` to `replyCount`. > [card] Job checkpoint > > Store the returned job `id`, `status`, and `poll_path`. Do not expect reply rows in the create response. > [card] Cursor checkpoint > > For JSON page loops, store `page_cursor`, `next_cursor`, and `has_more`. Then pass `nextCursor` back as `cursor`. > [card] Export checkpoint > > Store the chosen CSV, JSON, or XLSX `export_paths`. Also store the normalized reply fields sent downstream. ## Step 1. Estimate replies and credits Call `POST /extractions/estimate` before scraping. `reply_extractor` requires `targetTweetId`. The estimate uses the tweet's current `replyCount`. It does so even when you plan to cap the created job. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions/estimate \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862" }' | jq ``` The estimate returns `allowed`, `estimatedResults`, `creditsRequired`, `creditsAvailable`, and `source`. A successful tweet count lookup sets `source` to `replyCount`. Set `resultsLimit` on the create request. Do this when you want a smaller sample or hard run cap. Final rows and credits can be lower than the estimate. ## Step 2. Run the reply extraction Create the job with the same `toolType`, `targetTweetId`, and optional `resultsLimit`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500 }' | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "toolType": "reply_extractor", "status": "running" } ``` Store the creation response as a local handoff before polling. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "job": "reply_extraction", "reply_extraction_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "target_tweet_id": "1893704267862470862", "results_limit": 500, "status": "running", "handoff_created_at": "2026-05-16T03:07:00.000Z" } ``` Poll by `reply_extraction_id`. Keep `target_tweet_id` and `results_limit` with the audit record. Do not wait for `totalResults` or `createdAt` in the create response. Those fields arrive from `GET /extractions/{id}`. ## Step 3. Poll job status Poll `GET /extractions/{id}` until the job is `completed` or `failed`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Use the paginated response when your app wants JSON rows, not a file download. Use `limit` up to 1,000 and pass `nextCursor` as `cursor` until `hasMore` is `false`. ## Step 4. Export CSV, JSON, or XLSX File exports do not charge credits after job creation. Save `xquik-replies.jsonl` for queue replay or warehouse loads and `xquik-replies.json` for app ingestion. Save `xquik-replies.csv` for CRM import and `xquik-replies.xlsx` for analyst handoff. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET "https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=csv" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -o xquik-replies.csv ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET "https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=xlsx" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -o xquik-replies.xlsx ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X GET "https://xquik.com/api/v1/extractions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/export?format=json" \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -o xquik-replies.json ``` ### Saved export JSON Lines handoff Some consumers need one reply per line with stable field names. If a warehouse, queue, CRM, or AI agent does, use this after `format=json`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} jq -c --arg extraction_id "a1b2c3d4-e5f6-7890-abcd-ef1234567890" \ '.[] | { job: "reply_export", extraction_id: $extraction_id, reply_tweet_id: .tweetId, reply_text: .tweetText, reply_author_id: .xUserId, reply_author_username: .xUsername, created_at: .tweetCreatedAt, conversation_id: .conversationId, like_count: .likeCount, reply_count: .replyCount, quote_count: .quoteCount, view_count: .viewCount, handoff_format: "jsonl" }' xquik-replies.json > xquik-replies.jsonl ``` ## Direct replies API Use `GET /x/tweets/{id}/replies` for a paginated API response instead of a stored extraction job. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl "https://xquik.com/api/v1/x/tweets/1893704267862470862/replies" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` The direct replies API returns `tweets`, `has_next_page`, and `next_cursor`. Pass `next_cursor` back as `cursor` to fetch the next page. It costs 1 credit per tweet returned. Use `sinceTime` and `untilTime` as Unix timestamps in seconds. They limit replies to a specific window. Use them when a moderation queue, CRM sync, or agent only needs that window. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/1893704267862470862/replies \ --data-urlencode "sinceTime=1777392000" \ --data-urlencode "untilTime=1777478400" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ## Copy-ready workflow from replies to a moderation queue Use this direct API workflow for the latest reply pages as JSON Lines. Run it before deciding what to store, hide, label, or route. Each row maps the API response into stable downstream fields. They are `handoff_source`, `parent_tweet_id`, `reply_tweet_id`, and `reply_text`. Author fields are `reply_author_id`, `reply_author_username`, `reply_author_name`, `reply_author_followers`, `reply_author_verified`, and `reply_author_profile_picture`. The row also has `created_at`, `in_reply_to_id`, `conversation_id`, engagement counts, and `bookmark_count`. It ends with `is_note_tweet`, `tweet_source`, `media_urls`, and cursor fields. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const apiKey = process.env.XQUIK_API_KEY; const tweetId = "1893704267862470862"; let cursor; let pageIndex = 0; do { const url = new URL(`https://xquik.com/api/v1/x/tweets/${tweetId}/replies`); if (cursor) { url.searchParams.set("cursor", cursor); } const response = await fetch(url, { headers: { "x-api-key": apiKey }, }); if (response.status === 429) { throw new Error("Rate limited. Retry after the response header delay."); } if (!response.ok) { const body = await response.json(); throw new Error(`${response.status} ${body.error}`); } const page = await response.json(); for (const tweet of page.tweets ?? []) { const row = { handoff_source: "xquik.replies.direct", parent_tweet_id: tweetId, reply_tweet_id: tweet.id, reply_text: tweet.text, reply_author_id: tweet.author?.id ?? null, reply_author_username: tweet.author?.username ?? null, reply_author_name: tweet.author?.name ?? null, reply_author_followers: tweet.author?.followers ?? null, reply_author_verified: tweet.author?.verified ?? null, reply_author_profile_picture: tweet.author?.profilePicture ?? null, created_at: tweet.createdAt ?? null, in_reply_to_id: tweet.inReplyToId ?? null, conversation_id: tweet.conversationId ?? null, like_count: tweet.likeCount ?? 0, reply_count: tweet.replyCount ?? 0, retweet_count: tweet.retweetCount ?? 0, quote_count: tweet.quoteCount ?? 0, view_count: tweet.viewCount ?? 0, bookmark_count: tweet.bookmarkCount ?? 0, is_note_tweet: tweet.isNoteTweet ?? false, tweet_source: tweet.source ?? null, media_urls: (tweet.media ?? []).map((item) => item.mediaUrl).filter(Boolean), page_index: pageIndex, page_cursor: cursor ?? "", next_cursor: page.next_cursor, has_next_page: page.has_next_page, }; process.stdout.write(JSON.stringify(row) + "\n"); } cursor = page.has_next_page ? page.next_cursor : undefined; pageIndex += 1; } while (cursor); ``` Use extraction jobs for saved files, credit estimates, or fixed `resultsLimit` caps. ## Choose the right reply output ### How do replies differ from quote tweets? Replies stay within conversation threads beneath the original tweet. Quote tweets create separate posts with added commentary. Store the original tweet ID with every reply row. Use the [Quote Tweets API](/api-reference/x/tweet-quotes) for quote tweets. Never merge both result sets without a field that identifies their relationship type. ### Why can public replies be missing? X can rank replies instead of showing them chronologically. It can also place probable spam behind an extra control. Protected, deleted, and hidden replies have separate visibility rules. Review the [official X (Twitter) reply guidance](https://help.x.com/en/using-x/mentions-and-replies). For API exports, follow every cursor and store each confirmed page. Treat a `424 replies_incomplete` response as evidence against complete coverage. ### How should a support team moderate reply rows? Keep reply text, author ID, username, creation time, and engagement counts. Route uncertain rows to a human review queue. Add sentiment or spam labels with your own classifier. Xquik does not return a sentiment verdict. CSV suits spreadsheet review. JSON keeps nested media and author fields. ### When should I use the live replies API? Use the Twitter reply API when an application needs the latest cursor page. It returns reply tweets, authors, engagement counts, media, and the next cursor. Continue until `has_next_page` is `false`. New replies can arrive during pagination. Store each reply tweet ID and remove duplicate IDs downstream. ### When should I run a saved reply extraction? Choose `reply_extractor` for stored files and reviewable jobs. Estimate the parent tweet first. Then create one capped or uncapped extraction. Poll the returned job ID until completion. File conversion adds no credit charge. ### Which file format should I choose? Choose CSV for CRM imports and spreadsheet filters. Choose XLSX for analyst handoffs that require workbook tools. Choose JSON for applications that keep nested reply fields. Convert JSON to JSON Lines when queues or warehouses need one reply per record. ### How do I resume an interrupted reply export? Store the target tweet ID, extraction ID, current cursor, next cursor, and page index. Resume a saved job through `GET /extractions/{id}`. Resume live pagination with the last confirmed `next_cursor`. Never advance the checkpoint before storing its reply rows. ### How should I validate exported replies? Check that every row has a reply tweet ID and parent tweet ID. Keep author IDs separately from usernames because usernames can change. Keep tweet creation times in UTC. Compare the returned rows with the estimate only for planning. The parent `replyCount` can change and does not guarantee the final export size. ## Cost and failure handling Estimates are free. A `reply_extractor` job costs 1 credit per result. Direct `GET /x/tweets/{id}/replies` calls cost 1 credit per returned tweet. Available credits can reduce the returned page size. File exports do not charge credits after job creation. Respect the read rate limit on live X (Twitter) API pages. Use the parent reply count only for estimates. Trust the returned reply rows over the estimate. Handle common errors before retrying. > [card] 400 invalid tweet ID > > Status `400`. Error `invalid_tweet_id`. Send a post ID or post URL. > [card] 401 unauthenticated > > Status `401`. Error `unauthenticated`. Send a valid `x-api-key`. > [card] 402 billing or credits > > Status `402`. Errors `no_subscription`, `subscription_inactive`, `no_credits`, or `insufficient_credits`. Subscribe, add credits, or lower `resultsLimit`. > [card] 429 rate limit > > Status `429`. Error `rate_limit_exceeded`. Wait for `retryAfter` or the `Retry-After` header. > [card] 424 or 502 upstream unavailable > > Status `424` or `502`. Error `x_api_unavailable`. Retry with exponential backoff. ## Handoff checklist > [card] Spreadsheet > > Export `format=csv` to `xquik-replies.csv` or `format=xlsx` to `xquik-replies.xlsx`. > [card] App ingestion > > Export `format=json` to `xquik-replies.json`, convert it to `xquik-replies.jsonl`, or paginate `GET /extractions/{id}`. > [card] Cost control > > Set `resultsLimit` on create calls when you need a smaller run. > [card] New reply alerts > > Create an account or keyword monitor with `tweet.reply` events. ## Related reply APIs * [Plan saved tweet and reply exports](/guides/extraction-workflow) * [Create a reply extraction job](/api-reference/extractions/create) * [Fetch live tweet reply pages](/api-reference/x/tweet-replies) # Twitter advanced search API with CSV export via REST Source: https://docs.xquik.com/guides/tweet-scraper-csv-export Install the Python SDK with pip install x_twitter_scraper. Follow this step by step flow for specific accounts. Use from:username for one Twitter account. > For the complete documentation index, see [llms.txt](/llms.txt). For hashtags search, pass the exact hashtag token. Respect API rate limits and X's Terms of Service. Store Twitter profiles separately from tweet rows. ## Export Twitter data Define the export as tweet rows, author rows, or both. Keep each stable Tweet ID, text, author ID, creation time, and permalink. Add replies, reposts, likes, quotes, views, bookmarks, and media when returned. Store profile names, usernames, bios, verification, and audience counts in separate author columns. Use tweet_search_extractor for a durable job and downloadable files. Choose CSV, JSON, or XLSX. Save query, operators, language, date window, and result cap. Add extraction ID, completion status, and export time. Count unique Tweet IDs after download. Label limited windows and capped jobs. Never call a bounded search export a complete account archive. Use CSV with Google Sheets. Use XLSX for analyst review. Use JSON for queues, warehouses, or application ingestion. ### How do I scrape tweets without getting blocked? Use the documented Twitter scraper API instead of browser evasion. Respect each rate limit and wait for retryAfter after a 429 response. Retry temporary 424 or 502 failures with exponential backoff. Keep the same query, filters, and cursor during retries. Changing them can skip or duplicate tweets. Set resultsLimit before large extraction jobs. This caps the requested tweets and the estimated credit cost. Store nextCursor only after saving every returned tweet. Resume from that checkpoint after a process restart. Never guess or modify an opaque cursor. Keep concurrent requests within the documented limits. Add jitter to delayed retries so several workers do not restart together. Stop retrying permanent API key, validation, or credit errors. Record the request ID and error body for diagnosis. This approach keeps exports moving without browser evasion, rotating identities, or unsupported anti-bot tactics. Keep the API key secret, and validate author IDs after every resumed page. Validate media URLs too. ### Twitter scraper API Use the live Twitter search route for immediate cursor pages. Use tweet_search_extractor for estimates, durable job IDs, and status polling. It also provides saved rows and CSV, JSON, or XLSX files. Use a monitor when a keyword or account match must create a stored event. Every path should keep Tweet IDs, author IDs, text, and timestamps. Add engagement counts, media, query filters, and page state. Keep the API key in a secret manager. Respect rate limits and documented error recovery. A Twitter scraper API removes browser maintenance. It cannot make unclear queries complete. It cannot turn a result cap into an archive. ### Scrape tweets Python Use the [Python SDK](/sdks/python) or call REST with requests. Load the API key from a secret store. Send the keyword, hashtag, author, and language. Add the required date range, media, and engagement filters. Save returned tweets before advancing the opaque cursor. Normalize Tweet ID, text, author ID, username, and creation time. Add permalink, replies, reposts, likes, quotes, and media URLs. Deduplicate by Tweet ID. For saved jobs, estimate first. Then create, poll, and export the completed job. Retry 429, 424, or 502 only as documented. Never advance date checkpoints before the output becomes durable. ### Automate tweet export Store one explicit query and time window for each automated run. Estimate the requested result count. Create one extraction after the estimate passes the credit budget. Save its extraction ID before polling. Export only after the job reports completed. Write CSV, JSON, or XLSX to a dated, durable path. Record the query, filters, window, result cap, row count, extraction ID, status, and checksum. Count unique Tweet IDs before loading the destination. Advance the next time window only after the file upload succeeds. This prevents a failed handoff from creating an unseen gap. Validate author IDs, replies, reposts, and media before publishing the export. ### How do I build an automated Twitter data pipeline with an API? Translate "data pipeline" into named records and checkpoints. Capture tweets, authors, replies, engagement counts, media URLs, and the exact search filters. Use stable Tweet IDs and author IDs as keys. Keep usernames and profile names as changeable attributes. The pipeline should estimate, create, poll, export, validate, and load. Save the extraction ID immediately. Retry status reads without creating another job. Verify terminal status, row count, and unique Tweet IDs. Check first and last timestamps plus required fields. Load files without creating duplicate Tweet IDs. Record the last durable date window or cursor. Send failed jobs to review with their documented error, request ID, and unchanged input. ### How to schedule recurring tweet exports using a REST API Run one fixed interval through cron, a queue worker, or an orchestrator. Use separate UTC windows for routine exports. Add a small overlap only when the destination removes duplicate Tweet IDs. Save every window before starting its request. Call the estimate route and enforce approved result limits. Enforce credit limits too. Then create one extraction. Poll its ID to a terminal state. Download the selected format and validate unique Tweet IDs, timestamps, authors, and row counts. Upload the file, record its checksum, then advance the schedule checkpoint. Never advance after a timeout, failed extraction, invalid file, or incomplete destination upload. Check replies, reposts, and media columns before delivery. ### Twitter data pipeline Python Keep orchestration, API access, tweet row shaping, and destination writes in separate Python functions. One function builds the query and date window. One function estimates and creates the extraction. Another polls the stored ID. A final function validates and writes tweet rows. Use typed models for Tweet ID, author ID, text, and creation time. Include engagement counts, media URLs, query, and extraction ID. Store status before every retry. Honor retryAfter for rate limits. Use exponential backoff for documented temporary failures. Upsert by Tweet ID in the destination. Commit the next window only after the file or transaction succeeds. This structure makes reruns safe and testable. ### Tweet scraping workflow Start with the search intent. Define keywords, hashtags, authors, language, dates, media type, and minimum engagement. Choose live search for immediate cursor pages. Choose an extraction job for estimates, saved results, and file exports. Choose a monitor for continuous account or keyword events. Store the request, API path, result cap, cursor or extraction ID, and execution time. Normalize Tweet IDs, author IDs, text, timestamps, engagement, media, and permalinks. Save each page before advancing its cursor. Remove duplicate Tweet IDs. Validate the first and last timestamps. Mark capped, interrupted, or credit-bounded results as partial. Route only validated rows downstream. ## Build a scheduled tweet export pipeline A recurring tweet scraping workflow needs an explicit search window. Store the keyword, author, language, start time, and end time for every run. Reuse those values for retries. Schedule one run through cron, Prefect, or another job runner. Call POST /extractions/estimate before creating the extraction. Stop when the estimate exceeds the approved result count or credit budget. Create one extraction for the approved window. Store its job ID immediately. Poll `GET /extractions/{id}` until the job completes or fails. Do not create a replacement job while the first job still runs. Export the completed rows once. Write the CSV, JSON, or XLSX file to a dated path. Record its extraction ID, search query, filters, row count, and format. Advance the schedule checkpoint only after the file becomes durable. A failed upload must not move the next start time. This rule prevents missing tweets between recurring runs. Python pipelines can use the Python SDK for direct pages. They can also call the REST job endpoints. Keep orchestration separate from tweet row shaping. This makes retries predictable across Python, CLI, and no-code runners. ## Validate tweet export completeness Save the complete request before evaluating search results. Include the query, operators, language, date window, result limit, and export format. 2 files with different filters should never share one comparison label. Count unique Tweet IDs after every export. Duplicate IDs may appear when date windows overlap. They may also appear when a retry restarts from an earlier cursor. Keep one canonical row for each Tweet ID. Keep the newest complete author and engagement fields. Check the first and last tweet creation times. Compare them with the requested window. A bounded Twitter search can return fewer tweets than its result limit. This does not prove the job failed. Record the extraction status beside each file. A completed job supports an export. A failed job needs its returned error and a new decision. Never label partial search results as a complete archive. Review a small row sample before sending files downstream. Confirm tweet text, author username, author user ID, creation time, and permalink. Check likes, reposts, replies, quotes, views, and bookmarks when the response includes them. Validate attached media separately. Store media type and URL with the owning Tweet ID. Do not infer a missing image or video from tweet text. Keep user profiles separate from tweet identity. A username or display name can change. The author user ID remains the stable join key for later profile reads. Compare the exported row count with the stored job response. Investigate a difference before loading a warehouse. Common causes include duplicate Tweet IDs, rejected rows, file parsing errors, or interrupted downloads. Use monitors when the workflow needs real-time events. A scheduled X (Twitter) API export creates time-bounded snapshots. It should not claim instant coverage between completed runs. ## When to use this workflow Use this workflow for repeatable keyword, hashtag, account, or campaign exports. Choose it when teams need an auditable file of saved tweet rows. Those rows carry author profiles, engagement counts, and media URLs. Prefer direct tweet search for small live pages. Prefer monitors for continuous account or keyword alerts. ## Choose the right path Use extraction jobs for repeatable exports and audit trails. Use the direct API for low-latency pages or small app handoffs. It also handles exact lookup from one stored Tweet ID or X status URL. Keep API keys outside code and logs. Store search results with tweet fields and user profiles. Respect the read rate limit before requesting another page. Import CSV exports into Google Sheets for shared analyst review. ## End-to-end export handoff Store one checkpoint for the search request. That checkpoint carries it through estimate, job creation, JSON pagination, and file export. Tweet search exports include base user fields, tweet fields, and engagement counts. They also include metadata when available. ## Step 1. Estimate tweets and credits Call POST /extractions/estimate before scraping tweets. tweet_search_extractor requires searchQuery. resultsLimit defaults to 10,000. The estimate returns allowed, estimatedResults, creditsRequired, creditsAvailable, and source. Tweet search uses resultsLimit as its source, including the default. ## Filter fields tweet_search_extractor accepts structured filter fields beside searchQuery. Use fields when UI or SDK code owns filters. Use advancedQuery when you already have a trusted X (Twitter) search operator string. Set exactPhrase to match that exact phrase. Set excludeWords to drop posts with any of those comma-separated words. The advancedQuery field applies your own operators on top. For direct GET /x/tweets/search, put the same operators in q. A plain Tweet ID or X status URL in q is a direct lookup. It is not a saved extractor job. Create the job with the same toolType, searchQuery, filters, and resultsLimit. Store the creation response as a local handoff before polling. Poll by tweet_search_extraction_id. Keep search_query, filters, and results_limit with the audit record. Do not wait for totalResults or createdAt in the create response. Those fields arrive from `GET /extractions/{id}`. ## Step 3. Poll job status Poll `GET /extractions/{id}` until the job completes or fails. Use the paginated response when your app wants JSON rows, not a file download. ## Step 4. Export CSV, JSON, or XLSX Exports are free after the extraction job exists. Use CSV for spreadsheets, JSON for app ingestion, and XLSX for analyst handoff. CSV, JSON, and XLSX exports include every row. ## Step 5. Hand off rows For API handoff, call `GET /extractions/{id}` with limit up to 1000. Pass `nextCursor` as `cursor` until `hasMore` is false. Store `job`, `results`, `hasMore`, and `nextCursor`. Normalize each tweet row before sending it downstream. For direct API handoff, store tweets\[].id, tweets\[].text, and tweets\[].createdAt. Also store tweets\[].author.id, tweets\[].author.username, has_next_page, and next_cursor. For JSON Lines, write one normalized tweet object per line to xquik-tweet-search.jsonl. ## Direct tweet search API Use GET /x/tweets/search for a paginated API response instead of a stored extraction job. The direct search API returns tweets, has_next_page, and next_cursor. Leave limit unset for a simple cursor-driven page loop. In that loop, pass next_cursor back as cursor. Set limit when you want one bounded request. Xquik then collects up to that count. If has_next_page is true, continue with the same query, filters, queryType, and limit. Set cursor to next_cursor. Cost is 1 credit per tweet returned. For account date windows, sinceTime and untilTime limit results to that window. A request such as q=from:username\&sinceTime=2026-05-01\&untilTime=2026-05-02 behaves like from:username since:2026-05-01 until:2026-05-02. Use queryType=Latest for time-ordered backfills. Add a keyword, hashtag, or other operator when you need normal search ranking. A bare q=from:username request returns all the account's posts & reposts. Continue while the response includes next_cursor. Use mode=standard with limit only when an old integration needs the legacy behavior. It returns a single page where has_next_page is false. ## Failure handling Treat every failure as a stopped checkpoint, not a reason to skip tweets. Keep the exact query, filters, date window, cursor, extraction ID, and request ID. Never create a replacement extraction while the original job status remains unknown. Fix a 400 response before retrying. Check searchQuery, operators, dates, resultsLimit, and export format. Do not resend an unchanged invalid request. Replace an expired or invalid API key after a 401 response. Add credits after a 402 response, then continue from the saved checkpoint. Retry a documented 424 or 502 failure with exponential backoff and jitter. Keep the same extraction ID during status polling. For direct tweet search, keep the same query, filters, queryType, limit, and cursor. Changing those values can skip or duplicate tweets. Honor retryAfter after a 429 response. Pause only the affected worker. Do not start parallel requests for the same cursor page. Cap retries. Send exhausted requests to review with response status, request ID, and unchanged input. Treat a failed extraction status as terminal for that job. Save its returned error before deciding whether to create another extraction. Mark every interrupted export as partial. Keep completed pages, unique Tweet IDs, and the last durable cursor. Validate the downloaded file before advancing any schedule checkpoint. Reject empty files when the completed job reported rows. Reject malformed CSV, JSON, or XLSX output. Keep the previous window open until the verified file reaches its destination. ## Handoff checklist Hand off the exact searchQuery, structured filters, advancedQuery, language, sinceTime, untilTime, queryType, and resultsLimit. Include the extraction ID for saved jobs. Include the final cursor for direct tweet search. Record the terminal status, export format, file name, checksum, and byte size. Also record the row count and unique Tweet count. Add the earliest and latest tweet creation times. Mark capped, credit-bounded, interrupted, and partial exports explicitly. Keep Tweet ID, text, author ID, username, display name, and creation time. Keep replies, reposts, likes, quotes, views, bookmarks, permalinks, and media URLs when returned. Join refreshed profiles through stable author ID, not username. Name the downstream owner and destination. State whether the receiver expects CSV, JSON, XLSX, or JSON Lines. Document its duplicate key, required columns, timezone, and retry behavior. Confirm the destination accepted the file or rows before closing the window. Store the destination record count and load time. Investigate count differences before the next scheduled run. Advance the checkpoint only after this final confirmation. > [accordion] Related tweet, reply & media APIs > > * Tweets > * [Get tweet](/api-reference/x/get-tweet) > * [Tweet insights](/api-reference/x/tweet-engagement-insights) > * [Batch tweets](/api-reference/x/batch-tweets) > * [Tweet thread](/api-reference/x/tweet-thread) > * [Hidden replies](/api-reference/x/tweet-hidden-replies) > * [Translate tweet](/api-reference/x/tweet-translation) > * [Embed tweet](/api-reference/x/tweet-embed) > * [Resolve links](/api-reference/x/resolve-links) > * [Tweet subtitles](/api-reference/x/tweet-subtitles) > * [X Article](/api-reference/x/get-article) > * Analysis > * [Sentiment analysis](/api-reference/x/sentiment-analysis) > * [Brand mentions](/api-reference/x/brand-monitoring) > * [News classification](/api-reference/x/news-classification) > * [Market signals](/api-reference/x/market-signals) > * [Viral score](/api-reference/x/viral-score) > * [Classify posts](/api-reference/x/classify-tweets) > * Engagement > * [Tweet replies](/api-reference/x/tweet-replies) > * [Quote tweets](/api-reference/x/tweet-quotes) > * [Likers](/api-reference/x/favoriters) > * [Reposters](/api-reference/x/retweeters) > * [Reposter IDs](/api-reference/x/retweeter-ids) > * [Check repost](/api-reference/x/tweet-repost-check) > * Profiles > * [User tweets](/api-reference/x/user-tweets) > * [Batch user tweets](/api-reference/x/batch-user-tweets) > * [User replies](/api-reference/x/user-replies) > * [User likes](/api-reference/x/user-likes) > * [User media](/api-reference/x/user-media) > * [User highlights](/api-reference/x/user-highlights) > * [User articles](/api-reference/x/user-articles) > * Feeds > * [List tweets](/api-reference/x/list-tweets) > * [Trends](/api-reference/x/trends) > * [Trends history](/api-reference/x/trends-history) > * [Top tweets](/api-reference/x/top-tweets) > * [Trend locations](/api-reference/x/trend-locations) > * [Search Spaces](/api-reference/x/search-spaces) > * [Get Space](/api-reference/x/get-space) > * [Space replay](/api-reference/x/space-replay) > * [Get broadcast](/api-reference/x/get-broadcast) > * [User live status](/api-reference/x/user-live-status) > * [User shadowban](/api-reference/x/user-shadowban) > * [Notes contributor](/api-reference/x/community-notes-contributor) > * [Contributor notes](/api-reference/x/community-notes-contributor-notes) > * [Deleted notes](/api-reference/x/community-notes-contributor-deleted-notes) > * [Hashflags](/api-reference/x/hashflags) > * [Search places](/api-reference/x/search-places) > * [Download media](/api-reference/x/download-media) # TweetClaw OpenClaw X (Twitter) plugin for agents Source: https://docs.xquik.com/guides/tweetclaw Install the TweetClaw OpenClaw Twitter plugin. Search tweets, inspect profiles, export followers, monitor accounts, and approve posts, replies, DMs, and media. > For the complete documentation index, see [llms.txt](/llms.txt). TweetClaw is Xquik's official OpenClaw Twitter plugin. It connects an OpenClaw agent to documented Xquik API endpoints. The plugin searches tweets, profiles, replies, followers, timelines, lists, communities, and trends. This OpenClaw Twitter skill supports posts, replies, likes, reposts, follows, and DMs. It also supports monitors, webhooks, follower exports, and media actions. It keeps API keys outside prompts and model-visible tool arguments. TweetClaw is an OpenClaw plugin, not an MCP server. Choose Xquik MCP for remote MCP clients. Choose an Xquik SDK for application code outside an agent runtime. ## Prerequisites * OpenClaw `2026.7.1` or newer * Node.js `22` or newer, within the installed OpenClaw release's supported range * [Xquik API key](/x-api-quickstart) for account-backed automation * Optional [MPP setup](/mpp/quickstart) for anonymous read-only pay-per-use calls > [!WARNING] > > Install agent plugins only from trusted sources. OpenClaw plugin installs run > code. Official CLI docs recommend pinned production versions. ## Install the OpenClaw Twitter plugin Install from Xquik's verified ClawHub publisher scope. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} openclaw plugins install clawhub:@xquik/tweetclaw ``` OpenClaw records ClawHub as the tracked update source. Bare package names use npm during the launch cutover. Use the explicit npm fallback for repeatable shared environments. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} openclaw plugins install npm:@xquik/tweetclaw@1.8.0 --pin ``` `@xquik/tweetclaw` is the official package. The plugin id is `tweetclaw`. The npm package and the source repository are both at `1.8.0`. Run `openclaw plugins update tweetclaw` for normal tracked updates. Exact npm pins stay fixed until you select another release. ## Configure API key auth Create an API key from the Xquik dashboard, then configure TweetClaw. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export XQUIK_API_KEY="xq_..." openclaw config set plugins.entries.tweetclaw.config.apiKey "$XQUIK_API_KEY" ``` API key auth enables account status, reads, monitors, webhooks, extractions, draws, and media. It also enables approved actions for connected X accounts. ## Configure MPP pay-per-use MPP lets TweetClaw call fixed-price, read-only X API endpoints. These routes need no Xquik account or API key. Use a guest `paid_reads` key for the broader prepaid catalog. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npm i mppx@0.8.12 viem@2.55.4 export MPP_SIGNING_KEY="0x..." openclaw config set plugins.entries.tweetclaw.config.tempoSigningKey "$MPP_SIGNING_KEY" ``` MPP mode is read-only. Use API key auth for private reads and account state. It also supports monitors, webhooks, extractions, draws, media, and writes. ## Optional settings TweetClaw can poll Xquik events and show monitor notifications in chat. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} openclaw config set plugins.entries.tweetclaw.config.pollingEnabled true openclaw config set plugins.entries.tweetclaw.config.pollingInterval 60 ``` Use the default base URL unless you operate a private Xquik deployment. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} openclaw config set plugins.entries.tweetclaw.config.baseUrl "https://xquik.com" ``` ## Tools > [card] explore > > Search the bundled Xquik endpoint catalog and inspect parameters. This tool > does not call the network. > [card] tweetclaw > > Call catalog-listed Xquik endpoints with structured method, path, query, and > body input. This tool can make network requests. The `explore` tool accepts natural language catalog queries. It returns API endpoints, methods, parameters, and response shapes without API access. The `tweetclaw` tool sends structured API calls after authentication. Use `explore` before every live call. Confirm the route, target, limit, and account. Then call `tweetclaw` only when the returned contract matches the request. This split keeps endpoint discovery free and read-only. The `explore` tool is the safe first step. Inspect the catalog before calling an endpoint. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Find the endpoint for searching tweets about AI agents, then show the required parameters. ``` The `tweetclaw` tool can spend credits or read private account details. It can also perform write-like actions. Allow this optional tool explicitly. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} openclaw config set tools.alsoAllow '["explore", "tweetclaw"]' ``` OpenClaw plugins may stay hidden under restrictive tool profiles. The `tools.alsoAllow` config keeps existing coding tools and adds TweetClaw. ## Run OpenClaw Twitter workflows ### Search and read tweets An OpenClaw Twitter search starts with a bounded query. Ask `explore` for the tweet search route. Then pass the exact query and result limit to `tweetclaw`. Keep every tweet ID, author username, timestamp, metric, and cursor. Pass `next_cursor` back unchanged. Stop when `has_next_page` becomes false. Use timelines for one account's recent tweets. Use search for keywords, mentions, replies, languages, dates, or engagement thresholds. Private reads require an authorized X account. ### Export followers and replies Use extraction jobs for large follower, following, or reply exports. Estimate the job first. Confirm the target username, tweet ID, and maximum result count. Create the extraction only after approval. Poll its status endpoint until the job finishes. Store the extraction ID and every export URL. CSV supports spreadsheets, JSON keeps nested fields, and XLSX supports business handoffs. ### Monitor accounts and keywords Account monitors capture new tweets from selected profiles. Keyword monitors capture matching tweets for a stored query. Both create recurring usage. Approve the monitor definition before creation. Store its monitor ID. Replay events with the returned cursor. Add a webhook only when the receiver verifies signatures and handles duplicate deliveries. Treat an API rate limit separately from dependency failures. Keep completed tweet IDs and the current cursor. Resume only after the documented reset. ### Post tweets and replies To make OpenClaw post to Twitter, connect an X account first. Ask the agent to draft the exact text. Review the selected account, reply target, and media. Approve the structured call once. Send a unique `Idempotency-Key`. Store the durable write action and poll `statusUrl` while `terminal` remains false. An OpenClaw Twitter bot must not publish unattended posts. Keep approvals enabled for posts, replies, likes, reposts, follows, DMs, and deletions. ### Upload media and send DMs Tweet and reply actions accept public HTTPS image or MP4 URLs in `media`. Direct messages use an uploaded `mediaId` inside `media_ids`. Keep DM bodies outside shared logs and handoffs. Store only required resource IDs, action status, and retry guidance. Never resend a pending write. ## Workflow handoffs Use `explore` first. Then call `tweetclaw` for one intended endpoint, target, and limit. > [card] Tweet replies export > > Estimate `reply_extractor` with `targetTweetId`. Create the extraction and > poll `/api/v1/extractions/{id}`. Return CSV, JSON, and XLSX export URLs. > [card] Follower export > > Estimate `follower_explorer` with `targetUsername`. Create the extraction > and poll until completion. Export the job for CRM or warehouse import. > [card] Monitor webhook handoff > > Use `explore` to find monitor and webhook endpoints. Call `tweetclaw` for > `POST /api/v1/monitors` or `POST /api/v1/monitors/keywords`. Call > `POST /api/v1/webhooks` only after approval. Store its `secret` in a secret > manager. Receivers must verify `X-Xquik-Signature`. Store > `deliveryId` and `streamEventId`. Return `2xx` for accepted duplicates. > Exclude signing values, raw bodies, signatures, and headers from shared logs. > [card] Media tweets and DM attachments > > For tweets or replies, call `POST /api/v1/x/tweets` with public media URLs > in `media`. Store the durable action `id`, `status`, `billing`, `result`, > and `statusUrl`. Poll while `terminal` is false. Upload DM media first. > Pass the returned `mediaId` as the one-item `media_ids` value. Store the DM > action. Exclude full DM bodies. Leave `reply_to_message_id` unset. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use explore to find reply_extractor extraction endpoints. Estimate replies for tweet 1893704267862470862. Create the job with targetTweetId and resultsLimit 500 only if allowed. Return extraction id, status, poll URL, and CSV, JSON, and XLSX export URLs. ``` ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use explore to find follower_explorer extraction endpoints. Estimate followers for @username with resultsLimit 10000. Create the job only if allowed. Return extraction id, status, poll URL, and CSV, JSON, and XLSX export URLs. ``` ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use explore to find monitor and webhook endpoints. Create an account monitor or keyword monitor only after approval. Register the receiver URL with POST /api/v1/webhooks. Store the webhook secret in a secret manager. Verify X-Xquik-Signature, store deliveryId and streamEventId, and return 2xx for accepted duplicates. Keep endpoint signing values, raw request body, raw signature, and full headers out of chat logs and shared workflow outputs. ``` ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Use explore to find media write endpoints. For a tweet or reply, call POST /api/v1/x/tweets with media set to public HTTPS image or MP4 URLs. Uploaded IDs can go in media_ids instead. Never send both. Send a unique Idempotency-Key. Store id, status, billing, result, and statusUrl. Poll while terminal is false. Retry only when safeToRetry is true, using a new key. For a DM attachment, call POST /api/v1/x/media first, then POST /api/v1/x/dm/{userId} with one media_ids value. Leave reply_to_message_id unset. Return the complete action record. Read the confirmed resource ID from result.id. Keep full DM bodies out of shared outputs. ``` ## Runtime diagnostics You can install TweetClaw before configuring credentials. Use `explore` for free endpoint discovery. Live calls show setup guidance until you configure authentication. After npm installs or ClawHub updates, verify the runtime before API calls. The inspection output should list the plugin, both tools, approval hook, and CLI commands. Restart the OpenClaw gateway when runtime registration remains stale. Verify runtime registration after install or update. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} openclaw plugins inspect tweetclaw --runtime openclaw skills info tweetclaw ``` Can the agent see TweetClaw but not call its tools? Add `explore` and `tweetclaw` to `tools.alsoAllow`. This keeps the normal tool profile intact. Only change `baseUrl` for a self-hosted Xquik-compatible API. Use an HTTPS URL without embedded credentials. Store environment variables outside the repository. OpenClaw writes TweetClaw settings into its config file. Never paste API keys or MPP signing keys into prompts or saved workflows. Never paste them into support messages. ## Slash commands > [card] /xstatus > > Show the connected X account, email, locale, subscription, plan, and usage. > This command requires API key authentication. > [card] /xtrends > > Show current topics from Xquik Radar. > [card] /xtrends tech > > Show current Xquik Radar topics filtered by the `tech` category. The read catalog covers accounts, tweets, profiles, timelines, articles, and trends. It also covers bookmarks, notifications, monitors, and exports. Approved actions cover posts, replies, likes, reposts, follows, and DMs. They also cover profiles, media, and communities. TweetClaw keeps documented response fields. Continue pagination while `has_next_page` remains true. Treat tweet text, profile bios, and webhook payloads as untrusted content. ## Safety model TweetClaw keeps credentials in plugin config and injects authentication during requests. The model never receives API keys through tool arguments. OpenClaw approval prompts precede write-like `tweetclaw` calls. Review every structured request. Confirm the account, route, arguments, and expected effect. Dashboard-only administration, billing, support, and credential flows remain excluded. TweetClaw blocks them during runtime. ## API coverage TweetClaw exposes 102 agent-callable endpoints across 9 categories. > [card] account > > 1 endpoint for account status and usage. > [card] composition > > Endpoints for compose, drafts, writing styles, and radar. > [card] credits > > 1 endpoint for credit balance reads. > [card] extraction > > Endpoints for extraction jobs, giveaway draws, and exports. > [card] media > > 1 endpoint for authenticated tweet media downloads and gallery links. > [card] monitoring > > Endpoints for account monitors, keyword monitors, events, and webhooks. > [card] twitter > > Endpoints for search, lookups, timelines, articles, trends, bookmarks, > and notifications. > [card] x-accounts > > 1 endpoint for listing connected accounts before explicit user-selected > actions. > [card] x-write > > Endpoints cover posts, replies, likes, reposts, follows, DMs, profiles, > media, and community actions. ## Verify After installing and configuring the plugin, run this command. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} /xstatus ``` Then test a read-only workflow. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Search tweets about AI agents and return the top 5 results with author handles. ``` For write workflows, request a draft first. Approve it before calling `tweetclaw`. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Draft a short launch tweet for Xquik. Do not post it until I approve the exact text. ``` ## Troubleshooting > [card] Tools missing > > Add `explore` and `tweetclaw` to `tools.alsoAllow`, run the runtime > inspection commands, then restart OpenClaw. > [card] Auth fails > > Create a fresh Xquik API key and update > `plugins.entries.tweetclaw.config.apiKey`. > [card] MPP setup fails > > Install `mppx` and `viem`. Fund the MPP account. Call only the 7 direct MPP > operations. > [card] Monitor alerts missing > > Set `pollingEnabled` to `true` and keep `pollingInterval` at 60 seconds or > higher. > [card] Write approval required > > Review the structured request. Approve only the exact intended action and > account. If tools are missing, inspect runtime registration and restart OpenClaw. If authentication fails, replace the configured Xquik key. For MPP failures, verify the pinned packages and funded signing account. Missing monitor alerts usually indicate disabled polling. Keep the polling interval at 60 seconds or higher. Write approval prompts are expected. They are not runtime errors. ## OpenClaw Twitter questions ### Can OpenClaw use Twitter? Yes. TweetClaw provides catalog-backed Twitter operations through Xquik. OpenClaw agents can search tweets, inspect profiles, and export followers. They can also monitor accounts and request approved actions. ### Can OpenClaw read Twitter? Yes. Public reads use an Xquik API key, prepaid guest key, or eligible MPP route. Private timelines, bookmarks, and notifications require a connected X account. ### How do I connect OpenClaw to Twitter? Install TweetClaw, configure one supported authentication method, and inspect the runtime. Start with `explore`. Allow `tweetclaw` only when live API access is required. ### Is TweetClaw an OpenClaw Twitter skill? Yes. The package includes an OpenClaw Twitter skill and plugin runtime. The skill explains usage. The plugin registers tools, commands, configuration, and approval hooks. The package also provides an OpenClaw X Twitter skill for catalog-guided tasks. ### Is TweetClaw an OpenClaw Twitter plugin or MCP server? TweetClaw is an OpenClaw Twitter plugin. TweetClaw does not implement MCP. Remote MCP clients should connect directly to `https://xquik.com/mcp`. ### Can OpenClaw post to Twitter? Yes, after connecting an X account. Keep per-call approval enabled. Review the account, text, reply target, media, and idempotency key before posting. ### Can TweetClaw run read-only? Yes. Use `explore` for offline catalog search. Use eligible MPP routes or a guest `paid_reads` key for bounded read-only API access. ### How does TweetClaw handle API rate limits? Keep the completed tweet IDs and current cursor. Wait for reset guidance. Resume from the saved cursor without restarting the workflow. ### How do I update the OpenClaw Twitter integration? Run `openclaw plugins update tweetclaw`. OpenClaw reuses the tracked ClawHub or npm source. Exact npm pins remain fixed until you choose another version. ## References * [OpenClaw plugin CLI](https://docs.openclaw.ai/cli/plugins) * [Hermes Tweet for Hermes Agent](/guides/hermes-tweet) * [Xquik Billing](/guides/billing) * [MPP Quickstart](/mpp/quickstart) * [API Reference](/api-reference/overview) # How to Use Twitter Advanced Search Filters on X Source: https://docs.xquik.com/guides/twitter-advanced-search Use Twitter advanced search on X with filters or typed operators. Copy tested searches by account, phrase, date and likes, then export the matching tweets. > For the complete documentation index, see [llms.txt](/llms.txt). To use Twitter advanced search, open [x.com/search-advanced](https://x.com/search-advanced) and fill in the filters. You can also type search operators into the search box on X. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} nasa min_faves:1000 ``` That search returns posts about NASA with at least 1,000 likes. Xquik keeps the full, tested list of [Twitter advanced search operators](https://github.com/Xquik-dev/x-twitter-advanced-search). ## Use advanced search on X **1. Open advanced search** Open [x.com/search-advanced](https://x.com/search-advanced), or use the search box on X. **2. Add your filters** Fill in your words, accounts and dates. In the search box, type operators instead. **3. Pick Latest or Top** Latest lists the newest tweets first. Top shows the tweets X ranks highest. ## Search operators to copy | You want | Search | | - | - | | Tweets from 1 account | `from:NASA` | | Replies to an account | `to:NASA` | | Mentions of an account | `@NASA` | | An exact phrase | `"climate change"` | | Either of 2 words | `tesla OR rivian` | | A word without another word | `jaguar -car` | | A hashtag | `#photography` | | A stock or coin cashtag | `$TSLA` | | A language, by its 2-letter code | `ramen lang:ja` | | Tweets with at least 1,000 likes | `nasa min_faves:1000` | | Tweets with an image or video | `nasa filter:media` | | Tweets from verified accounts | `nasa filter:verified` | | Tweets without replies | `nasa -filter:replies` | | Tweets from a date onward | `from:NASA since:2026-10-01` | The operator list ran each of these examples on X on 2026-10-13. ## Search the tweets of 1 user Type `from:` and the username to see only that account's tweets. Add a keyword to narrow the list. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from:NASA mars ``` To limit the dates too, read [search tweets by date](/guides/search-tweets-by-date). ## Run and export the search in Xquik X shows results on screen only. To keep them, run the same search through the [X (Twitter) Advanced Search](https://xquik.com/en/twitter-advanced-search) page. * Filter by keyword, account, phrase, date and 65 languages. * Add minimum likes, media type, hashtags, cashtags and verified authors. * Exclude accounts, then sort by Latest or Top. * Export the tweets as CSV, Excel, JSON or Markdown. You can build and copy a search with no account. Running it on that page needs an Xquik account. Each returned tweet costs 1 credit, USD 0.00015 with pay-as-you-go credits. ## Advanced search questions ### Can I use X advanced search without an account? Yes. You can build and copy a search on the Xquik page with no account. Running it there needs an Xquik account. ### How do I find tweets from 1 account? Type `from:nasa` to find tweets from @nasa. Or fill in the account under the advanced filters. ### Which sort order should I pick? Latest lists the newest tweets first and suits date-ordered exports. Top shows the tweets X ranks highest. ### How far back does Twitter search go? X search goes back to March 2006. Read [Twitter archive search](/guides/twitter-archive-search) for old tweets. > [card] [Search operators](https://github.com/Xquik-dev/x-twitter-advanced-search) > > Every tested Twitter advanced search operator, with 1 example each. > [card] [Search tweets by date](/guides/search-tweets-by-date) > > Use since and until to read 1 day, month or year. > [card] [Search tweets API](/api-reference/x/search-tweets) > > Query parameters, filters, cursors, and response fields. > [card] [Pricing & billing](/guides/billing) > > Credits per result, plans, and top-ups. # Twitter Archive Search to Find Old Posts on X Source: https://docs.xquik.com/guides/twitter-archive-search Search the Twitter archive for old posts with until and from on X. X search goes back to March 2006. Copy dated searches, then export the old tweets you find. > For the complete documentation index, see [llms.txt](/llms.txt). Add `until:` and a past UTC day to search the Twitter archive on X. X search goes back to March 2006. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from:NASA until:2010-01-01 ``` That search returns posts by NASA sent before 2010. Every date operator is in Xquik's tested list of [Twitter advanced search operators](https://github.com/Xquik-dev/x-twitter-advanced-search). ## Search old posts on X **1. Open advanced search** Open [x.com/search-advanced](https://x.com/search-advanced), or use the search box on X. **2. Add your words and an end date** Type your words or an account, then add `until:` with a UTC day. **3. Pick Latest** Pick Latest to list the newest matching posts first, walking back from that day. ## Old-post searches to copy | You want | Search | | - | - | | An account's posts before 2010 | `from:NASA until:2010-01-01` | | Posts on a topic before 2010 | `nasa until:2010-01-01` | | An account's posts in 1 old year | `from:NASA since:2012-01-01 until:2013-01-01` | | Posts on 1 old day | `nasa since:2012-08-06 until:2012-08-07` | `since:` keeps posts sent on or after its UTC day. `until:` keeps posts sent before its UTC day. Read [search tweets by date](/guides/search-tweets-by-date) for every date operator. ## Save the old tweets you find X shows results on screen only. To keep them, paste the search into the [X (Twitter) Advanced Search](https://xquik.com/en/twitter-advanced-search) page. Pick a result limit, then export CSV, Excel, JSON or Markdown. Running a search there needs an Xquik account. Each returned tweet costs 1 credit, USD 0.00015 with pay-as-you-go credits. An empty search costs nothing. ## Archive search questions ### How far back does Twitter search go? X search goes back to March 2006. Set an end date, or type `until:2010-01-01` in the search box. ### Can I search the old tweets of another account? Yes, when the account is public. Add `from:` and its username to the search. ### Can I get an archive of my own tweets? Yes. X lets you request your own archive in your account settings. This guide covers search, which reads public posts from any account. ### Why can't I find an old tweet? The tweet may be deleted, or its account may be protected. Try fewer words, or widen the dates. > [card] [Search tweets by date](/guides/search-tweets-by-date) > > Use since and until to read 1 day, month or year. > [card] [Twitter advanced search](/guides/twitter-advanced-search) > > Filters and tested operators you can copy. > [card] [Tweet export](/guides/tweet-scraper-csv-export) > > Export search results to CSV with the API or an SDK. > [card] [Pricing & billing](/guides/billing) > > Credits per result, plans, and top-ups. # Twitter comment picker & retweet giveaway API Source: https://docs.xquik.com/guides/twitter-comment-retweet-picker Build Twitter comment, retweet, and hashtag picker entry lists from reply authors and retweeters. Keep all cursors, user IDs, filters, and selection proof. > For the complete documentation index, see [llms.txt](/llms.txt). Build reviewable giveaway entry lists from replies and retweets. Keep stable user IDs, Tweet IDs, cursors, filters, and checked timestamps. Then create one draw from the source Tweet URL and published filters. ## How does a Twitter comment picker work? A Twitter comment picker treats direct reply authors as potential entries. Use [Get Tweet Replies](/api-reference/x/tweet-replies) for reply text and authors. Page until `has_next_page` is `false`. Pass `next_cursor` back as `cursor`. Store every reply ID, author ID, text, timestamp, and source Tweet ID. Remove duplicate authors before selection when campaign rules require uniqueness. Apply only published keyword, hashtag, mention, language, and account filters. A random comment picker selects winners from the remaining stable user IDs. It cannot prove follows or retweets without separate API checks. ## How do I pick a winner from Twitter comments? A random Twitter comment picker retrieves every direct reply page. To pick a winner from Twitter comments, store each reply ID and author ID. Reject replies posted after the published closing time. A Twitter reply picker should freeze eligible user IDs before selection. Set the number of winners and backup winners once. Create one draw to pick a random winner from filtered reply entries. Use the [Twitter giveaway picker](/guides/twitter-giveaway-picker) with the source Tweet URL. Send every published filter in the original create request. Store those giveaway rules beside the returned draw ID. `GET /draws/{id}` does not repeat the create-time filters. After completion, export `type=winners` for stored winners and backups. Read those stored records instead of running another random selection. Search draw history when the create response is uncertain. One stored draw prevents conflicting random winners. Export the giveaway winner and every backup position. Never pick multiple winners through separate speculative draws. This winner selection process stays tied to the original reply evidence. ## How does a Twitter retweet picker verify entries? Use a Twitter retweet giveaway picker when published entry rules require reposts. A Twitter retweet picker reads stable user IDs from the retweeter list. Use [Get Retweeters](/api-reference/x/retweeters) to retrieve every available page. Store each retweeter ID, page cursor, source Tweet ID, and checked timestamp. Do not trust a displayed repost count as participant proof. Set `mustRetweet` only when the published rules require a repost. Join retweeter IDs with reply-author IDs when campaigns require both actions. Keep the join result beside both original entry sources. This record shows why each participant entered the winner pool. ## How does a Twitter hashtag giveaway picker work? A Twitter hashtag giveaway picker checks required hashtags in reply text. Use a specific hashtag only when published campaign rules require it. Store the matched reply ID, author ID, hashtag, and checked timestamp. Keep unmatched rows when an operator needs rejection evidence. Normalize hashtag comparisons according to the published campaign rules. Record original reply text beside every match and rejection. Keep letter case when the published rule requires exact matching. Hashtag text cannot prove follows or retweets. Run those checks separately. Apply all required checks before random selection begins. ## Can a comment picker verify likes? No. The Draws contract does not accept likes as an eligibility rule. Do not claim that a comment picker verifies likes. Use only documented follow, retweet, keyword, hashtag, mention, and account rules. The contract also supports documented language and unique-author conditions. It supports account-age and follower-count thresholds when campaigns publish them. Do not launch unsupported selection when likes define campaign entry. Rewrite rules around supported signals before the campaign opens. Never substitute replies for likes after participants enter. ## Combine comment and retweet checks 1. Store one source Tweet URL and numeric Tweet ID. 2. Retrieve every reply page and every retweeter page. 3. Normalize each participant to a stable X (Twitter) user ID. 4. Remove duplicates according to published uniqueness rules. 5. Apply required reply text and account filters. 6. Join required retweet and follow results by user ID. 7. Store accepted and rejected entries with reasons. 8. Create one draw with the source Tweet URL and published eligibility filters. Never change filters after the entry deadline. Never replace stable IDs with names. Repeat uncertain reads with the same Tweet ID, filter, and cursor. ## Store an entry audit row Keep one row for each checked participant and entry source. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweet_id": "1893704267862470862", "x_user_id": "9876543210", "reply_id": "1893705000000000000", "retweet_verified": true, "required_hashtag_verified": true, "verification_state": "eligible", "checked_at": "2026-05-24T19:30:00.000Z" } ``` Store cursor checkpoints outside participant rows. One checkpoint can resume each page. Keep private notes and API keys outside any public result URL. ## Next steps > [card] [Get tweet replies](/api-reference/x/tweet-replies) > > Page reply text and stable author IDs. > [card] [Get retweeters](/api-reference/x/retweeters) > > Page stable user IDs for repost checks. > [card] [Giveaway picker](/guides/twitter-giveaway-picker) > > Select winners and backup winners after verification. > [card] [Campaign verification](/guides/campaign-verification-workflow) > > Combine every campaign proof source. # Twitter data for research, datasets & run records Source: https://docs.xquik.com/guides/twitter-data-for-research Collect X (Twitter) data for research. Pull tweets by query & date, export CSV or JSON, then cite each run by job ID, query & row count. USD 0.00015 a tweet. > For the complete documentation index, see [llms.txt](/llms.txt). This guide shows how to build a tweet dataset with Xquik for a study. It covers cost, collection and the run record your methods section needs. ## What a tweet dataset costs [X's pricing docs](https://docs.x.com/x-api/getting-started/pricing), read on 2026-11-04, list USD 0.005 per post read. Xquik bills 1 credit per delivered tweet. A top-up credit costs USD 0.00015. | Dataset size | X API | Xquik | | - | - | - | | 10,000 tweets | USD 50 | USD 1.50 | | 100,000 tweets | USD 500 | USD 15 | | 2,000,000 tweets | USD 10,000 | USD 300 | Empty pages, duplicates and filtered rows cost nothing on Xquik. Check the price of a job before you run it with the [cost estimator](/api-reference/extractions/twitter-scraping-cost-estimator). ## Pull a small sample Each search call returns 1 page of tweets. Put the date window in the query with `since:` and `until:`. Days are UTC. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} from x_twitter_scraper import XTwitterScraper client = XTwitterScraper() page = client.x.tweets.search(q="heatwave lang:en since:2026-07-01 until:2026-07-08", limit=100) for tweet in page.tweets: print(tweet.id, tweet.created_at, tweet.text) ``` Continue with `next_cursor` until it is empty. Store tweet IDs so a rerun skips rows you already have. ## Collect a large dataset **1. Estimate the job** Send the query to the [cost estimator](/api-reference/extractions/twitter-scraping-cost-estimator) first. It returns `estimatedResults` and `creditsRequired`. **2. Start an extraction job** [Create an extraction](/api-reference/extractions/create) with `toolType` set to `tweet_search_extractor`. Pass your query as `searchQuery` and a cap as `resultsLimit`. **3. Wait for the job** Poll [Get Extraction](/api-reference/extractions/twitter-extraction-results) until the job finishes. Its `totalResults` field gives the row count. **4. Export the rows** Download the rows as CSV, JSON or XLSX with [Export Extraction](/api-reference/extractions/export). Use `sinceDate` and `untilDate` to keep one study window. ## Cite the run in your methods section Each extraction job keeps its own record. Copy these fields from Get Extraction into your notes. | Field | What it records | | - | - | | `id` | The job ID, which names the run | | `toolType` | The kind of collection | | `searchQuery` | The exact query the job ran | | `totalResults` | The number of rows collected | | `createdAt` | When the job started | | `completedAt` | When the job finished | Add the `sinceDate` and `untilDate` you exported with. A methods sentence can follow this template. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} We collected TOTAL_RESULTS posts matching SEARCH_QUERY from SINCE_DATE to UNTIL_DATE with Xquik extraction job ID, completed on COMPLETED_AT. ``` Keep the job ID and the tweet IDs with your data. Another team can then repeat the same query and window. ## Plan the study * Fix the query and window before you collect. A changed query is a new run with a new job ID. * Keep raw exports unchanged. Clean a copy, and record each cleaning step. * Follow your ethics board's rules for storing and sharing user data. > [card] [Search tweets by date](/guides/search-tweets-by-date) > > Set exact date windows with `since:` and `until:`. > [card] [Create an extraction](/api-reference/extractions/create) > > Start a bulk job for tweets, replies, followers or lists. > [card] [Export an extraction](/api-reference/extractions/export) > > Download rows as CSV, JSON or XLSX. > [card] [Python SDK](/sdks/python) > > Install the SDK and run your first search. # X (Twitter) Discord bot to post tweets in a channel Source: https://docs.xquik.com/guides/twitter-discord-bot Post each new tweet from an X (Twitter) account or search in Discord. Xquik uses a channel webhook, so no bot joins your server. Compare it with TweetShift. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik posts each new X (Twitter) post in a Discord channel. It sends them through a channel webhook, so no bot joins your server. This guide sets it up and compares it with TweetShift. New to Xquik? [Create an account](https://dashboard.xquik.com/en/signup?ref=docs-discord-bot) before the steps below. ## What arrives in Discord An account monitor checks 1 X account every second. A keyword monitor does the same for a search, a hashtag or a mention. Each match arrives in your channel as a Discord message. * The message names the account and the event, such as "New post". * It shows the post's text and links to the post on X. * Mentions in a post ping no one in your server. * Alerts that wait together come as 1 message. * A busy channel gets 5 quick messages, then 1 every 30 seconds. Each event keeps its own delivery. Discord can ask Xquik to slow down. The retry then waits as long as Discord asks. ## Set it up in the dashboard **1. Copy a Discord channel webhook** In your server's settings, open Integrations, then Webhooks. Make a new webhook, pick the channel and press Copy Webhook URL. Discord asks for the Manage Webhooks permission. **2. Add a monitor** Open [account monitors](https://dashboard.xquik.com/en/monitors/accounts) and press Add Account Monitor. Enter the X username. For a search or hashtag, use [keyword monitors](https://dashboard.xquik.com/en/monitors/keywords) instead. **3. Add the webhook** Open [webhooks](https://dashboard.xquik.com/en/monitors/webhooks) and press Add Webhook. Paste the Discord URL, then pick event types such as new posts. **4. Send a test** Send a test delivery from the webhook list. A test message then shows in the channel. Each webhook gets the event types you pick from every monitor on your account. Add a second webhook to send them to another channel too. ## Set it up with the API Create the monitor first. Store the `id` it returns. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/monitors \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "username": "NASA", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq ``` Then register the Discord channel webhook URL as a webhook. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "url": "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq ``` [Create monitor](/api-reference/monitors/create) and [Create webhook](/api-reference/webhooks/create) list every field and event type. ## Pick which posts arrive | Event type | What reaches the channel | | - | - | | `tweet.new` | Each new original post. | | `tweet.reply` | Each reply the account posts. | | `tweet.quote` | Each quote post. | | `tweet.retweet` | Each repost. | | `tweet.media` | Each post with media, such as a photo. | | `profile.name.changed` | A new display name. | | `profile.bio.changed` | A new bio. | Keyword monitors send tweet events only. Account monitors send tweet and profile events. ## Price Each active monitor costs 30 credits per hour, or 720 credits per day. Webhook and Discord deliveries are included. The USD 20 plan includes 140,000 credits a month. That keeps 6 monitors on all month. Pause a monitor to stop its hourly credits. Creating or resuming one needs at least 30 credits. ## TweetShift vs Xquik TweetShift is a Discord bot for X (Twitter) feeds. Its home page, read on 2026-11-20, says it posts tweets in channels or threads. It also lists keyword filters and a dashboard. | Area | TweetShift | Xquik | | - | - | - | | In your server | A bot you invite with an invite link. | A channel webhook. No bot joins the server. | | What it posts | An account's tweets. | Posts, replies, quotes, reposts and profile changes. | | Searches | Keyword filters on an account's feed. | Keyword monitors for any search, hashtag or mention. | | Other places | Discord channels and threads. | Discord, Telegram, Slack and signed webhooks. | | Setup | 1 bot command, then its dashboard. | The dashboard, or REST API, SDKs and MCP with 1 API key. | | Price | Its home page calls the service free. | 30 credits per active monitor hour. | ## Send the same alerts to Telegram or Slack A Slack incoming webhook URL works the same way as a Discord URL. For Telegram, press Connect Telegram on the webhooks page. Then press Start in @XquikBot. > [card] [Webhooks overview](/webhooks/overview) > > See every event type, retry and delivery field. > [card] [Account monitors](/api-reference/monitors/create) > > Create a monitor for 1 X account from code. > [card] [Keyword monitors](/api-reference/monitors/create-keyword) > > Watch a search, a hashtag or a mention. > [card] [Monitor billing](/guides/billing) > > Plan credits for each active monitor. # Twitter giveaway picker API for verified winners Source: https://docs.xquik.com/guides/twitter-giveaway-picker Select Twitter giveaway winners from checked replies, retweets, follows, keywords, hashtags, mentions, and account rules. Export entries and winner proof. > For the complete documentation index, see [llms.txt](/llms.txt). Use Xquik as a Twitter giveaway picker with reviewable entry checks. One draw stores filters, winners, backup winners, timestamps, and exports. It can also publish a result URL for participant review. ## What makes the best X (Twitter) giveaway picker? The best X (Twitter) giveaway picker records every published rule before selection. Store the source Tweet ID, winner count, backup count, and unique-author rule. Keep each follow, retweet, keyword, hashtag, mention, language, and account filter. Keep inspected entry IDs, selected winner IDs, status, and draw ID. Stable user IDs matter more than display names or handles. Avoid tools that return only winner names. Those names cannot prove eligibility. A useful giveaway tool exports inspected entries and selected winners separately. It also keeps a public result URL when campaigns require transparency. ## How do I automate a Twitter giveaway with an API? Write every campaign rule before collecting entries. Identify one source tweet. Define `winnerCount`, optional `backupCount`, and `uniqueAuthorsOnly`. Add only the filters shown to participants. Call [Create Draw](/api-reference/draws/create) once. Save the returned draw ID. Poll that draw until it completes or fails. Then export its records. Use `type=entries` for inspected participants. Use `type=winners` for selections. Treat an unknown create response as an investigation. Search draw history first. Do not create another draw because a client lost its local response. Keep API keys and private notes outside any public result record. ## Programmatic Twitter giveaway draw checklist 1. Store the source Tweet URL and numeric Tweet ID. 2. Record the entry closing time before collection starts. 3. Define the winner and backup counts. 4. Publish every required follow, retweet, keyword, hashtag, or mention. 5. Publish any language, account-age, or follower-count threshold. 6. Collect replies, retweeters, quotes, or followers. 7. Remove duplicate authors when rules require unique participants. 8. Apply every published rule before random selection. 9. Create one draw and save its ID immediately. 10. Export entries, winners, backup winners, filters, and timestamps. Never draw from an unchecked follower or reply snapshot. Exclude inactive or spam accounts only through published filters. High engagement does not reduce the proof requirements. ## How do I pick a winner from replies and retweets? A Twitter picker should build one eligible pool before it picks a winner. Start with one giveaway post and its numeric Tweet ID. Collect reply authors and retweeters through their separate paginated endpoints. Store each cursor beside the page it produced. Record the collection start and closing times. Reject late replies and retweets using the published closing boundary. Keep each rejected user ID with its failed check. Store no extra profile details unless a published filter needs them. When a Twitter contest requires both actions, join participants by stable user ID. Keep entries only when both source lists contain that ID. For a specific hashtag, check the original reply text. Store the matching reply ID and checked timestamp. Never infer hashtag compliance from aggregate engagement counts. A retweet picker alone can produce winners from retweets. It cannot confirm replies, follows, hashtags, or account thresholds. Run every published check before the draw selects any participant. Then freeze the eligible pool and create one draw. This sequence lets teams run giveaways without changing rules after closing. If the create response becomes uncertain, search draw history. Reuse the stored draw ID when the request succeeded. Never pick a winner through a second speculative draw. That duplicate draw could return a conflicting winner. Export inspected entries first, then export final winners. Compare their counts with the stored request. ## How does a Twitter random giveaway picker choose winners? A Twitter random giveaway picker filters entries before random selection. Set the number of winners and backup count in one request. The draw randomly selects eligible stable user IDs after every check. Never randomly pick from an unchecked follower, reply, or retweeter list. A Twitter giveaway winner picker should keep the starting entry count. Keep every selected user ID, position, backup flag, filter, and timestamp. Export the original request beside inspected entries and final winners. These records explain why each participant entered the eligible pool. ## How do I prove giveaway winners were eligible? Export `type=entries` and `type=winners` after the draw completes. Keep the draw ID, source Tweet ID, participant IDs, and applied filters. Record timestamps, verification states, winner positions, and backup flags. Share the public result URL when participants need reviewable proof. Reconcile exported user IDs with inspected entry counts before publishing. Keep rejection reasons for participants excluded by any published filter. Keep export filenames and formats with the campaign record. Do not publish API keys, private notes, or unnecessary participant details. Keep those records within the campaign audit. ## What should I publish with the winner? Publish the winner handle, giveaway tweet, and result URL when appropriate. Keep the verified user ID and draw ID in your private audit. Explain any published eligibility filter that affected selection. Never apply a rule that participants could not see. Publish the closing time, winner position, and backup status when required. Link results to the source tweet for participant context. Avoid publishing rejected entry details or complete participant exports. Keep those records within the private campaign audit. ## Next steps > [card] [Create draw](/api-reference/draws/create) > > Select winners with documented campaign rules. > [card] [Export draw](/api-reference/draws/export) > > Download inspected entries or selected winners. > [card] [Campaign verification](/guides/campaign-verification-workflow) > > Combine follows, retweets, replies, quotes, and audit rows. > [card] [Comment & retweet picker](/guides/twitter-comment-retweet-picker) > > Verify reply and retweet entry sources. # Twitter Media Viewer for Any Public X Account Source: https://docs.xquik.com/guides/twitter-media-viewer View the photos, videos and GIFs of a public X (Twitter) account with a Twitter media viewer. Enter a username, play each video, then download a ZIP of media. > For the complete documentation index, see [llms.txt](/llms.txt). A Twitter media viewer lists the photos, videos and GIFs of a public account. Enter a username in the [X (Twitter) Media Viewer](https://xquik.com/en/twitter-media-viewer) to see them. You can also open a profile on X and tap Media. The viewer adds downloads and exports. ## View an account's media **1. Open the media viewer** Open the [X (Twitter) Media Viewer](https://xquik.com/en/twitter-media-viewer) and sign in to Xquik. **2. Enter the account** Enter a username or profile link. A post link lists the media of its author. **3. Play or download the media** Play each video on the results page. Press Download under a file to save it. ## What you get Each row is 1 post with media. It shows the text, the post date, the media type and the file links. It adds the engagement counts. * Download ZIP saves 200 posts at a time. * The list exports to CSV. ## Media viewer questions ### Can I view Twitter media without an X account? Yes. You only sign in to Xquik. Public profiles need no connected X account. ### Does it work on private accounts? No. The media viewer reads public accounts only. ### Which media types does it find? Photos, videos and GIFs. Each row names its media type. ### Can I paste a post link? Yes. The viewer lists the media of that post's author. ### How do I download Twitter media? Run the viewer for the account. Then press Download ZIP on the results page, or press Download under a file. > [card] [Twitter advanced search](/guides/twitter-advanced-search) > > Find media posts by keyword with `filter:media`. > [card] [Pricing & billing](/guides/billing) > > Credits per result, plans, and top-ups. # X (Twitter) Telegram bot to get tweets in a chat Source: https://docs.xquik.com/guides/twitter-telegram-bot Get each new tweet from an X (Twitter) account or search in Telegram. Pick posts, replies or every event, then press Start in @XquikBot. See the steps. > For the complete documentation index, see [llms.txt](/llms.txt). @XquikBot sends each new X (Twitter) post from your monitors to a Telegram chat. You run no server and write no code. This guide sets it up from the dashboard or the API. New to Xquik? [Create an account](https://dashboard.xquik.com/en/signup?ref=docs-telegram-bot) before the steps below. ## What arrives in Telegram An account monitor checks 1 X account every second. A keyword monitor does the same for a search, a hashtag or a mention. Each match arrives as a message from @XquikBot. * The message shows the account and the event in bold. * It shows the post's text or the profile change, and a link. * With `tweet.media` on, a post with media arrives as 1 alert. * Alerts that wait together come as 1 digest. * A busy chat gets 5 quick messages, then 1 every 30 seconds. * Only the first message of a minute rings. The rest arrive silently. @XquikBot works in private chats. It answers in English, Spanish, Turkish, Japanese, Korean or Chinese, by your Telegram language. Other languages get English. ## Set it up in the dashboard **1. Add a monitor** Open [account monitors](https://dashboard.xquik.com/en/monitors/accounts) and press Add Account Monitor. Enter the X username. For a search or hashtag, use [keyword monitors](https://dashboard.xquik.com/en/monitors/keywords) instead. **2. Connect Telegram** Open [webhooks](https://dashboard.xquik.com/en/monitors/webhooks) and press Connect Telegram. Pick what the chat gets, from "New posts" to "Everything". **3. Press Start** Press Open Telegram, then Start in @XquikBot. The bot answers "Connected." and alerts start. A link works once, within 15 minutes. Make a new one if it expires. Connect again anytime to change what the chat gets. ## Set it up with the API Create the monitor first. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/monitors \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "username": "NASA", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq ``` Then ask for a Telegram link and open it. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks/telegram \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{"eventTypes": ["tweet.new", "tweet.reply"]}' \ | jq -r '.url' ``` The link looks like `https://t.me/XquikBot?start=...`. Omit `eventTypes` to get new posts only. [Connect Telegram](/api-reference/webhooks/telegram) lists every field. ## Control alerts from the chat | Command | What it does | | - | - | | `/stop` | Pauses alerts to this chat. | | `/status` | Shows whether alerts are on. | A new link turns alerts on again. The chat shows in your webhook list as `telegram:`. Deliveries, retries, resume and test deliveries work as for any webhook. ## Price Connecting a chat and its messages cost no credits. Each active monitor costs 30 credits per hour, or 720 credits per day. The USD 20 plan includes 140,000 credits a month. That keeps 6 monitors on all month. Pause a monitor to stop its hourly credits. Creating or resuming one needs at least 30 credits. ## Send the same alerts to Discord or Slack A Discord channel webhook or a Slack incoming webhook URL gets the same alerts. Add it on the webhooks page. > [card] [Discord alerts](/guides/twitter-discord-bot) > > Post each new tweet in a Discord channel. > [card] [Connect Telegram API](/api-reference/webhooks/telegram) > > Ask for a Telegram link from code. > [card] [Keyword monitors](/api-reference/monitors/create-keyword) > > Watch a search, a hashtag or a mention. > [card] [Monitor billing](/guides/billing) > > Plan credits for each active monitor. # Twitter Thread Unroll for Any Public Post on X Source: https://docs.xquik.com/guides/twitter-thread-unroll Unroll a Twitter thread from 1 post URL on X. Read each post and reply in 1 list, with its text, author and date. Save the thread as Markdown, PDF, CSV or JSON. > For the complete documentation index, see [llms.txt](/llms.txt). To unroll a Twitter thread, copy the URL of 1 public post from it. Paste it into the [X (Twitter) Thread Reader](https://xquik.com/en/twitter-thread-reader). Xquik returns the conversation as 1 list. ## Unroll a thread **1. Copy a post URL** Copy the URL of a public post from the thread on X. **2. Paste it into the thread reader** Open the [X (Twitter) Thread Reader](https://xquik.com/en/twitter-thread-reader) and paste the URL. **3. Read or save the thread** Read it top to bottom. Or export Markdown, PDF, CSV, Excel or JSON. Each row is 1 post or reply from the thread. It shows the text, the author and the date. It adds the likes, reposts and replies. ## Read a conversation on X On X, search `conversation_id:` with the ID of the post that started the conversation. The ID is the last part of that post's URL. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} conversation_id:2109320622882873464 ``` Xquik's list of [Twitter advanced search operators](https://github.com/Xquik-dev/x-twitter-advanced-search) ran this example on X on 2026-10-13. ## Thread unroll questions ### Do I need an X account to read a thread? No. Xquik reads public threads without your X account. You sign in to Xquik. ### Does it include replies? Yes. It returns the thread and its replies, up to your result limit. ### Can I save a thread as a PDF? Yes. Pick PDF when you export. Pick Markdown for notes you want to edit. ### Does it read threads from private accounts? No. It reads threads that anyone can see on X. > [card] [Read replies without an account](/guides/read-twitter-replies-without-account) > > Read and sort the replies to 1 public post. > [card] [Pricing & billing](/guides/billing) > > Credits per result, plans, and top-ups. # Test X (Twitter) webhooks, signatures & retry events Source: https://docs.xquik.com/guides/twitter-webhook-testing Test signed tweet, profile, and keyword monitor webhook deliveries with a local server, ngrok, or webhook.site. Verify HMAC signatures. Follow exact steps. > For the complete documentation index, see [llms.txt](/llms.txt). Test your webhook integration before deploying to production. Use Xquik's signed test delivery, local HTTPS tunnels, payload inspectors, and delivery logs. They let you verify handlers before real monitor events arrive. ## Test with Xquik first Use the [Test Webhook](/api-reference/webhooks/test) endpoint after you create a webhook. Xquik sends a real `webhook.test` delivery to the configured URL. It carries the same `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce` headers as production monitor events. `webhook.test` payloads contain `eventType`, `data.message`, and `timestamp`. They omit `deliveryId` and `streamEventId`. Use them for reachability and signature checks, not production deduplication. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks/15/test \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` **Response when your endpoint accepts the delivery.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": true, "statusCode": 200 } ``` **Response when your endpoint rejects the delivery.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": false, "statusCode": 500, "error": "HTTP 500" } ``` Check your server logs for the `webhook.test` payload. Verify the HMAC before processing it. Return a 2xx response only after your handler accepts the event. ## End-to-end handoff check Use a signed test delivery to prove the receiver can verify requests. Then use production monitor deliveries to prove idempotency and storage behavior. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "workflow": "signed_webhook_test_handoff", "webhook": { "webhook_id": "15", "url": "https://example.com/xquik/webhook", "event_types": ["tweet.new", "tweet.reply"], "secret_storage": "store_once" }, "test_delivery": { "endpoint": "/api/v1/webhooks/15/test", "event_type": "webhook.test", "has_delivery_id": false, "has_stream_event_id": false, "signature_headers": ["X-Xquik-Signature", "X-Xquik-Timestamp", "X-Xquik-Nonce"], "receiver_status": 200, "success": true }, "production_delivery": { "event_type": "tweet.new", "delivery_id": "502", "stream_event_id": "9002", "dedupe_keys": ["deliveryId", "streamEventId"], "return_status": "2xx_before_slow_work" }, "delivery_triage": { "endpoint": "/api/v1/webhooks/15/deliveries", "status": "failed", "attempts": 3, "last_status_code": 500, "last_error": "Internal Server Error" }, "event_context": { "endpoint": "GET /api/v1/events/{id}", "id_source": "streamEventId", "store": ["monitorId", "monitorType", "type", "occurredAt", "data"] }, "handoff_state": "verified_signature_then_join_event_context" } ``` > [card] Signature checkpoint > > Store the webhook `secret` once. Verify the raw body with > `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce`. Do this > before parsing or queueing the event. > [card] Test payload checkpoint > > Treat `webhook.test` as a signed reachability check. It includes > `eventType`, `data.message`, and `timestamp`, and omits `deliveryId` and > `streamEventId`. > [card] Production deduplication > > Use `deliveryId` for receiver retry deduplication. Use `streamEventId` when one > monitor event should process once across endpoint changes. > [card] Delivery triage > > Query `GET /api/v1/webhooks/{id}/deliveries` for `status`, `attempts`, > `lastStatusCode`, `lastError`, `createdAt`, and `deliveredAt`. Do this > before paging or replaying work. > [card] Event join > > Use delivery `streamEventId` as the `{id}` for > [Get Event](/api-reference/events/get). Store the event `monitorId`, > `monitorType`, `type`, `occurredAt`, and `data` with the receiver incident. ### Receiver replay row Store signed test deliveries separately from production delivery rows. A `webhook.test` row proves reachability and HMAC verification only. Production rows carry the IDs your receiver needs. It needs them for retry deduplication, event deduplication, and event detail joins. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "webhook_receiver_replay_check", "webhook_id": "15", "test_payload_has_ids": false, "production_delivery_id": "502", "production_stream_event_id": "9002", "signature_verified": true, "nonce_cache_key": "webhook:15:nonce_hash", "event_join": "GET /api/v1/events/9002", "delivery_log": "GET /api/v1/webhooks/15/deliveries", "shared_storage_excludes": [ "endpoint_signing_values", "raw_request_body", "raw_signature", "full_headers" ] } ``` Use this row after verification succeeds and before slow downstream work. Keep the raw body available for the HMAC check. Then limit what you store in shared systems. Store only the deduplication IDs, join route, verification state, and sanitized delivery context. ## Local testing with ngrok [ngrok](https://ngrok.com) creates a public HTTPS tunnel to your local server. Xquik can then deliver webhooks to your development machine. **1. Install ngrok** ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # macOS brew install ngrok # Linux curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok-v3-stable-linux-amd64.tgz \ | tar -xz -C /usr/local/bin # Authenticate (free account required) ngrok config add-authtoken YOUR_NGROK_TOKEN ``` **2. Start your local server** Run your webhook handler on a local port such as `:3000`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} node server.js # or: python app.py # or: go run main.go ``` **3. Start the ngrok tunnel** ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} ngrok http 3000 ``` ngrok outputs a public HTTPS URL. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Forwarding https://a1b2c3d4.ngrok-free.app → http://localhost:3000 ``` Copy the `https://` URL. **4. Create a webhook with the ngrok URL** ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "url": "https://a1b2c3d4.ngrok-free.app/webhook", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq ``` Save the `secret` from the response for signature verification. **5. Send a signed test delivery** Trigger a signed `webhook.test` request through the tunnel before waiting for real tweet events. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks/15/test \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Inspect your app logs and the ngrok web inspector at `http://localhost:4040`. **6. Trigger events** When a monitored account posts a tweet, Xquik delivers the event through ngrok. The event reaches your local server. Check your server logs and the ngrok web inspector at `http://localhost:4040`. > [!WARNING] > > ngrok URLs change every time you restart the tunnel (free plan). Update your webhook URL after each restart. Or use an ngrok plan above Free for stable subdomains. ## Testing with webhook.site Use [webhook.site](https://webhook.site) to inspect webhook payloads without running a local server. **1. Get a webhook.site URL** Visit [webhook.site](https://webhook.site). The site generates a unique HTTPS URL automatically. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} https://webhook.site/a1b2c3d4-e5f6-7890-abcd-ef1234567890 ``` **2. Create a webhook with the webhook.site URL** ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "url": "https://webhook.site/a1b2c3d4-e5f6-7890-abcd-ef1234567890", "eventTypes": ["tweet.new"] }' | jq ``` **3. View incoming payloads** When events arrive, they appear in the webhook.site dashboard in real time. Inspect headers (`X-Xquik-Signature`, `Content-Type`) and the JSON body. Check that the payload format matches your expectations. > [!NOTE] > > webhook.site is useful for inspecting payload structure. For testing signature verification and handler logic, use [ngrok with a local server](#local-testing-with-ngrok) instead. ## Sending test payloads Simulate a webhook delivery to your local handler without calling Xquik. This is useful for unit tests or offline debugging. For end-to-end verification of the configured webhook URL, prefer `POST /webhooks/{id}/test`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # Generate a test signature SECRET="your_webhook_secret_here" PAYLOAD=$(cat <<'JSON' {"eventType":"tweet.new","schemaVersion":1,"deliveryId":"502","streamEventId":"9002","occurredAt":"2026-02-24T14:22:00.000Z","username":"elonmusk","data":{"id":"1893456789012345678","text":"The future is now.","author":{"id":"44196397","userName":"elonmusk","name":"Elon Musk"},"isRetweet":false,"isReply":false,"isQuote":false,"createdAt":"2026-02-24T14:22:00.000Z"}} JSON ) TIMESTAMP=$(date +%s)000 NONCE=$(openssl rand -hex 16) SIGNATURE="sha256=$(printf '%s.%s.%s' "$TIMESTAMP" "$NONCE" "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET" | cut -d' ' -f2)" # Send to your local server curl -X POST http://localhost:3000/webhook \ -H "Content-Type: application/json" \ -H "X-Xquik-Timestamp: $TIMESTAMP" \ -H "X-Xquik-Nonce: $NONCE" \ -H "X-Xquik-Signature: $SIGNATURE" \ -d "$PAYLOAD" ``` **Test payload structure.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "tweet.new", "schemaVersion": 1, "deliveryId": "502", "streamEventId": "9002", "occurredAt": "2026-02-24T14:22:00.000Z", "username": "elonmusk", "data": { "id": "1893456789012345678", "text": "The future is now.", "author": { "id": "44196397", "userName": "elonmusk", "name": "Elon Musk" }, "isRetweet": false, "isReply": false, "isQuote": false, "createdAt": "2026-02-24T14:22:00.000Z" } } ``` Include `deliveryId` and `streamEventId` in offline fixtures so receiver idempotency tests match production deliveries. Test other event types by changing the `eventType` field. For example, set it to `tweet.reply`, `tweet.quote`, or `tweet.retweet`. ## Debugging delivery failures ### Check delivery status Query the [deliveries endpoint](/api-reference/webhooks/deliveries) to see delivery attempts and error details. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/webhooks/15/deliveries \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` **Response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "deliveries": [ { "id": "502", "streamEventId": "9002", "status": "failed", "attempts": 3, "lastStatusCode": 500, "lastError": "Internal Server Error", "createdAt": "2026-02-24T14:25:00.000Z" } ] } ``` Join `streamEventId` to [Get Event](/api-reference/events/get) to find the monitor event behind a failed delivery. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/api/v1/events/9002 \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` Store the event `monitorId`, `monitorType`, `type`, `occurredAt`, and `data`. Store them with the delivery `id`, `status`, `attempts`, `lastStatusCode`, and `lastError`. Do this before paging support, queue, or receiver owners. ### Reconcile missed deliveries Use delivery rows for receiver attempts and event pages for stored monitor history. The delivery `streamEventId` is the event `id`. A failed receiver can rebuild its downstream queue from stored events. It can do so after you fix the handler. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "webhook_delivery_reconciliation", "delivery_endpoint": "GET /api/v1/webhooks/15/deliveries", "event_backfill_endpoint": "GET /api/v1/events?limit=100&cursor={nextCursor}", "join_key": "delivery.streamEventId == event.id", "store": ["deliveryId", "streamEventId", "status", "attempts", "eventId", "nextCursor"], "next_action": "rebuild_receiver_queue_after_handler_fix" } ``` Store `nextCursor` after each event page. Continue with `GET /api/v1/events?limit=100&cursor={nextCursor}` until `hasMore` is `false`. Then compare event IDs with delivery `streamEventId` values before replaying your own downstream work. ### Delivery statuses > [card] pending > > Not sent yet. It may wait while your endpoint is failing. Check recent > deploys, tunnel uptime, and receiver availability. > [card] delivered > > Your endpoint returned `2xx`. Confirm your handler verified the signature > and stored the event before it returned success. > [card] failed > > The latest attempt failed. Xquik retries with backoff until your endpoint > returns `2xx` or 30 days pass. Inspect `lastStatusCode`, `lastError`, and your receiver > logs. > [card] exhausted > > 30 days passed without a `2xx`. `lastError` says why. Read the event with > `GET /api/v1/events/{id}`. ### Common failure reasons > [accordion] Slow response > > Respond within 10 seconds. If your handler is slow, return `200` immediately. Then process the event asynchronously in a background job queue. > [accordion] Non-2xx response > > Any response outside the 200-299 range counts as a failure. Check your server logs for unhandled exceptions or validation errors in your handler. Common causes include missing middleware like `express.raw()`, JSON parse errors, or database connection failures. > [accordion] DNS resolution failure > > Xquik could not resolve the webhook URL hostname. Verify your domain DNS records are correct. If using ngrok, confirm the tunnel is still running. > [accordion] TLS/SSL errors > > Webhook URLs must use HTTPS with a valid certificate. Xquik rejects self-signed certificates. Use a trusted CA (Let's Encrypt, Cloudflare) or ngrok for local development. > [accordion] Connection refused > > The target server is not accepting connections. Verify your server is running and listening on the correct port. Check firewall rules if running on a cloud provider. > [accordion] Signature verification failing > > Compute the HMAC over the raw request body bytes, not a re-serialized JSON object. Re-serialization can alter whitespace or key ordering. Use `express.raw()` in Node.js, `request.get_data()` in Flask, or `io.ReadAll(r.Body)` in Go. > [card] [Webhooks overview](/webhooks/overview) > > How webhooks work, delivery format, and retry policy. > [card] [Signature verification](/webhooks/verification) > > HMAC-SHA256 verification in Node.js, Python, and Go. > [card] [Deliveries API](/api-reference/webhooks/deliveries) > > Query delivery attempts and statuses. # X (Twitter) API versioning & deprecation policy Source: https://docs.xquik.com/guides/versioning How Xquik's v1 X (Twitter) API stays compatible and what notice breaking removals get. Which Deprecation & Sunset headers mark deprecated fields & parameters. The Xquik REST API is v1, and v1 stays compatible. We add fields, parameters & endpoints without notice. Your client should ignore fields it doesn't know. This policy has applied since 2026-08-26. ## Notice for breaking removals * We announce a breaking removal at least 90 days before it happens. * A deprecated part keeps working until its removal date. * The [changelog](/changelog) announces each new deprecation & removal. The tables below list today's with their dates. * OpenAPI marks each deprecated operation, parameter & field `deprecated: true`. ## Exceptions * If X stops running a feature, no request can return its data. Xquik then answers 424 right away & charges nothing. * A security or legal emergency may shorten the notice. * The changelog explains each exception. ## Headers on deprecated requests A request with a deprecated query parameter or search filter gets these headers. `GET /api/v1/account` sends them too, because its answer still has `monitorsAllowed`. OpenAPI declares them on each success answer that sends them. | Header | Example | Meaning | | - | - | - | | `Deprecation` | `@1777420800` | The Unix time of the deprecation, as [RFC 9745](https://www.rfc-editor.org/rfc/rfc9745) defines. | | `Link` | `; rel="deprecation"; type="text/markdown"` | This policy in Markdown. | | `Sunset` | `Fri, 15 Jan 2027 00:00:00 GMT` | The removal date, as [RFC 8594](https://www.rfc-editor.org/rfc/rfc8594) defines. Sent once set. | Log these headers in your client. A `Deprecation` header means a change is due. A `Sunset` header gives the date. ## Scheduled removals | Request | Deprecated item | Use instead | Since | Removal | | - | - | - | - | - | | `POST /api/v1/extractions` & `POST /api/v1/extractions/estimate` | `excludeSource`, or `-source:` or `-within:` in a query | Nothing. X ignores them, so rows come back unfiltered | 2026-10-11 | 2027-01-15 | From 2027-01-15 such an extraction answers 424 `search_unavailable` & charges nothing. ## Deprecated with no removal date | Request | Deprecated item | Use instead | Since | | - | - | - | - | | `GET /api/v1/account` | `monitorsAllowed` in the response | Nothing. Monitor slots are unlimited | 2026-07-13 | | `GET /api/v1/extractions/{id}` | `includeRaw` parameter | `outputMode=raw` | 2026-08-09 | | `GET /api/v1/x/users/{id}/followers` & `/following` | `after` parameter | `cursor` | 2026-04-29 | | `GET /api/v1/x/users/{id}/verified-followers` | `after` parameter | `cursor` | 2026-08-09 | | `GET /api/v1/x/lists/{id}/followers`, `/members` & `/tweets` | `after` parameter | `cursor` | 2026-09-29 | | `GET /api/v1/x/tweets/{id}/replies` | `after` parameter | `cursor` | 2026-09-29 | OpenAPI is the full list. It marks a few more fields deprecated that send no header. `POST /api/v1/compose` ignores `hasLink`. It returns `radarRecommendations` & `examplePatterns` empty. Monitor events keep `userName` & `rawVerified`. Read `username` & `verified` instead. ## Check your integration 1. Search your code for the items in the tables above. 2. Watch for `Deprecation` & `Sunset` headers in responses. 3. Read the [changelog](/changelog) before each upgrade. Read [this policy as Markdown](https://xquik.com/deprecation-policy.md). # X API workflows for tweets, followers & webhooks Source: https://docs.xquik.com/guides/workflows Choose workflows for tweet lookup, search, follower export, profile monitors, signed webhooks, MCP agents, file exports, or DMs. Includes exact API steps. > For the complete documentation index, see [llms.txt](/llms.txt). Choose a workflow for dashboards, webhooks, agents, exports, or content. Open its API examples. Run the [API checklist](/guides/x-api-integration-checklist) before launch. > [card] Monitor & poll > > Batch processing, dashboards, and low-frequency checks. Interval-based, low setup effort. > [card] Signed monitor webhooks > > Alerts, queues, support triage, and warehouse sync. Medium setup effort. > [card] AI agent (MCP) > > Tweet search, user lookups, follower checks, and research summaries. Low setup effort. > [card] Publish tweet or reply > > Post tweets, post tweet replies, and hand off public media URLs. Low setup effort. > [card] Tweet composition > > Draft generation and reply monitoring. Low setup effort. ## Choose a workflow > [card] Track competitor or brand posts > > Use monitor polling or webhooks. Both return tweets, replies, quotes, and retweets. > [card] Send monitor alerts > > Use signed webhooks. They deliver event payloads to queues or support tools. > [card] Build an AI research assistant > > Use the MCP path. It returns tweet search results, user profiles, and monitor events. > [card] Export followers or audiences > > Use extraction workflows. They return CSV, JSON, XLSX, or paginated JSON. > [card] Sync followers to CRM > > Use the follower export CRM workflow. It returns CSV, XLSX, JSON, and a CRM field map. > [card] Post a tweet or reply > > Use the create tweet workflow. It returns published `tweetId`, `success`, `charged`, and `chargedCredits`. > [card] Score and refine a draft tweet > > Use tweet composition. It returns algorithm guidance, refined text, and score. > [card] Audit giveaway activity > > Use draws. They return eligible participants, winners, and archived tweet metrics. ## Use-case endpoint finder Start here when a user asks which Xquik endpoint to call. Pick the matching job, then open the API page for params, responses, and examples. * **One tweet by ID.** `GET /x/tweets/{id}`. Hand off a tweet row with media and metrics. * **Many known tweet IDs.** `GET /x/tweets`. Hand off the batch response before single-tweet loops. * **Keyword or advanced search.** `GET /x/tweets/search`. Hand off cursor pages, or `tweet_search_extractor` exports. * **Profile timeline.** `GET /x/users/{id}/tweets`. Hand off `cursor`, `includeReplies`, and `includeParentTweet`. * **Article body.** `GET /x/articles/{tweetId}`. Hand off body blocks, cover image, author, and not-found handling. * **Replies, quotes, or threads.** `GET /x/tweets/{id}/replies`. Hand off conversation rows from replies, quotes, or threads. * **Follower or following page.** `GET /x/users/{id}/followers` or `GET /x/users/{id}/following`. Hand off `users`, `has_next_page`, and `next_cursor`. * **Follower or following export.** `POST /extractions/estimate`. Hand off the `follower_explorer` or `following_explorer` estimate, job, CSV, JSON, or XLSX. * **Campaign verification.** `GET /x/followers/check`, retweeters, replies, quotes, or draws. Hand off proof exports. * **Post tweet or reply.** `POST /x/tweets`. Hand off `tweetId`, write status, credits, and public media URLs. * **Direct messages.** `GET /x/dm/{userId}/history`. Hand off history, cursor state, outbound `messageId`, and success. * **1-second monitoring.** `POST /monitors` or `POST /monitors/keywords`. Hand off signed payloads and delivery IDs. * **AI agent handoff.** `xquik.request(...)`. Hand off normalized Xquik API results for MCP clients. * **Saved file exports.** `GET /extractions/{id}/export`. Hand off CSV, JSON, XLSX, Markdown, PDF, or TXT. ## Integration handoff matrix Use this matrix before choosing code, webhooks, MCP, or exports. > [accordion] Competitor or brand monitoring > > Setup needs an API key, an account username or keyword query, and event types. > First, call `POST /monitors` for accounts or `POST /monitors/keywords` for search queries, then `GET /events`. > It returns tweet, reply, quote, and retweet events. > Hand off a polling cursor or signed webhook payload. > Active monitors bill 30 credits per hour while enabled. > [accordion] Monitor alert routing > > Setup needs a webhook URL and subscribed event types. > First, call `POST /webhooks`, then `POST /webhooks/{id}/test`. > It returns the delivery status and signed event body. > Hand off to a queue, Slack, CRM, or warehouse endpoint. > Active monitor billing includes webhook management and deliveries. > [accordion] AI research agent > > Setup needs an MCP API key or OAuth. > First, call `xquik.request('/api/v1/x/tweets/search')`. > It returns tweets, profiles, and monitor events. > Hand off the MCP tool result with normalized pagination. > Tweet search, profile lookup, and follower exports use endpoint credits. > [accordion] Audience export handoff > > Setup needs a target username, `follower_explorer` or `following_explorer`, and optional `resultsLimit`. > First, call `POST /extractions/estimate`, then `POST /extractions`. > It returns job status, rows, and export links. > Hand off CSV, JSON, XLSX, or paginated JSON. > Estimate the cost before creating the job. > [accordion] Tweet replies export > > Setup needs a tweet ID and optional `resultsLimit`. > First, call `POST /extractions/estimate` with `reply_extractor`. > It returns reply author fields, reply tweet fields, engagement counts, and metadata. > Hand off CSV, JSON, XLSX, JSONL, or moderation queue rows. > Each reply returned or extracted costs 1 credit. > [accordion] Post tweets or replies > > Setup needs a connected X account plus text, media URLs, or parent tweet ID. > First, call `POST /x/tweets`. > It returns `tweetId`, `success`, `charged`, and `chargedCredits`. > Hand off the published tweet ID and charged credits. > Use them for queue, CRM, CMS, or agent state. > A text-only post costs 30 credits. Attached media adds 2 credits per started MB. > [accordion] Tweet draft workflow > > Setup needs a topic, goal, tone, and optional style username. > First, call `POST /compose` with `step`. > It returns algorithm guidance, refined draft, and score checklist. > Hand off draft text or an X (Twitter) compose URL. > Compose, refine, and score cost no credits. ## High-value workflows first Prioritize rows for analysts and IDs for systems of record. Also prioritize events for queues and published action IDs for audit trails. > [card] 1. Scrape tweets to CSV, JSON, or XLSX > > Exports matching tweets as rows for research, leads, support, and AI retrieval. > First, call `POST /extractions/estimate` with `tweet_search_extractor`. > Hand off an export file, paginated JSON, or a direct `GET /x/tweets/search` page. > Each tweet returned or extracted costs 1 credit. > [card] 2. Scrape tweet replies to CSV, JSON, or XLSX > > Exports a post's replies as rows for moderation, support, giveaways, research, or AI review. > First, call `POST /extractions/estimate` with `reply_extractor` and `targetTweetId`. > Hand off an export file, paginated JSON, JSONL rows, or a direct `GET /x/tweets/{id}/replies` page. > Each reply returned or extracted costs 1 credit. > [card] 3. Export followers or following to CRM > > Builds audience and interest tables with stable X user IDs for import and upsert. > First, call `POST /extractions/estimate` with `follower_explorer` or `following_explorer`. > Hand off CSV, JSON, XLSX, or a CRM field map keyed by `x_user_id`. > Each user returned costs 1 credit. > [card] 4. Monitor tweets to signed webhooks > > Delivers new posts, replies, quotes, and retweets to queues without polling. > First, call `POST /monitors` for accounts or `POST /monitors/keywords` for search queries, then `POST /webhooks`. > Hand off a signed payload with `deliveryId`, `streamEventId`, `eventType`, and tweet data. > Each active monitor-hour costs 30 credits. The rate includes webhook delivery. > [card] 5. Post media tweets or replies > > Publishes media tweets or replies from public image URLs or 1 public MP4 URL. > The MP4 can be up to 100 MB. > First, call `POST /x/tweets` with `media`. > Hand off `tweetId`, `success`, `chargedCredits`, original `media` URLs, and optional `reply_to_tweet_id`. > A text-only post costs 30 credits. Attached media adds 2 credits per started MB. > [card] 6. Send direct messages with returned IDs > > Lets support, sales, and agents store the outbound message ID. > First, call `GET /x/users/{id}` if needed. Use `GET /x/dm/{userId}/history?account=...`, then `POST /x/dm/{userId}`. > Hand off `account`, `messages`, `has_next_page`, `next_cursor`, `messageId`, and `success`. > Each user lookup or history message costs 1 credit. Each DM send costs 10 credits. ### 1. Scrape tweets to CSV, JSON, or XLSX Use this to scrape tweets, search tweets, or export hashtag results. You can also use it to hand matching posts to analysts. Estimate first, create the job, poll it, then export the format your system expects. For reply-specific exports, use the next workflow. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions/estimate \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "toolType": "tweet_search_extractor", "searchQuery": "from:username webhook OR SDK", "language": "en", "resultsLimit": 500 }' | jq ``` The extraction returns a job ID. `GET /extractions/{id}` returns `job`, `results`, `hasMore`, and `nextCursor`. `GET /extractions/{id}/export?format=csv` downloads the rows. For live pagination without a stored job, call `GET /x/tweets/search` with `q`. Leave `limit` unset for a simple cursor loop. Or set `limit` for a bounded pull. Then keep the same `q`, filters, and `limit` while sending `next_cursor` as `cursor`. It returns `tweets`, `has_next_page`, and `next_cursor`. ### 2. Scrape tweet replies to CSV, JSON, or XLSX Use this when a system needs every reply under a post as rows. It fits moderation, support, giveaway, research, or AI review systems. Estimate with `reply_extractor` and `targetTweetId`, create the job, and poll it. Then export `format=csv`, `format=json`, or `format=xlsx`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions/estimate \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "toolType": "reply_extractor", "targetTweetId": "1893704267862470862", "resultsLimit": 500 }' | jq ``` `GET /extractions/{id}` returns reply rows, `hasMore`, and `nextCursor`. Pass `nextCursor` as `cursor` for more stored results. For live pagination without a stored job, call `GET /x/tweets/{id}/replies`. Then pass `next_cursor` back as `cursor`. Store `tweets`, `has_next_page`, and `next_cursor`. ### 3. Export followers or following to CRM Use this for follower export, following export, audience ownership, CRM import, or warehouse sync. Keep `resultsLimit` on estimate and create calls for a predictable credit cap. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/extractions \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "toolType": "follower_explorer", "targetUsername": "username", "resultsLimit": 10000 }' | jq ``` When the job needs accounts the user follows, use `following_explorer`. It takes the same `targetUsername` shape. After `status` becomes `completed`, export `format=csv`, `format=xlsx`, or `format=json`. Map stable `User ID` values to `x_user_id`. Do not key imports by display name. ### 4. Monitor tweets to signed webhooks Use this for account alerts, keyword alerts, support routing, warehouse ingest, or queue fanout. It fits workflows that need them within seconds. Create an account monitor or keyword monitor, then register the webhook URL. Test delivery, then process signed events asynchronously. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/monitors \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "username": "username", "eventTypes": ["tweet.new", "tweet.reply", "tweet.quote"] }' | jq ``` For query alerts, call `POST /monitors/keywords` with `query` and `eventTypes` instead of `username`. Account and keyword monitors both check every 1 second while active. Both can deliver events to the same signed webhooks. Each POST has 1 event. Multiple matches produce multiple POSTs. Payloads include durable IDs. Store `deliveryId` for delivery-level idempotency. When you must process each monitor event once across retries or endpoints, store `streamEventId`. Store the one-time `secret` returned by `POST /webhooks`. Verify `X-Xquik-Signature` against the raw body before accepting the event. Return `2xx` before slow CRM, Slack, warehouse, or queue work starts. #### Receiver storage handoff For Zapier, Make, and Pipedream receivers, map production payload IDs before enqueueing slow work. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "workflow_webhook_receiver_parity", "delivery_id": "502", "stream_event_id": "9002", "event_type": "tweet.new", "occurred_at": "2026-02-24T14:22:00.000Z", "duplicate_delivery_status": "2xx", "duplicate_event_status": "2xx", "event_join": "GET /api/v1/events/9002", "shared_storage_excludes": [ "endpoint_signing_values", "raw_request_body", "raw_signature", "full_headers" ] } ``` Return `2xx` for duplicate `deliveryId` or `streamEventId` after signature verification. Store raw request bytes only long enough to verify `X-Xquik-Signature`. Do not put endpoint signing values or raw body in shared workflow rows. Do not put raw signature or full headers there either. ### 5. Post media tweets or replies Use this when an agent or app needs to post a tweet or reply. It applies to public image URLs or exactly 1 public MP4 video URL. The video can be up to 100 MB. Pass those URLs directly in the `media` array on `POST /x/tweets`. Do not call `POST /x/media` first for tweet posts when the media is already public. For a local file, upload it first. Then send its `mediaId` in `media_ids`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/tweets \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "account": "brand_account", "text": "Product screenshot from today", "reply_to_tweet_id": "1893456789012345678", "media": ["https://example.com/product-screenshot.png"] }' | jq ``` The response is a durable action record. Store `id`, `status`, `billing`, `result`, `request.hash`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new `Idempotency-Key`. Store media URLs with the action record. Text-only tweet or reply writes cost 30 credits. Attached media adds 2 credits per started MB across all files. Use `POST /x/media` for local files, then pass its `mediaId` in `media_ids`. [DMs](/api-reference/x-write/send-dm) take exactly 1 media ID. ### 6. Send direct messages with returned IDs Use this when a workflow needs direct messages with audit trails. It fits support, sales, or agent workflows. Look up the recipient user ID. Pass the same connected sender as `account` for history reads and DM writes. Then store returned message IDs. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/dm/987654321/history \ --data-urlencode "account=brand_account" \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` History reads require `account`. That connected account must participate in the conversation. Missing `account` returns `400 account_required`. A non-participant account returns `403 dm_not_permitted`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/dm/987654321 \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "account": "brand_account", "text": "Thanks for reaching out. Here is the next step." }' | jq ``` `GET /x/dm/{userId}/history` returns `messages`, `has_next_page`, and `next_cursor`. Pass `next_cursor` back as `cursor` for older messages. `POST /x/dm/{userId}` returns `messageId` and `success`. Store both on the support ticket, CRM note, or agent state. ## Focused workflow pages Choose a path, then open its examples, SDK guidance, and error recovery. > [card] [Tweet search exports](/guides/tweet-scraper-csv-export) > > Build CSV, JSON, or XLSX exports from `tweet_search_extractor`, or use direct `GET /x/tweets/search` pagination. > [card] [Tweet replies exports](/guides/tweet-replies-export) > > Turn a post conversation into `reply_extractor` jobs or direct replies pagination. You can also turn it into JSONL rows or moderation queues. > [card] [Follower CRM export](/guides/follower-export-crm) > > Estimate `follower_explorer`, export CSV, JSON, or XLSX files, and map stable `x_user_id` fields. > [card] [Campaign verification](/guides/campaign-verification-workflow) > > Check social actions and draw exports. > [card] [Monitor webhooks](/guides/twitter-webhook-testing) > > Test signed deliveries and verify `X-Xquik-Signature`. Store `deliveryId` and `streamEventId`. Return `2xx` before slow work. > [card] [Media tweets and DMs](/guides/media-upload-workflow) > > Use public URLs in tweet `media`, or upload files for tweet and DM `media_ids`. > [card] [Direct messages](/guides/direct-message-workflow) > > Read DM history with `account`, send DMs, and store returned `messageId` values. > [card] [MCP agents](/mcp/overview) > > Connect agents, call `xquik.request(...)`, and hand normalized pagination back to memory. > [card] [Tweet composition](/api-reference/compose/create) > > Use `POST /compose` for compose, refine, and score loops without usage credits. ## Public draw results Completed giveaway draws have a public results page at `https://xquik.com/results/{drawId}`. The page needs no authentication. Share the URL so participants can check the winners. > [card] [Create a monitor](/api-reference/monitors/create) > > Start 1-second checks for one account. > [card] [Register a webhook](/api-reference/webhooks/create) > > Receive detected events through signed webhooks. > [card] [MCP server](/mcp/overview) > > Connection details and setup instructions. > [card] [Signature verification](/webhooks/verification) > > Verify webhook payloads with HMAC-SHA256. # X (Twitter) API rate limits, errors & webhook events Source: https://docs.xquik.com/guides/x-api-integration-checklist Handle Xquik REST API auth, pagination, HTTP errors, and X (Twitter) API rate limits. It covers webhook events, durable writes, and normalized responses. > For the complete documentation index, see [llms.txt](/llms.txt). Use this production checklist with Xquik. It covers X (Twitter) API rate limits, REST API calls, and error responses. It also covers cursor pagination and signed webhook events. Apply its API error handling rules before launching a client, workflow, or agent. Use API pagination for complete tweet, follower, reply, and event collections. Branch on HTTP status codes. Protect durable API writes with idempotency keys and status polling. ## Integration readiness checklist Use this checklist before connecting production clients, workflow builders, or agents to the API. > [card] Authentication > > Send a full account key or OAuth token for account operations. Use an active guest key on its paid reads. Use direct MPP only on its fixed-price operations. Handle the documented `401` and `402` contracts separately. > [card] Response contract > > Default REST examples use the v1 shape. `xquik-api-contract: 2026-04-29` gives snake_case, date-time fields as Unix seconds, structured errors, `has_more`, and `next_cursor`. Send it when your client expects those. The API MCP server sends this contract automatically. > [card] Pagination > > Use `cursor` with `nextCursor` on events, draws, and extractions. Use `after` on Radar. Use `afterCursor` on drafts. Use `cursor` with `next_cursor` on X endpoints. Deduplicate stable IDs and reject repeated cursors. > [card] Billing > > Handle `402 no_credits` and `402 insufficient_credits`. Treat every `payment_options` action as an offer. Ask the user to select an amount and explicitly confirm before creating checkout. > [card] Rate limits > > Respect `Retry-After`. Read calls allow 500 per 1s. Writes allow 120 per 60s. Deletes allow 60 per 60s. Back off after repeated `429 rate_limit_exceeded` responses. > [card] Durable writes > > Send a unique `Idempotency-Key`. Store the returned action. Poll `statusUrl` while `terminal` is `false`. Retry only when `safeToRetry` is `true`, using a new key. ## Validate every HTTP request Match each HTTP request to its documented API endpoint. Use the listed HTTP methods, path parameters, query parameters, and headers. Send `GET` for reads. Use `POST` requests for creation and actions. Use `PATCH` or `PUT` for supported updates. Send `DELETE` only for documented removal routes. Validate required values before sending the REST API call. Confirm X (Twitter) usernames, tweet IDs, list IDs, community IDs, and monitor IDs. Check numeric limits and allowed enum values. Reject an empty search query on the client side. These checks reduce avoidable `400 Bad Request` responses. Send JSON writes with `Content-Type: application/json`. Encode the request body once. Never send secrets in query parameters. Put account keys in `x-api-key` or `Authorization`. Store webhook secrets outside the request body. Check the complete URL before release. The base URL is `https://xquik.com/api/v1`. Keep the version segment in every API endpoint. Do not send production credentials to test hosts. ## Classify API responses Read the HTTP status code before parsing API responses. A successful response does not always use `200`. Creation routes can return `201`. Accepted work can return `202`. Durable actions can return a status URL for later polling. Handle each failure class separately. * `400` means the path, query, or request body failed validation. * `401` means authentication is missing or invalid. * `402` means billing access or credits need attention. * `404` means the requested tweet, profile, monitor, or resource is unavailable. * `424` or `502` means a read dependency failed temporarily. * `429` means the current method bucket reached its limit. Keep the machine-readable error code with each failed request. Show human-readable error messages where a person must act. Never replace exact codes with guessed messages. When an error occurs, inspect the code before choosing a retry. ## Separate client and server errors Fix client-side errors before retrying. A repeated invalid query produces the same response. Correct the field, type, identifier, or authentication header. Do not hide validation failures behind automatic retries. Treat temporary server errors differently. Retry `424` and `502` failures with bounded exponential backoff. Stop after the configured attempt limit. Return the final failure with its original status and error code. Never retry every `4xx` response. A `401` needs a valid credential. A `402` needs an explicit billing choice. A `404` may require a different tweet or profile ID. A `429` must wait for `Retry-After`. Keep request context without logging secrets. Record the method, route, status, retry count, and returned code. Remove API keys, bearer tokens, webhook secrets, cookies, and payment credentials. ## Page through tweets, followers & replies API pagination uses opaque cursors. Store each cursor exactly as returned. Never decode, trim, or construct it. Use stable tweet and profile IDs to remove duplicates across pages. Tweet, profile, follower, reply, timeline, community, and list reads use `cursor`. Send the returned `next_cursor` on the next REST API call. Continue while `has_next_page` is true. Events, draws, and extractions use `cursor`. Radar uses `after`. Drafts use `afterCursor`. Send the matching `nextCursor` value without changing its case. Each family has a different parameter contract. Continue through an empty page when the response still reports more results. Stop when the next cursor is missing, unchanged, or already seen. Report that edge case instead of looping forever. Store partial tweets, followers, following profiles, replies, or events before requesting the next page. Resume from the last confirmed cursor after a temporary failure. ## Recover from X (Twitter) API rate limits Treat X (Twitter) API rate limits as method-specific Xquik buckets. Reads share one window. Writes share another. Deletes use their own window. One busy workflow should not force unrelated methods into the same retry queue. Always read `Retry-After` from a `429` response. Wait for that duration before sending another HTTP request. Add bounded jitter when many workers share one credential. This prevents synchronized retry spikes. Limit concurrency before the error occurs. Batch tweet or profile IDs on endpoints that support batches. Use exports for large follower, reply, or timeline jobs. Cache stable profile fields when freshness permits. Track `rate_limit_exceeded` by method and route. Measure repeated throttles, retry delay, and final success. Reduce request frequency when the same route reaches its bucket repeatedly. Never treat a `429` as an authentication or billing failure. Keep its recovery path separate from `401` and `402` handling. ## Process webhook events safely Accept webhook events only on HTTPS. Save the one-time secret during webhook creation. Verify the HMAC signature before trusting a tweet or profile event. Reject a missing or invalid signature. Read the event type before processing the payload. Tweet events include new tweets, replies, quotes, reposts, and media. They also include links, polls, mentions, hashtags, and long-form posts. Profile events cover names, usernames, bios, locations, URLs, avatars, and banners. They also cover verification, protection, pinned tweets, and availability. Store the event ID before starting side effects. Use it to prevent duplicate notifications or repeated downstream writes. Keep handlers idempotent across delivery retries. Return a successful status only after accepting the event. Keep expensive work outside the request path. Test signatures, failure responses, and retries before enabling real-time monitor traffic. Use [webhook verification](/webhooks/verification) for signature code. Use [webhook testing](/guides/twitter-webhook-testing) for delivery and retry checks. ## Protect durable API writes Send a unique `Idempotency-Key` with each new write intent. Keep that key with the submitted action. Do not reuse it for a different tweet, like, follow, message, or profile update. Store the returned action ID and `statusUrl`. Poll while `terminal` is false. Stop when the action succeeds, fails, or requires user action. Respect the documented polling interval and rate limits. Read `safeToRetry` before creating another action. Retry only when it is true. Use a new idempotency key for that retry. Keep the earlier action for diagnosis. Treat connected-account failures as account state. Reauthenticate the X account when the response requires it. Do not convert an account restriction into an automatic retry loop. Verify the final action result before updating local state. A submitted request does not prove that X accepted the write. ## Test production edge cases Test success and failure paths before launch. Use a valid API key, then an invalid key. Send one malformed request body. Request one missing tweet or profile. Exhaust a safe test rate-limit window. Confirm each response maps to the expected handler. Test API pagination with multiple pages, an empty intermediate page, and a repeated cursor. Confirm the collector stops safely. Verify deduplication with repeated tweet or profile IDs. Test webhook events with a valid signature, invalid signature, duplicate event, and handler failure. Confirm only verified events reach downstream systems. Test durable writes through submission, polling, success, and failure. Confirm the client never repeats an unsafe action. Review logs to confirm no credential or webhook secret appears. Keep these checks in automated integration tests. Run them after authentication, pagination, response, webhook, or write-contract changes. ## Conventions > [accordion] IDs are strings > > Treat every ID as an opaque string. IDs may use digits, UUIDs, or prefixes. Never parse them as numbers. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "id": "123456789" } > ``` > [accordion] Default timestamps are ISO 8601 UTC > > Default REST responses use ISO 8601 UTC strings. The normalized contract converts date-time fields to Unix seconds and renames `createdAt` to `created`. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "created": 1771929000 } > ``` > [accordion] Default errors use string codes > > Default REST errors return an `error` field with a machine-readable string code. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { "error": "error_code" } > ``` > > **Common errors.** > > > [card] 400 validation > > > > `invalid_input` means the request body, query, or path failed > > validation. Fix the schema, field types, or required parameters before > > retrying. > > > [card] 401 authentication > > > > `unauthenticated` means the API key or bearer token is missing or > > invalid. Send `x-api-key` or a valid `Authorization` bearer token. > > > [card] 402 billing state > > > > `no_subscription`, `no_credits`, and `insufficient_credits` mean the > > request lacks usable billing access or enough credits. Existing > > available credits work without an active plan. > > > [card] 404 missing resource > > > > `not_found` means the requested resource does not exist. Or it is not > > available to the authenticated account. > > > [card] 429 rate limit > > > > `rate_limit_exceeded` includes `Retry-After` and JSON `retryAfter`. > > Wait for the window and retry with backoff. > > > [card] 502 read service retry > > > > `x_api_unavailable` means the read service is temporarily unavailable. > > Retry with exponential backoff. > > See [Error Handling](/guides/error-handling) for the full error code list and handling strategies. > [accordion] Cursor-based pagination > > > [tab] Platform endpoints > > > > Events, draws, extractions, Radar, and drafts use cursor-based pagination. > > More results return `hasMore: true` and a `nextCursor` value. > > > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > > { > > "events": [], > > "hasMore": true, > > "nextCursor": "MjAyNi0wMi0yNFQxMDozMDowMC4wMDBa..." > > } > > ``` > > > > Pass `nextCursor` as `cursor` for events, draws, and extractions. > > Pass it as `after` for Radar. > > Pass it as `afterCursor` for drafts. > > > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > > curl "https://xquik.com/api/v1/events?cursor=MjAyNi0wMi0yNFQxMDozMDowMC4wMDBa..." \ > > -H "x-api-key: xq_your_api_key_here" > > ``` > > > [tab] X endpoints > > > > Tweet, profile, follower, and reply endpoints under `/x/*` use a > > different pagination shape. So do timeline, community, and list > > endpoints there. When more results exist, the response includes > > `has_next_page: true` and a `next_cursor` value. > > > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > > { > > "tweets": [], > > "has_next_page": true, > > "next_cursor": "DAABCgABGRnYttk__..." > > } > > ``` > > > > Pass `next_cursor` as the `cursor` query parameter to fetch the next page. > > > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > > curl "https://xquik.com/api/v1/x/tweets/search?q=xquik&cursor=DAABCgABGRnYttk__..." \ > > -H "x-api-key: xq_your_api_key_here" > > ``` > > Cursors are opaque strings. Do not decode or construct them. Continue through empty pages while the response says more data exists. Return a pagination error when the next cursor is missing, unchanged, or already seen. Monitors, webhooks, and API keys page the same way. > [accordion] Opt-in response contract > > v1 keeps the default response contract unchanged for existing clients. Send `xquik-api-contract: 2026-04-29` to opt in to the normalized v1 response contract. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > curl "https://xquik.com/api/v1/events" \ > -H "x-api-key: xq_your_api_key_here" \ > -H "xquik-api-contract: 2026-04-29" > ``` > > Opt-in responses use snake_case field names, Unix timestamps in seconds, and structured error objects. They use `has_more` and `next_cursor` pagination fields. Recognized resources get an `object` field and prefixed IDs where available. Date-only strings stay unchanged. A default `createdAt` field becomes `created`. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "events": [], > "has_more": true, > "next_cursor": "MjAyNi0wMi0yNFQxMDozMDowMC4wMDBa..." > } > ``` > > Legacy dependency failures that return `502` by default return `424 Failed Dependency` in the opt-in contract. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "error": { > "type": "dependency_error", > "code": "x_api_unavailable", > "message": "Read service temporarily unavailable. Retry shortly." > } > } > ``` > > Pass `next_cursor` as `cursor` on tweet, profile, follower, reply, timeline, > community, and list endpoints. Use `cursor` for events, draws, and extractions. > Use `after` for Radar. Use `afterCursor` for drafts. ## Event types ### Monitor events Monitors, webhooks, and events share these event types. * Tweet events are `tweet.new`, `tweet.quote`, `tweet.reply`, `tweet.retweet`, `tweet.media`, `tweet.link`, `tweet.poll`, `tweet.mention`, `tweet.hashtag`, and `tweet.longform`. * Profile identity events are `profile.name.changed`, `profile.username.changed`, `profile.bio.changed`, `profile.location.changed`, and `profile.url.changed`. * Profile media events are `profile.avatar.changed` and `profile.banner.changed`. * Profile status events are `profile.verified.changed`, `profile.protected.changed`, `profile.pinned_tweet.changed`, and `profile.unavailable.changed`. * Account activity events are `tweet.deleted`, `broadcast.started`, and `space.started`. * Following events are `following.added` and `following.removed`. * Follower events are `follower.added` and `follower.removed`. * Count events are `profile.followers.changed` and `profile.following.changed`. Keyword monitors accept only the 10 tweet events above. Post monitors use their own 10 events. New reply & quote events are `post.reply.new` and `post.quote.new`. Metric events are `post.likes.changed`, `post.retweets.changed`, `post.replies.changed`, `post.quotes.changed`, `post.bookmarks.changed`, and `post.views.changed`. Change events are `post.edited` and `post.deleted`. > [card] tweet.new > > Original tweet posted by the monitored account or matching query. Xquik uses it when > no reply, quote, or retweet signal is present. > [card] tweet.quote > > Quote tweet posted by the monitored account or matching query. Xquik classifies it > when quote metadata is present. > [card] tweet.reply > > Reply posted by the monitored account or matching query. Xquik classifies it from > reply flags or reply target IDs. > [card] tweet.retweet > > Retweet posted by the monitored account or matching query. Xquik classifies it from > retweet flags or `RT @` text. # X (Twitter) API TypeScript types for accounts & keys Source: https://docs.xquik.com/guides/x-api-typescript-account-types Copy TypeScript types for Xquik accounts, API keys, connected X accounts, support tickets, and API error responses. Use them to type each call in your own code. > For the complete documentation index, see [llms.txt](/llms.txt). These types belong to the [X API TypeScript types](/guides/x-api-typescript-types) set. Copy them into your `xquik-types.ts` file. ## Types ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} // ─── Account ───────────────────────────────────────────── interface Account { plan: "active" | "inactive"; monitorsAllowed: number; monitorsUsed: number; creditInfo?: { balance: number; lifetimePurchased: number; lifetimeUsed: number; autoTopupEnabled: boolean; }; xUsername?: string; } // ─── API Keys ──────────────────────────────────────────── // Returned when creating a new key (includes full key) interface ApiKeyCreated { id: string; fullKey: string; prefix: string; name: string; createdAt: string; } // Returned when listing keys (full key is never exposed) interface ApiKey { id: string; name: string; prefix: string; isActive: boolean; createdAt: string; lastUsedAt?: string; } // ─── X Accounts ─────────────────────────────────────────── interface XAccount { id: string; username: string; displayName: string; isActive: boolean; createdAt: string; } // ─── Support Tickets ────────────────────────────────────── interface SupportTicket { publicId: string; subject: string; status: "open" | "in_progress" | "resolved" | "closed"; messageCount: number; createdAt: string; updatedAt: string; } interface SupportTicketDetail { publicId: string; subject: string; status: "open" | "in_progress" | "resolved" | "closed"; createdAt: string; updatedAt: string; messages: SupportMessage[]; } interface SupportMessage { body: string; sender: "user" | "support"; createdAt: string; } // ─── Error Response ────────────────────────────────────── type ApiErrorType = | "api_error" | "authentication_error" | "billing_error" | "dependency_error" | "invalid_request_error" | "permission_error" | "rate_limit_error"; interface StructuredApiError { message: string; type: ApiErrorType; code: string; } interface ApiError { error: string | StructuredApiError; message?: string; reason?: string; retryAfter?: number; retryAfterMs?: number; } ``` ## Next steps * [X API TypeScript types](/guides/x-api-typescript-types) * [Shared types](/guides/x-api-typescript-shared-types) # X (Twitter) API TypeScript types for radar & compose Source: https://docs.xquik.com/guides/x-api-typescript-content-types Copy TypeScript types for Xquik radar items, styles, drafts, tweet composer results, and X write responses. Use them to type each content call in your own code. > For the complete documentation index, see [llms.txt](/llms.txt). These types belong to the [X API TypeScript types](/guides/x-api-typescript-types) set. Copy them into your `xquik-types.ts` file. ## Types ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} // ─── Radar ────────────────────────────────────────────── interface RadarItem { id: string; title: string; description?: string; url?: string; imageUrl?: string; source: RadarSource; sourceId: string; category: RadarCategory; region: string; language: string; score: number; metadata: Record; publishedAt: string; createdAt: string; } interface RadarList { items: RadarItem[]; hasMore: boolean; nextCursor?: string; } // ─── Styles ───────────────────────────────────────────── interface StyleProfile { xUsername: string; isOwnAccount: boolean; tweetCount: number; fetchedAt: string; tweets: StyleTweet[]; } interface StyleListItem { xUsername: string; isOwnAccount: boolean; tweetCount: number; fetchedAt: string; } interface StyleList { styles: StyleListItem[]; } interface StyleComparison { style1: StyleProfile; style2: StyleProfile; } interface PerformanceAnalysis { xUsername: string; tweetCount: number; tweets: PerformanceTweet[]; } // ─── Drafts ───────────────────────────────────────────── interface Draft { id: string; text: string; topic?: string; goal?: "engagement" | "followers" | "authority" | "conversation"; createdAt: string; updatedAt: string; } interface DraftList { drafts: Draft[]; hasMore: boolean; nextCursor?: string; } // ─── Compose ────────────────────────────────────────────── interface RadarRecommendation { endpoint: string; guidance: string; source: RadarSource; useFor: string; } // step="compose" response interface ComposeTweetResult { contentRules: { rule: string }[]; engagementMultipliers: { action: string; multiplier: string }[]; engagementVelocity: string; followUpQuestions: string[]; intentUrl: string; nextStep: string; radarRecommendations: RadarRecommendation[]; savedStyles?: { tweetCount: number; username: string }[]; scorerWeights: { signal: string; weight: null; context: string }[]; source: string; styleNote?: string; styleTweets?: string[]; topPenalties: string[]; } // step="refine" response interface RefineTweetResult { compositionGuidance: string[]; examplePatterns: { description: string; pattern: string }[]; intentUrl: string; nextStep: string; } // step="score" response interface ScoreTweetResult { passed: boolean; passedCount: number; totalChecks: number; topSuggestion: string; nextStep: string; checklist: { factor: string; passed: boolean; suggestion?: string }[]; intentUrl?: string; } // ─── X Write ────────────────────────────────────────────── interface XWriteResponse { success: boolean; data?: Record; } ``` ## Next steps * [X API TypeScript types](/guides/x-api-typescript-types) * [Shared types](/guides/x-api-typescript-shared-types) # X (Twitter) API TypeScript types for tweets & users Source: https://docs.xquik.com/guides/x-api-typescript-data-types Copy TypeScript types for tweets, tweet authors, search results, user profiles, follower checks, and trends. Use them to type each X (Twitter) read in code. > For the complete documentation index, see [llms.txt](/llms.txt). These types belong to the [X API TypeScript types](/guides/x-api-typescript-types) set. Copy them into your `xquik-types.ts` file. ## Types ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} // ─── X API ────────────────────────────────────────────── interface Tweet { id: string; text: string; type?: string; createdAt?: string; retweetCount?: number; replyCount?: number; likeCount?: number; quoteCount?: number; viewCount?: number; bookmarkCount?: number; media?: TweetMediaItem[]; url?: string; lang?: string; isReply?: boolean; inReplyToId?: string; inReplyToUserId?: string; inReplyToUsername?: string; conversationId?: string; source?: string; displayTextRange?: number[]; textHighlights?: Array<{ startIndex: number; endIndex: number }>; isNoteTweet?: boolean; isQuoteStatus?: boolean; isRetweet?: boolean; isLimitedReply?: boolean; entities?: Record; author?: UserProfile; quoted_tweet?: Tweet; retweeted_tweet?: Tweet; } interface TweetAuthor { id: string; username: string; followers: number; verified: boolean; profilePicture?: string; } interface TweetSearchResult { id: string; text: string; createdAt: string; likeCount: number; retweetCount: number; replyCount: number; author: { id: string; username: string; name: string; verified: boolean; }; media?: TweetMediaItem[]; } interface UserProfile { id: string; username: string; name: string; description?: string; followers?: number; following?: number; verified?: boolean; profilePicture?: string; coverPicture?: string; location?: string; createdAt?: string; statusesCount?: number; mediaCount?: number; url?: string; favouritesCount?: number; hasCustomTimelines?: boolean; isTranslator?: boolean; withheldInCountries?: string[]; possiblySensitive?: boolean; pinnedTweetIds?: string[]; isAutomated?: boolean; automatedBy?: string; unavailable?: boolean; unavailableReason?: string; verifiedType?: string; profile_bio?: Record; } interface FollowerCheck { sourceUsername: string; targetUsername: string; isFollowing: boolean; isFollowedBy: boolean; } // ─── Trends ───────────────────────────────────────────── interface Trend { name: string; description?: string; rank?: number; query?: string; } interface TrendList { trends: Trend[]; total: number; woeid: number; } ``` ## Next steps * [X API TypeScript types](/guides/x-api-typescript-types) * [Shared types](/guides/x-api-typescript-shared-types) # X (Twitter) API TypeScript draw & extraction types Source: https://docs.xquik.com/guides/x-api-typescript-job-types Copy TypeScript types for Xquik giveaway draws, extraction jobs, extraction results, and cost estimates. Use them to type each bulk job call in your project. > For the complete documentation index, see [llms.txt](/llms.txt). These types belong to the [X API TypeScript types](/guides/x-api-typescript-types) set. Copy them into your `xquik-types.ts` file. ## Types ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} // ─── Draws ────────────────────────────────────────────── interface Draw { id: string; tweetId: string; tweetUrl: string; tweetText: string; tweetAuthorUsername: string; tweetLikeCount: number; tweetRetweetCount: number; tweetReplyCount: number; tweetQuoteCount: number; status: "pending" | "running" | "completed" | "failed"; totalEntries: number; validEntries: number; createdAt: string; drawnAt?: string; } interface DrawListItem { id: string; tweetUrl: string; status: "pending" | "running" | "completed" | "failed"; totalEntries: number; validEntries: number; createdAt: string; drawnAt?: string; } interface DrawWinner { position: number; authorUsername: string; tweetId: string; isBackup: boolean; } interface DrawList { draws: DrawListItem[]; hasMore: boolean; nextCursor?: string; } // ─── Extractions ──────────────────────────────────────── interface ExtractionJob { id: string; toolType: ExtractionToolType; status: "pending" | "running" | "completed" | "failed"; totalResults: number; targetTweetId?: string; targetUsername?: string; targetUserId?: string; targetCommunityId?: string; searchQuery?: string; errorMessage?: string; createdAt: string; completedAt?: string; } interface ExtractionResult { id: string; xUserId: string; xUsername?: string; xDisplayName?: string; xFollowersCount?: number; xVerified?: boolean; xProfileImageUrl?: string; tweetId?: string; tweetText?: string; tweetCreatedAt?: string; createdAt: string; enrichmentData?: Record; } interface ExtractionList { extractions: ExtractionJob[]; hasMore: boolean; nextCursor?: string; } interface ExtractionEstimate { allowed: boolean; source: | "collection" | "followers" | "following" | "paginationCap" | "quoteCount" | "replyCount" | "resultsLimit" | "retweetCount" | "unknown"; estimatedResults: number; creditsRequired: string; creditsAvailable: string; resolvedXUserId?: string; } ``` ## Next steps * [X API TypeScript types](/guides/x-api-typescript-types) * [Shared types](/guides/x-api-typescript-shared-types) # X (Twitter) API TypeScript monitor & webhook types Source: https://docs.xquik.com/guides/x-api-typescript-monitor-types Copy TypeScript types for Xquik monitors, events, webhooks, deliveries, and webhook payloads. Use them to type each X (Twitter) monitor handler in your code. > For the complete documentation index, see [llms.txt](/llms.txt). These types belong to the [X API TypeScript types](/guides/x-api-typescript-types) set. Copy them into your `xquik-types.ts` file. ## Types ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} // ─── Monitors ──────────────────────────────────────────── interface Monitor { id: string; username: string; xUserId: string; eventTypes: EventType[]; isActive: boolean; createdAt: string; nextBillingAt: string; } interface KeywordMonitor { id: string; query: string; eventTypes: EventType[]; isActive: boolean; createdAt: string; nextBillingAt: string; } interface PostMetricReading { current: number | null; gain: number | null; } type PostMetric = "views" | "likes" | "retweets" | "replies" | "quotes" | "bookmarks"; interface PostMonitor { id: string; name?: string; postId: string; postUrl: string; authorId: string; authorUsername: string; authorName: string; text: string; postedAt: string; eventTypes: PostEventType[]; isActive: boolean; createdAt: string; nextBillingAt: string; pausedReason?: "insufficient_credits" | "x_post_deleted" | "x_post_protected" | "x_post_unavailable"; pausedAt?: string; metrics: Record; } // ─── Events ────────────────────────────────────────────── interface Event { id: string; type: EventType | PostEventType; monitorId: string; monitorType: "account" | "keyword" | "post"; occurredAt: string; data: EventData; username?: string; query?: string; keywordMonitorId?: string; postId?: string; postUrl?: string; authorId?: string; authorUsername?: string; xEventId?: string; } interface EventList { events: Event[]; hasMore: boolean; nextCursor?: string; } // ─── Webhooks ──────────────────────────────────────────── // Returned when creating a webhook (includes signing secret) interface WebhookCreated { id: string; url: string; eventTypes: EventType[]; secret: string; createdAt: string; } // Returned when listing webhooks (secret is never exposed) interface Webhook { id: string; url: string; eventTypes: EventType[]; isActive: boolean; createdAt: string; } // ─── Deliveries ────────────────────────────────────────── interface Delivery { id: string; streamEventId: string; status: "pending" | "delivered" | "failed" | "exhausted"; attempts: number; lastStatusCode?: number; lastError?: string; createdAt: string; deliveredAt?: string; } // ─── Webhook Payload ───────────────────────────────────── interface WebhookPayload { eventType: EventType | PostEventType; schemaVersion: 1; deliveryId: string; streamEventId: string; occurredAt: string; monitorId: string; monitorName?: string; monitorType: "account" | "keyword" | "post"; data: EventData; username?: string; xUserId?: string; query?: string; postId?: string; postUrl?: string; authorId?: string; authorUsername?: string; } interface WebhookTestPayload { eventType: "webhook.test"; data: { message: string }; timestamp: string; } ``` ## Next steps * [X API TypeScript types](/guides/x-api-typescript-types) * [Shared types](/guides/x-api-typescript-shared-types) # X (Twitter) API TypeScript create request types Source: https://docs.xquik.com/guides/x-api-typescript-request-types Copy TypeScript request types for monitors, webhooks, API keys, draws, extractions, drafts, and compose calls. Use them to type each body you send to Xquik. > For the complete documentation index, see [llms.txt](/llms.txt). These types belong to the [X API TypeScript types](/guides/x-api-typescript-types) set. Copy them into your `xquik-types.ts` file. ## Types ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} interface CreateMonitorRequest { username: string; eventTypes: EventType[]; } interface UpdateMonitorRequest { eventTypes?: EventType[]; isActive?: boolean; } interface CreateWebhookRequest { url: string; eventTypes: EventType[]; } interface UpdateWebhookRequest { url?: string; eventTypes?: EventType[]; isActive?: boolean; } interface CreateApiKeyRequest { name?: string; } interface CreateDrawRequest { tweetUrl: string; winnerCount?: number; backupCount?: number; uniqueAuthorsOnly?: boolean; mustRetweet?: boolean; mustFollowUsername?: string; filterMinFollowers?: number; filterAccountAgeDays?: number; filterLanguage?: string; requiredKeywords?: string[]; requiredHashtags?: string[]; requiredMentions?: string[]; } interface CreateExtractionRequest { toolType: ExtractionToolType; targetTweetId?: string; targetUsername?: string; targetCommunityId?: string; targetListId?: string; targetSpaceId?: string; searchQuery?: string; resultsLimit?: number; } interface CreateDraftRequest { text: string; topic?: string; goal?: "engagement" | "followers" | "authority" | "conversation"; } interface ComposeRequest { step: "compose" | "refine" | "score"; topic?: string; goal?: ComposeTweetGoal; styleUsername?: string; tone?: string; additionalContext?: string; callToAction?: string; hasLink?: boolean; /** @deprecated Accepted for compatibility. Text checks ignore it. */ hasMedia?: boolean; mediaType?: MediaType; draft?: string; } ``` ## Next steps * [X API TypeScript types](/guides/x-api-typescript-types) # X (Twitter) API TypeScript shared & event types Source: https://docs.xquik.com/guides/x-api-typescript-shared-types Copy shared TypeScript types for Xquik event names, tweet event data, filters, extraction tools, media, and radar sources. The other type pages build on them. > For the complete documentation index, see [llms.txt](/llms.txt). These types belong to the [X API TypeScript types](/guides/x-api-typescript-types) set. Copy them into your `xquik-types.ts` file. ## Types ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} type EventType = | "tweet.new" | "tweet.quote" | "tweet.reply" | "tweet.retweet" | "tweet.media" | "tweet.link" | "tweet.poll" | "tweet.mention" | "tweet.hashtag" | "tweet.longform" | "profile.avatar.changed" | "profile.banner.changed" | "profile.name.changed" | "profile.username.changed" | "profile.bio.changed" | "profile.location.changed" | "profile.url.changed" | "profile.verified.changed" | "profile.protected.changed" | "profile.pinned_tweet.changed" | "profile.unavailable.changed" | "tweet.deleted" | "broadcast.started" | "space.started" | "following.added" | "following.removed" | "follower.added" | "follower.removed" | "profile.followers.changed" | "profile.following.changed"; type PostEventType = | "post.reply.new" | "post.quote.new" | "post.likes.changed" | "post.retweets.changed" | "post.replies.changed" | "post.quotes.changed" | "post.bookmarks.changed" | "post.views.changed" | "post.edited" | "post.deleted"; // The data field contains the tweet object stored with the monitor event. interface TweetEventData { id: string; text: string; author: { id: string; userName: string; name: string; }; isRetweet: boolean; isReply: boolean; isQuote: boolean; createdAt: string; inReplyToId?: string; quoted_tweet?: { id: string; text: string; author: { userName: string }; }; } type EventData = TweetEventData; interface EventFilters { keywords?: { include?: string[]; exclude?: string[] }; minLikes?: number; minRetweets?: number; verifiedOnly?: boolean; } type ExtractionToolType = | "article_extractor" | "community_extractor" | "community_moderator_explorer" | "community_post_extractor" | "community_search" | "favoriters" | "follower_explorer" | "following_explorer" | "list_follower_explorer" | "list_member_extractor" | "list_post_extractor" | "mention_extractor" | "people_search" | "post_extractor" | "quote_extractor" | "reply_extractor" | "repost_extractor" | "space_explorer" | "thread_extractor" | "tweet_search_extractor" | "user_affiliates" | "user_likes" | "user_media" | "verified_follower_explorer"; type ComposeTweetGoal = "authority" | "conversation" | "engagement" | "followers"; type MediaType = "none" | "photo" | "video"; type RadarSource = string; type RadarCategory = "business" | "culture" | "dev" | "entertainment" | "general" | "politics" | "science" | "tech"; interface TweetMediaItem { mediaUrl: string; type: string; url: string; } interface StyleTweet { id: string; authorUsername: string; text: string; createdAt: string; media?: TweetMediaItem[]; } interface PerformanceTweet { id: string; text: string; likeCount: number; retweetCount: number; replyCount: number; quoteCount: number; viewCount: number; bookmarkCount: number; } ``` ## Next steps * [X API TypeScript types](/guides/x-api-typescript-types) # TypeScript types for tweets, followers & X API Source: https://docs.xquik.com/guides/x-api-typescript-types Use TypeScript definitions for tweets, profiles, followers, monitors, webhooks, extractions, write actions, pagination, and API errors. Follow exact steps. > For the complete documentation index, see [llms.txt](/llms.txt). This page provides TypeScript helpers you can copy for common Xquik API objects. Use these for prototypes, docs examples, and lightweight clients. For complete generated coverage, use the [OpenAPI spec](https://docs.xquik.com/openapi.yaml) or an [official SDK](/sdks). | Contract area | Curated types | Route use | | - | - | - | | Tweets | `Tweet`, `PaginatedTweets`, `TweetSearchParams` | Search tweets and continue with `nextCursor`. | | Profiles | `User`, `PaginatedUsers` | Read profiles, followers, following, and mentions. | | Monitors | `Monitor`, `KeywordMonitor` | Create and reconcile account or keyword monitors. | | Events | `Event`, `EventList` | Page through stored monitor events. | | Webhooks | `Webhook`, `WebhookDelivery` | Track subscriptions and delivery attempts. | | Extractions | `Extraction`, `ExtractionResultPage` | Run follower or reply exports and retrieve saved rows. | | Write actions | `WriteAction` | Track tweets, follows, likes, reposts, and profile updates. | | Errors | `ApiError` | Branch on status, code, message, and retry details. | ## Usage Use these types in 1 of 3 ways. 1. **Copy curated types.** Copy each type page below into one `xquik-types.ts` file 2. **Copy individual interfaces.** Grab only the types you need such as `Tweet` or `EventList` 3. **Generate full coverage from OpenAPI.** Use the [OpenAPI spec](https://docs.xquik.com/openapi.yaml) with tools like `openapi-typescript` to auto-generate types. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npx openapi-typescript https://docs.xquik.com/openapi.yaml -o xquik-api.d.ts ``` > [!TIP] > > For complete coverage in production projects, option 3 or an official SDK is safest. For quick prototypes, copy only the interfaces you need. | Type page | Covers | | - | - | | [Account types](/guides/x-api-typescript-account-types) | Accounts, API keys, X accounts, support & errors | | [Monitor types](/guides/x-api-typescript-monitor-types) | Monitors, events, webhooks & payloads | | [Job types](/guides/x-api-typescript-job-types) | Draws & extractions | | [Tweet & user types](/guides/x-api-typescript-data-types) | Tweets, users & trends | | [Content types](/guides/x-api-typescript-content-types) | Radar, styles, drafts, compose & writes | | [Request types](/guides/x-api-typescript-request-types) | Request bodies | | [Shared types](/guides/x-api-typescript-shared-types) | Event names, tool types & shared unions | ## REST API vs MCP field naming > [!NOTE] > > REST examples show the default v1 response contract unless they send > `xquik-api-contract: 2026-04-29`. API MCP sends that contract > automatically. MCP results use snake_case, Unix timestamps, structured > errors, `has_more`, and `next_cursor`. Pass `next_cursor` as `cursor` on > tweet, profile, follower, reply, timeline, community, and list pages. Use > `cursor` for draws, extractions, and events. Use `after` for Radar. Use `afterCursor` for > drafts. A default `createdAt` field becomes `created`. ## Type reference ### Account `GET /api/v1/account` returns this shape. The API omits the `creditInfo` field when no credit balance record exists yet. `creditInfo.balance` shows the current credit count available for metered API calls. ### API keys API keys have 2 shapes. Only `POST /api/v1/api-keys` returns `ApiKeyCreated`, which includes the `fullKey` field. This is the only time the API exposes the full key. `GET /api/v1/api-keys` returns `ApiKey`, which shows only the `prefix` (first 8 characters) for identification. ### Monitors Account monitor endpoints return `Monitor`. The `xUserId` is the X (Twitter) user ID resolved from the `username`. That resolution happens at creation time. Keyword monitor endpoints return `KeywordMonitor` with the normalized X (Twitter) search `query`. Both monitor types include `eventTypes`, `isActive`, `createdAt`, and `nextBillingAt` for active monitor billing. Post monitor endpoints return `PostMonitor` with the tracked post & its 6 metrics. ### Events `Event` represents one tracked account, keyword or post action. `monitorType` is `account`, `keyword` or `post`. `monitorId` points to the source monitor. Account events include `username`. Keyword events include `query` and `keywordMonitorId`. Post events include `postId`, `postUrl`, `authorId` and `authorUsername`. `data` contains the documented Tweet event fields. `EventList` wraps paginated responses. Use `nextCursor` with the `cursor` query parameter for subsequent pages. ### Webhooks Like API keys, webhooks have 2 shapes. `WebhookCreated` includes the `secret` field used for HMAC signature verification. `Webhook` (from list) never exposes the secret. If you lose the secret, delete and recreate the webhook. ### Deliveries Each `Delivery` tracks 1 event sent to 1 webhook endpoint. Status starts as `pending` and becomes `delivered` on success. A failed attempt sets `failed`. Xquik retries until your endpoint returns `2xx` or 30 days pass. Then the delivery shows `exhausted`. `lastStatusCode` and `lastError` help diagnose delivery failures. ### Webhook payload The `WebhookPayload` type describes the JSON body your endpoint receives on each delivery. Normal monitor events include `schemaVersion`, `deliveryId`, `streamEventId`, `occurredAt`, `eventType`, `monitorId`, `monitorType`, and `data`. `monitorName` comes when the monitor has a name. Account monitor events include `username`. Keyword monitor events include `query`. Account monitor events also carry `xUserId`. Post monitor events carry `postId`, `postUrl`, `authorId`, and `authorUsername`. Verify authenticity with the `X-Xquik-Signature` header and your webhook secret. See [Webhook Verification](/webhooks/verification) for implementation details. > [!NOTE] > > `webhook.test` payloads include `timestamp` and omit monitor-only fields because no stored event backs them. Normal event payloads omit `timestamp`. ### Draws `Draw` is the full draw object returned by `GET /api/v1/draws/{id}`. It includes tweet metadata and engagement counts. `DrawListItem` is the compact shape returned in list responses. `DrawWinner` contains the position, username, tweet ID, and backup flag for each winner. Filter fields on `CreateDrawRequest` control which entries qualify for the draw. ### Extractions `ExtractionJob` represents a completed or failed extraction job. The target fields (`targetTweetId`, `targetUsername`) vary by `toolType`. `ExtractionResult` contains the core user and tweet data the API returns. The get endpoint paginates results with up to 1,000 results per page. Exports (CSV, XLSX, Markdown) include additional enrichment columns not present in the API response. See [Export Extraction](/api-reference/extractions/export) for the full column list. `ExtractionEstimate` previews the cost before running a job. ### X API Tweet, profile, and relationship lookup types. `Tweet` and `TweetAuthor` come from tweet lookup. `TweetSearchResult` includes an inline `author` object. `UserProfile` contains the full profile. `FollowerCheck` returns the bidirectional follow relationship between 2 users. `Tweet` and `TweetSearchResult` include an optional `media` array when media exists. Media types are `photo`, `video`, or `animated_gif`. ### Trends `Trend` represents a single trending topic on X. The API omits the `description`, `rank`, and `query` fields when unavailable. `TrendList` wraps the `GET /api/v1/trends` response. `total` is the number of trends returned. `woeid` is the region ID. ### Radar `RadarItem` represents a single trending topic or news item that Xquik collects. The `source` field identifies the Radar stream. Reddit metadata can include post text, links, and media. It can also include public scores, estimated vote counts, and comment counts. It never includes comment bodies. Startup growth metadata can include reported growth and revenue. Company details and a founder `xHandle` appear when available. `RadarList` wraps paginated responses from `GET /api/v1/radar`. Use `nextCursor` with the `after` query parameter for later pages. ### Styles The analyze style (`POST /api/v1/styles`) and get style (`GET /api/v1/styles/{id}`) endpoints return `StyleProfile`. It includes the cached tweets array with text, media, and timestamps. `StyleListItem` is the compact shape returned by `GET /api/v1/styles` (no tweets). `StyleComparison` wraps 2 full profiles for side-by-side comparison. `PerformanceAnalysis` adds engagement metrics (likes, retweets, replies, quotes, views, bookmarks) to each cached tweet. `isOwnAccount` is `true` when the analyzed username matches the authenticated user's linked X identity. ### Drafts `Draft` represents a saved tweet draft. List, create, and get responses include `id`, `text`, `createdAt`, and `updatedAt`. The API omits optional `topic` and `goal` fields when unset. They are never `null`. `DraftList` wraps paginated responses. Use `nextCursor` with the `afterCursor` query parameter to fetch subsequent pages. A page holds as many drafts as `limit` asks. ### X accounts `XAccount` represents a linked X account. `displayName` is the user's display name on X. `isActive` indicates whether the account is connected and usable for API operations. ### Compose `ComposeRequest` drives a 3-step writing flow. `compose` returns 10 source facts, 4 questions, published signal names, and a topic `intentUrl`. `radarRecommendations` is always empty for compatibility. Production signal weights remain `null`. `refine` returns request context and source guidance. `examplePatterns` stays empty. `score` checks that the draft contains text. It does not predict reach. `styleUsername` selects a cached style. Compose responses may include `savedStyles`, `styleTweets`, or `styleNote`. ### X write Write operations (post, retweet, like, reply) return `XWriteResponse`. `success` indicates whether the operation completed. The optional `data` field contains platform-specific response data when available. ### Support tickets `SupportTicket` is the compact shape returned in list responses. `SupportTicketDetail` includes the full `messages` array. Each `SupportMessage` has a `sender` field. It shows whether the user or the support team sent the message. Status progresses from `open` through `in_progress` to `resolved` or `closed`. ### Request bodies All request body types use optional fields for update operations (PATCH). They use required fields for creation (POST). The API validates request bodies and returns `400 invalid_input` for missing or malformed fields. # Zapier Twitter automation with webhooks & X API Source: https://docs.xquik.com/guides/zapier Build Zapier Twitter automation for tweet search, follower exports, monitors, and signed webhooks. Add extraction jobs and approved X (Twitter) actions. > For the complete documentation index, see [llms.txt](/llms.txt). Build Zapier Twitter automation through Xquik without an X Developer app. Search tweets, export followers, route webhooks, and approve write actions. Build a private Zapier Platform CLI integration. Add routes after Zap history confirms repeated demand. ## Zapier alternative or Zapier add-on Xquik doesn't build workflows, so it doesn't replace Zapier. Keep Zapier for triggers, branching and app steps. Add Xquik when a workflow needs X (Twitter) data or X (Twitter) actions. That covers tweet search, follower exports, posts and monitor events. ## Replace the retired Zapier Twitter integration Zapier retired its native Twitter integration in 2023. Xquik restores those workflows through an API-key connection. Choose an Xquik connection based on the workflow. > [card] API by Zapier > > Use one reusable API-key connection for a small number of actions. Keep the > Xquik key in the app connection instead of a Zap field. > [card] Private platform integration > > Use the CLI for shared actions, polling triggers, and REST Hooks. Add > samples, output fields, custom errors, and shared field mapping. > [card] Webhooks by Zapier > > Use simple unauthenticated payloads only. Zapier keeps credentials in > Webhooks step fields. People with Zap access can read them. > [card] Search versus monitor > > Search existing tweets with an action. Monitor new tweets, replies, quotes, > or reposts with polling or signed webhook events. This guide builds the private Platform integration. ## Prerequisites * [Xquik API key](/x-api-quickstart) * Zapier account with Platform CLI access * A Node.js release supported by the current Zapier Platform CLI * HTTPS callback URLs for REST Hook testing Install and sign in to the Zapier CLI. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npm install -g zapier-platform-cli zapier-platform --version zapier login zapier init xquik-zapier --template minimal cd xquik-zapier npm install ``` ## Integration shape > [card] Auth > > API key field named `apiKey`, injected as `x-api-key`. > [card] Base URL > > `https://xquik.com/api/v1` > [card] Request helper > > JSON requests, structured Xquik errors, and `Retry-After` handling. > [card] Actions > > Search Tweets, Get User, Read Followers, Create Extraction, and Create > Monitor. Add Create Webhook, Create Tweet, and Create Reply. > [card] Triggers > > New Matching Tweet polling and Monitor Event instant trigger. Add Extraction > Completed and Webhook Delivery Failure polling. ## API key auth Add a custom auth field and inject it into every Xquik request. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const BASE_URL = "https://xquik.com/api/v1"; function addApiKeyHeader(request, z, bundle) { request.headers = request.headers || {}; request.headers["x-api-key"] = bundle.authData.apiKey; return request; } async function testAuth(z) { const response = await z.request({ method: "GET", url: `${BASE_URL}/account`, }); return response.data; } module.exports = { authentication: { type: "custom", fields: [{ key: "apiKey", label: "Xquik API Key", required: true }], test: testAuth, }, beforeRequest: [addApiKeyHeader], }; ``` ## Shared error handling Normalize Xquik responses in one helper. See [Zapier error handling](/guides/zapier-error-handling) for the full helper. ## Starter actions > [card] Search tweets > > Call `GET /x/tweets/search` with `q`. Use `cursor` for page loops. Keep `limit` on bounded resumes. > [card] Get tweet > > Call `GET /x/tweets/{id}` with a tweet ID. > [card] Get user > > Call `GET /x/users/{id}` with a username or numeric user ID. > [card] Read followers > > Call `GET /x/users/{id}/followers`. Keep `next_cursor` between pages. > [card] Read following > > Call `GET /x/users/{id}/following`. Keep following rows separate. > [card] Read tweet replies > > Call `GET /x/tweets/{id}/replies`. Keep parent and reply tweet IDs. > [card] Get trends > > Call `GET /x/trends` with optional `woeid` and `count`. > [card] Create tweet > > Call `POST /x/tweets` with account, text, and optional public media URLs. > [card] Create reply > > Call `POST /x/tweets` with account, text, and `reply_to_tweet_id`. > [card] Create extraction > > Call `POST /extractions` with `toolType`, query fields, and result limit. > [card] Create monitor > > Call `POST /monitors` with username and event types. > [card] Create webhook > > Call `POST /webhooks` with callback URL and event types. ## Result handoff Use Zapier samples and `outputFields` so later Zap steps map stable values. See [Zapier result handoff](/guides/zapier-result-handoff) for each mapping. ## Trigger 1. New matching tweet Poll searches for query alerts. Return stable tweet records with unique IDs. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async function performNewMatchingTweet(z, bundle) { return performSearchTweets(z, { ...bundle, inputData: { ...bundle.inputData, cursor: undefined, limit: 100, queryType: "Latest", }, }); } ``` Return newest tweets first. Never reuse saved cursors across polling runs. ## Trigger 2. Monitor event REST hook Use REST Hooks for near-real-time tweets, replies, quotes, and retweets. See [Monitor event REST hook](/guides/zapier-monitor-rest-hook) for the verification relay and the trigger code. ## Trigger 3. Extraction completed ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async function performCompletedExtractions(z) { const response = await xquikRequest(z, { method: "GET", url: `${BASE_URL}/extractions`, params: { status: "completed", limit: 25 }, }); return response.data.extractions || []; } ``` ## Trigger 4. Webhook delivery failure ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async function performWebhookFailures(z, bundle) { const response = await xquikRequest(z, { method: "GET", url: `${BASE_URL}/webhooks/${bundle.inputData.webhookId}/deliveries`, }); return (response.data.deliveries || []).filter((delivery) => delivery.status === "failed"); } ``` ## Build useful Zapier Twitter automation > [card] Zapier Twitter Google Sheets > > Search tweets with one saved query. Append IDs, text, authors, times, and > URLs to Google Sheets. Resume with that query's `next_cursor`. > [card] Zapier Twitter to Slack > > Verify each monitor event. Send normalized tweets, accounts, event types, > and URLs to Slack in real time. > [card] Zapier Twitter Discord > > Send matched tweets or replies to Discord. Include the author, timestamp, > tweet URL, and search query. > [card] Zapier RSS to Twitter > > Read blog posts from an RSS feed. Create approved scheduled tweets with the > article title, URL, and campaign tags. > [card] Zapier post to Twitter > > Review the Twitter account, text, reply target, and media. Then run the > approved write action with an idempotency key. > [card] Followers to CRM > > Use an automated workflow for bounded follower pages. Choose an extraction > job for durable CSV, JSON, or XLSX exports. Zapier Twitter Google Sheets workflows store searchable tweet rows. Zapier Twitter to Slack sends verified alerts in real time. Zapier Twitter Discord sends matched tweet notifications. Zapier RSS to Twitter converts blog posts from an RSS feed. Review scheduled tweets and the Twitter account before scheduling posts. Approve every Zapier post to Twitter step. Keep each automated workflow focused. Compare other Twitter automation tools before choosing. ## Test coverage Add focused Zapier tests before sharing the private app. > [card] Auth header injection > > Every request includes `x-api-key` from `bundle.authData.apiKey`. > [card] Invalid key > > `401` returns "Authentication failed. Check the Xquik API key." > [card] Invalid input > > `400` returns the safe Xquik detail or an input-field remediation. > [card] Billing required > > `402` tells the user to update subscription or credits. > [card] Missing resource > > `404` identifies a bad tweet, user, monitor, webhook, or extraction ID. > [card] Dependency failure > > `424` stops unsafe automatic retries and keeps a safe explanation. > [card] Rate limit > > `429` creates `ThrottledError` with `Retry-After` when present. > [card] Retrieval failure > > `502` uses a bounded retry policy outside unsafe write actions. > [card] REST hook subscribe > > The relay stores `bundle.targetUrl`, selected event types, and the secret. > [card] REST hook unsubscribe > > `DELETE /webhooks/{id}` uses `bundle.subscribeData.id`. > [card] Sample output > > `performList` and live `perform` return identical snake_case fields. > [card] Search action > > Search returns stable tweet IDs, authors, timestamps, URLs, and cursors. > [card] Raw-body signature > > Changing one raw body byte makes HMAC verification fail. > [card] Stale timestamp > > The relay rejects a timestamp outside 5 minutes before JSON parsing. > [card] Secret hygiene > > Production Zapier output and logs never receive the Xquik signing secret. > [card] Relay replay store > > The relay rejects reused nonces and deduplicates delivery and event IDs. > [card] Acknowledgement ownership > > Relay tests cover custom `2xx` rules. Zapier owns its hook URL response. Run the local Zapier suite with this command. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} zapier-platform test zapier-platform validate ``` ## Zapier Twitter automation questions ### How does a Zapier X (Twitter) API connection work? A private Platform app calls Xquik with one API key. ### Why does the native Zapier Twitter integration not work? Zapier retired it in 2023. Use a private Platform integration. ### What does a Twitter Zapier workflow replace? It replaces manual copying across tweet workflows. ### Can Zapier search tweets by keyword? Yes. Search with `q`. Store tweet IDs and cursors. ### Can Zapier export Twitter followers? Yes. Page small lists. Export larger ones. ### Should a zap poll or use a Twitter webhook? Poll delayed searches. Use signed hooks for live monitors. ### How does Zapier verify an Xquik webhook? Use a production relay. Verify HMAC over the raw body there. Check the timestamp and nonce before parsing JSON. Reject reused nonces. Deduplicate delivery and event IDs before forwarding events to Zapier. ### Can Zapier post tweets and replies? Yes. Use Zapier to automate tweets only after explicit approval. ### Can Zapier schedule posts from an RSS feed? Convert RSS items into scheduled tweets. Approve them before publishing. ## Zapier and Xquik sources * [Zapier Platform CLI quickstart](https://docs.zapier.com/integrations/quickstart/build-integration) * [Zapier Twitter integration removal](https://help.zapier.com/hc/en-us/articles/43554846358541-App-update-Twitter-integration-removal) * [Zapier API request options](https://help.zapier.com/hc/en-us/articles/44391646192397-Ways-to-make-API-requests-in-Zapier) * [Zapier REST Hook trigger](https://docs.zapier.com/integrations/build/cli-hook-trigger) * [Zapier bundle reference](https://docs.zapier.com/integrations/build/bundle) * [Zapier HTTP request logging](https://docs.zapier.com/integrations/build-cli/making-http-requests) * [Zapier integration monitoring](https://docs.zapier.com/integrations/build/test-monitoring) * [Zapier throttling guidance](https://docs.zapier.com/integrations/build/troubleshoot-throttles) * [Xquik webhook verification](/webhooks/verification) * [Xquik error handling](/guides/error-handling) * [Xquik follower export](/guides/follower-export-crm) ## Next steps Read [API Reference](/api-reference/overview) for statuses, [Webhooks](/webhooks/overview) for verification, and [Extraction Workflow](/guides/extraction-workflow) for jobs. # Zapier Twitter automation error handling helper Source: https://docs.xquik.com/guides/zapier-error-handling Normalize Xquik API auth, credit, limit, and input errors in one Zapier helper. Every X (Twitter) automation action then reports the same fix for each error. > For the complete documentation index, see [llms.txt](/llms.txt). This guide belongs to the [Zapier Twitter integration](/guides/zapier) build. ## Shared error handling Normalize Xquik responses in one helper. Every action then reports the same remediation. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} function throwForXquikError(z, response) { if (response.status < 400) { return; } const detail = response.data?.message || response.data?.error; if (response.status === 400) { throw new z.errors.Error( detail || "Invalid request. Fix the input fields.", "XquikInvalidRequest", 400, ); } if (response.status === 401) { throw new z.errors.RefreshAuthError("Authentication failed. Check the Xquik API key."); } if (response.status === 402) { throw new z.errors.Error( "Subscription or credits required. Update billing in Xquik.", "XquikBillingRequired", 402, ); } if (response.status === 404) { throw new z.errors.Error( detail || "Resource not found. Check the supplied ID.", "XquikResourceMissing", 404, ); } if (response.status === 424) { throw new z.errors.Error( detail || "X dependency failed. Retry only when the workflow is safe.", "XquikDependencyFailure", 424, ); } if (response.status === 429) { const retryAfter = Number.parseInt( response.getHeader?.("retry-after") || response.headers?.["retry-after"] || "", 10, ); if (Number.isInteger(retryAfter) && retryAfter > 0) { throw new z.errors.ThrottledError("Rate limited. Zapier scheduled a retry.", retryAfter); } throw new z.errors.Error( "Rate limited. Retry after the cooldown period.", "XquikRateLimit", 429, ); } if (response.status === 502) { throw new z.errors.Error( detail || "X retrieval failed. Retry with a bounded attempt count.", "XquikRetrievalFailure", 502, ); } throw new z.errors.Error( detail || "Xquik request failed. Inspect the safe status.", "XquikRequestError", response.status, ); } async function xquikRequest(z, options) { const response = await z.request({ ...options, skipThrowForStatus: true, throwForThrottlingEarly: false, }); throwForXquikError(z, response); return response; } ``` Call `xquikRequest(z, options)` before reading response data. Use each route's response widget as the canonical status list. ## Next steps * [Zapier Twitter integration](/guides/zapier) * [Zapier result handoff](/guides/zapier-result-handoff) * [Monitor event REST hook](/guides/zapier-monitor-rest-hook) # Zapier Twitter monitor event REST hook trigger Source: https://docs.xquik.com/guides/zapier-monitor-rest-hook Build a Zapier REST Hook trigger for Xquik monitor events. Get near-real-time tweets, replies, quotes, and retweets through a verification relay you control. > For the complete documentation index, see [llms.txt](/llms.txt). This guide belongs to the [Zapier Twitter integration](/guides/zapier) build. ## Trigger 2. Monitor event REST hook Use REST Hooks for near-real-time X (Twitter) tweets, replies, quotes, and retweets. ### Choose a secure webhook path Use a verification relay. Keep the one-time signing secret outside Zapier logs. > [card] Production relay > > Let the relay create the Xquik webhook. Store its secret only in the relay. > Verify HMAC, timestamp, nonce, delivery ID, and event ID there. Forward a > normalized event to `bundle.targetUrl` after verification. > [card] Direct private prototype > > Use direct Zapier subscription only for isolated testing. The returned > secret enters `bundle.subscribeData` and may enter Zapier HTTP logs. Never > use this path when that exposure violates your secret policy. ### Direct prototype subscribe ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async function subscribeHook(z, bundle) { const response = await xquikRequest(z, { method: "POST", url: `${BASE_URL}/webhooks`, body: { url: bundle.targetUrl, eventTypes: bundle.inputData.eventTypes, }, }); return { id: response.data.id, secret: response.data.secret, eventTypes: response.data.eventTypes, }; } ``` Zapier stores this result in `bundle.subscribeData`. Never expose the `secret` through trigger output. Use this path only for isolated testing. ### Unsubscribe ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async function unsubscribeHook(z, bundle) { const response = await xquikRequest(z, { method: "DELETE", url: `${BASE_URL}/webhooks/${bundle.subscribeData.id}`, }); return response.data; } ``` ### Direct prototype perform ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const { createHmac, timingSafeEqual } = require("node:crypto"); const FIVE_MINUTES_MS = 5 * 60 * 1000; function readRawHeader(headers, requestedName) { const wanted = requestedName.toLowerCase(); for (const [name, value] of Object.entries(headers || {})) { const normalized = name.toLowerCase().replace(/^http-/, ""); if (normalized === wanted) { return String(value); } } return ""; } function verifyXquikWebhook(z, bundle) { const rawBody = bundle.rawRequest?.content; const headers = bundle.rawRequest?.headers; const secret = bundle.subscribeData?.secret; const timestamp = readRawHeader(headers, "x-xquik-timestamp"); const nonce = readRawHeader(headers, "x-xquik-nonce"); const signature = readRawHeader(headers, "x-xquik-signature"); if (!rawBody || !secret || !timestamp || !nonce || !signature) { throw new z.errors.Error( "Webhook rejected. Signing fields are missing.", "XquikWebhookVerificationError", 400, ); } const timestampMs = Number(timestamp); if (!Number.isFinite(timestampMs) || Math.abs(Date.now() - timestampMs) > FIVE_MINUTES_MS) { throw new z.errors.Error( "Webhook rejected. Timestamp is stale or invalid.", "XquikWebhookVerificationError", 400, ); } const signingString = `${timestamp}.${nonce}.${rawBody}`; const expected = "sha256=" + createHmac("sha256", secret).update(signingString).digest("hex"); const expectedBuffer = Buffer.from(expected); const actualBuffer = Buffer.from(signature); if ( expectedBuffer.length !== actualBuffer.length || !timingSafeEqual(expectedBuffer, actualBuffer) ) { throw new z.errors.Error( "Webhook rejected. Signature does not match.", "XquikWebhookVerificationError", 400, ); } return JSON.parse(rawBody); } function performMonitorEvent(z, bundle) { const payload = verifyXquikWebhook(z, bundle); return [ { id: payload.streamEventId || payload.deliveryId || String(payload.timestamp), delivery_id: payload.deliveryId || null, stream_event_id: payload.streamEventId || null, event_type: payload.eventType, occurred_at: payload.occurredAt || payload.timestamp, username: payload.username || null, tweet_id: payload.data?.id || null, text: payload.data?.text || null, author_username: payload.data?.author?.userName || payload.username || null, }, ]; } ``` Verify `bundle.rawRequest.content` before using `bundle.cleanedRequest`. Zapier prefixes most inbound raw headers with `Http-`. Normalize that prefix. Zapier does not provide a durable 5-minute nonce store. Place a durable verification relay before Zapier in production. Verify HMAC, timestamps, and nonces there. Deduplicate `deliveryId` and `streamEventId` before forwarding. Zapier owns responses from `bundle.targetUrl`. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async function performList(z) { const response = await xquikRequest(z, { method: "GET", url: `${BASE_URL}/events`, params: { limit: 1 }, }); return (response.data.events || []).slice(0, 1).map((event) => ({ id: event.id, delivery_id: null, stream_event_id: event.id, event_type: event.type, occurred_at: event.occurredAt, username: event.username || null, tweet_id: event.data?.id || null, text: event.data?.text || null, author_username: event.data?.author?.userName || event.username || null, })); } ``` Testing a REST Hook calls `performList`, not the live `perform` handler. ## Next steps * [Zapier Twitter integration](/guides/zapier) * [Zapier error handling](/guides/zapier-error-handling) * [Zapier result handoff](/guides/zapier-result-handoff) # Zapier Twitter result handoff & output fields Source: https://docs.xquik.com/guides/zapier-result-handoff Map X (Twitter) results in Zapier with samples and outputFields. Later Zap steps then read stable snake_case values from tweets, profiles, jobs, and events. > For the complete documentation index, see [llms.txt](/llms.txt). This guide belongs to the [Zapier Twitter integration](/guides/zapier) build. ## Result handoff Use Zapier samples and `outputFields` so later Zap steps map stable values. Use snake_case storage keys when direct API responses use camelCase. Return compact objects from actions and arrays from triggers. > [card] Search tweets action > > Return `id`, `tweet_id`, `text`, `author_username`, `created_at`, and `url`. Keep `has_next_page` and `next_cursor` when a Zap loops pages. > [card] User profile rows > > Return source `id` as `user_id`. Keep `username`, `name`, `followers`, `verified`, and `profile_picture`. Store the input, `has_next_page`, and `next_cursor` separately. > [card] Follower and following rows > > Store `user_id`, `username`, `name`, `followers`, `following`, `verified`, and `profile_picture`. Keep the source account, page cursor, and relationship direction. > [card] Trend rows > > Return each trend `name`, `rank`, `query`, and `description`. Keep response `count`, `woeid`, and the selected region with the Zap run. > [card] Tweet or reply write > > Send a unique `Idempotency-Key`. Store `id`, `status`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. > [card] Media attachments > > For tweets or replies, pass public URLs in `media` or uploaded IDs in `media_ids`. Never send both. For DMs, upload first. Pass 1 `media_id` in `media_ids`. Store `message_id` and leave `reply_to_message_id` unset. > [card] Monitor and webhook setup > > Return monitor `id`, `username`, `xUserId`, `eventTypes`, `isActive`, and `nextBillingAt`. Return webhook `id`, `url`, `eventTypes`, and one-time `secret`. Map production `deliveryId` to `delivery_id` for receiver retry deduplication. Map `streamEventId` to `stream_event_id` for event deduplication across webhook changes. > [card] REST hook trigger > > Return `id`, `delivery_id`, and `stream_event_id`. Use delivery IDs for endpoint retries. Use event IDs across webhook changes. > [card] Stored event replay > > Call `GET /events` with `cursor` when a Zap needs replay. Map event and monitor IDs first. Then map `occurredAt`, `hasMore`, and `nextCursor` to snake_case fields. > [card] Receiver acceptance > > Zapier controls responses from its generated hook URL. Use a relay when you > need custom acceptance or replay rules. Keep signing values, raw bodies, and > raw signatures outside Zap history. Keep full headers outside business apps > too. > [card] Extraction polling trigger > > Return completed job `id`, `toolType`, and `status`. Store normalized IDs, status, `has_more`, and `next_cursor`. Then fetch detail rows. Map friendly region names to WOEID values. Submit the selected value to Xquik. This example shows a search action. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async function performSearchTweets(z, bundle) { const response = await xquikRequest(z, { method: "GET", url: `${BASE_URL}/x/tweets/search`, params: { q: bundle.inputData.q, queryType: bundle.inputData.queryType || "Latest", limit: bundle.inputData.limit || 25, cursor: bundle.inputData.cursor || undefined, }, }); const page = response.data; return (page.tweets || []).map((tweet) => ({ id: tweet.id, tweet_id: tweet.id, text: tweet.text, author_username: tweet.author?.username || null, created_at: tweet.createdAt || null, url: tweet.url || null, has_next_page: Boolean(page.has_next_page), next_cursor: page.next_cursor || null, })); } module.exports = { key: "search_tweets", noun: "Tweet", display: { label: "Search Tweets", description: "Find recent tweets that match a search query.", }, operation: { inputFields: [ { key: "q", label: "Query", required: true, type: "string" }, { key: "queryType", label: "Order", required: false, choices: ["Latest", "Top"], }, { key: "limit", label: "Limit", required: false, type: "integer" }, { key: "cursor", label: "Cursor", required: false, type: "string" }, ], perform: performSearchTweets, sample: { id: "1840000000000000000", tweet_id: "1840000000000000000", text: "Example tweet text", author_username: "example_user", created_at: "2026-08-02T12:00:00Z", url: "https://x.com/example_user/status/1840000000000000000", has_next_page: true, next_cursor: "DAACCgACExample", }, outputFields: [ { key: "id", label: "Tweet ID" }, { key: "tweet_id", label: "Tweet ID for Storage" }, { key: "text", label: "Text" }, { key: "author_username", label: "Author Username" }, { key: "created_at", label: "Created At" }, { key: "url", label: "URL" }, { key: "has_next_page", label: "Has Next Page", type: "boolean" }, { key: "next_cursor", label: "Next Cursor" }, ], }, }; ``` ## Next steps * [Zapier Twitter integration](/guides/zapier) * [Zapier error handling](/guides/zapier-error-handling) * [Monitor event REST hook](/guides/zapier-monitor-rest-hook) # Tweet scraper & X API alternative Source: https://docs.xquik.com/index Use Xquik as a tweet scraper and X API alternative. Search tweets, export followers and replies, retrieve profiles and timelines, and automate webhooks. > For the complete documentation index, see [llms.txt](/llms.txt). Use Xquik as a tweet scraper and X API alternative. Its X (Twitter) scraper API searches tweets and can scrape follower lists and replies. It also retrieves profiles and timelines. Post tweets, upload media, and monitor tweets every 1 second. Track profile changes, send signed webhooks, and connect SDKs or MCP. Accountless guest wallets cover the prepaid GET reads. Direct MPP covers fixed-price operations. ## Run in Postman Fork the official Xquik collection into your Postman workspace. It holds every request you can send with an API key. It groups them by tag, with example responses. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/12709954-5ee4fae0-138a-4615-ae47-ac4be7904df2?action=collection%2Ffork\&source=rip_markdown\&collection-url=entityId%3D12709954-5ee4fae0-138a-4615-ae47-ac4be7904df2%26entityType%3Dcollection%26workspaceId%3Db77ecb6f-d780-4179-968c-95dc06ae28c0) Paste your API key into the collection's `apiKey` variable, then send any request. Browse the [public Postman workspace](https://www.postman.com/xquik-dev/xquik-apis) or the [hosted collection docs](https://documenter.getpostman.com/view/12709954/2sBY4TpxXK). To import it into another tool, use the [collection file](https://xquik.com/xquik.postman_collection.json). ## Copy-ready X tasks Use these after you create an API key. Each call returns JSON. Send it to an app, agent, spreadsheet job, webhook worker, or dashboard. ### Search tweets Returns `tweets`, `has_next_page`, and `next_cursor`. Omit `mode` for automatic maximum coverage. Pass `next_cursor` back unchanged as `cursor`. Search supports X operators such as `from:username`, `since:YYYY-MM-DD`, `until:YYYY-MM-DD`, hashtags, phrases, and `OR`. The cost is 1 credit per tweet returned. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/tweets/search \ --data-urlencode "q=from:username giveaway" \ --data-urlencode "queryType=Latest" \ --data-urlencode "limit=50" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "tweets": [ { "id": "1780000000000000000", "text": "Giveaway entry is open.", "createdAt": "2026-05-08T04:00:00Z", "likeCount": 42, "retweetCount": 5, "replyCount": 3, "author": { "id": "9876543210", "username": "username", "name": "Xquik" } } ], "has_next_page": true, "next_cursor": "DAACCgACGRElMJcAAA" } ``` ### List followers Returns `users`, `has_next_page`, and `next_cursor`. Omit `mode` for automatic maximum coverage. Pass `next_cursor` back unchanged as `cursor`. Use `pageSize` to cap each page between 20 and 10,000 users. The cost is 1 credit per follower returned. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -G https://xquik.com/api/v1/x/users/username/followers \ --data-urlencode "pageSize=50" \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "users": [ { "id": "9876543210", "username": "username", "name": "Xquik", "followers": 10000, "following": 500, "verified": true } ], "has_next_page": true, "next_cursor": "DAACCgACGRElMJcAAA" } ``` ### Upload media from a URL Returns `mediaId` for tweet and DM `media_ids`, plus `mediaUrl` for tweet `media` arrays. URL uploads suit agents and workflow tools that pass files by HTTPS URL. The cost is 10 credits per upload. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/x/media \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"account": "myxhandle", "url": "https://example.com/image.png"}' | jq ``` ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "success": true, "mediaId": "1893726451023847424", "mediaUrl": "https://media.xquik.com/uploads/1893726451023847424.png" } ``` ## Use Xquik with AI agents Give agents a docs index first, then choose the execution path. * Use [llms.txt](/llms.txt) when an agent needs the right page. It covers the API, SDK, MCP, webhook, and billing pages. * Use the [Context7 library](https://context7.com/xquik-dev/xquik-docs) when your coding environment supports Context7 docs lookup. * Install the [Xquik Skill](https://github.com/Xquik-dev/x-twitter-scraper) when the agent writes Xquik code. It covers tweet search, follower exports, media uploads, DMs, monitors, and webhooks. * Install the [X API alternative Skill](https://github.com/Xquik-dev/x-api) to move official X API code to Xquik. * Connect API MCP at `https://xquik.com/mcp` for authenticated tasks. Use the [current client path](/mcp/overview#client-compatibility) for OAuth, API-key fallback, or an adapter. Full credentials expose every catalog route. Guest `paid_reads` keys expose the eligible paid-read routes. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npx skills add Xquik-dev/x-twitter-scraper npx skills add Xquik-dev/x-api ``` ## What you can do See [every Xquik feature](/api-reference/features) in 1 list, grouped by theme. > [card] Tweets, followers & more > > Pull followers, following, replies, reposts, likes, and quotes. Also pull community members, list members, Space participants, tweet threads, profiles, posts, and media. > [card] Giveaway draws > > Run random draws with archived tweet snapshots and public result pages. > [card] Account monitoring > > Check monitored accounts every second. Deliver matched events through signed webhooks. > [card] Developer API > > Use REST API v1, HMAC-signed webhooks, and an MCP server for AI agents. > [card] Trending topics > > Read current X trends across 12 regions. > [card] Radar > > Free trending topics and news from Xquik's own infrastructure. Filter by category, region, and time window. > [card] Tweet composer > > Get source-backed writing guidance and one input check. It is free and needs no credits. > [card] Style analysis & drafts > > Analyze tweet styles, compare accounts, track engagement performance, and save tweet drafts. Cache recent tweets for reference when composing. > [card] X write API > > Act from your connected X accounts. Post tweets, like, retweet, follow, send DMs, upload media, and manage community membership. > [card] Pay-per-use API > > Fund guest reads through a hosted checkout. Pay for fixed-price operations through direct MPP. You need no account. ## For developers Xquik provides 6 integration methods. **1. REST API v1** Create monitors, query events, and manage webhooks. Authenticate with API keys via the `x-api-key` header. **2. HMAC webhooks** Receive monitor events at your HTTPS endpoint. Every delivery uses an HMAC-SHA256 signature. **3. MCP server** Connect AI agents through API MCP. Use OAuth 2.1 where supported. Otherwise, use the [documented client fallback](/mcp/overview#client-compatibility). Code Mode exposes `docs`, `search`, `execute`, and `whoami`. Add `?codemode=false` for OpenAPI-native tools. **4. AI agent skill** Add the [Xquik Skill](https://github.com/Xquik-dev/x-twitter-scraper) to a compatible agent. Claude Code, Cursor, Codex, Copilot and Windsurf all work. It covers the Xquik API, MCP tools, and REST operations. Run `npx skills add Xquik-dev/x-twitter-scraper`. **5. Guest wallets** Prepay the eligible paid-read routes without an account. Confirm USD 10 to 250 and create a hosted checkout through REST. Use the `paid_reads` key after Xquik verifies payment. **6. Machine Payments Protocol** Pay per API call without subscribing. MPP payments through Tempo (USDC) cover fixed-price read operations. See the [MPP overview](/mpp/machine-payments-protocol) for operations and pricing. ## Quick links > [card] [Quickstart](/x-api-quickstart) > > Get your API key and make your first request in 5 minutes. > [card] [API reference](/api-reference/overview) > > Read endpoint documentation with request and response schemas. > [card] [MCP server](/mcp/overview) > > Use Code Mode or OpenAPI-native tools through API MCP. # AI agent MCP handoff for tweet search & exports Source: https://docs.xquik.com/mcp/agent-handoff Route AI agents between tweet search, follower exports, account actions, Docs MCP, API MCP, REST, SDKs, webhooks, and event replay. See tool examples. > For the complete documentation index, see [llms.txt](/llms.txt). Use this page when an AI agent needs to choose the right Xquik interface. It can search tweets, inspect X (Twitter) profiles, export followers, or recover missed webhooks. Keep live calls narrow. Aggregate high-volume pages inside the sandbox. Store cursor state. Move durable jobs to REST, SDKs, or webhooks. ## Pick the agent interface > [card] Docs MCP > > Use `https://docs.xquik.com/mcp` for public docs, API reference pages, > examples, troubleshooting, or type definitions. It is read-only and requires > no auth. > [card] API MCP > > Use API MCP at `https://xquik.com/mcp` for live calls. Full account > keys and OAuth tokens expose every catalog route. Guest `paid_reads` keys > expose only the eligible GET routes. Current SDKs negotiate MCP > `2026-07-28` through `server/discover`. > [card] REST or SDK > > Use REST or generated SDKs when a service owns work outside the chat > session. That means retries, cursor storage, file downloads, queues, > or batch jobs. > [card] Webhooks and replay > > Use monitor webhooks for fresh events. Use `GET /api/v1/events` when a > receiver, queue, warehouse, or agent run needs replay. ## Use the default agent route 1. Search public docs or `llms.txt` before requesting current API data. 2. Use `docs` for product guidance. Use `search` before `xquik.request(...)`. That search confirms the endpoint path, required parameters, costs, and response shape. 3. Keep requested filters. Never add others. Call `xquik.request({ path, method?, query?, body? })` with the smallest useful page. Hosted MCP injects authentication and required idempotency headers. 4. Continue while `has_more` is true and `next_cursor` advances. 5. Return normalized rows, IDs, counts, samples, and cursors instead of full raw pages. 6. Hand long-running or replayable work to REST, SDKs, webhooks, or exports. Credential lifecycle operations and direct saved-payment mutations are not in the MCP catalog. Guest wallet creation, status, and top-up also remain direct REST only. A `402` creates no checkout, and its MCP answer names no checkout step. Report the balance, the required credits and the `dashboard` link. The user adds credits at that link in the browser. MCP has no checkout, top-up, subscription or guest wallet tool. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { return Object.entries(spec.paths).flatMap(([path, methods]) => Object.entries(methods).flatMap(([method, operation]) => path.includes("/x/tweets/search") || operation?.summary?.toLowerCase().includes("followers") ? [{ method: method.toUpperCase(), path, ...operation }] : [], ), ); }; ``` ## Route guest paid reads An active guest key gives `search` and `execute` a read-only catalog. It lists the eligible operations. The `docs` tool remains available. Every route appears in the [guest paid-read inventory](/guides/guest-wallets#eligible-paid-read-routes). Batch `GET /api/v1/x/tweets` reads every tweet ID the URL holds. The sandbox cannot execute writes, account actions, automations, billing, or credential management. It cannot execute any other read either. OAuth and full account behavior remain unchanged. If the guest key needs creation, activation status, or more credits, leave MCP. Then follow the [accountless guest wallet flow](/guides/guest-wallets) through direct REST. * [`POST /api/v1/guest-wallets`](/api-reference/guest-wallets/create) * [`GET /api/v1/guest-wallets/status`](/api-reference/guest-wallets/status) * [`POST /api/v1/guest-wallets/topups`](/api-reference/guest-wallets/topup) Creation and top-up require explicit user confirmation. Status polling does not create payment. Never place the guest key in tool code, chat output, or shared agent state. Never place its creation `Idempotency-Key` there either. ## Return stored rows MCP returns normalized snake_case fields, structured errors, and date-time fields as Unix seconds. Keep agents on `has_more` and `next_cursor`. Do so even when REST or SDK pages show camelCase response fields. Read a REST `createdAt` field as `created` in MCP results. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const query = "from:username MCP"; const { result: page } = await xquik.request({ path: "/api/v1/x/tweets/search", query: { q: query, limit: "50" }, }); return { source: "xquik_mcp", job: "tweet_search", query, rows: page.tweets.map((tweet) => ({ tweet_id: tweet.id, text: tweet.text ?? null, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, created_at: tweet["created"] ?? null, url: tweet.url ?? null, })), has_more: page.has_more, next_cursor: page.next_cursor, }; }; ``` ## Follow cursor rules | Source | Next request | | - | - | | MCP tweet, profile, follower, reply, timeline, community, and list pages | Pass `next_cursor` back as `cursor` when `has_more` is true. | | MCP `/api/v1/draws`, `/api/v1/extractions`, and `/api/v1/events` | Pass `next_cursor` back as `cursor`. | | MCP `/api/v1/radar` | Pass `next_cursor` back as `after`. | | MCP `/api/v1/drafts` | Pass `next_cursor` back as `afterCursor`. | | REST and generated SDKs | Follow the response fields documented on that endpoint page. | Full account sessions can check `GET /api/v1/credits` before large reads. Guest sessions receive balance and top-up context in `402`. The direct REST guest status route reports the balance. Low balances can return smaller pages. Zero affordable rows can return `402 insufficient_credits`. Follow these rules for high-volume MCP reads. * Deduplicate tweet or user rows by stable `id` * Continue through empty pages when `has_more` is true * Stop at the requested total, page cap, `has_more: false`, or `cursor_stalled` when cursors repeat. Keep output below 24,000 characters. ## Store handoff state Store the values a later agent, service, or workflow needs. Then it can resume without reading chat history. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "agent_job_id": "mcp-research-q2", "surface": "api_mcp", "endpoint": "GET /api/v1/x/tweets/search", "query": "from:username MCP", "cursor_param": "cursor", "next_cursor": "DAACCgACGRElMJcAAA", "has_more": true, "webhook_id": "15", "delivery_id": "502", "stream_event_id": "9002", "event_replay_route": "GET /api/v1/events?cursor=9002", "export_route": "GET /api/v1/extractions/77777/export?format=json", "saved_fields": ["tweet_id", "author_username", "text", "url"] } ``` Keep API keys, webhook secrets, raw request bodies, raw signatures, and full headers out. That covers chat transcripts, shared agent memory, spreadsheets, CRM rows, and queue payloads. ## Know when to leave MCP > [card] [File exports](/guides/response-formats-exports) > > Use extraction export endpoints for CSV, JSON, XLSX, Markdown, or PDF files. > [card] [Webhook receivers](/guides/twitter-webhook-testing) > > Use signed webhooks when downstream systems need fresh monitor events. > [card] [Replay jobs](/guides/brand-monitoring-workflow) > > Use stored events and delivery rows when receivers miss work. > [card] [SDK backends](/sdks) > > Use SDKs when a backend owns retries, storage, and batch orchestration. ## Continue with focused references > [card] [MCP tools reference](/mcp/tools) > > Review Code Mode, OpenAPI-native tools, response contracts, and examples. > [card] [Docs MCP server](/mcp/docs-mcp) > > Connect read-only documentation search beside the API MCP server. > [card] [No-code handoff](/guides/no-code-workflow-handoff) > > Hand monitor events, exports, and direct reads to workflow platforms. > [card] [Webhook testing](/guides/twitter-webhook-testing) > > Verify signed receivers before accepting production events. # ChatGPT X (Twitter) app to read tweets & profiles Source: https://docs.xquik.com/mcp/chatgpt Connect Xquik to ChatGPT with OAuth. Search X (Twitter) posts, read replies, threads & timelines, look up profiles, and see trends. It uses your Xquik credits. > For the complete documentation index, see [llms.txt](/llms.txt). The Xquik ChatGPT app reads public X (Twitter) data in a ChatGPT chat. It uses the `docs`, `search`, `execute` & `whoami` tools of the [API MCP server](/mcp/overview). Each result uses your Xquik credits. ## Connect Xquik 1. In ChatGPT on the web, open **Settings > Security and login**. Turn on **Developer mode**. 2. Open [chatgpt.com/plugins](https://chatgpt.com/plugins) and select **+**. 3. Enter `https://xquik.com/mcp?app=chatgpt`, then select **Create**. 4. Sign in to Xquik & approve read-only access when prompted. 5. Open **Personal**, select Xquik & select **+** to install it. 6. Start a new chat. Type `@`, select Xquik & describe your task. Use Xquik in Chat or Work. Try "Find popular posts about the Artemis launch." Developer mode supports Plus, Pro, Business, Enterprise & Edu accounts on the web. Workspace admins control developer mode & plugin access. Ask your admin when Developer mode or the plus button is missing. For posting, monitors & other operations, enter `https://xquik.com/mcp` instead. ChatGPT uses Xquik OAuth and cannot present a custom API key. If ChatGPT's labels change, follow [OpenAI's setup guide](https://developers.openai.com/plugins/deploy/connect-chatgpt). ## Plugins & client access These steps create your personal MCP connection, without a public directory submission. They do not install bundled Skills. Follow [OpenAI's setup guide](https://developers.openai.com/plugins/deploy/connect-chatgpt) for account eligibility & supported authentication. [ChatGPT supports plugins](https://learn.chatgpt.com/docs/plugins) on web, desktop & mobile. On mobile, use plugins available to your account. Create your connection on the web first. If Xquik is unavailable on mobile, continue on the web. Imported packages with MCP server declarations are [Desktop only](https://learn.chatgpt.com/docs/enterprise/plugin-management#desktop-only-plugins), even with HTTPS URLs. Workspace publication only reaches accounts inside that workspace. Public directory links require an [approved & published plugin](https://developers.openai.com/plugins/deploy/app-review#publication-and-distribution). See [Codex setup & plugin distribution](/mcp/overview#plugin-distribution) for local marketplace options. ## Tools | Tool | What it does | | - | - | | `docs` | Searches the Xquik documentation | | `search` | Finds the reads the app can run & their inputs | | `execute` | Runs those reads & returns the data | | `whoami` | Names the Xquik account you signed in with | The app asks only for read-only access. `search` & `execute` reach public post search, posts, replies, and threads. They also reach profiles, profile search, an account's posts & trends. No tool posts, follows or changes your account. ## Results An answer holds up to 24,000 characters. Paged reads return `next_cursor`. Ask for more, and ChatGPT reads the next page. The [REST API](/api-reference/overview) returns the same records. ## Credits Results cost the prices in [Billing](/guides/billing). When your balance can't cover a request, the answer says so. Add credits in your Xquik dashboard, then ask again. ## Troubleshooting * **Sign-in fails.** Remove the app, add it again, then sign in. * **A tool is missing.** Open the app in [chatgpt.com/plugins](https://chatgpt.com/plugins) and select **Refresh**. Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp. # Coding-agent MCP setup for X API & OAuth clients Source: https://docs.xquik.com/mcp/coding-agents Connect Claude Code, Cursor, OpenCode, Pi & Codex to Xquik MCP. Compare current releases, OAuth setup & API-key formats. Use public Docs MCP without login. Use `https://xquik.com/mcp` for authenticated X (Twitter)/Twitter actions. Use `https://docs.xquik.com/mcp` for public documentation, without authentication. See [MCP setup](/mcp/overview#setup) for the full client examples. ## Current client releases We checked these official releases on October 1, 2026. Versions below record that review. Install your client's latest stable release before setup. | Client | Reviewed release | API MCP path | | - | - | - | | Claude Code | [2.1.287](https://github.com/anthropics/claude-code/releases/tag/v2.1.287) | Native HTTP & OAuth | | Cursor | [Desktop 3.22](https://cursor.com/download), [CLI 2026.10.01-14929f9](https://cursor.com/install) | Native HTTP & OAuth | | OpenCode | [1.18.34](https://github.com/anomalyco/opencode/releases/tag/v1.18.34) | Native remote MCP & OAuth | | Codex | [0.159.3](https://github.com/openai/codex/releases/tag/rust-v0.159.3) | Native HTTP & OAuth | | Pi | [1.0.0](https://github.com/earendil-works/pi/releases/tag/v1.0.0) | Native HTTP & OAuth | | GitHub Copilot CLI | [1.0.91](https://github.com/github/copilot-cli/releases/tag/v1.0.91) | Native HTTP & OAuth | | Gemini CLI | [0.62.0](https://github.com/google-gemini/gemini-cli/releases/tag/v0.62.0) | Native HTTP & OAuth | | Cline | [CLI 3.0.67](https://github.com/cline/cline/releases/tag/cli-v3.0.67), [extension 4.1.22](https://github.com/cline/cline/releases/tag/v4.1.22), [Desktop 0.0.40](https://github.com/cline/cline/releases/tag/desktop-v0.0.40) | Native HTTP & OAuth | | Qwen Code | [CLI 0.24.7](https://github.com/QwenLM/qwen-code/releases/tag/v0.24.7) | Native HTTP & OAuth | | Goose | [1.52.0](https://github.com/aaif-goose/goose/releases/tag/v1.52.0) | Native HTTP & OAuth | | VS Code | [1.140.0](https://code.visualstudio.com/updates) | Native HTTP & OAuth | | Windsurf / Devin Desktop | [3.10.48](https://docs.devin.ai/desktop/releases) | Separate Cascade & Devin Local configuration | | Roo Code | [3.54.0, archived](https://github.com/RooCodeInc/Roo-Code/releases/tag/v3.54.0) | API-key headers without native MCP OAuth | These paths describe vendor support. Complete Xquik authorization before calling paid tools. For Codex & ChatGPT, follow the [OpenAI setup guides](/mcp/overview#openai). ## Codex Current Codex supports Xquik OAuth with the shared local MCP configuration. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} codex mcp add xquik --url https://xquik.com/mcp codex mcp login xquik codex mcp list ``` Complete sign-in & authorization in your browser. The CLI, app & IDE extension share the host's MCP configuration. See [OpenAI setup](/mcp/overview#openai) & [Codex MCP](https://learn.chatgpt.com/docs/extend/mcp). For API keys, use [environment-backed authentication](/mcp/overview#codex-api-key-authentication). ## Claude Code Add Xquik to your user configuration. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} claude mcp add --scope user --transport http xquik https://xquik.com/mcp claude mcp login xquik claude mcp list ``` Use `--scope project` to share the URL through `.mcp.json`. Claude Code asks you to approve project servers before connecting. Use `/mcp` inside a session to authenticate or reconnect. Version 2.1.286 fixes stale MCP discovery & repeated authentication reminders. It also fixes credential redaction in MCP errors. Upgrade before diagnosing those symptoms. Version 2.1.287 keeps managed permissions for all MCP tool names. Xquik supports automatic registration. Leave client ID & client secret unset. For API-key headers, `.mcp.json` expands `${XQUIK_API_KEY}` from your environment. See [Claude Code MCP](https://code.claude.com/docs/en/mcp). ## Cursor Keep the existing URL entry in `~/.cursor/mcp.json` or `.cursor/mcp.json`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "mcpServers": { "xquik": { "url": "https://xquik.com/mcp" } } } ``` Current [Cursor CLI docs](https://cursor.com/docs/cli/mcp) use the `agent` command. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} agent mcp login xquik agent mcp list ``` Approve the server when prompted. Team distribution does not automatically enable it. Enterprise policy may restrict servers. Xquik needs no static OAuth `auth` object. API-key headers use `${env:XQUIK_API_KEY}`. Remote entries cannot load `envFile`. See [Cursor MCP configuration](https://cursor.com/docs/mcp). ## OpenCode Add this entry to `opencode.json`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "$schema": "https://opencode.ai/config.json", "mcp": { "xquik": { "type": "remote", "url": "https://xquik.com/mcp" } } } ``` Then authenticate and check discovery. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} opencode mcp auth xquik opencode mcp list ``` OpenCode automatically registers the client & refreshes OAuth tokens. For connection failures, run `opencode mcp debug xquik`. An API-key entry needs `"oauth": false` & `Bearer {env:XQUIK_API_KEY}`. See [OpenCode MCP servers](https://opencode.ai/docs/mcp-servers/). ## Pi Pi 1.0.0 has native MCP. No community adapter is required. If your build lacks `pi mcp`, run `pi update self` before setup. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} pi mcp add xquik --url https://xquik.com/mcp pi mcp login xquik pi mcp list ``` Pi stores global servers in `~/.pi/agent/mcp.json`. Use `--local` for `.pi/mcp.json`. Project trust is required. Pi supports Streamable HTTP, not legacy SSE. Use `/mcp` to inspect connections & `/reload` after changing external configuration. Pi 1.0.0 validates OAuth callback issuers & stores credentials per server name & URL. Different server names at the same URL need separate sign-ins. Pi's default `codemode` exposure makes tools available through tool search & scripts. Use `--exposure direct` when adding Xquik to expose its 4 tools directly. Pi's exposure setting is separate from Xquik's [tool mode](/mcp/overview#choose-a-tool-mode). For an environment-backed API key, run this command. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} pi mcp add xquik --url https://xquik.com/mcp --bearer-token-env-var XQUIK_API_KEY ``` Set `XQUIK_API_KEY` before starting Pi. This replaces OAuth for that entry. See [Pi's MCP guide](https://github.com/earendil-works/pi/blob/v1.0.0/packages/coding-agent/docs/mcp.md). ## Copilot CLI, Gemini CLI, Cline & Qwen Code Current Copilot CLI uses this command. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} copilot mcp add --transport http xquik https://xquik.com/mcp ``` The URL is positional. Use `/mcp` to inspect the server & complete authentication. Version 1.0.90 improves discovery recovery & cached OAuth token reuse. See [Copilot CLI MCP setup](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers). Gemini CLI & Qwen Code retain `httpUrl` for manual Streamable HTTP entries. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "mcpServers": { "xquik": { "httpUrl": "https://xquik.com/mcp" } } } ``` Gemini uses `~/.gemini/settings.json`. Qwen uses `~/.qwen/settings.json`. Use their `/mcp` authentication flow after adding the server. See [Gemini MCP](https://geminicli.com/docs/tools/mcp-server/) & [Qwen MCP](https://qwenlm.github.io/qwen-code-docs/en/users/features/mcp/). Cline CLI uses `cline mcp` to manage servers & OAuth. Its extension uses the MCP Servers panel. Choose Streamable HTTP & enter `https://xquik.com/mcp`. The CLI, extension & Desktop app have separate release versions. See [Cline MCP](https://docs.cline.bot/mcp/mcp-overview). ## VS Code Current VS Code recommends portable `.mcp.json` for new project servers. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "mcpServers": { "xquik": { "type": "http", "url": "https://xquik.com/mcp" } } } ``` Existing `.vscode/mcp.json` entries still use the top-level `servers` object. Run the `MCP: Add Server` command for guided setup, then approve server trust & OAuth. Managed MCP policies may restrict access. See [VS Code MCP setup](https://code.visualstudio.com/docs/agent-customization/mcp-servers). ## Windsurf / Devin Desktop Current Windsurf documentation calls the editor Devin Desktop. Choose the guide for your active agent. For Devin Local, run these commands. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} devin mcp add xquik https://xquik.com/mcp devin mcp login xquik devin mcp list ``` Current Devin CLI stores servers in dedicated `mcp_config.json` files. The default local file is `.devin/mcp_config.local.json`. Use `--scope user` for your global configuration. See [Devin MCP configuration](https://docs.devin.ai/cli/extensibility/mcp/configuration). Legacy Cascade uses `mcp_config.json` with `mcpServers` & `serverUrl`. Open that file through Cascade's MCP menu to find your installed version's location. Current macOS & Linux releases use `~/.config/devin/mcp_config.json`. Older Windsurf releases used `~/.codeium/windsurf/mcp_config.json`. Cascade allows 100 enabled tools total, so prefer Xquik's default Code Mode. See [Cascade MCP configuration](https://docs.devin.ai/desktop/cascade/mcp). ## TRAE TRAE reads remote MCP servers from its MCP JSON settings. An entry with the URL alone cannot sign in. So add your API key as a header. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "mcpServers": { "xquik": { "url": "https://xquik.com/mcp", "headers": { "Authorization": "Bearer xq_your_api_key_here" } } } } ``` Create the key on the [API Keys dashboard](https://dashboard.xquik.com/en/api-keys). TRAE keeps the key in its settings file. So keep that file out of version control. A key Xquik does not accept gets a `401` that says so. See [TRAE's MCP guide](https://docs.trae.ai/ide/add-mcp-servers). ## Zed Zed reads remote MCP servers from its settings. Xquik needs no extension. Open Settings, choose AI, then MCP Servers. Click Add Server & choose Add Remote Server. Zed opens a JSON editor with a sample entry. Replace `some-remote-server` with `xquik` & the sample URL with `https://xquik.com/mcp`. You can also run `zed: open settings file` and add this entry. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "context_servers": { "xquik": { "url": "https://xquik.com/mcp" } } } ``` Xquik lists its tools before sign-in. So Zed shows the server as running first. The first tool call returns a `401`. Zed then shows Authenticate in MCP Servers. Click it & finish sign-in & authorization in your browser. Prefer OAuth. An API key sits in plain text in `settings.json`. To use one anyway, add a bearer header. Zed then skips OAuth. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "context_servers": { "xquik": { "url": "https://xquik.com/mcp", "headers": { "Authorization": "Bearer xq_your_api_key_here" } } } } ``` Create the key on the [API Keys dashboard](https://dashboard.xquik.com/en/api-keys). Keep `settings.json` out of version control. See [Zed MCP](https://zed.dev/docs/ai/mcp). ## Goose & Roo Code Goose 1.46.0 fixed the OAuth issuer callback defect. Current 1.52.0 retains that fix. Add a Streamable HTTP extension and complete the browser authorization flow. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} goose session --with-streamable-http-extension https://xquik.com/mcp ``` See [Goose extensions](https://goose-docs.ai/docs/getting-started/using-extensions/) & the [issuer fix](https://github.com/aaif-goose/goose/releases/tag/v1.46.0). Goose also supports [environment-backed API-key headers](/mcp/overview#remaining-api-key-and-adapter-paths). Roo Code is archived. Its final release supports HTTP headers without MCP OAuth. Use its [environment-backed API-key configuration](/mcp/overview#remaining-api-key-and-adapter-paths). ## Check the connection Confirm the server connects & lists `docs`, `search` & `execute`. Those are Xquik's default Code Mode tools. Xquik also lists these tools before sign-in. So a tool list does not prove sign-in. The client asks you to sign in at its first tool call. Native mode at `?codemode=false` exposes individual operations instead. Use `xquik-docs` as a separate entry for `https://docs.xquik.com/mcp`. That server needs no OAuth & searches public documentation. A successful Docs MCP connection does not authorize API MCP. See [Docs MCP setup](/mcp/docs-mcp). OAuth connections need browser login & consent in each client. Do not copy another client's token store. For a `401`, use the client's authentication flow. For issuer errors, upgrade the affected client before retrying. Include the UTC time & `X-Request-Id` when [reporting a connection failure](/guides/troubleshooting). # Docs MCP server for tweet, follower & webhook docs Source: https://docs.xquik.com/mcp/docs-mcp Search Xquik tweet, follower, profile, monitor, webhook, extraction, SDK, MCP, and account-action documentation from AI tools. Includes OAuth and tool examples. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik documentation is available as an MCP server at `https://docs.xquik.com/mcp`. AI tools can search the full docs site and retrieve indexed public pages. Both happen during conversations. Those pages include API reference, guides, examples, and type definitions. This differs from the [Xquik API MCP server](/mcp/overview) at `xquik.com/mcp`. That server searches tweets, looks up profiles, exports followers, runs draws, and manages monitors. The docs MCP server is read-only and requires no authentication. ## Agent route checklist > [card] Read docs first > > Use Docs MCP at `https://docs.xquik.com/mcp` for public docs, API > parameters, and examples. Also use it for error codes, SDK guidance, and > no-auth page retrieval. > [card] Run account actions > > Use API MCP at `https://xquik.com/mcp` for live X (Twitter) reads, writes, monitors, > or webhooks. Also use it for draws or extraction jobs. Authenticate with an > API key or OAuth 2.1. Prefer OAuth when the client supports browser > authorization. > [card] Store outside chat > > Use REST or generated SDKs when a backend must own the work. That means > retries, cursor storage, file downloads, queues, or batch orchestration. > [card] Hand off results > > Store the endpoint path, request parameters, returned IDs, `has_more`, or > `next_cursor`. Or store the export route or webhook replay route. Do this > before ending the agent run. ## Quick connect Use the contextual menu at the top of any docs page. * **Copy MCP Server URL.** Copies `https://docs.xquik.com/mcp` to your clipboard. * **Copy MCP Install Command.** Copies the `npx add-mcp` install command. * **Connect to Cursor.** Installs the docs MCP server in Cursor. * **Connect to VS Code.** Installs the docs MCP server in VS Code. ## Search docs through NLWeb `GET /ask` & `POST /ask` on `https://xquik.com` search public docs through NLWeb 0.55. It needs no authentication. Never send secrets or private data. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl 'https://xquik.com/ask?query=How%20does%20MCP%20OAuth%20work%3F' ``` Send JSON, form data, or query parameters. Structured 0.54 requests remain compatible. JSON uses `conversational_search` and lowercase response types. Set `prefer.streaming` to `true` for SSE. Streams emit `start`, `result`, and `complete` events. ## Search docs through A2A The public [A2A 1.0](https://a2a-protocol.org/latest/specification/) agent card lives at `https://xquik.com/.well-known/agent-card.json`. It advertises the JSON-RPC endpoint at `https://xquik.com/a2a`. Send a `SendMessage` request with `A2A-Version: 1.0`. The agent accepts text questions and returns the same public documentation results as NLWeb. It needs no authentication and cannot run extractions or account actions. The server does not advertise streaming, push notifications, or extended cards. ## Setup ### Web clients > [tab] Claude.ai (web) > > 1. Open [Claude Connectors](https://claude.ai/settings/connectors) or **Customize > Connectors**. > 2. Select **Add custom connector**. > 3. Enter `Xquik Docs` as the name and `https://docs.xquik.com/mcp` as the URL. > 4. Select **Add**. > 5. In a chat, select **+ > Connectors** and enable **Xquik Docs**. > [tab] ChatGPT > > 1. In ChatGPT on the web, open **Settings > Security and login**. Enable **Developer mode**. > 2. Open [**Settings > Plugins**](https://chatgpt.com/plugins). Select **+**. > 3. Enter `https://docs.xquik.com/mcp`, then select **Create**. > 4. Open **Personal**, select Xquik Docs & select **+** to install it. > 5. Start a new chat. Type `@` & select Xquik Docs. > > The Docs MCP server only reads public documentation. It needs no authentication. > Developer mode supports Plus, Pro, Business, Enterprise & Edu accounts on the web. > Workspace admins control access. Create the connection on the web first. > On mobile, use plugins available to your account. > If Xquik Docs is unavailable on mobile, continue on the web. > Follow [OpenAI's current setup guide](https://developers.openai.com/plugins/deploy/connect-chatgpt) > when ChatGPT changes its labels. ### Coding agents > [tab] Claude Code > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > claude mcp add --transport http xquik-docs https://docs.xquik.com/mcp > ``` > > Verify the connection with this command. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > claude mcp list > ``` > [tab] Codex > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > codex mcp add xquik-docs --url https://docs.xquik.com/mcp > codex mcp list > ``` > [tab] GitHub Copilot CLI > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > copilot mcp add --transport http xquik-docs https://docs.xquik.com/mcp > ``` > > If your installed build lacks these flags, start Copilot CLI and run > `/mcp add`. Choose **HTTP** and enter the server name and URL. Keep `*` for > tools, then press **Ctrl+S**. Verify it with `/mcp show xquik-docs`. > [tab] Gemini CLI > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > gemini mcp add --transport http xquik-docs https://docs.xquik.com/mcp > ``` > > Or add this entry under `mcpServers` in `~/.gemini/settings.json` or > `.gemini/settings.json`. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "xquik-docs": { > "type": "http", > "url": "https://docs.xquik.com/mcp" > } > } > ``` > > Older Gemini CLI builds also accept the legacy `httpUrl` field. ### Additional coding agents > [tab] Qwen Code > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > qwen mcp add --transport http xquik-docs https://docs.xquik.com/mcp > ``` > > Manual Qwen Code configuration still uses > `httpUrl: "https://docs.xquik.com/mcp"` under `mcpServers`. > [tab] Goose > > Start a session with the Docs MCP extension. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > goose session --with-streamable-http-extension https://docs.xquik.com/mcp > ``` > > Docs MCP needs no OAuth or API-key header. > [tab] Pi > > Pi 1.0.0 has native MCP. Add the public Docs MCP server. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > pi mcp add xquik-docs --url https://docs.xquik.com/mcp > pi mcp list > ``` > > No authentication is required. > If your build lacks `pi mcp`, run `pi update self` before setup. > See [Pi configuration](/mcp/coding-agents#pi). See [current coding-agent configuration](/mcp/coding-agents) for version-specific changes. ### Editor clients > [tab] Cursor > > Add this block to `~/.cursor/mcp.json` for all projects or `.cursor/mcp.json` for 1 project. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcpServers": { > "xquik-docs": { > "url": "https://docs.xquik.com/mcp" > } > } > } > ``` > [tab] VS Code > > Add this block to `.mcp.json` for portable project setup. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcpServers": { > "xquik-docs": { > "type": "http", > "url": "https://docs.xquik.com/mcp" > } > } > } > ``` > > Existing `.vscode/mcp.json` entries still use the top-level `servers` object. > [tab] Windsurf > > For legacy Cascade, open its **MCP config file**. Current Devin Desktop uses > `~/.config/devin/mcp_config.json`. Older Windsurf used > `~/.codeium/windsurf/mcp_config.json`. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcpServers": { > "xquik-docs": { > "serverUrl": "https://docs.xquik.com/mcp" > } > } > } > ``` > [tab] OpenCode > > Add this block to `opencode.json`. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcp": { > "xquik-docs": { > "type": "remote", > "url": "https://docs.xquik.com/mcp" > } > } > } > ``` ### Additional editors > [tab] Cline > > Run `cline mcp`, add a Streamable HTTP server, and enter > `https://docs.xquik.com/mcp`. In the IDE, use the **MCP Remote Servers** UI. > Cline stores global MCP settings at > `~/.cline/data/settings/cline_mcp_settings.json`. Project settings use > `.cline/mcp.json`. > [tab] Roo Code > > Roo Code is archived. Its final release can still connect to this > authentication-free server. Add this block to project `.roo/mcp.json` or global > `mcp_settings.json`. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcpServers": { > "xquik-docs": { > "type": "streamable-http", > "url": "https://docs.xquik.com/mcp" > } > } > } > ``` ## Using both MCP servers Connect both servers. 1. **Docs MCP** (`docs.xquik.com/mcp`). The AI searches documentation to understand API parameters, error codes, and usage patterns. 2. **API MCP** (`xquik.com/mcp`). The AI executes actions such as tweet searches, extractions, and monitor setup. The AI decides which server to query based on context. A question about how draw filters work goes to the docs server. A request to run a draw goes to the API server. API MCP results use the normalized v1 contract. It has snake_case fields, date-time fields as Unix seconds, structured errors, `has_more`, and `next_cursor`. Docs MCP returns indexed documentation text and never executes account actions. ## What gets searched The docs MCP server indexes all public pages. * API reference (every documented operation) * Guides (workflows, error handling, rate limits, billing, extraction workflow, trends, webhook testing) * Webhook documentation (overview, signature verification) * MCP server setup and tools reference * OAuth 2.1 documentation * Architecture, troubleshooting, and type definitions * `llms.txt` (compact documentation index) # MCP execute examples for followers & extractions Source: https://docs.xquik.com/mcp/execute-follower-examples Copy MCP execute examples that summarize followers with guarded pagination and run a resumable extraction handoff through the Xquik API sandbox for your agents. > For the complete documentation index, see [llms.txt](/llms.txt). Run these inside the [`execute` tool](/mcp/tools#execute). Each example is one sandbox call. ## Examples > Summarize up to 100 X (Twitter) followers with guarded pagination (credits required) ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const target = 100; const sourceUser = "username"; const seenIds = new Set(); const seenCursors = new Set(); const sampleProfiles = []; let verifiedCount = 0; let cursor; let hasMore = true; let nextCursor = ""; let stopReason = "page_cap"; for (let pageNumber = 0; pageNumber < 10 && seenIds.size < target && hasMore; pageNumber += 1) { const { result: page } = await xquik.request({ path: `/api/v1/x/users/${sourceUser}/followers`, query: { pageSize: String(Math.max(20, Math.min(200, target - seenIds.size))), ...(cursor ? { cursor } : {}), }, }); for (const user of page.users) { if (seenIds.has(user.id) || seenIds.size >= target) continue; seenIds.add(user.id); if (user.verified === true) verifiedCount += 1; if (sampleProfiles.length < 25) { sampleProfiles.push({ user_id: user.id, username: user.username, name: user.name ?? null, followers: user.followers ?? null, verified: user.verified ?? null, profile_picture: user.profile_picture ?? null, }); } } hasMore = Boolean(page.has_more); nextCursor = page.next_cursor ?? ""; if (!hasMore) { stopReason = "exhausted"; break; } if (!nextCursor || nextCursor === cursor || seenCursors.has(nextCursor)) { stopReason = "cursor_stalled"; break; } seenCursors.add(nextCursor); cursor = nextCursor; } return { source: "xquik_mcp", job: "follower_export", source_user: sourceUser, rows_seen: seenIds.size, verified_count: verifiedCount, sample_profiles: sampleProfiles, has_more: hasMore, next_cursor: nextCursor, stop_reason: seenIds.size >= target ? "requested_total" : stopReason, }; }; ``` > Run an extraction with a resumable handoff (credits required) ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const body = { toolType: "tweet_search_extractor", searchQuery: "launch announcement", resultsLimit: 500, }; // Add optional filters only when the user requests them. const { result: job } = await xquik.request({ path: "/api/v1/extractions", method: "POST", body, }); return { source: "xquik_mcp", job: "tweet_search_extraction", extraction_id: job.id, tool_type: job.tool_type, status: job.status, query: body.searchQuery, results_limit: body.resultsLimit, poll: `/api/v1/extractions/${job.id}`, export_after_complete: `/api/v1/extractions/${job.id}/export?format=json`, }; }; ``` ## Next steps * [MCP tools](/mcp/tools) * [MCP overview](/mcp/overview) # MCP execute examples for media & tweet posting Source: https://docs.xquik.com/mcp/execute-media-examples Copy MCP execute examples that post tweets with media, upload media for DMs, download media, and build a gallery link through the Xquik API sandbox for agents. > For the complete documentation index, see [llms.txt](/llms.txt). Run these inside the [`execute` tool](/mcp/tools#execute). Each example is one sandbox call. ## Examples > Post an X (Twitter) tweet or reply with public media URLs (credits required) Hosted MCP injects the required `Idempotency-Key`. Direct REST callers must supply it themselves. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const body = { account: "myxhandle", text: "Launch media is ready", reply_to_tweet_id: "1893456789012345678", media: ["https://example.com/product-demo.mp4"], }; const { result } = await xquik.request({ path: "/api/v1/x/tweets", method: "POST", body, }); return { source: "xquik_mcp", job: "tweet_write", status: result.status, terminal: result.terminal, safe_to_retry: result.safe_to_retry, write_action_id: result.id, request_hash: result.request.hash, tweet_id: result.result?.id ?? result.tweet_id ?? null, poll: result.terminal ? null : result.status_url, account: body.account, reply_to_tweet_id: body.reply_to_tweet_id, media: body.media, charged: result.billing.charged, charged_credits: result.billing.charged_credits, }; }; ``` > Upload media for a DM (credits required) ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const account = "myxhandle"; const user_id = "44196397"; const source_url = "https://example.com/image.png"; const { result: media } = await xquik.request({ path: "/api/v1/x/media", method: "POST", body: { account, url: source_url, }, }); const { result: dm } = await xquik.request({ path: `/api/v1/x/dm/${user_id}`, method: "POST", body: { account, text: "Here is the asset", media_ids: [media.media_id], }, }); return { source: "xquik_mcp", job: "dm_media", status: "sent", user_id, account, source_url, media_id: media.media_id, media_url: media.media_url, message_id: dm.message_id, }; }; ``` Store `message_id` with the uploaded `media_id`. Keep full DM bodies out of shared MCP outputs. Return IDs, status, media references, and source filenames instead. Leave `reply_to_message_id` unset because the DM send endpoint rejects reply threading. > Download media and get gallery link (credits required) ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const tweet_input = "1234567890"; const { result: download } = await xquik.request({ path: "/api/v1/x/media/download", method: "POST", body: { tweetInput: tweet_input }, }); return { source: "xquik_mcp", job: "media_download", mode: "single", tweet_input, tweet_id: download.tweet_id, gallery_url: download.gallery_url, cache_hit: download.cache_hit, note: "Store gallery_url as the saved media gallery. It is not an uploaded media_id for DMs.", }; }; ``` > Bulk download combines search and download. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const query = "from:berktavsan has:videos"; const { result: search } = await xquik.request({ path: "/api/v1/x/tweets/search", query: { q: query }, }); if (!search.tweets?.length) { return { source: "xquik_mcp", job: "bulk_media_download", status: "empty", query, }; } const tweetIds = search.tweets.map((t) => t.id).slice(0, 50); const { result: download } = await xquik.request({ path: "/api/v1/x/media/download", method: "POST", body: { tweetIds }, }); return { source: "xquik_mcp", job: "bulk_media_download", status: "ready", query, tweet_ids: tweetIds, gallery_url: download.gallery_url, total_tweets: download.total_tweets, total_media: download.total_media, }; }; ``` ## Next steps * [MCP tools](/mcp/tools) * [MCP overview](/mcp/overview) # MCP execute examples for monitors & webhooks Source: https://docs.xquik.com/mcp/execute-monitor-examples Copy MCP execute examples that monitor an X (Twitter) user, create a webhook, and poll stored monitor events through the Xquik API sandbox for your own agents. > For the complete documentation index, see [llms.txt](/llms.txt). Run these inside the [`execute` tool](/mcp/tools#execute). Each example is one sandbox call. ## Examples > Monitor a user + create webhook (monitor creation requires credits, webhook costs no credits) ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const { result: monitor } = await xquik.request({ path: "/api/v1/monitors", method: "POST", body: { username: "elonmusk", eventTypes: ["tweet.new", "tweet.reply"] }, }); const { result: webhook } = await xquik.request({ path: "/api/v1/webhooks", method: "POST", body: { url: "https://example.com/hook", eventTypes: ["tweet.new", "tweet.reply"] }, }); const { result: test } = await xquik.request({ path: `/api/v1/webhooks/${webhook.id}/test`, method: "POST", }); return { monitor_id: monitor.id, event_types: monitor.event_types, next_billing_at: monitor.next_billing_at, webhook_id: webhook.id, webhook_url: webhook.url, save_secret_once: "Store webhook.secret for X-Xquik-Signature verification; do not print it in logs.", idempotency_keys: ["deliveryId", "streamEventId"], delivery_status: `/api/v1/webhooks/${webhook.id}/deliveries`, test, }; }; ``` > Poll stored monitor events (costs no credits) ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const monitor_id = "mon_123"; const event_type = "tweet.new"; const { result: page } = await xquik.request({ path: "/api/v1/events", query: { monitorId: monitor_id, eventType: event_type }, }); return { source: "xquik_mcp", job: "monitor_event_poll", monitor_id, event_type, rows: page.events.map((event) => ({ event_id: event.id, type: event.type, username: event.username ?? null, query: event.query ?? null, monitor_id: event.monitor_id, monitor_type: event.monitor_type, occurred_at: event.occurred_at, data: event.data, })), has_more: page.has_more, next_cursor: page.next_cursor, next_query: page.next_cursor ? { monitorId: monitor_id, eventType: event_type, cursor: page.next_cursor } : null, }; }; ``` ## Next steps * [MCP tools](/mcp/tools) * [MCP overview](/mcp/overview) # MCP execute examples for tweet search & replies Source: https://docs.xquik.com/mcp/execute-tweet-examples Copy MCP execute examples that summarize tweets with guarded pagination and scrape tweet replies to CSV, JSON, or XLSX through the Xquik sandbox with credits. > For the complete documentation index, see [llms.txt](/llms.txt). Run these inside the [`execute` tool](/mcp/tools#execute). Each example is one sandbox call. ## Examples > Summarize up to 100 tweets with guarded pagination (credits required) Use `q` for keywords and X (Twitter) search operators. For a single stored link, pass a plain Tweet ID or X status URL. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const target = 100; const query = "from:username giveaway"; const seenIds = new Set(); const seenCursors = new Set(); const sampleTweets = []; let cursor; let hasMore = true; let nextCursor = ""; let stopReason = "page_cap"; for (let pageNumber = 0; pageNumber < 10 && seenIds.size < target && hasMore; pageNumber += 1) { const { result: page } = await xquik.request({ path: "/api/v1/x/tweets/search", query: { q: query, limit: String(Math.min(200, target - seenIds.size)), ...(cursor ? { cursor } : {}), }, }); for (const tweet of page.tweets) { if (seenIds.has(tweet.id) || seenIds.size >= target) continue; seenIds.add(tweet.id); if (sampleTweets.length < 20) { sampleTweets.push({ tweet_id: tweet.id, text_excerpt: tweet.text?.slice(0, 120) ?? null, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, created: tweet["created"] ?? null, like_count: tweet.like_count ?? null, view_count: tweet.view_count ?? null, }); } } hasMore = Boolean(page.has_more); nextCursor = page.next_cursor ?? ""; if (!hasMore) { stopReason = "exhausted"; break; } if (!nextCursor || nextCursor === cursor || seenCursors.has(nextCursor)) { stopReason = "cursor_stalled"; break; } seenCursors.add(nextCursor); cursor = nextCursor; } return { source: "xquik_mcp", job: "tweet_search", query, rows_seen: seenIds.size, sample_tweets: sampleTweets, has_more: hasMore, next_cursor: nextCursor, stop_reason: seenIds.size >= target ? "requested_total" : stopReason, }; }; ``` > Scrape tweet replies to CSV, JSON, or XLSX (credits required) ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const body = { toolType: "reply_extractor", targetTweetId: "1893704267862470862", resultsLimit: 500, }; const { result: extraction } = await xquik.request({ path: "/api/v1/extractions", method: "POST", body, }); return { source: "xquik_mcp", job: "reply_extraction", extraction_id: extraction.id, status: extraction.status, target_tweet_id: body.targetTweetId, results_limit: body.resultsLimit, poll: `/api/v1/extractions/${extraction.id}`, export_csv: `/api/v1/extractions/${extraction.id}/export?format=csv`, export_json: `/api/v1/extractions/${extraction.id}/export?format=json`, export_xlsx: `/api/v1/extractions/${extraction.id}/export?format=xlsx`, }; }; ``` ## Next steps * [MCP tools](/mcp/tools) * [MCP overview](/mcp/overview) # Twitter MCP server & X MCP server for AI agents Source: https://docs.xquik.com/mcp/overview Use Xquik as an X Twitter scraper and X (Twitter) API alternative through MCP. Search posts, replies, profiles, followers, lists, communities, and Spaces. > For the complete documentation index, see [llms.txt](/llms.txt). [![Play Framer's video on YouTube. Framer builds a tweet ticker with Xquik.](https://img.youtube.com/vi/4UOSpoOoC3Y/maxresdefault.jpg)](https://youtu.be/4UOSpoOoC3Y?t=367) Watch Framer build a tweet ticker with Xquik, from 6:07. Framer posted it on June 16, 2026. Xquik's MCP server lets AI agents search, read & post on X (Twitter). Public reads cost USD 0.00015 per result, & empty or failed reads are free. Add 1 URL to install it, then sign in when your app asks. | App | URL | | - | - | | Claude | `https://xquik.com/mcp?app=claude` | | ChatGPT | `https://xquik.com/mcp?app=chatgpt` | | Cursor & other MCP clients | `https://xquik.com/mcp` | Xquik API MCP exposes the REST API through [Model Context Protocol](https://modelcontextprotocol.io). Code Mode is the default. Native mode exposes one tool per OpenAPI operation. Full credentials see every JSON or text route. Private support media downloads use REST. Guest `paid_reads` keys see only the eligible paid-read routes. See [every Xquik feature](/api-reference/features) in 1 list, grouped by theme. See how Xquik compares with [other X MCP servers](/alternatives/twitter-mcp-servers). > [!NOTE] > > Public reads need no connected X account. This covers tweets, profiles, followers, replies, timelines, communities & lists. > Every X write requires one. Private reads also require one. They include DMs, bookmarks, notifications, home timeline, likes, likers & mutual followers. See [Connect X account](/api-reference/x-accounts/connect). This page covers the API MCP server at `https://xquik.com/mcp` for authenticated account actions. That server is also for guest prepaid reads. For public documentation search, use the [Docs MCP server](/mcp/docs-mcp) at `https://docs.xquik.com/mcp`. Supported browsers expose a read-only WebMCP tool on the homepage. It searches the public OpenAPI contract without calling an endpoint. ## Connection > [card] Protocol > > Model Context Protocol over Streamable HTTP. > [card] Endpoint > > Connect clients to `https://xquik.com/mcp`. > [card] Server version > > `server/discover` returns the deployed server version. > [card] Authentication > > Prefer OAuth 2.1. API keys remain available for clients with secure header > storage. `GET` and `POST` on `/.well-known/mcp.json` return a compatibility document. It comes from the MCP Registry manifest. `/server.json` and `/.well-known/mcp/server-card.json` return the same document. Its standard `remotes` entry identifies the `streamable-http` endpoint. Extra top-level convenience fields support older clients. They are not MCP Registry or experimental MCP Server Card fields. OAuth clients read `GET /.well-known/oauth-protected-resource/mcp` for protected-resource metadata. Compatibility clients can also read `GET /.well-known/oauth-protected-resource/.well-known/mcp.json`. It redirects to the canonical metadata URL. Registry-compatible clients receive a `streamable-http` remote for `https://xquik.com/mcp`. OAuth-capable clients discover authentication from the endpoint. Clients without OAuth may send an API key as `Authorization: Bearer {XQUIK_API_KEY}` or `x-api-key: {XQUIK_API_KEY}`. Create API keys at `https://dashboard.xquik.com/en/api-keys`. The direct client examples below use OAuth. Use the API-key fallback only when the client documents secure request headers. Discover Xquik through `https://xquik.com/.well-known/ard.json` or `https://xquik.com/.well-known/agents.json`. ARD lists the MCP server and the REST API. Each has example queries and its `https://xquik.com` identity. The agent catalog adds the public A2A docs agent, capabilities, OAuth metadata, and `https://xquik.com/auth.md`. `auth.md` covers Client ID Metadata Documents (CIMD), Dynamic Client Registration (DCR) and PKCE. It also covers the `mcp:tools` & `mcp:read` scopes. MCP connection metadata also lives at `https://xquik.com/.well-known/mcp.json`. A client that cannot use CIMD takes the supported anonymous OAuth client registration path. That is DCR at `https://xquik.com/api/oauth/register`. Agent Skills discovery is available at `https://xquik.com/.well-known/agent-skills/index.json`. It publishes a SHA-256 digest for Xquik's hosted `SKILL.md`. Compatible agents can verify the downloaded instructions. ## MCP 2026-07-28 Xquik supports MCP `2026-07-28` at the same Streamable HTTP endpoint. Current clients start with `server/discover`. They do not call `initialize` or create a session for a modern connection. Use a current MCP SDK. It adds the request `_meta` envelope and required HTTP headers automatically. Modern requests must advertise both `application/json` and `text/event-stream`. Read `X-Request-Id` on MCP responses, including authentication and protocol errors. Include it and the UTC time when reporting failures. It identifies the HTTP request, not the JSON-RPC message or authenticated session. Allowed browser clients can send and read this header. `server/discover` and `tools/list` include private cache hints with a 5-minute TTL. Every catalog stays static for a connection. The server advertises no tool-list changes, and `subscriptions/listen` completes at once. Cache only within the same authorization context. Xquik also accepts stateless 2025-era clients at the same endpoint. This keeps existing integrations working while current SDKs adopt `2026-07-28`. Each 2025-era request gets its answer as 1 JSON response. > [!NOTE] > > Modern Xquik connections are request-scoped. Ignore legacy session IDs and > resume state. Let the client SDK negotiate the protocol. Clients and directories can discover Xquik before sign-in. Without a credential, `https://xquik.com/mcp` and `https://xquik.com/mcp?codemode=false` answer a single JSON-RPC message. That message is `initialize`, `notifications/initialized`, `ping`, `server/discover`, or `tools/list`. Each `initialize` and `server/discover` result carries `instructions`. That is a short Xquik summary with links to `https://xquik.com/llms.txt` and this page. Every other request without a credential returns `401` with a `WWW-Authenticate: Bearer` challenge. This includes every `tools/call`, every batch, and every request to `https://xquik.com/mcp?app=claude`, `https://xquik.com/mcp?app=chatgpt`, and `https://xquik.com/sse`. A first-time OAuth client therefore connects and lists the tools. It then gets `401` on its first tool call. Then it asks you to sign in. The challenge includes `resource_metadata="https://xquik.com/.well-known/oauth-protected-resource/mcp"`, `scope="mcp:tools"`, and the OAuth realm. The `?app=chatgpt` challenge asks for `mcp:read`, and its `resource_metadata` URL ends in `?app=chatgpt`. The JSON body is `{ "error": "Sign in through your MCP client. Or send your Xquik API key as a Bearer token." }`. OAuth-capable clients use the challenge to discover the authorization metadata. API-key clients should send `x-api-key` on the first request. A supplied invalid bearer token adds `error="invalid_token"` and `error_description="Invalid access token"` to the challenge. The `error` text says what to fix when Xquik refuses a credential. | The request sends | `error` | | - | - | | No credential | `Sign in through your MCP client. Or send your Xquik API key as a Bearer token.` | | An API key Xquik does not accept | `This API key is not valid. Create a key in your Xquik dashboard.` | | An OAuth token that expired or was revoked | `This access token expired or was revoked. Sign in again from your app.` | | An `Authorization` header without `Bearer` & a token | `Xquik could not read the Authorization header. Send Bearer, a space & your key.` | A paused API key gets `403` with `error` set to `api_key_paused`. Resume it on the [API keys page](https://dashboard.xquik.com/en/api-keys), and the next request goes through. A key sees only the tools & routes its scopes allow. Other calls fail with a message. It names the scope to add on the [API keys page](https://dashboard.xquik.com/en/api-keys). Calls from IPs outside a key's allowlist get `403` with `error` set to `ip_not_allowed`. Add the IP on the [API keys page](https://dashboard.xquik.com/en/api-keys), or connect from a listed IP. ## Authentication The MCP server supports 2 authentication methods. * **OAuth 2.1** is recommended. Compatible clients discover Xquik and open the browser login and consent flow. They then store and refresh Bearer tokens. Xquik supports CIMD and DCR. Normal client setup needs no manual client ID, client secret, or API key. * **API key** (`x-api-key` or `Authorization: Bearer xq_your_api_key_here`) is an Xquik-specific fallback, not an OAuth token. Do not apply OAuth discovery or refresh rules. Use it only with secure header storage. Full account keys expose every catalog route. Active guest keys expose the `paid_reads` routes. New OAuth connections have no monthly credit cap. To set one, open **Set a monthly credit cap** on the consent screen. Leave the field empty for no cap. A call past a cap gets `403` with `error` set to `api_key_budget_reached`. Each connection appears on the [API keys page](https://dashboard.xquik.com/en/api-keys) under the app's name. Pause it, revoke it or change its cap there. See [OAuth 2.1 authorization](/oauth/overview) for discovery URLs, token lifetimes, client registration, and implementation details. ## Choose a tool mode Use the default endpoint for Code Mode. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} https://xquik.com/mcp ``` Code Mode uses 4 tools. API discovery and execution run in isolated sandboxes. | Approach | Tools | Tokens to list them | | - | - | - | | The whole OpenAPI spec in the prompt | None | About 230,000 | | Native mode, `?codemode=false` | About 180 | About 160,000 | | Code Mode, the default | 4 | About 2,000 | Each token figure is the JSON size divided by 4, measured on 2026-10-30. > [card] docs > > Search X/Twitter scraper & API documentation. Read-only. No credits. > [card] search > > Search the X/Twitter API catalog. No network calls or credits. > [card] execute > > Call authenticated X/Twitter APIs. Cost follows the endpoint. > [card] whoami > > Return the signed-in account's stable id. No credits. `server/discover` sends no global model instructions. Tool descriptions identify the X/Twitter domain and explain code mechanics. `docs` searches public documentation. `search` accepts an async arrow function. `spec` is global and its first argument. Its examples show endpoint and operation lookup. `execute` accepts the same form. `xquik` is global and its first argument. OpenAPI and these docs define endpoint behavior. | Tool | Title | Safety annotations | | - | - | - | | `docs` | Search Xquik documentation | Read-only, idempotent, open-world, non-destructive | | `search` | Search Xquik API specification | Read-only, idempotent, closed-world, non-destructive | | `execute` | Execute Xquik API requests | May mutate data, may access live services, not idempotent | | `whoami` | Current Xquik account | Read-only, idempotent, closed-world, non-destructive | For a guest `paid_reads` session, `execute` is read-only and idempotent. In that session it makes live calls only to the eligible paid-read routes. Claude's Connectors Directory and Claude's custom connectors use the Claude catalog. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} https://xquik.com/mcp?app=claude ``` It has `docs`, `search`, `execute`, `executeWrite` and `whoami`. `execute` runs each operation whose search spec says `readOnly: true`. Claude runs those without asking. `executeWrite` runs the rest, such as posts, follows, monitors, webhooks and drafts. Claude asks before each of those calls. Claude's directory accepts no single tool that both reads and writes. Use native mode when a client cannot run Code Mode. It also suits a client that needs ordinary MCP tools. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} https://xquik.com/mcp?codemode=false ``` Native mode serves an OpenAPI-derived catalog. It validates only the called tool. Full credentials receive `docs`, `readSavedResult`, `whoami`, and the OpenAPI operations. Guest keys receive `docs`, `readSavedResult`, `whoami`, and the eligible GET operations. Each native tool uses its OpenAPI `operationId` as its stable name. Its input schema, title, description, and HTTP method come from the OpenAPI contract. Its path, query parameters, and JSON body come from that contract too. REST and the generated SDKs use the same contract. The server injects authentication and required idempotency headers. It rejects unknown routes, custom headers, redirects, traversal, and unsupported binary responses. `docs` searches canonical Xquik documentation. Pass a non-empty `query` string. `readSavedResult` reads a saved oversized answer in free pages. ### `search` tool Searches the full account catalog. The call uses no credits. MCP authentication remains required. The sandbox provides the `spec` object typed below. With a guest `paid_reads` key, `spec.paths` contains only the eligible paid-read routes. Inputs resolve inline. Response `$ref` values point into `spec.components.schemas`. The catalog includes only response schemas reachable from your allowed operations. Follow references to inspect shared fields and recursive types. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} interface OperationInfo { operationId: string; summary?: string; description?: string; readOnly: boolean; tags?: string[]; parameters?: unknown[]; requestBody?: unknown; responses?: Record; } interface PathItem { get?: OperationInfo; post?: OperationInfo; put?: OperationInfo; patch?: OperationInfo; delete?: OperationInfo; } declare const spec: { paths: Record; components: { schemas: Record }; }; ``` ### `execute` tool Executes API calls. The sandbox provides the `xquik` client. Call `xquik.request({ path, method?, query?, body? })`. It returns `success`, `status`, `result`, `errors`, and `messages`. `result` contains the endpoint body. Pass `result_id` to project saved data through `xquik.result`. [Recover oversized results](/mcp/tools#recover-oversized-results) without repeating paid requests. See the complete [execute contract](/mcp/tools#execute). The server injects authentication and required idempotency headers. The server reuses each generated key for bounded transient retries. Verify unresolved writes. Retry only when `safe_to_retry` is true. An `execute` call can run for up to 55 seconds, waits included. Sandbox API requests stop after 54 seconds. The reserve lets completed work return. A post takes about 30 seconds and can take over a minute. Send 1 post per call. To space writes out, wait between calls, not inside a script. A script past the limit with no request running gets a refusal. The refusal names its last successful request. Disconnecting cancels the call. Timeouts do not cancel durable extraction jobs. Find the job through `GET /extractions`, then resume with its stored ID. Rejections include `error.status` when available. ### MCP operation boundary Full credentials expose every JSON or text route of the REST contract. The actions below are the exception. They stay outside MCP, so no MCP tool moves money. * Create, list, or revoke account API keys * Create a subscription or top-up checkout, or read its status * Charge a saved payment method * Create, poll, or top up a guest wallet * Download support attachments or draw and extraction exports Guest wallet credential routes remain direct REST only. MCP cannot execute `POST /api/v1/guest-wallets`, `POST /api/v1/guest-wallets/topups`, or `GET /api/v1/guest-wallets/status`. Follow the [accountless guest wallet guide](/guides/guest-wallets) for confirmation, checkout, polling, and top-up steps. A guest `paid_reads` MCP session exposes exactly the [eligible paid-read routes](/guides/guest-wallets#eligible-paid-read-routes). It cannot execute writes or any other route. An MCP answer to a `402` names no checkout step. It keeps `error`, `message`, `balance` and `required`. For an account, it also keeps `dashboard` as a full link. Send the user to that link. There they add credits or change the plan in the browser. ## MCP vs REST API MCP follows REST authentication, authorization, billing, and response contracts for every exposed operation. > [card] MCP server > > Use MCP for agents and IDE integrations. Full credentials expose every catalog route. Guest keys expose the eligible GET reads. Use REST for binary downloads. > [card] REST API > > Use REST for backend services, automation scripts, guest wallet credential routes, and direct access. The REST contract documents every operation and file download response. ## Website WebMCP Supported browsers discover `search_xquik_api` on `https://xquik.com`. Pass a non-empty `query` and optionally set `maxResults` from 1 to 50. The tool returns matching methods, paths, inputs & response statuses. It sends no credentials, calls no API operation, and spends no credits. The page uses the current `document.modelContext` API. > [!TIP] > > Start with [Claude.ai](https://claude.ai) for OAuth login or [Claude Code](#setup) for terminal setup. ## Client compatibility See [Coding agents & MCP compatibility](/mcp/coding-agents) for current releases & configuration changes. Choose the authentication path that your current client can complete. Xquik validates the OAuth issuer, redirect and resource for every client. It also keeps Proof Key for Code Exchange (PKCE) validation on. | Client | API MCP authentication today | Registration and behavior | | - | - | - | | [Claude Code](https://code.claude.com/docs/en/mcp) | OAuth 2.1 | Uses Client ID Metadata Documents (CIMD), secure token storage, and automatic refresh | | [OpenCode](https://opencode.ai/docs/mcp-servers/) | OAuth 2.1 | Uses Dynamic Client Registration (DCR) and refreshes tokens | | [Gemini CLI](https://geminicli.com/docs/tools/mcp-server/) | OAuth 2.1 | Uses automatic OAuth discovery and DCR. Streamable HTTP configuration uses `httpUrl` | | [Cursor](https://cursor.com/docs/mcp) | OAuth 2.1 | Supports remote MCP OAuth and `agent mcp login` | | [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers) | OAuth 2.1 | Uses the browser authorization code flow and DCR | | [Cline](https://docs.cline.bot/cli/cli-reference) | OAuth 2.1 | Completes OAuth from its MCP configuration flow | | [Qwen Code](https://github.com/QwenLM/qwen-code) | OAuth 2.1 | Uses DCR and its `httpUrl` Streamable HTTP field | | [Codex](https://learn.chatgpt.com/docs/extend/mcp) | OAuth 2.1 or environment-backed API key | Current Codex CLI supports browser OAuth. API-key authentication is also supported | | [Goose](https://goose-docs.ai/docs/getting-started/using-extensions/) | OAuth 2.1 or environment-backed API key | Goose 1.46.0 and newer preserve the RFC 9207 `iss` callback value | | [Roo Code](https://github.com/RooCodeInc/Roo-Code) | Environment-backed API key | Roo Code's archived final release has Streamable HTTP but no MCP OAuth provider | | [Pi](https://github.com/earendil-works/pi/tree/main/packages/coding-agent) | OAuth 2.1 or environment-backed API key | Pi 1.0.0 has native Streamable HTTP & OAuth | Use the latest stable client before starting OAuth. ## Setup ### Web and terminal clients > [tab] Claude.ai (web) > > 1. Open [Claude Connectors](https://claude.ai/settings/connectors) or **Customize > Connectors**. > 2. Select **+**, then **Add custom connector**. > 3. Enter `https://xquik.com/mcp?app=claude`. > 4. Select **Add**. > 5. In a chat, select **+ > Connectors**, enable Xquik, then select **Connect** and approve access. > > Leave the advanced client ID and client secret fields empty. Custom remote > connectors require Pro, Max, Team, or Enterprise. On Team and Enterprise, > an Owner or Primary Owner must add the connector first. > [tab] Claude Desktop > > Claude Desktop uses the same remote custom connectors as Claude.ai. Open > **Customize > Connectors**, add `https://xquik.com/mcp?app=claude`, then complete the > browser authorization flow. > [tab] Claude Code > > Add the remote server. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > claude mcp add --transport http xquik https://xquik.com/mcp > ``` > > Run `claude mcp login xquik`, or authenticate through `/mcp` inside Claude Code. > The command defaults to local scope. Add `--scope user` for global setup. > [tab] ChatGPT > > Follow the [ChatGPT app guide](/mcp/chatgpt). ### OpenAI Use the steps below to connect Xquik directly. No plugin package is required. > [tab] Codex CLI > > Add Xquik and complete browser authorization. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > codex mcp add xquik --url https://xquik.com/mcp > codex mcp login xquik > codex mcp list > ``` > > Codex CLI, the IDE extension, and the ChatGPT desktop app share an MCP > configuration. It is in `config.toml`. > [tab] Codex Desktop > > Open **Settings > MCP servers**. Add `https://xquik.com/mcp` as Streamable > HTTP & select **Authenticate**. Complete browser authorization, then restart. > [tab] Codex Config > > Use this OAuth configuration in > `~/.codex/config.toml` or a trusted project's `.codex/config.toml`. > > ```toml theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > [mcp_servers.xquik] > url = "https://xquik.com/mcp" > ``` > > Then run `codex mcp login xquik`. ### Plugin distribution OpenAI's [September 29, 2026 DevDay announcements](https://learn.chatgpt.com/docs/whats-new/devday-2026) add Plugin Extensions & MCP Events. Public directory publication still requires review. Codex supports plugins from your own repository marketplace. These packages can bundle Skills & MCP tools without public directory submission. Follow [OpenAI's packaging guide](https://developers.openai.com/plugins/build/plugins) to distribute your own package. Xquik's own plugin adds the MCP server as `xquik`, without a sign-in. Sign in once after the install. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} codex plugin marketplace add Xquik-dev/x-twitter-scraper codex plugin add x-twitter-scraper@x-twitter-scraper codex mcp login xquik ``` In the Codex app, select **Authenticate** next to `xquik` instead. To use an API key, add the [API key configuration](#codex-api-key-authentication). It replaces the plugin's `xquik` entry. | Client | Connection & plugin limits | | - | - | | Codex CLI & desktop | Connect Xquik directly with OAuth. Local & repository marketplaces also support plugin packages. | | Codex IDE extension | Uses the same host MCP configuration. It does not support plugin packages. | | ChatGPT web | Add your personal connection through [developer mode](/mcp/chatgpt). Account & workspace restrictions apply. | | ChatGPT desktop & mobile | Use plugins available to your account. Packages declaring MCP servers are Desktop only. | | Codex Cloud | Local MCP configuration does not establish cloud access. Verify the cloud environment separately. | OpenAI documents [client support](https://learn.chatgpt.com/docs/plugins) & [shared local MCP configuration](https://learn.chatgpt.com/docs/extend/mcp). CLI users install marketplace plugins through `/plugins`, then start a new session. Workspace admins can [import a GitHub marketplace](https://learn.chatgpt.com/docs/enterprise/plugin-management) & configure access for members. Importing does not connect members' accounts or grant required app access. Workspace publication stays inside that workspace & organization. It does not give customers in other workspaces access. A public directory listing requires [OpenAI review & publication](https://developers.openai.com/plugins/deploy/app-review#publication-and-distribution). Direct listing links work after publication. Personal connections do not provide a public plugin install link. ### Codex API key authentication Codex also supports API-key authentication. Store the key in an environment variable. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export XQUIK_API_KEY="xq_your_api_key_here" ``` Add this configuration to `~/.codex/config.toml` or a trusted project's `.codex/config.toml`. ```toml theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} [mcp_servers.xquik] url = "https://xquik.com/mcp" bearer_token_env_var = "XQUIK_API_KEY" ``` Restart Codex & run `codex mcp list`. The configured key authenticates requests directly. This entry also replaces the `xquik` server that Xquik's plugin adds. Never commit the key or place its value in `config.toml`. ### Editor clients > [tab] Cursor > > Add this block to `~/.cursor/mcp.json` for all projects or `.cursor/mcp.json` for 1 project. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcpServers": { > "xquik": { > "url": "https://xquik.com/mcp" > } > } > } > ``` > > Cursor starts OAuth when the server first returns `401`. You can also run > `agent mcp login xquik`. Approve the server when prompted. > Enterprise policy may restrict MCP access. > [tab] VS Code > > Add this block to `.mcp.json` for portable project setup. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcpServers": { > "xquik": { > "type": "http", > "url": "https://xquik.com/mcp" > } > } > } > ``` > > Start the server from the MCP view and follow the OAuth prompt. VS Code > stores the resulting authentication state. > > Existing `.vscode/mcp.json` entries still use the top-level `servers` object. > [tab] Windsurf > > For legacy Cascade, open **MCP config file** from its MCP menu. > Current Devin Desktop releases use `~/.config/devin/mcp_config.json`. > Older Windsurf releases used `~/.codeium/windsurf/mcp_config.json`. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcpServers": { > "xquik": { > "serverUrl": "https://xquik.com/mcp" > } > } > } > ``` > > Enable the server in **Windsurf Settings > Cascade > MCP Servers**, then > complete OAuth. Enterprise users must enable MCP manually. Team policies > may disable MCP or restrict servers to an allowlist. > Devin Local uses [Devin CLI configuration](/mcp/coding-agents). > [tab] OpenCode > > Add this block to `opencode.json`. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcp": { > "xquik": { > "type": "remote", > "url": "https://xquik.com/mcp" > } > } > } > ``` > > Then run this command. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > opencode mcp auth xquik > opencode mcp list > ``` ### Other terminal clients > [tab] GitHub Copilot CLI > > Add the remote server. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > copilot mcp add --transport http xquik https://xquik.com/mcp > ``` > > If your installed build lacks the noninteractive add flags, start Copilot > CLI. Then run `/mcp add`. Enter `xquik`, choose **HTTP**, enter > `https://xquik.com/mcp`, keep `*` for tools, then press **Ctrl+S**. Run > `/mcp` & complete authentication after the server appears. Enterprise policy may block > servers outside the organization allowlist. > [tab] Gemini CLI > > Add the remote server. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > gemini mcp add --transport http xquik https://xquik.com/mcp > ``` > > Or add it to `~/.gemini/settings.json` for user scope or > `.gemini/settings.json` for project scope. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcpServers": { > "xquik": { > "httpUrl": "https://xquik.com/mcp" > } > } > } > ``` > > Run `/mcp auth xquik` to complete OAuth. > [tab] Cline > > Run `cline mcp`, add a Streamable HTTP server, and enter > `https://xquik.com/mcp`. Select **Authorize OAuth** when Cline reports that > authentication is required. > [tab] Qwen Code > > Enable encrypted token storage before adding Xquik. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > export QWEN_CODE_FORCE_ENCRYPTED_FILE_STORAGE=true > qwen mcp add --transport http xquik https://xquik.com/mcp > ``` > > Start Qwen Code, open `/mcp`, then authorize `xquik`. Qwen Code still uses > `httpUrl` for manual Streamable HTTP configuration. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcpServers": { > "xquik": { > "httpUrl": "https://xquik.com/mcp" > } > } > } > ``` ### Remaining API key and adapter paths API-key authentication is client-specific. ChatGPT custom apps require OAuth and cannot present custom API keys. Codex uses the environment-backed `bearer_token_env_var` configuration above. For other clients, follow that client's documented secret-input or environment-variable syntax. Never copy a generic header example into an incompatible schema. Never place a literal key in a configuration file or commit a key. > [tab] Goose > > Goose 1.46.0 and newer support the OAuth issuer callback. > Prefer OAuth with current releases. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > goose session --with-streamable-http-extension https://xquik.com/mcp > ``` > > For API-key authentication, export your key & add this configuration > to `~/.config/goose/config.yaml`. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > export XQUIK_API_KEY="xq_your_api_key_here" > ``` > > ```yaml theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > extensions: > xquik: > type: streamable_http > name: xquik > enabled: true > uri: "https://xquik.com/mcp" > headers: > Authorization: "Bearer ${XQUIK_API_KEY}" > env_keys: > - XQUIK_API_KEY > envs: {} > ``` > > Goose substitutes the environment variable before sending the header. > [tab] Roo Code > > Roo Code's archived final release supports API-key headers, not MCP OAuth. > Add this to global `mcp_settings.json` or project `.roo/mcp.json`. > > ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > { > "mcpServers": { > "xquik": { > "type": "streamable-http", > "url": "https://xquik.com/mcp", > "headers": { > "Authorization": "Bearer ${env:XQUIK_API_KEY}" > } > } > } > } > ``` > > Export `XQUIK_API_KEY` before starting the editor. Do not place the key > value in the JSON file. > [tab] Pi > > Pi 1.0.0 has native MCP. Add Xquik and complete OAuth. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} > pi mcp add xquik --url https://xquik.com/mcp > pi mcp login xquik > pi mcp list > ``` > > If your build lacks `pi mcp`, run `pi update self` before setup. > See [Pi configuration & tool exposure](/mcp/coding-agents#pi). ## Example prompts Once connected, ask questions like these. **Monitoring & events** * Start watching @elonmusk for new tweets and replies. * List the accounts I am monitoring. * Show monitored account activity from today. * Replay stored events for monitor mon_123 using the last next_cursor as cursor. * Stop tracking @elonmusk. **Search & lookup** * Search recent X posts about TypeScript. * Find recent tweets from @vercel. * Read the tweet at `https://x.com/elonmusk/status/1893456789012345678` * Get metrics for the tweet at `https://x.com/vercel/status/1893704267862470862` **User profiles & follows** * Get @username follower count. * Read @openai profile bio. * Check whether @elonmusk follows @SpaceX. * Check whether @vercel and @nextjs follow each other. **Trends** * Show current X (Twitter) trends. * Show top trending topics in the US. * Check whether AI is trending today. **Radar & news** * Show current Radar trends. * Show current Reddit posts with text, links, media, and engagement signals. * Show top developer trends today. * Show startups ranked by available growth metrics. * Get technology topics from the last 12 hours. * Show popular knowledge topics right now. * Show regional trends for a selected region. * Find trending tech news and draft a tweet about one item. **Extractions** * Pull all replies to the tweet at `https://x.com/elonmusk/status/1893456789012345678` * List users who retweeted the tweet at `https://x.com/vercel/status/1893704267862470862` * Estimate the cost to extract all followers of @elonmusk. * Get quote tweets for the post at `https://x.com/openai/status/1893456789012345678` * Extract the full thread for the tweet at `https://x.com/elonmusk/status/1893704267862470862` **Giveaways** * Pick 3 random winners from the tweet at `https://x.com/example_user/status/1893456789012345678` * Run a giveaway draw. Each participant must have retweeted and have at least 100 followers. * Show the results of my last giveaway draw. **Webhooks** * Set up a webhook at `https://my-server.com/events` for new tweets. * List configured webhook endpoints. * Remove the webhook pointing to my old server. **Tweet composition** * Write a casual launch tweet for my new product. * Research a fresh angle from Compose's Radar recommendations. * Optimize the draft for engagement. * Score the draft "Just shipped v2.0 of our API. What do you think?" * Improve this tweet to get more replies. **Style analysis & drafts** * Analyze how @elonmusk tweets. * Compare @vercel and @nextjs tweeting styles. * Show cached tweet performance. * Save this tweet draft for later. * Show all saved drafts. * Set my X account to @myusername. **X write actions** * Post a tweet that says "Just shipped v2.0!" * Like the tweet at `https://x.com/vercel/status/1893704267862470862` * Retweet the post at `https://x.com/openai/status/1893456789012345678` * Follow @vercel from my connected account. * Send a DM to user ID 44196397 saying hello. * Post a tweet that says "New feature!" and use the public image URL `https://example.com/launch.png`. **Account & usage** * Show my plan and month-to-date usage. * Check whether I have enough budget left for a large extraction. ## Framework guides Build agents with Xquik's MCP tools in your preferred framework. > [card] [LangChain](/guides/langchain) > > Python agents with LangChain + LangGraph > [card] [CrewAI](/guides/crewai) > > Multi-agent crews with CrewAI > [card] [Pydantic AI](/guides/pydantic-ai) > > Type-safe agents with Pydantic AI > [card] [Google ADK](/guides/google-adk) > > Multi-agent assistants with Google ADK > [card] [Mastra](/guides/mastra) > > TypeScript agents with Mastra > [card] [Microsoft Agent Framework](/guides/microsoft-agent-framework) > > Python agents with Microsoft Agent Framework > [card] [Migrate from Composio](/guides/composio-migration) > > Move an existing Composio workflow to Xquik ## AI agent skill The [Xquik Skill](https://github.com/Xquik-dev/x-twitter-scraper) documents the Xquik API for AI coding agents. It needs no MCP connection. With it installed, your agent can write API integrations and set up webhooks. It can also configure MCP connections. Claude Code, Cursor, GitHub Copilot, Codex, Windsurf, VS Code and Gemini CLI support it. Other Skill-capable agents work too. It covers MCP tools and the REST API operations. Install the [X API alternative Skill](https://github.com/Xquik-dev/x-api) to move code off the official X API. Run `npx skills add Xquik-dev/x-api`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npx skills add Xquik-dev/x-twitter-scraper ``` # MCP tools for tweet search & X (Twitter) actions Source: https://docs.xquik.com/mcp/tools Choose API MCP tools for tweet search, profile lookup, follower exports, monitors, webhooks, account actions, pagination, and sandbox work. See tool examples. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik API MCP supports 2 explicit tool modes. Code Mode uses `docs`, `search`, `execute`, and `whoami`. Native mode exposes `docs`, `readSavedResult`, `whoami`, and one tool for each eligible OpenAPI operation. Active guest `paid_reads` keys see only the eligible paid-read routes in either mode. Modern clients negotiate MCP `2026-07-28` through `server/discover`. Current SDKs add required request metadata and headers. See [MCP 2026-07-28](/mcp/overview#mcp-2026-07-28). ## Native OpenAPI tools Connect to `https://xquik.com/mcp?codemode=false` for ordinary MCP tools. Full credentials get `docs`, `readSavedResult`, and 1 tool for each eligible operation. Guest keys get `docs`, `readSavedResult`, and 1 tool for each eligible GET route. Native names, schemas, and contracts come from OpenAPI. `compose` and `estimateExtraction` are read-only. Clients read each JSON Schema from `tools/list`. The server embeds no model prompt, routing, sample count, or endpoint preference. Use `https://xquik.com/mcp` for Code Mode. Choose native mode for one tool per operation. Binary downloads, credential lifecycle, checkout, top-up and subscription operations remain REST-only. ## `docs` Search canonical public documentation. `docs` is read-only and uses no credits. **Input.** Pass a non-empty `query` string of up to 500 characters. **Output.** `structuredContent.results` lists each matching passage with its `id`, `url`, `title`, and `text`. The text content shows the same passages as `` blocks within 24,000 characters. ## `whoami` Return the signed-in account's stable id. `whoami` takes no arguments, makes no API request, and uses no credits. **Output.** `{ "id": "user:" }`. The `id` stays the same across token refresh, reconnection, and permission changes. It never moves to another account. Use it to tell connected accounts apart. ChatGPT reads it as the app's profile tool. ## `readSavedResult` Native mode reads a saved oversized answer in pages. Pages make no API requests and use no credits. **Input.** Pass `result_id` from the oversized answer and optional `offset`, which starts at 0. **Output.** Each page returns `characters`, `next_offset`, and `text` within 24,000 characters. Pass `next_offset` as `offset` until it is `null`, then join each `text` in order. A page never splits a character. ## `search` Search the authenticated API catalog. `search` makes no network calls and uses no credits. Full credentials search every catalog route. Guest keys search the eligible paid-read routes. **Input.** Pass required `code` as an async arrow function of up to 10,000 characters. Read `spec.paths`. Return matching paths, methods, and relevant contract fields. Inspect inputs and response fields separately when an operation is large. **Sandbox API.** Inputs resolve inline. Response `$ref` values point into `spec.components.schemas`. The catalog includes only response schemas reachable from your allowed operations. Search retains operation-specific response descriptions. Date-only fields keep string types. Follow references to inspect shared fields and recursive types. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} interface OperationInfo { operationId: string; summary?: string; description?: string; readOnly: boolean; tags?: string[]; parameters?: unknown[]; requestBody?: unknown; responses?: Record; } interface PathItem { get?: OperationInfo; post?: OperationInfo; put?: OperationInfo; patch?: OperationInfo; delete?: OperationInfo; } declare const spec: { paths: Record; components: { schemas: Record }; }; ``` **Examples.** > Inspect an operation's input contract ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const path = "/api/v1/x/tweets/search"; const { operationId, summary, parameters } = spec.paths[path].get; return { path, method: "GET", operationId, summary, parameters }; }; ``` Inspect specific response properties in a separate `search` call. For example, `#/components/schemas/PaginatedTweets` identifies the shared pagination schema. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => spec.components.schemas.PaginatedTweets.properties; ``` ## `execute` Execute API calls allowed by the authenticated credential. Full account keys and OAuth tokens keep their existing account capabilities. Guest keys can execute only the eligible GET reads. The server injects authentication and required idempotency headers. For full credentials, `execute` carries `destructiveHint: true` and `openWorldHint: true`. As a result, MCP clients such as Claude ask before each call. Guest keys see it as read-only. Native tools carry the hints of their operation, so reads run without a prompt. **Input.** Pass `code` as an async arrow function of up to 10,000 characters. `xquik` is global and the function's first argument. Pass optional `result_id` to load a saved result into `xquik.result`. Without it, `xquik.result` is `null`. Pass the function itself, not a promise or its result. Place API calls inside its body. Non-functions fail before any API request starts. `path` works with or without the `/api/v1` prefix, as in `/x/users/nasa/follow`. **Sandbox API.** ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} interface XquikRequest { path: string; method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; query?: Record; body?: unknown; } interface XquikResponse { success: true; status: number; result: T; errors: []; messages: []; } declare const xquik: { result: unknown; request(options: XquikRequest): Promise>; }; ``` **Response contract.** `xquik.request()` returns `success`, `status`, `result`, `errors`, and `messages`. `status` contains the HTTP status. `result` contains the endpoint body. A rejected request includes `error.status` when available. Existing string-path calls still return the body for compatibility. Hosted MCP injects a unique `Idempotency-Key` and reuses it for bounded transient retries. Verify unresolved writes. Retry only when `safe_to_retry` is true. Results use snake_case with Unix timestamps. CamelCase reads work, including `favoriteCount` for `like_count`. Errors stay structured. Pagination uses `has_more` and `next_cursor`. Compact extraction results retain `like_count`, `retweet_count`, `reply_count`, `quote_count`, `view_count`, and `bookmark_count`. They omit profile images and nested enrichment. MCP keeps every safe field that X supplies. Optional fields stay absent. See [Read Data Richness](/guides/tweet-profile-api-fields) for the REST field map. Missing response-field reads return `undefined` and produce `warnings`. Each warning maps a missing field to available response keys. Optional-field fallbacks remain valid. Warnings contain field names, never response values. With warnings, text and structured output both contain `{ result, warnings }`. The combined output follows the existing 24,000-character limit. List and search responses use `has_more` and `next_cursor`. They do so even when REST shows `has_next_page` or `hasMore`. Pass `next_cursor` unchanged as `cursor` for X reads, draws, extractions, and events. Never replace an extraction cursor with `offset`. Use `after` for `/api/v1/radar` and `afterCursor` for drafts. Hosted MCP keeps each requested `limit`. REST enforces documented bounds. Omit `mode` for tweet search, replies, followers, following, and verified followers. Those operations use automatic maximum coverage. Pass `next_cursor` back unchanged. Use `mode=standard` only for legacy pagination. Keep paging while `has_more` is true and the cursor advances. That includes empty pages, filtered or not. Stop when you reach the requested total or `has_more` becomes false. Treat a missing or repeated `next_cursor` while `has_more` is true as stalled pagination. Return the partial count plus a stop reason. For advanced nested-reply diagnostics, call `/api/v1/x/tweets//replies?mode=complete&limit=25000`. Complete mode adds nested replies & a coverage diagnostic. Direct replies match `inReplyToId`. Keep `nested_replies` separate. Trust `diagnostic.complete`. HTTP 424 `replies_incomplete` keeps rows. MCP returns that documented body instead of a tool error. Inspect `coveragePercentage`, `recommendedFallback`, and X-dependent coverage limits. Errors use `error.type`, `error.code`, and `error.message`. They add fields such as `error.retryable` or `error.retry_after` when available. Invalid routes stay blocked without suggesting or calling a different operation. Find the exact method and path in `spec.paths` before retrying. Dependency failures use HTTP `424` in this contract. Fix validation errors before retrying. Respect `retry_after` on `429`. Write and media results follow the same contract. Read `tweet_id`, `write_action_id`, `charged_credits`, `media_id`, `media_url`, and `message_id` from `response.result`. Both `search` and `execute` return compact JSON within 24,000 characters. Whitespace inside strings stays unchanged. Native API tools apply the same limit to successful & failed responses. The limit bounds tool output, not catalog access or available results. Large schema selections can exceed it. Oversized output returns a shortened copy, never an error. `result` stays valid JSON. Lists keep whole items from the start. Each cut says `--- TRUNCATED ---`. Examples are `--- TRUNCATED --- 11 more items` and `--- TRUNCATED --- 5,000 chars`. A `truncated` object sits beside `result`. Its `characters` gives the whole answer's size. Its `next` says what to do for the rest. A saved answer adds `result_id` & `download_url`. That link downloads the whole result as a CSV file. An answer too large to keep returns `characters`, `next` & any saved `reads`. An ordinary result containing an `error` field is not a tool failure. Output errors do not undo completed API actions or charges. Use REST, SDKs, or extraction exports to store every row. ### Cursor pages and response size Cursor-based reads may return fewer rows than requested to fit each MCP response. Continue with `next_cursor` while `has_more` is true. Deferred rows remain available through that cursor, with their fields intact. Only rows delivered in each page incur result charges. Each API response within `execute` must fit within 2 MiB. A single larger row returns HTTP 413 `response_item_too_large` before result billing. Retrieve that row through REST. Projecting fields in `execute` cannot reduce the incoming API response size. The separate 24,000-character tool output limit still applies. ### Recover oversized results When saving succeeds, the `truncated` object of an oversized API result includes `result_id` & `download_url`. Its `next` names only tools your catalog lists. Use 1 of these retrieval methods. * In Code Mode, pass `result_id` to `execute`, then project or page `xquik.result`. * In native mode, pass `result_id` with `offset` 0 to [`readSavedResult`](#readsavedresult), then each `next_offset`. * Open `download_url` signed in to the same account. It downloads the whole result as a CSV file. * Read `xquik://results/{result_id}` through MCP `resources/read`. Resources return complete `{ result, warnings? }` JSON. Return selected fields, fewer rows, shorter strings, or an aggregate from saved data. Reading saved data makes no API requests and spends no extraction credits. Explicit `xquik.request()` calls still follow normal billing. Use the original account and credential scope. Another account or scope cannot retrieve the result. Missing or unavailable results return an error. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "code": "async () => xquik.result.tweets.slice(0, 10).map(({ id }) => id)", "result_id": "" } ``` Recovery applies only when the response supplies `result_id`. Every API answer MCP accepts fits in storage. A storage failure may still prevent saving. An oversized `search` answer is not saved. Return a smaller selection for the rest. Without a saved result, contact support before repeating requests that cost credits. Verify completed writes before retrying them. ### Scope and unavailable operations The [MCP operation boundary](/mcp/overview#mcp-operation-boundary) lists excluded operations. Guest wallet credential routes and file downloads use REST. Guest keys expose only [eligible paid-read routes](/guides/guest-wallets#eligible-paid-read-routes). A `402` creates no checkout. Its MCP answer keeps `error`, `message`, `balance`, and `required`. It also keeps `credits_renew_at` when a plan renews, and `dashboard` as a full link. It leaves out `payment_options`, `next_step` and the top-up fields. Report the balance and send the user to the `dashboard` link to add credits. **Examples.** Each page holds complete `execute` calls. | Task | Page | | - | - | | Tweet search and replies | [Tweet examples](/mcp/execute-tweet-examples) | | Followers and extractions | [Follower examples](/mcp/execute-follower-examples) | | Posting and media | [Media examples](/mcp/execute-media-examples) | | Monitors and events | [Monitor examples](/mcp/execute-monitor-examples) | ## Agent handoff patterns Use extraction exports for generated files. Keep agent handoffs small. Include the job, route, stored row IDs, next cursor, and poll action. Avoid raw pages when later workers need durable rows. > [card] Search tweets to JSON > > Call `GET /api/v1/x/tweets/search`. Put keywords, operators, a Tweet ID, or an X status URL in `q`. Valid time bounds apply to every page. The start is inclusive and the end is exclusive. Store `tweets[].id`, `tweets[].text`, `tweets[].author`, `tweets[].created`, `has_more`, `next_cursor`, and the original `q`. The cost is 1 credit per tweet returned. > [card] Scrape tweet replies to files > > Call `POST /api/v1/extractions` with `reply_extractor` and `targetTweetId`. The create route handles required preflight. Poll `GET /api/v1/extractions/{id}`. Export CSV, JSON, or XLSX with `GET /api/v1/extractions/{id}/export`. Store reply rows plus `has_more` and `next_cursor`. The cost is 1 credit per reply extracted or returned. > [card] Export followers to CRM > > Call `GET /api/v1/x/users/{id}/followers` or `POST /api/v1/extractions` with `follower_explorer`. Store `users[].id`, `users[].username`, `users[].name`, `users[].followers`, `has_more`, and `next_cursor`. The cost is 1 credit per follower returned or extracted. > [card] Post media tweets or replies > > Call `POST /api/v1/x/tweets` with `media: ["https://..."]`. Store `tweet_id` or `write_action_id`, `reply_to_tweet_id`, `account`, `charged_credits`, and the original `media` URLs. The cost is 30 credits text-only. Add 2 credits per started MB across attached media. > [card] Send DMs with media > > Call `POST /api/v1/x/media`, then `POST /api/v1/x/dm/{userId}` with one `media_ids` value. Store `media_id`, `media_url`, `message_id`, `user_id`, `account`, and source URL or filename. Keep full DM bodies out of shared outputs and leave `reply_to_message_id` unset. The cost is 10 credits per media upload plus 10 credits per DM send. > [card] Track tweet or reply writes > > Call `POST /api/v1/x/tweets`, then `GET /api/v1/x/write-actions/{id}` when pending. Store `tweet_id`, `reply_to_tweet_id`, `write_action_id`, `status`, `charged`, `charged_credits`, and `media`. The cost is 30 credits text-only. Add 2 credits per started MB across attached media. > [card] Monitor tweets to webhooks > > Call `POST /api/v1/monitors` or `POST /api/v1/monitors/keywords`, then `POST /api/v1/webhooks`. Store `monitor.id`, `event_types`, `next_billing_at`, `webhook.id`, webhook URL, and the one-time `webhook.secret`. Run `POST /api/v1/webhooks/{id}/test` before routing production events. Verify `X-Xquik-Signature`. Deduplicate production payloads with `deliveryId` and `streamEventId`. Inspect `GET /api/v1/webhooks/{id}/deliveries` for retry status rows. Each payload contains one monitor event. Process multiple POSTs when one check catches multiple new matching tweets. The cost is 30 credits per active monitor-hour. The rate includes webhook delivery. > [card] Replay monitor events > > Call `GET /api/v1/events` when a receiver missed webhook delivery or a downstream queue needs replay. Store `event_id`, `type`, `monitor_id`, `monitor_type`, `occurred_at`, `has_more`, and `next_cursor`. Use `cursor` for the next page. When the media is already public, post tweets or replies without uploading it first. Pass public URLs in `media`. Send up to 4 image URLs or exactly 1 MP4 video URL. The video can be up to 100 MB. For a local file, upload it and pass its `media_id` in `media_ids`. Never send `media` and `media_ids` together. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const { result: page } = await xquik.request({ path: "/api/v1/x/tweets/search", query: { q: "from:username giveaway", limit: "50" }, }); return { source: "xquik_mcp", job: "tweet_search", query: "from:username giveaway", rows: page.tweets.map((tweet) => ({ tweet_id: tweet.id, text: tweet.text, author: tweet.author, created: tweet["created"], url: tweet.url, })), has_more: page.has_more, next_cursor: page.next_cursor, }; }; ``` > Look up known tweet IDs `GET /api/v1/x/tweets` is available in both the full and `paid_reads` catalogs. Send as many tweet IDs as fit in 1 URL. ```javascript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} async () => { const { result: page } = await xquik.request({ path: "/api/v1/x/tweets", query: { ids: "1893456789012345678,1893456789012345679" }, }); return { tweets: page.tweets.map((tweet) => ({ tweet_id: tweet.id, text: tweet.text, author_username: tweet.author?.username ?? null, })), }; }; ``` ## API endpoints The full MCP catalog groups its operations into 10 categories. > [card] Account, composition, and credits > > MCP operations across `account`, `composition`, and `credits` cover account info and X identity. They also cover compose, styles, drafts, radar, and balance checks. > [card] Extractions and media > > Operations across `extraction` and `media` cover giveaway draws, extraction jobs, estimates, and media download. > [card] Monitoring and webhooks > > Operations in `monitoring` cover account monitors, keyword monitors, and post monitors. They also cover stored events, webhooks, deliveries, and test delivery. > [card] Support > > Operations in `support` create, list, read, reply to, and close tickets. > [card] Tweets, profiles & followers > > Operations in `twitter` cover batch and single tweet lookup, tweet search, and article lookup. The category also covers user Article lists, hidden replies, user lookup, and repost checks. It covers follower and following ID lists, creator subscriptions, affiliates, and follow checks. It covers trends, bookmarks, notifications, timeline, DM history, likes, media, and highlights. It also covers followers, replies, communities, lists, and job listings. Timeline and thread results exclude X ads. > [card] X accounts and writes > > Operations across `x-accounts` and `x-write` connect accounts and resolve challenges. They post tweets, like, retweet, follow, and remove followers. They also send and delete DMs, upload media, update profiles, and manage communities. A guest `paid_reads` key limits `search` and `execute` to the eligible `twitter` GET operations. The `docs` tool remains available. Use the [guest paid-read route inventory](/guides/guest-wallets#eligible-paid-read-routes) as the public route list. ## Cost summary > [card] Always unmetered discovery > > `docs` and `search` cost no credits. They return documentation and API contract details. > [card] Unmetered account and stored records > > Compose, cached styles, drafts, radar, account, and support cost no credits. The same goes for credits, X account management, webhooks, and stored monitors. Stored events and existing extraction or draw reads cost no credits either. > [card] Metered reads and jobs > > Tweet search, user lookup, follow checks, media download, and trends are metered. Extraction creation and draw creation are metered too. > [card] Monitor billing > > Active monitors cost 30 credits per monitor-hour. Creating one requires enough available credits. > [card] Write actions > > Tweet, reply, like, retweet, follow, DM, profile, community, and media upload writes are metered. A write that must sign in to your X account first adds 10 credits. Xquik refunds them if the sign-in fails. See [the X sign-in fee](/guides/billing#x-sign-in-fee). > [card] Metered refreshes > > Fresh style analysis after the 7-day cache window requires enough available credits. > [!WARNING] > > Never combine unmetered and metered endpoints in a single `Promise.all`. A 402 error on one call fails every result. Call unmetered endpoints first, then metered ones separately. ## Error handling * **402 / `no_subscription` / `subscription_inactive`.** Report the billing state. Existing available credits can still fund metered calls. Send the user to the `dashboard` link to choose a plan. * **402 / `no_credits` / `insufficient_credits`.** Report `balance` and `required`. Then send the user to the `dashboard` link to add credits. Guest sessions may explain the direct REST top-up flow, but MCP cannot execute it. * **429 / `rate_limit_exceeded`.** Respect `error.retry_after`, then retry safe reads with backoff. * **424 dependency errors.** Report `error.code`, keep partial aggregates, and retry only when `error.retryable` allows it. * **Validation errors.** Fix the path, query, or body before retrying. `execute` throws a failed request as an Error. A native tool answers it as an error result with the same text. The text names the method, path, and HTTP status of the failed request. The API's JSON error follows. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Xquik API request GET /api/v1/x/tweets/search returned HTTP 400 Bad Request with {"error":{"message":"Use a whole number of 1 or more for limit.","type":"invalid_request_error","code":"invalid_input"}} ``` MCP has no subscription, checkout, top-up or guest wallet tool. No MCP call moves money. # Machine Payments Protocol for X API billing Source: https://docs.xquik.com/mpp/machine-payments-protocol Use HTTP 402 and Tempo USDC for anonymous fixed-price tweet, user, follow-check, article, trend, and community reads. Includes payment and receipt examples. > For the complete documentation index, see [llms.txt](/llms.txt). The [Machine Payments Protocol](https://mpp.dev) (MPP) is an open standard for machine-to-machine payments over HTTP. Xquik accepts direct MPP payments on fixed-price read operations. You can call them without an account, API key, or subscription. ## How it works MPP uses HTTP 402 (Payment Required) as a payment challenge. A direct MPP operation called without authentication returns an `application/problem+json` response. The response also has a `WWW-Authenticate: Payment` header. Your client pays through Tempo (USDC), then retries the request with a payment credential. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Client Xquik │ │ │ 1. GET /api/v1/x/tweets/123 │ │──────────────────────────────────▶│ │ │ │ 2. 402 Payment Required │ │ WWW-Authenticate: Payment │ │ (challenge with amount, etc.) │ │◀──────────────────────────────────│ │ │ │ 3. Pay via Tempo (USDC) │ │ (off-band) │ │ │ │ 4. Retry with credential │ │ Authorization: Payment proof │ │──────────────────────────────────▶│ │ │ │ 5. HTTP response + │ │ Payment-Receipt │ │◀──────────────────────────────────│ ``` > [!NOTE] > > Every response after an accepted payment includes `Payment-Receipt`, including non-2xx responses. The receipt confirms settlement, not application success. Challenges and rejected payment credentials do not include a receipt. The same `402` body also advertises an optional accountless guest wallet. The MPP challenge remains unchanged. A failed read creates no checkout. Create a hosted checkout only after the user confirms an amount. You need no account, API key, or subscription. The payment credential authenticates the retried request. ## Payment method MPP payments on Xquik use Tempo with USDC, a dollar-pegged stablecoin. Tempo provides the settlement method for these fixed charges. You need a funded Tempo USDC wallet. See the [MPP quickstart](/mpp/quickstart) for setup instructions. ## Discovery Each direct MPP operation carries `x-payment-info` in the live OpenAPI spec. That field gives its method, intent, currency & amount. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} https://xquik.com/openapi.json ``` [`/.well-known/api-catalog`](https://xquik.com/.well-known/api-catalog) links the spec. A call without payment also answers `402` with the same offer in `WWW-Authenticate: Payment`. ## Payment intent All direct MPP operations use the `charge` intent. Each accepted payment settles the fixed price for one request. Xquik does not advertise direct MPP session pricing for result-sized pages. ## Eligible endpoints | Endpoint | Method | Price | Intent | | - | - | - | - | | `/api/v1/x/tweets/{id}` | GET | USD 0.00015 per call | charge | | `/api/v1/x/tweets/{id}/translation` | GET | USD 0.00015 per call | charge | | `/api/v1/x/tweets/{id}/embed` | GET | USD 0.00015 per call | charge | | `/api/v1/x/users/{id}` | GET | USD 0.00015 per call | charge | | `/api/v1/x/spaces/{id}` | GET | USD 0.00015 per call | charge | | `/api/v1/x/spaces/{id}/replay` | GET | USD 0.00015 per call | charge | | `/api/v1/x/broadcasts/{id}` | GET | USD 0.00015 per call | charge | | `/api/v1/x/followers/check` | GET | USD 0.00015 per call | charge | | `/api/v1/x/articles/{tweetId}` | GET | USD 0.00075 per call | charge | | `/api/v1/trends` | GET | USD 0.00015 per call | charge | | `/api/v1/x/trends` | GET | USD 0.00015 per call | charge | | `/api/v1/x/communities/{id}/info` | GET | USD 0.00015 per call | charge | | `/api/v1/x/lists/{id}` | GET | USD 0.00015 per call | charge | | `/api/v1/x/sports/{league}/games` | GET | USD 0.00015 per call | charge | | `/api/v1/x/sports/{league}/games/{id}` | GET | USD 0.00015 per call | charge | | `/api/v1/x/sports/{league}/games/{id}/plays` | GET | USD 0.00015 per call | charge | | `/api/v1/x/sports/{league}/games/{id}/box-score` | GET | USD 0.00015 per call | charge | | `/api/v1/x/sports/{league}/games/{id}/roster` | GET | USD 0.00015 per call | charge | | `/api/v1/x/sports/{league}/games/{id}/player-props` | GET | USD 0.00015 per call | charge | | `/api/v1/x/sports/{league}/games/{id}/audience` | GET | USD 0.00015 per call | charge | An accountless guest wallet covers the prepaid GET routes, including these. See the [guest paid-read route inventory](/guides/guest-wallets#eligible-paid-read-routes). Direct MPP payment credentials and guest keys cannot access monitors, webhooks, extractions, or draws. They also cannot access writes, account routes, or account credential routes. API MCP cannot execute guest wallet credential routes. ## MPP vs subscription
Compare MPP, guest wallet, and account access.
Capability MPP Guest wallet Account
Account required No No Yes
Credential Per-request payment credential `paid_reads` API key Full API key or OAuth token
Payment Per request via Tempo (USDC) USD 10 to 250 hosted checkout Available account credits. Plans add monthly credits.
Available endpoints Fixed-price GET operations Prepaid GET routes Full account API
Write actions Not available Not available Available with a connected X (Twitter) account
Monitors, webhooks, extractions, and draws Not available Not available Available
Best for Machine-paid requests Prepaid reads without an account Full platform workflows
## Next steps > [card] [MPP quickstart](/mpp/quickstart) > > Make your first pay-per-use API call. > [card] [Authentication](/api-reference/authentication) > > Read every authentication method, including MPP headers. > [card] [Billing & usage](/guides/billing) > > Subscription, guest wallet, and direct MPP pricing. > [card] [Guest wallets](/guides/guest-wallets) > > Prepay accountless reads with one scoped API key. # MPP quickstart for pay-per-use X API requests Source: https://docs.xquik.com/mpp/quickstart Make an anonymous pay-per-use tweet, profile, follow-check, article, or trend request with HTTP 402, Tempo USDC, and a payment receipt. See payment examples. > For the complete documentation index, see [llms.txt](/llms.txt). Call fixed-price Xquik X (Twitter) operations without an account or subscription. Pay per request with Tempo (USDC) using the `mppx` SDK. ## Step 1. Install the SDK ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npm i mppx viem ``` The `mppx` package provides both client and server utilities. You only need the client. `viem` manages the wallet account. ## Step 2. Set up a Tempo wallet You need a Tempo wallet funded with USDC. The `mppx` client also needs the wallet's raw hex private key. **Path A. CLI only.** Recommended for agents. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} mppx account create # generates a local keychain-backed account mppx account export # prints the hex private key (0x...) ``` Fund the account's address with USDC on Tempo. Then copy the exported key into `TEMPO_PRIVATE_KEY`. **Path B. Web wallet as a USDC source.** Use [wallet.tempo.xyz/welcome](https://wallet.tempo.xyz/welcome) as a hosted UI to buy & send USDC. Run `mppx account create` to create a local account and copy its address. Send USDC from the web wallet to that address. Then run `mppx account export` to get the hex key. You cannot import the web wallet into `mppx`. It is a funding source, not a key source. > **Warning.** Never commit your private key to version control. Load it from an environment variable. ## Step 3. Make a charge request Look up a single tweet. The SDK intercepts 402 responses, pays via Tempo, and retries automatically. ```typescript theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { Mppx, tempo } from "mppx/client"; import { privateKeyToAccount } from "viem/accounts"; // Configure the MPP client. This patches global fetch // to automatically handle 402 Payment Required challenges Mppx.create({ methods: [ tempo({ account: privateKeyToAccount(process.env.TEMPO_PRIVATE_KEY as `0x${string}`), }), ], }); // Now any fetch to an MPP-enabled endpoint auto-pays const response = await fetch("https://xquik.com/api/v1/x/tweets/1893456789012345678"); const data = await response.json(); console.log(data.tweet.text); ``` `Mppx.create()` patches the global `fetch` function. A direct MPP request can return 402 with a `WWW-Authenticate: Payment` header. The SDK then pays the requested amount. It sends the request again with an `Authorization: Payment` credential. Every response after accepted payment includes a `Payment-Receipt` header confirming settlement. ## Step 4. Raw HTTP flow without the SDK Without the `mppx` SDK, implement the protocol yourself. **Step 1.** Request the endpoint. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -i https://xquik.com/api/v1/x/tweets/1893456789012345678 ``` **Step 2.** Receive the 402 challenge. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} HTTP/2 402 WWW-Authenticate: Payment id="abc...", realm="xquik.com", method="tempo", intent="charge", request="eyJhbW91bnQiOi..." ``` The `request` parameter is a base64url-encoded JSON object. It holds the amount, currency, and recipient address. The `application/problem+json` body also includes an optional `payment_options.guest_wallet.create_checkout` action. It does not replace the MPP header. The failed request creates no checkout. Ignore it when completing MPP. Use it only after a user explicitly picks and confirms a guest wallet. Its amount is USD 10 to 250. **Step 3.** Pay and retry. After completing the Tempo payment, retry the request with the payment credential. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -i https://xquik.com/api/v1/x/tweets/1893456789012345678 \ -H "Authorization: Payment eyJjaGFsbGVuZ2UiOnsi..." ``` The `Authorization: Payment` value is a base64url-encoded JSON object. It holds the original challenge and your payment proof. **Step 4.** Receive the response and receipt. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} HTTP/2 200 Payment-Receipt: eyJzdGF0dXMiOiJzdWNjZXNzIiwi... Content-Type: application/json {"tweet": {"id": "1893456789012345678", "text": "..."}} ``` The `Payment-Receipt` header confirms settlement. Check the HTTP status and response body separately. Accepted payments include a receipt on non-2xx responses too. ## Next steps * [MPP overview](/mpp/machine-payments-protocol) covers direct MPP operations, pricing, and protocol details. * [Guest wallets](/guides/guest-wallets) let you prepay the eligible reads with an accountless API key. * [Get tweet](/api-reference/x/get-tweet) is the full endpoint reference for tweet lookups. * [Get user](/api-reference/x/twitter-profile-lookup) is the full endpoint reference for user lookups. # Xquik, X & Twitter trademark & affiliation notice Source: https://docs.xquik.com/non-affiliation Learn how Xquik references X, Twitter, tweets, profiles, and related trademarks while operating as an independent third-party service with its own support. > For the complete documentation index, see [llms.txt](/llms.txt). **Xquik is an independent third-party service.** Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp. ## What this means Xquik builds and operates its own APIs, SDKs, MCP tools, webhooks, dashboard, and documentation. X Corp. does not sponsor, authorize, endorse, or operate Xquik. Nothing here implies a partnership, agency, or official integration. References to X and Twitter identify the services and workflows that Xquik supports. The same applies to tweets, reposts, replies, followers, following, and profiles. It also applies to timelines, communities, lists, direct messages, and other platform features. Those references do not transfer ownership of X Corp. trademarks or products to Xquik. ## Separate services Xquik controls its subscriptions, credits, API keys, endpoints, SDKs, monitor events, and webhook deliveries. X Corp. controls the X platform, accounts, official X (Twitter) APIs, and developer access. It also controls platform rules and feature availability. Changes made by either service may affect an integration. Use official X Corp. websites for X account support or official X API access. Use them too for X developer terms, trademark policies, or platform status. Use Xquik support when you need help with Xquik API keys, credits, or requests. Use it too for responses, exports, monitors, SDKs, MCP tools, or webhook signatures. ## Your responsibilities Review the rules that apply to your use case before collecting content. That covers tweets, profiles, followers, replies, media, or other content. Meet every permission, retention, disclosure, and deletion requirement. Product examples explain Xquik request and response contracts. They are not legal advice or a replacement for applicable platform terms. # OAuth 2.1 for MCP & X API agent authorization Source: https://docs.xquik.com/oauth/overview Authorize MCP clients and agents with OAuth 2.1, PKCE, claimed service identities, interactive refresh tokens, discovery metadata, and revocation examples. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik supports 2 MCP authorization paths for X (Twitter) data. Interactive clients use [OAuth 2.1](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1) Authorization Code with S256 PKCE. Agents can use claimed `service_auth` registration. Both paths require the user to sign in and approve access. > [!NOTE] > > Prefer OAuth for compatible remote MCP clients. Check the [client compatibility > matrix](/mcp/overview#client-compatibility) before using an API key fallback. * **Client ID Metadata Documents (CIMD).** Recommended for modern clients. The client's HTTPS metadata URL becomes its `client_id`. It needs no registration request or client secret. * **Dynamic Client Registration (DCR).** Fallback for clients without CIMD. The client registers once at `/api/oauth/register`. ## Discovery MCP clients configure endpoints from these standard discovery documents. ### Authorization server metadata ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/.well-known/oauth-authorization-server ``` ```json Response theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "issuer": "https://xquik.com", "authorization_endpoint": "https://xquik.com/api/oauth/authorize", "token_endpoint": "https://xquik.com/api/oauth/token", "registration_endpoint": "https://xquik.com/api/oauth/register", "scopes_supported": ["mcp:read", "mcp:tools"], "response_types_supported": ["code"], "grant_types_supported": [ "authorization_code", "refresh_token", "urn:workos:agent-auth:grant-type:claim", "urn:ietf:params:oauth:grant-type:jwt-bearer" ], "code_challenge_methods_supported": ["S256"], "token_endpoint_auth_methods_supported": ["none", "client_secret_post", "private_key_jwt"], "token_endpoint_auth_signing_alg_values_supported": ["RS256"], "revocation_endpoint": "https://xquik.com/api/oauth/revoke", "revocation_endpoint_auth_methods_supported": ["none", "client_secret_post", "private_key_jwt"], "revocation_endpoint_auth_signing_alg_values_supported": ["RS256"], "protected_resources": [ "https://xquik.com", "https://xquik.com/en", "https://xquik.com/es", "https://xquik.com/tr", "https://xquik.com/mcp" ], "service_documentation": "https://docs.xquik.com/oauth/overview", "authorization_response_iss_parameter_supported": true, "response_modes_supported": ["query"], "client_id_metadata_document_supported": true, "agent_auth": { "claim_endpoint": "https://xquik.com/agent/identity/claim", "claim_uri": "https://xquik.com/agent/identity/claim", "identity_endpoint": "https://xquik.com/agent/identity", "identity_types_supported": ["service_auth"], "register_uri": "https://xquik.com/agent/identity", "revocation_uri": "https://xquik.com/api/oauth/revoke", "skill": "https://xquik.com/auth.md" } } ``` The endpoint fields follow the current Auth.md profile. The URI fields are working compatibility aliases. Generic OAuth clients may ignore this object. ### Protected resource metadata ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/.well-known/oauth-protected-resource/mcp ``` ```json Response theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "resource": "https://xquik.com/mcp", "resource_name": "Xquik MCP Server", "authorization_servers": ["https://xquik.com"], "bearer_methods_supported": ["header"], "resource_documentation": "https://docs.xquik.com/mcp/overview", "scopes_supported": ["mcp:read", "mcp:tools"] } ``` Localized site resources publish the same RFC 9728 contract under `/.well-known/oauth-protected-resource/en`, `/es`, and `/tr`. Request `https://xquik.com` for direct REST calls. Use `/mcp` tokens only with MCP. The MCP endpoint also returns this metadata URL in its unauthenticated `WWW-Authenticate` challenge. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Bearer realm="OAuth", resource_metadata="https://xquik.com/.well-known/oauth-protected-resource/mcp", scope="mcp:tools" ``` The ChatGPT app's `https://xquik.com/mcp?app=chatgpt` asks for `mcp:read`. Its `resource_metadata` URL, ending in `?app=chatgpt`, lists only that. REST calls under `/api/v1/` answer `401` without a valid credential. Each answer names its own metadata URL. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Bearer realm="xquik", resource_metadata="https://xquik.com/.well-known/oauth-protected-resource/api/v1/x/tweets/search" ``` RFC 9728 requires that document's `resource` to match the URL you called. The query string stays out. The document names no authorization server. For OAuth on REST, request a token for `https://xquik.com`. An API key works too. ## Client registration choices ### Client ID metadata document Publish JSON at a stable HTTPS URL with an explicit path. A trailing `/` is sufficient. Use that exact URL as the `client_id`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "client_id": "https://client.example/oauth/client.json", "client_name": "Example MCP Client", "redirect_uris": ["https://client.example/oauth/callback"], "grant_types": ["authorization_code", "refresh_token"], "response_types": ["code"], "token_endpoint_auth_method": "none" } ``` The HTTPS `client_id` must include an explicit path. Exclude user information, queries, fragments, and dot segments. Xquik requires a direct `200` JSON response. Redirects fail. Keep the document within 5 KiB. Repeat the exact `client_id`. Include `client_name`, `redirect_uris`, and `token_endpoint_auth_method: "none"`. List every allowed redirect URI. ### Dynamic client registration Clients without CIMD may register at `POST /api/oauth/register`. DCR supports public clients with `none` and confidential clients with `client_secret_post`. The manual flow below uses a DCR-issued UUID. So each step can show a concrete `client_id`. ## Manual implementation **1. Register a DCR client** Skip this step when the client uses CIMD. For DCR, register once to get a UUID `client_id`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/oauth/register \ -H "Content-Type: application/json" \ -d '{ "client_name": "My MCP Client", "redirect_uris": ["https://myapp.example.com/callback"] }' ``` ```json Response theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "client_id": "550e8400-e29b-41d4-a716-446655440000", "client_name": "My MCP Client", "redirect_uris": ["https://myapp.example.com/callback"], "grant_types": ["authorization_code", "refresh_token"], "response_types": ["code"], "token_endpoint_auth_method": "none" } ``` **Redirect URI requirements.** * Production web callbacks use HTTPS only * In development, HTTP loopback callbacks may use `localhost`, `127.0.0.1`, or `::1` * HTTPS and supported native callbacks require exact matching * HTTP loopback callbacks may change only the ephemeral port. Scheme, host, path, and query must match * Xquik does not support wildcards or subpath matching **Client types.** * **Public** (`token_endpoint_auth_method: "none"`) is the default. It has no client secret. Browser apps and MCP clients use it. * **Confidential** (`token_endpoint_auth_method: "client_secret_post"`) returns a `client_secret` in the registration response. Server-side apps use it. > [!WARNING] > > If you register a confidential client, the registration response returns the `client_secret` once. Store it in a secret manager. **2. Generate PKCE parameters** Generate a cryptographically random `code_verifier` and derive the `code_challenge` from it. ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { randomBytes, createHash } from "node:crypto"; const codeVerifier = randomBytes(32).toString("hex"); const codeChallenge = createHash("sha256") .update(codeVerifier) .digest("base64url"); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import base64 import hashlib import secrets code_verifier = secrets.token_hex(32) code_challenge = base64.urlsafe_b64encode( hashlib.sha256(code_verifier.encode()).digest() ).rstrip(b"=").decode() ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "crypto/rand" "crypto/sha256" "encoding/base64" "encoding/hex" ) func generatePKCE() (string, string) { b := make([]byte, 32) rand.Read(b) codeVerifier := hex.EncodeToString(b) hash := sha256.Sum256([]byte(codeVerifier)) codeChallenge := base64.RawURLEncoding.EncodeToString(hash[:]) return codeVerifier, codeChallenge } ``` > [!WARNING] > > Use at least 32 cryptographically random bytes (64 hex characters) for the `code_verifier`. Store the verifier securely on the client. You need it for the token exchange in step 5. **3. Redirect to authorization** Redirect the user to the Xquik authorization endpoint with the required query parameters. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} GET https://xquik.com/api/oauth/authorize ?response_type=code &client_id=550e8400-e29b-41d4-a716-446655440000 &redirect_uri=https://myapp.example.com/callback &code_challenge=a1b2c3d4e5f6... &code_challenge_method=S256 &scope=mcp:tools &state=random_csrf_token &resource=https://xquik.com/mcp ``` **Required parameters.** | Parameter | Value | | - | - | | `response_type` | `code` | | `client_id` | UUID from client registration | | `redirect_uri` | Must match a registered URI exactly | | `code_challenge` | Base64url-encoded SHA256 digest of the `code_verifier` | | `code_challenge_method` | `S256` | | `resource` | `https://xquik.com/mcp` for MCP or `https://xquik.com` for REST | **Optional parameters.** | Parameter | Default | Description | | - | - | - | | `scope` | `mcp:tools` | `mcp:tools`, `mcp:read`, or both, separated by a space | | `state` | | Opaque value for CSRF protection | These examples use `/mcp`. Direct REST clients use `https://xquik.com`. Send the same value in every authorization, token, and refresh request. The user sees a login page with Google OAuth or an email magic link. A consent screen follows. The user can set a monthly credit cap there. New connections have none by default. After approval, Xquik redirects back to your `redirect_uri`. **4. Receive the authorization code** After the user approves, Xquik redirects to your `redirect_uri` with a `code` parameter. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} https://myapp.example.com/callback?code=AUTH_CODE_HERE&state=random_csrf_token&iss=https%3A%2F%2Fxquik.com ``` Verify `state` against the value sent in step 3. Verify `iss` exactly equals the discovered issuer, `https://xquik.com`, before exchanging the code. The authorization code expires in 60 seconds and is single-use. **5. Exchange code for tokens** Exchange the authorization code and your `code_verifier` for an access token and refresh token. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/oauth/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=authorization_code\ &code=AUTH_CODE_HERE\ &code_verifier=YOUR_CODE_VERIFIER\ &client_id=550e8400-e29b-41d4-a716-446655440000\ &redirect_uri=https://myapp.example.com/callback\ &resource=https://xquik.com/mcp" ``` ```json Response theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "access_token": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1", "scope": "mcp:tools" } ``` **6. Use the access token** Pass the token as a Bearer credential to its selected resource. This example calls MCP. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl https://xquik.com/mcp \ -H "Authorization: Bearer ${XQUIK_ACCESS_TOKEN}" ``` ## Token lifetimes | Token | Lifetime | Notes | | - | - | - | | Access token | 1 hour | Use the refresh token to get a new one | | Refresh token | 30 days | Single-use. Each refresh issues a new pair | | Authorization code | 60 seconds | Single-use. Exchange immediately | | Claim token | 24 hours | Registers one claimed service identity | | User code | 10 minutes | Refresh it while the claim token remains active | | Identity assertion | 1 hour | Reuse it to mint agent access tokens | A client that runs several processes may send 1 refresh token twice. Xquik answers a repeat within 45 seconds with the same pair it just issued. The repeat needs the same `client_id`. It also needs the same IP address, or the same /64 for IPv6. A later repeat revokes every token of that sign-in. So does a repeat from another client or address. ## Claimed agent registration Use `service_auth` when an agent knows the user's verified email. Xquik never issues anonymous agent credentials. **1. Register the service identity** Send the verified email as `login_hint`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/agent/identity \ -H "Content-Type: application/json" \ -d '{"type":"service_auth","login_hint":"user@example.com"}' ``` The response includes `claim_token`, `registration_id`, and a `claim` object. Show `claim.verification_uri` and `claim.user_code` to the user. Keep every token secret. **2. Complete the claim** The user opens `claim.verification_uri`, signs in, and enters the code. The signed-in email must match `login_hint`. If the code expires, refresh it before the claim token expires. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/agent/identity/claim \ -H "Content-Type: application/json" \ -d '{"claim_token":"CLAIM_TOKEN","email":"user@example.com"}' ``` **3. Poll for tokens** Honor the returned `claim.interval`. Poll the token endpoint with the static public client ID. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/oauth/token \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "grant_type=urn:workos:agent-auth:grant-type:claim" \ --data-urlencode "client_id=urn:xquik:agent-auth" \ --data-urlencode "claim_token=CLAIM_TOKEN" ``` Handle `authorization_pending`, `slow_down`, `access_denied`, and `expired_token`. Success returns an access token and `identity_assertion`. It never returns a refresh token. **4. Exchange an identity assertion** Reuse a current assertion when a fresh access token is required. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/oauth/token \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer" \ --data-urlencode "client_id=urn:xquik:agent-auth" \ --data-urlencode "assertion=IDENTITY_ASSERTION" ``` Xquik accepts service-signed assertions for active registrations. Restart registration after expiry or `invalid_grant`. ## Refresh tokens Interactive access tokens last 1 hour. Refresh them without another login. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/oauth/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=refresh_token\ &refresh_token=f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1\ &client_id=550e8400-e29b-41d4-a716-446655440000\ &resource=https://xquik.com/mcp" ``` ```json Response theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "access_token": "NEW_ACCESS_TOKEN", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "NEW_REFRESH_TOKEN", "scope": "mcp:tools" } ``` > [!WARNING] > > Refresh tokens are single-use. Always store the latest returned token. ## Token revocation Revoke a token when a user disconnects or your app no longer needs it. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/oauth/revoke \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "token=ACCESS_OR_REFRESH_TOKEN\ &client_id=550e8400-e29b-41d4-a716-446655440000\ &token_type_hint=access_token" ``` | Parameter | Required | Description | | - | - | - | | `token` | Yes | The token to revoke | | `client_id` | Yes | The client ID that owns the token | | `token_type_hint` | No | `access_token` or `refresh_token`. Helps the server locate the token faster | It returns `200` with an empty body. That holds even for a revoked or invalid token (RFC 7009). Revoke a claimed agent with its `identity_assertion`, `client_id=urn:xquik:agent-auth`, and `token_type_hint=urn:ietf:params:oauth:token-type:id-jag`. This revokes the registration & every access token. Revoking 1 access token keeps the registration. **Revocation errors.** | Status | Error | When | | - | - | - | | 400 | `invalid_request` | `token` parameter is empty or missing | | 400 | `invalid_request` | `client_id` parameter is empty or missing | | 401 | `invalid_client` | `client_id` does not match a registered client | ## Scopes | Scope | Description | | - | - | | `mcp:tools` | Full access to all MCP tools, such as tweet search, monitors, extractions, and draws | | `mcp:read` | 8 reads of public posts, profiles & trends, paid with credits | Consent lists only what the requested scopes allow, and the token gets exactly those. A refresh keeps them. Asking for others gets `invalid_scope`. Without `mcp:tools`, MCP still lists `docs`, `search`, `execute` & `whoami`. In that case, `search` & `execute` reach only those 8 reads. ## Client registration ### Request ``` POST /api/oauth/register Content-Type: application/json ``` | Field | Type | Required | Description | | - | - | - | - | | `client_name` | string | No | Display name shown on the consent screen. Defaults to `MCP Client` | | `redirect_uris` | string\[] | Yes | Allowed redirect URIs (1 or more) | | `token_endpoint_auth_method` | string | No | `none` (default) or `client_secret_post` | | `grant_types` | string\[] | No | Defaults to `["authorization_code", "refresh_token"]` | | `response_types` | string\[] | No | Defaults to `["code"]` | ### Response | Field | Type | Description | | - | - | - | | `client_id` | string | UUID. Use this in all later OAuth requests | | `client_name` | string | Resolved display name. Defaults to `MCP Client` | | `redirect_uris` | string\[] | Echoed from request | | `grant_types` | string\[] | Resolved grant types | | `response_types` | string\[] | Resolved response types | | `token_endpoint_auth_method` | string | Resolved auth method | | `client_secret` | string | Only present for confidential clients (`client_secret_post`) | | `client_id_issued_at` | number | Unix timestamp when the client ID was issued | | `client_secret_expires_at` | number | Always `0` (non-expiring). Only present for confidential clients | ## Error responses Token, registration, and revocation endpoint errors use the standard OAuth JSON format. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "error": "error_code", "error_description": "Human-readable description." } ``` Authorization errors use 2 transports. Xquik returns an HTML error page when it cannot safely trust the client. It also returns one when it cannot safely trust the redirect URI. After validating both, Xquik redirects errors to the registered callback. The redirect carries `error`, `error_description`, optional `state`, and `iss=https://xquik.com` query parameters. ### Authorization errors | Error | When | | - | - | | `unsupported_response_type` | `response_type` is not `code` | | `invalid_request` | Missing or repeated parameters, or missing S256 PKCE data | | `invalid_scope` | Scope is neither `mcp:tools` nor `mcp:read` | | `invalid_target` | Resource is not a published protected resource | | `access_denied` | User denied the authorization request | ### Token errors | Error | When | | - | - | | `invalid_request` | Missing `code`, `code_verifier`, `client_id`, or `refresh_token` | | `invalid_grant` | The code or token is invalid, expired, or already used. It also covers a `client_id` mismatch, a `redirect_uri` mismatch, or failed PKCE verification | | `authorization_pending` | The user has not completed the agent claim | | `slow_down` | Claim polling exceeded the returned interval | | `access_denied` | The agent claim was denied or revoked | | `expired_token` | The claim token or user code expired | | `unsupported_grant_type` | Grant type is not advertised by discovery | | `invalid_target` | Resource is not a published protected resource | ### Registration errors | Error | When | | - | - | | `invalid_client_metadata` | The JSON body, client name, token authentication method, grant types, or response types are malformed or unsupported | | `invalid_redirect_uri` | `redirect_uris` is missing, malformed, duplicated, too long, unsupported, or exceeds the 10 URI limit | | `temporarily_unavailable` | Registration is rate limited. Honor `Retry-After` before retrying | Read `error_description` for the specific validation failure. Missing or blank `client_name` values default to `MCP Client`. ## Where to go next > [card] [MCP server](/mcp/overview) > > Connect AI agents to Xquik via MCP. > [card] [MCP tools reference](/mcp/tools) > > Read every MCP tool with input and output schemas. > [card] [API key auth](/api-reference/authentication) > > Use API key authentication for the REST API and MCP. > [card] [Quickstart](/x-api-quickstart) > > Get your API key and make your first request. # X/Twitter SDKs & CLI for tweet search & exports Source: https://docs.xquik.com/sdks Install Xquik SDKs and CLI tools for tweet search exports, media uploads, and DMs. They also cover webhooks, MCP handoff, and X (Twitter) API automation. > For the complete documentation index, see [llms.txt](/llms.txt). [![Play Framer's video on YouTube. Framer builds a tweet ticker with Xquik.](https://img.youtube.com/vi/4UOSpoOoC3Y/maxresdefault.jpg)](https://youtu.be/4UOSpoOoC3Y?t=367) Watch Framer build a tweet ticker with Xquik, from 6:07. Framer posted it on June 16, 2026. Official Xquik SDKs wrap the REST API with generated request types and response models. They add retries, pagination helpers, and consistent authentication. Use this page to choose the right SDK, CLI, or MCP handoff. It covers tweet search exports, follower export jobs, media tweets, and DM attachments. It also covers monitor webhooks and agent workflows. > [!NOTE] > > For SDK extraction jobs, treat `202 Accepted` as a queued run receipt. Poll `GET /extractions/{id}` before exporting rows. Xquik reserves credits after the job starts. The run can lower `resultsLimit` to the affordable count or fail with `insufficient_credits`. > [card] [TypeScript / Node.js](/sdks/typescript) > > Use typed REST calls in Node.js, Bun, and Next.js route handlers. Cover tweet search exports, media tweets, and DMs. > [card] [Python](/sdks/python) > > Build sync or async jobs for tweet search and monitors. Export JSON Lines, CSV, or XLSX, and automate webhooks. > [card] [Go](/sdks/go) > > Add tweet search exports, write actions, and monitor workers to Go services. Every call takes a context. > [card] [Java](/sdks/java) > > Add the Java SDK with Maven or Gradle. It fits Spring, worker, and JVM backend applications. > [card] [Kotlin](/sdks/kotlin) > > Use idiomatic Kotlin types, nullable values, sequences, and suspend-friendly client methods. > [card] [C# / .NET](/sdks/csharp-x-api-sdk) > > Install from NuGet. Use REST for support attachment downloads. > [card] [Ruby](/sdks/ruby) > > Use the Ruby gem with Yard, RBS, RBI, retries, and connection pooling. > [card] [PHP](/sdks/php) > > Add the Composer package to PHP 8.1+ applications with named parameters and typed exceptions. > [card] [CLI](/sdks/cli) > > Run terminal workflows for tweet search exports and scripted API calls. Output JSON, or hand off CSV or XLSX. > [card] [Terraform provider](/sdks/terraform) > > Install from the Terraform Registry and manage Xquik resources as infrastructure. ## Choose an SDK * **TypeScript / Node.js.** Install from npm. Open the [TypeScript SDK guide](/sdks/typescript) or the [source on GitHub](https://github.com/Xquik-dev/x-twitter-scraper-typescript). * **Python.** Install from PyPI. Open the [Python SDK guide](/sdks/python) or the [source on GitHub](https://github.com/Xquik-dev/x-twitter-scraper-python). * **Go.** Install with Go modules. Open the [Go SDK guide](/sdks/go) or the [source on GitHub](https://github.com/Xquik-dev/x-twitter-scraper-go). * **Java.** Install from Maven Central. Open the [Java SDK guide](/sdks/java) or the [source on GitHub](https://github.com/Xquik-dev/x-twitter-scraper-java). * **Kotlin.** Install from Maven Central. Open the [Kotlin SDK guide](/sdks/kotlin) or the [source on GitHub](https://github.com/Xquik-dev/x-twitter-scraper-kotlin). * **C# / .NET.** Install from NuGet. Open the [C# SDK guide](/sdks/csharp-x-api-sdk) or the [source on GitHub](https://github.com/Xquik-dev/x-twitter-scraper-csharp). * **Ruby.** Install from RubyGems. Open the [Ruby SDK guide](/sdks/ruby) or the [source on GitHub](https://github.com/Xquik-dev/x-twitter-scraper-ruby). * **PHP.** Install from Packagist with Composer. Open the [PHP SDK guide](/sdks/php) or the [source on GitHub](https://github.com/Xquik-dev/x-twitter-scraper-php). * **CLI.** Install from npm or with Go. Open the [CLI guide](/sdks/cli) or the [source on GitHub](https://github.com/Xquik-dev/x-twitter-scraper-cli). * **Terraform provider.** Install from the Terraform Registry. Open the [Terraform guide](/sdks/terraform) or the [source on GitHub](https://github.com/Xquik-dev/terraform-provider-x-twitter-scraper). ## Choose by job * **Tweet search exports.** Start with [TypeScript](/sdks/typescript), [Python](/sdks/python), [Go SDK](/sdks/go), or [CLI](/sdks/cli) plus [Search Tweets](/api-reference/x/search-tweets). Hand off `PaginatedTweets`, `tweets`, `has_next_page`, `next_cursor`, and `xquik-tweet-search.jsonl` for JSON Lines, CSV, or XLSX. The cost is 1 credit per tweet returned. * **Follower export files.** Start with [Follower Export CRM Workflow](/guides/follower-export-crm), [TypeScript](/sdks/typescript), [Python](/sdks/python), [Go SDK](/sdks/go), or [CLI](/sdks/cli). Run `follower_explorer` with `targetUsername` and optional `resultsLimit`. Then export CSV, JSON, or XLSX from [Export Extraction](/api-reference/extractions/export). Store the `202 Accepted` receipt `id` and `toolType`. Then poll `GET /extractions/{id}` for `job.status`, `results`, `hasMore`, and `nextCursor`. The cost is 1 credit per follower extracted or returned. * **Post media tweets or replies.** Start with [TypeScript](/sdks/typescript), [Go SDK](/sdks/go), or [CLI](/sdks/cli) plus [Create Tweet](/api-reference/x-write/create-tweet). Pass public media URLs in `media`. Send up to 4 image URLs. Or send exactly 1 MP4 video URL up to 100 MB. Store `tweetId`, `reply_to_tweet_id`, `chargedCredits`, or `writeActionId`. A text-only write costs 30 credits. Attached media adds 2 credits per started MB across all files. * **Upload DM attachments.** Call [Upload Media](/api-reference/x-write/upload-media), then [Send Direct Message](/api-reference/x-write/send-dm). Use the returned `mediaId` as the one-item `media_ids` value. Store `mediaUrl` and the returned `messageId`. The cost is 10 credits per media upload plus 10 credits per DM send. * **Monitor tweets to webhooks.** Start with [Create Monitor](/api-reference/monitors/create), [Webhooks](/webhooks/overview), or [Terraform](/sdks/terraform). Store monitor IDs, webhook IDs, event types, and signed delivery metadata. Active monitors cost 30 credits per monitor-hour. * **Agent handoff.** Use the [MCP Server](/mcp/overview) for tool calls, or SDKs for direct code. Return JSON objects with the endpoint path, request parameters, and result fields. Add the pagination cursor and endpoint cost. ## Authentication All SDKs accept the same API credentials as the REST API. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` SDKs accept OAuth 2.1 bearer tokens where the generated SDK exposes `X_TWITTER_SCRAPER_BEARER_TOKEN`. ## Common workflows * Search tweets or scrape tweets to JSON Lines, CSV, or XLSX through [Search Tweets](/api-reference/x/search-tweets). Keep `xquik-tweet-search.jsonl` or the language-specific export file as the downstream handoff. * Inspect threads through [Get Tweet](/api-reference/x/get-tweet) and [Tweet Thread](/api-reference/x/tweet-thread). * Look up profiles and relationships through [Get User](/api-reference/x/twitter-profile-lookup), [Followers](/api-reference/x/followers), and [Check Follower](/api-reference/x/check-follower). * Post media tweets or replies through [Create Tweet](/api-reference/x-write/create-tweet). Send up to 4 public image URLs. Or send exactly 1 public MP4 video URL up to 100 MB. Text-only tweet or reply writes cost 30 credits. Attached media adds 2 credits per started MB across all files. [Send Direct Message](/api-reference/x-write/send-dm) takes one uploaded media ID in `media_ids`. Get it through [Upload Media](/api-reference/x-write/upload-media). * Create account monitors with [Create Monitor](/api-reference/monitors/create), then receive events through [Webhooks](/webhooks/overview). * Run exports and giveaway workflows with [Extractions](/api-reference/extractions/create) and [Draws](/api-reference/draws/create). * Connect agents through the [MCP Server](/mcp/overview) when you need tool use. Use direct SDK calls otherwise. ## Error handling & pagination Generated SDKs map HTTP errors into language-native exception or error types. The [error handling guide](/guides/error-handling) explains each status code. Each language page shows its idiomatic handling. Paginated endpoints return a page object with a next-page marker. It reads `has_next_page`, `hasNextPage`, or `HasNextPage`, by language casing. Use the SDK's generated pagination helpers when available. Otherwise pass the cursor fields documented on each endpoint. # Twitter CLI & X CLI for tweet search & exports Source: https://docs.xquik.com/sdks/cli Use the Xquik CLI to search tweets, export JSON Lines, CSV, or XLSX, post media tweets, send DMs, monitor tweets, and script X API workflows from a terminal. > For the complete documentation index, see [llms.txt](/llms.txt). Use the CLI when you need X API data without an application wrapper. It fits a shell script, cron job, CI workflow, or operations runbook. It can search tweets and export follower data. It can scrape tweets to JSON Lines, CSV, or XLSX. It can upload media, post media tweets, and post tweet replies. It can also send direct messages and monitor tweets. Hand results to `jq`, Python, a warehouse loader, or a queue worker. ## Install ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npm install --global x-twitter-scraper-cli ``` Or run it once without installing. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npx x-twitter-scraper-cli --help ``` npm installs the build for your platform. With Go, install from source. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} go install github.com/Xquik-dev/x-twitter-scraper-cli/cmd/x-twitter-scraper@latest ``` Confirm your Go bin directory is on `PATH`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export PATH="$PATH:$(go env GOPATH)/bin" ``` ## Authenticate ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` You can also pass `--api-key` per command. For OAuth 2.1 access tokens, use `X_TWITTER_SCRAPER_BEARER_TOKEN`. ## Basic example ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-twitter-scraper x:tweets search \ --q from:elonmusk \ --limit 10 \ --format json ``` Use `--help` at any level. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-twitter-scraper x:tweets search --help ``` ## Tweet search workflow to JSON Lines, CSV, or XLSX Use this workflow to get tweets from an X (Twitter) search query. It suits an analyst, data engineer, or growth operator. Deliver the tweets as a JSON Lines handoff, analyst CSV file, or XLSX workbook. They can also go to a warehouse load, CRM enrichment job, or queue. The CLI command below calls `GET /x/tweets/search`. It maps the same REST API query parameters to CLI flags. The flags are `--q`, `--limit`, `--cursor`, `--since-time`, `--until-time`, and `--query-type`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} query="from:username webhook OR SDK" cursor="" page_index=0 headers='["source","query","tweet_id","text","author_id","author_username","author_name","created_at","like_count","reply_count","retweet_count","quote_count","view_count","bookmark_count","is_note_tweet","page_index","page_cursor","next_cursor","has_next_page"]' : > xquik-tweet-search.jsonl jq -nr "$headers | @csv" > xquik-tweet-search.csv while :; do page_cursor="$cursor" if [ -n "$cursor" ]; then x-twitter-scraper x:tweets search \ --q "$query" \ --query-type Latest \ --cursor "$cursor" \ --limit 100 \ --format json \ --format-error json > search-page.json else x-twitter-scraper x:tweets search \ --q "$query" \ --query-type Latest \ --limit 100 \ --format json \ --format-error json > search-page.json fi has_next_page="$(jq -r '.has_next_page // false' search-page.json)" next_cursor="$(jq -r 'if .has_next_page then (.next_cursor // "") else "" end' search-page.json)" jq -c \ --arg source "xquik.cli.search" \ --arg query "$query" \ --arg page_cursor "$page_cursor" \ --arg next_cursor "$next_cursor" \ --argjson page_index "$page_index" \ --argjson has_next_page "$has_next_page" \ '.tweets[] | { source: $source, query: $query, tweet_id: .id, text: .text, author_id: (.author.id // ""), author_username: (.author.username // ""), author_name: (.author.name // ""), created_at: (.createdAt // ""), like_count: (.likeCount // 0), reply_count: (.replyCount // 0), retweet_count: (.retweetCount // 0), quote_count: (.quoteCount // 0), view_count: (.viewCount // 0), bookmark_count: (.bookmarkCount // 0), is_note_tweet: (.isNoteTweet // false), page_index: $page_index, page_cursor: $page_cursor, next_cursor: $next_cursor, has_next_page: $has_next_page }' search-page.json >> xquik-tweet-search.jsonl jq -r \ --arg source "xquik.cli.search" \ --arg query "$query" \ --arg page_cursor "$page_cursor" \ --arg next_cursor "$next_cursor" \ --argjson page_index "$page_index" \ --argjson has_next_page "$has_next_page" \ '.tweets[] | [ $source, $query, .id, .text, (.author.id // ""), (.author.username // ""), (.author.name // ""), (.createdAt // ""), (.likeCount // 0), (.replyCount // 0), (.retweetCount // 0), (.quoteCount // 0), (.viewCount // 0), (.bookmarkCount // 0), (.isNoteTweet // false), $page_index, $page_cursor, $next_cursor, $has_next_page ] | @csv' search-page.json >> xquik-tweet-search.csv [ "$has_next_page" = "true" ] || break [ -n "$next_cursor" ] || break cursor="$next_cursor" page_index=$((page_index + 1)) done ``` The response includes `.tweets[]`, `.has_next_page`, and `.next_cursor`. Each tweet can include `id`, `text`, `createdAt`, engagement counts, `bookmarkCount`, and `isNoteTweet`. It can also include `author`, `media`, `quoted_tweet`, and `retweeted_tweet`. Each field appears only when the result has it. Project `.tweets[]` into `xquik-tweet-search.jsonl` and `xquik-tweet-search.csv` rows. Give each row `tweet_id`, `author_username`, engagement counts, `page_index`, `page_cursor`, `next_cursor`, and `has_next_page`. Scripts can then resume. They can also load the same records into XLSX, CRM, warehouse, or agent workflows. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} python3 - <<'PY' import csv import json rows = [json.loads(line) for line in open("xquik-tweet-search.jsonl", encoding="utf-8")] fieldnames = [ "source", "query", "tweet_id", "text", "author_id", "author_username", "author_name", "created_at", "like_count", "reply_count", "retweet_count", "quote_count", "view_count", "bookmark_count", "is_note_tweet", "page_index", "page_cursor", "next_cursor", "has_next_page", ] with open("xquik-tweet-search-from-jsonl.csv", "w", newline="", encoding="utf-8") as handle: writer = csv.DictWriter(handle, fieldnames=fieldnames) writer.writeheader() writer.writerows(rows) PY ``` Save the cursor with the job checkpoint before requesting the next page. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} tail -n 1 xquik-tweet-search.jsonl | jq '{query, page_index, next_cursor, has_next_page}' ``` Use `--limit` as a 1 to 200 upper bound for a bounded pull. When `.has_next_page` is true, keep the same `--q`, filters, `--query-type`, and `--limit`. Only `--cursor` changes. Tweet search costs 1 credit per tweet returned. If credits cannot cover a bounded `--limit` request, the API can return fewer tweets. If credits cover no results, it returns `402 insufficient_credits`. If a bounded pull returns fewer tweets than `--limit`, pass `.next_cursor` back as `--cursor`. Send the same query, filters, `--query-type`, and `--limit` with it. Use `--format-error json` so batch jobs can branch on `status` and `code`. Retry `429` or temporary `5xx` responses with backoff. For XLSX handoff, keep `xquik-tweet-search.jsonl` as the master file. When account managers need a workbook, convert the same projected rows in your pipeline. ## Follower export workflow to CSV, JSON, or XLSX Use this workflow when a team needs an owned follower list. It fits sales, support, research, or marketing teams. Deliver the list as a CRM import, warehouse load, or analyst CSV file. You can also deliver it as an XLSX workbook or resumable JSON handoff. `follower_explorer` requires `targetUsername`. The CLI flag is `--target-username`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-twitter-scraper extractions estimate-cost \ --tool-type follower_explorer \ --target-username username \ --format json > follower-estimate.json ``` The estimate calls `POST /extractions/estimate` and returns `allowed`, `estimatedResults`, `creditsRequired`, `creditsAvailable`, and `source`. For follower exports, `source` is usually `followers`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} jq -e '.allowed == true' follower-estimate.json >/dev/null x-twitter-scraper extractions run \ --tool-type follower_explorer \ --target-username username \ --format json > follower-run.json jq -e '.status == "running" and .toolType == "follower_explorer"' follower-run.json >/dev/null job_id="$(jq -r '.id' follower-run.json)" ``` The run command calls `POST /extractions` and returns the queued `202 Accepted` receipt. The receipt holds `id`, `toolType`, and `status: "running"`. Store `follower-run.json`, `job_id`, the source username, and the estimate before polling. Credit reservation happens after the job starts. If available credits changed since the estimate, the run has 2 outcomes. It can fetch only the affordable count before export. Or it can mark the job `failed` with `insufficient_credits`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} while :; do x-twitter-scraper extractions retrieve \ --id "$job_id" \ --limit 1000 \ --format json > followers-page.json status="$(jq -r '.job.status' followers-page.json)" [ "$status" = "completed" ] && break [ "$status" = "failed" ] && exit 1 sleep 10 done ``` The retrieve command returns `.job`, `.results`, `.hasMore`, and `.nextCursor`. When `.hasMore` is true, pass `.nextCursor` back as `--cursor`. That fetches the next saved page. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} : > xquik-followers.jsonl cursor="" while :; do if [ -n "$cursor" ]; then x-twitter-scraper extractions retrieve \ --id "$job_id" \ --cursor "$cursor" \ --limit 1000 \ --format json > followers-page.json else x-twitter-scraper extractions retrieve \ --id "$job_id" \ --limit 1000 \ --format json > followers-page.json fi jq -c '.results[]' followers-page.json >> xquik-followers.jsonl has_more="$(jq -r '.hasMore // false' followers-page.json)" next_cursor="$( jq -r 'if .hasMore then (.nextCursor // "") else "" end' followers-page.json )" [ "$has_more" = "true" ] || break [ -n "$next_cursor" ] || break cursor="$next_cursor" done ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-twitter-scraper extractions export-results \ --id "$job_id" \ --format csv \ --output xquik-followers.csv ``` Use `--format json --output xquik-followers.json` for app ingestion or `--format xlsx --output xquik-followers.xlsx` for XLSX handoff. Map `User ID` or result `xUserId` as the CRM unique key. Keep `xquik-followers.jsonl` for queue replay or warehouse loads, and `xquik-followers.json` for app ingestion. Keep `xquik-followers.csv` for CRM import and `xquik-followers.xlsx` for analyst handoff. The cost is 1 credit per follower extracted or returned. Exports cost no credits after the extraction job exists. ## Tweet replies workflow to CSV, JSON, or XLSX Use this workflow when you need every reply under one Tweet. Export CSV, JSON, or XLSX. Write a local JSON Lines file from paginated JSON rows. `reply_extractor` requires `targetTweetId`. The CLI flag is `--target-tweet-id`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-twitter-scraper extractions estimate-cost \ --tool-type reply_extractor \ --target-tweet-id 1893704267862470862 \ --format json > reply-estimate.json ``` The estimate calls `POST /extractions/estimate` and returns `allowed`, `estimatedResults`, `creditsRequired`, `creditsAvailable`, and `source`. For replies, `source` is usually `replyCount`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} jq -e '.allowed == true' reply-estimate.json >/dev/null job_id="$(x-twitter-scraper extractions run \ --tool-type reply_extractor \ --target-tweet-id 1893704267862470862 \ --transform id \ --raw-output)" ``` The run command calls `POST /extractions`. Store `job_id` before polling. With it, a shell restart, queue retry, or CI rerun can resume that extraction. Reuse the follower export polling loop above with reply filenames. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-twitter-scraper extractions retrieve \ --id "$job_id" \ --limit 100 \ --format json > replies-page.json next_cursor="$(jq -r '.nextCursor // empty' replies-page.json)" x-twitter-scraper extractions retrieve \ --id "$job_id" \ --cursor "$next_cursor" \ --limit 100 \ --format json > replies-next-page.json ``` The retrieve command calls `GET /extractions/{id}` and returns `.job`, `.results`, `.hasMore`, and `.nextCursor`. Append `.results[]` to your queue, CRM import, or warehouse load. While `.hasMore` is true, pass `.nextCursor` back as `--cursor "$next_cursor"`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-twitter-scraper extractions export-results \ --id "$job_id" \ --format csv \ --output xquik-tweet-replies.csv ``` The export command calls `GET /extractions/{id}/export` and writes bytes to `--output`. Use `--format csv`, `--format json` with `--output xquik-tweet-replies.json`, or `--format xlsx` with `--output xquik-tweet-replies.xlsx`. The cost is 1 credit per reply extracted or returned. Exports cost no credits after the extraction job exists. ## Workflow to post media tweets, replies, and DM attachments Use this workflow when an operator, support queue, or agent sends media. It can publish a media-backed tweet or reply with media. It can also send one media attachment in a DM. The workflow runs from a connected X account. Tweet and reply media posts use public media URLs directly on `x:tweets create`. Pass repeated `--media` flags for up to 4 image URLs. Or pass exactly 1 MP4 video URL up to 100 MB. Do not mix video with other media. Do not upload first when you already have public media URLs. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-twitter-scraper x:tweets create \ --account @username \ --text "New demo video is live." \ --media https://example.com/product-demo.mp4 \ --format json \ --format-error json > posted-tweet.json ``` To reply with media, add the parent tweet ID. The `--reply-to-tweet-id` flag maps to `reply_to_tweet_id`. `--media` maps to the public URL array on `POST /x/tweets`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-twitter-scraper x:tweets create \ --account @username \ --text "Here is the requested screenshot." \ --reply-to-tweet-id 1893704267862470862 \ --media https://example.com/export-preview.png \ --format json \ --format-error json > posted-reply.json ``` Send a unique `Idempotency-Key`. Store the durable action's `id`, `request.hash`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. Keep one JSON Lines handoff shape for every lifecycle state. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} write_handoff() { input_file="$1" jq -c ' { status, terminal, safe_to_retry: .safeToRetry, write_action_id: .id, request_hash: .request.hash, tweet_id: (.result.id // .tweetId // null), charged: .billing.charged, charged_credits: .billing.chargedCredits, poll: (if .terminal then null else .statusUrl end) } ' "$input_file" } write_handoff posted-tweet.json > tweet-handoff.jsonl write_handoff posted-reply.json > reply-handoff.jsonl ``` Each create-tweet call costs 30 credits. Use `x:media upload` when you need an uploaded media ID for a DM attachment. The CLI upload command accepts a local file through `--file`. `--transform mediaId` extracts the upload response ID for scripts. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} media_id="$(x-twitter-scraper x:media upload \ --account @username \ --file ./handoff.png \ --transform mediaId \ --raw-output)" x-twitter-scraper x:dm send \ --account @username \ --user-id 44196397 \ --text "Here is the asset." \ --media-id "$media_id" \ --format json > sent-dm.json jq -c --arg media_id "$media_id" '{ status: "sent", message_id: .messageId, media_id: $media_id }' sent-dm.json > dm-handoff.jsonl ``` The `--media-id` flag maps to the REST `media_ids` body field. DMs accept exactly 1 uploaded media ID. Store `messageId` from the DM response. Put it on the support ticket, CRM record, queue job, or agent memory. Keep DM body text in private systems. Shared logs, public artifacts, queue status, and agent handoffs should omit full DM bodies. They should store `message_id`, optional `media_id`, and send status. They should also store recipient and account identifiers from your job context. Uploading media costs 10 credits. Sending the DM costs 10 credits. Do not pass `--reply-to-message-id` to `x:dm send`. The REST endpoint rejects `reply_to_message_id`. Start a new DM with `--user-id`, `--account`, `--text`, and optional one-item `--media-id` instead. Do not pass uploaded `mediaId` values to `x:tweets create`. That command uses `--media` with public media URLs. ## Useful commands > [card] Search tweets or scrape tweets > > Run `x-twitter-scraper x:tweets search` to return tweet objects, author objects, metrics, media, `has_next_page`, and `next_cursor`. > [card] Fetch one tweet > > Run `x-twitter-scraper x:tweets retrieve` to return the full tweet text, author, and metrics. It also returns media, the quoted tweet, and the retweeted tweet. > [card] Get tweet replies > > Run `x-twitter-scraper x:tweets get-replies` to return reply tweets plus cursor fields. > [card] Export followers > > Run `x-twitter-scraper x:users retrieve-followers` to return user profiles, follower counts, and cursor fields. > [card] Post a tweet or reply > > Run `x-twitter-scraper x:tweets create` to return `tweetId`, `success`, `charged`, and `chargedCredits`. When confirmation is pending, it returns `writeActionId` instead. > [card] Upload media for a DM attachment > > Run `x-twitter-scraper x:media upload` to return `mediaId` for one-item DM `media_ids`. It also returns `mediaUrl` for tweet `media` URL handoff. > [card] Send a direct message > > Run `x-twitter-scraper x:dm send` to return `messageId` and `success`. Use `--format json` for scripts and `--format yaml` for readable operations output. When you only need one field from the response, use `--transform` with GJSON syntax. ## Error handling The CLI writes API errors to stderr and exits non-zero for failed requests. Use `--format-error json` when scripts need machine-readable errors. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x-twitter-scraper x:users retrieve-search \ --q not-a-real-user \ --format json \ --format-error json ``` Retryable API responses follow the same semantics as the REST API. See [error handling](/guides/error-handling) and [rate limits](/guides/rate-limits). ## Pagination Commands that call paginated endpoints include pagination fields in their JSON output. Keep the response body when your script needs the next page. The script requests that page with endpoint cursor parameters. ## Webhooks & references * [Search Tweets](/api-reference/x/search-tweets) * [Get User](/api-reference/x/twitter-profile-lookup) * [Create Tweet](/api-reference/x-write/create-tweet) * [Upload Media](/api-reference/x-write/upload-media) * [Send Direct Message](/api-reference/x-write/send-dm) * [Webhook Overview](/webhooks/overview) * [Verify HMAC Signatures](/webhooks/verification) * [REST API Overview](/api-reference/overview) * [Source Repository](https://github.com/Xquik-dev/x-twitter-scraper-cli) # X (Twitter) API C# follower export to CSV & XLSX Source: https://docs.xquik.com/sdks/csharp-follower-export Export X (Twitter) followers with the Xquik C# SDK. Estimate the job, run the extraction, and save CSV, JSON, or XLSX files for your team and your CRM tools. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [C# SDK setup](/sdks/csharp-x-api-sdk), which covers install and authentication. ## Follower export workflow to CSV, JSON, or XLSX This workflow is for a .NET worker, console job, or ASP.NET background service. Use it when that code needs an owned follower list. It feeds CRM imports, warehouse loads, analyst CSVs, XLSX workbooks, or resumable JSON handoffs. `client.Extractions.EstimateCost` and `client.Extractions.Run` map to the extraction workflow. For follower exports, use `ExtractionEstimateCostParamsToolType.FollowerExplorer` and `ExtractionRunParamsToolType.FollowerExplorer`. `follower_explorer` requires `TargetUsername`. `client.Extractions.Retrieve` returns `Results`, `HasMore`, and `NextCursor` for pagination. `client.Extractions.ExportResults` returns an `HttpResponse`. Read CSV and JSON as strings, and copy XLSX from the response stream. > [!NOTE] > > `client.Extractions.Run` returns the queued `202 Accepted` receipt from `POST /extractions`. C# exposes REST `id`, `toolType`, and `status: "running"` as `job.ID`, `job.ToolType`, and `job.Status`. Store `job.ID` immediately, then poll `client.Extractions.Retrieve` before reading pages or calling `client.Extractions.ExportResults`. Credit reservation happens after the job starts. Available credits can change after `EstimateCost`. If they did, the run can fetch only the affordable count before export. In that case it can instead mark the job `failed` with `insufficient_credits`. ```csharp theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} using System; using System.IO; using System.Text.Json; using System.Threading.Tasks; using XTwitterScraper; using XTwitterScraper.Core; using XTwitterScraper.Models.Extractions; XTwitterScraperClient client = new(); string targetUsername = "username"; ExtractionEstimateCostResponse estimate = await client.Extractions.EstimateCost( new ExtractionEstimateCostParams { ToolType = ExtractionEstimateCostParamsToolType.FollowerExplorer, TargetUsername = targetUsername, } ); if (!estimate.Allowed) { throw new InvalidOperationException("Insufficient credits for follower export."); } ExtractionRunResponse job = await client.Extractions.Run( new ExtractionRunParams { ToolType = ExtractionRunParamsToolType.FollowerExplorer, TargetUsername = targetUsername, } ); while (true) { ExtractionRetrieveResponse statusPage = await client.Extractions.Retrieve( job.ID, new ExtractionRetrieveParams { Limit = 1 } ); string? status = statusPage.Job.TryGetValue("status", out JsonElement statusValue) ? statusValue.GetString() : null; if (status == "completed") { break; } if (status == "failed") { throw new InvalidOperationException("Follower export failed."); } await Task.Delay(TimeSpan.FromSeconds(10)); } string? cursor = null; using StreamWriter writer = File.CreateText("xquik-followers.jsonl"); do { ExtractionRetrieveResponse page = await client.Extractions.Retrieve( job.ID, new ExtractionRetrieveParams { Cursor = cursor, Limit = 1000 } ); foreach (var follower in page.Results) { await writer.WriteLineAsync(JsonSerializer.Serialize(follower)); } cursor = page.HasMore ? page.NextCursor : null; } while (!string.IsNullOrEmpty(cursor)); using HttpResponse csvResponse = await client.Extractions.ExportResults( job.ID, new ExtractionExportResultsParams { Format = Format.Csv } ); await File.WriteAllTextAsync("xquik-followers.csv", await csvResponse.ReadAsString()); using HttpResponse jsonResponse = await client.Extractions.ExportResults( job.ID, new ExtractionExportResultsParams { Format = Format.Json } ); await File.WriteAllTextAsync("xquik-followers.json", await jsonResponse.ReadAsString()); using HttpResponse xlsxResponse = await client.Extractions.ExportResults( job.ID, new ExtractionExportResultsParams { Format = Format.Xlsx } ); using Stream xlsxStream = await xlsxResponse.ReadAsStream(); using FileStream xlsxFile = File.Create("xquik-followers.xlsx"); await xlsxStream.CopyToAsync(xlsxFile); ``` The cost is 1 credit per follower extracted or returned. Store `job.ID`, `targetUsername`, `estimate.EstimatedResults`, and `estimate.Source` before polling. With them, a queue retry can resume the same follower export. So can a Windows service restart or worker restart. Keep `page.NextCursor` as the checkpoint when you stream followers to JSON Lines. Map exported `User ID` or row `xUserId` as the CRM unique key. Use `xquik-followers.jsonl` for queue replay or warehouse loads and `xquik-followers.json` for app ingestion. Use `xquik-followers.csv` for CRM import and `xquik-followers.xlsx` for analyst handoff. Exports are free after the extraction job exists. ## Next steps * [C# SDK setup](/sdks/csharp-x-api-sdk) * [Tweet search](/sdks/csharp-tweet-search) * [Media tweets](/sdks/csharp-media-tweets) # X (Twitter) API C# media tweets & DM attachments Source: https://docs.xquik.com/sdks/csharp-media-tweets Upload media with the Xquik C# SDK, post tweets with photos or video, and send DM attachments from a connected X (Twitter) account in your own apps and bots. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [C# SDK setup](/sdks/csharp-x-api-sdk), which covers install and authentication. ## Workflow to post media tweets and DM attachments Use this workflow to post a media tweet or reply. It can also DM an uploaded local file. `client.X.Tweets.Create` maps to `POST /x/tweets`. Pass public media URLs through `Media`. Send up to 4 image URLs or exactly 1 MP4 video URL. The video can be up to 100 MB. Do not mix video with other media. For replies, set `ReplyToTweetID` to the parent tweet ID. `client.X.Media.Upload` maps to `POST /x/media`. Use `media.MediaID` only for the one-item `MediaIds` handoff on `client.X.Dm.Send`. ```csharp theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Text.Json; using System.Threading.Tasks; using XTwitterScraper; using XTwitterScraper.Core; using XTwitterScraper.Models.X.Dm; using XTwitterScraper.Models.X.Media; using XTwitterScraper.Models.X.Tweets; XTwitterScraperClient client = new(); string parentTweetID = "1893704267862470862"; using HttpResponse tweetResponse = await client.X.Tweets.WithRawResponse.Create( new TweetCreateParams { Account = "@username", Text = "Shipping the weekly X API video.", Media = new[] { "https://static.example.com/reports/x-api-export.mp4" }, } ); Dictionary tweetHandoff = await CreateTweetHandoff( tweetResponse, new Dictionary { ["account"] = "@username", ["media_url"] = "https://static.example.com/reports/x-api-export.mp4", } ); using HttpResponse replyResponse = await client.X.Tweets.WithRawResponse.Create( new TweetCreateParams { Account = "@username", Text = "Here is the chart behind the update.", Media = new[] { "https://static.example.com/reports/reply-chart.png" }, ReplyToTweetID = parentTweetID, } ); Dictionary replyHandoff = await CreateTweetHandoff( replyResponse, new Dictionary { ["account"] = "@username", ["reply_to_tweet_id"] = parentTweetID, ["media_url"] = "https://static.example.com/reports/reply-chart.png", } ); await using FileStream localFile = File.OpenRead("handoff.png"); MediaUploadResponse media = await client.X.Media.Upload( new MediaUploadParams { Account = "@username", File = localFile, } ); DmSendResponse dm = await client.X.Dm.Send( "44196397", new DmSendParams { Account = "@username", Text = "Here is the requested asset.", MediaIds = new[] { media.MediaID }, } ); Dictionary dmHandoff = new() { ["message_id"] = dm.MessageID, ["media_id"] = media.MediaID, ["user_id"] = "44196397", ["account"] = "@username", }; await Console.Out.WriteLineAsync(JsonSerializer.Serialize(tweetHandoff)); await Console.Out.WriteLineAsync(JsonSerializer.Serialize(replyHandoff)); await Console.Out.WriteLineAsync(JsonSerializer.Serialize(dmHandoff)); static async Task> CreateTweetHandoff( HttpResponse response, Dictionary row ) { string body = await response.ReadAsString(); using JsonDocument document = JsonDocument.Parse(body); JsonElement payload = document.RootElement; JsonElement billing = payload.GetProperty("billing"); JsonElement result = payload.GetProperty("result"); bool terminal = payload.GetProperty("terminal").GetBoolean(); row["status"] = payload.GetProperty("status").GetString(); row["terminal"] = terminal; row["safe_to_retry"] = payload.GetProperty("safeToRetry").GetBoolean(); row["write_action_id"] = payload.GetProperty("id").GetString(); row["request_hash"] = payload.GetProperty("request").GetProperty("hash").GetString(); row["tweet_id"] = result.ValueKind == JsonValueKind.Object ? result.GetProperty("id").GetString() : null; row["charged"] = billing.GetProperty("charged").GetBoolean(); row["charged_credits"] = billing.GetProperty("chargedCredits").GetString(); row["poll"] = terminal ? null : payload.GetProperty("statusUrl").GetString(); if (row["tweet_id"] is null && payload.TryGetProperty("tweetId", out JsonElement tweetId)) { row["tweet_id"] = tweetId.GetString(); } return row; } ``` Use `client.X.Tweets.WithRawResponse.Create` to capture the durable write action. Send a unique `Idempotency-Key`. Store `id`, `request.hash`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. Keep DM body text in private systems. Shared logs and handoffs should store `message_id`, optional `media_id`, `account`, `user_id`, and lifecycle status. Leave `ReplyToMessageID` unset because the REST endpoint rejects DM reply threading. `client.X.Dm.DeleteMessage` [deletes a DM](/api-reference/x-write/delete-dm). Use public media URLs with `client.X.Tweets.Create`. Do not pass uploaded `media.MediaID` values to tweet creation. ### REST routes | Task | REST route | Reference | | - | - | - | | Post a media tweet or reply | `POST /x/tweets` | [Create tweet](/api-reference/x-write/create-tweet) | | Upload a local file | `POST /x/media` | [Upload media](/api-reference/x-write/upload-media) | | Send a DM attachment | `POST /x/dm/{userId}` | [Send DM](/api-reference/x-write/send-dm) | | Check a write action | `GET /x/write-actions/{id}` | [Write action status](/api-reference/x-write/get-write-action-status) | | Delete a DM | `DELETE /x/dm/{userId}/messages/{messageId}` | [Delete DM](/api-reference/x-write/delete-dm) | ## Next steps * [C# SDK setup](/sdks/csharp-x-api-sdk) * [Tweet search](/sdks/csharp-tweet-search) * [Follower export](/sdks/csharp-follower-export) # X (Twitter) API C# tweet search to CSV & JSON lines Source: https://docs.xquik.com/sdks/csharp-tweet-search Search tweets with the Xquik C# SDK, follow cursors, and save rows as JSON Lines, CSV, or XLSX for workers, queues, and analysts in your own apps and jobs. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [C# SDK setup](/sdks/csharp-x-api-sdk), which covers install and authentication. ## Tweet search workflow to JSON Lines, CSV, or XLSX This workflow is for a .NET worker, console job, or ASP.NET background service. Use it when that code needs tweet search results in a durable handoff format. The handoff can go to a queue, data lake, or analyst CSV export. It can also go to an XLSX workbook or CRM enrichment step. `client.X.Tweets.Search` calls `GET /x/tweets/search`. Build a `TweetSearchParams` object with the same query parameters the REST API accepts. They are `Q`, `Limit`, `Cursor`, `SinceTime`, `UntilTime`, and `QueryType`. ```csharp theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.Json; using XTwitterScraper; using XTwitterScraper.Models; using XTwitterScraper.Models.X.Tweets; XTwitterScraperClient client = new(); string query = "from:username webhook OR SDK"; string? cursor = null; int pageIndex = 0; string[] headers = new[] { "source", "query", "tweet_id", "text", "author_id", "author_username", "author_name", "created_at", "like_count", "reply_count", "retweet_count", "quote_count", "view_count", "bookmark_count", "is_note_tweet", "page_index", "page_cursor", "next_cursor", "has_next_page", }; using StreamWriter jsonlWriter = File.CreateText("xquik-tweet-search.jsonl"); using StreamWriter csvWriter = File.CreateText("xquik-tweet-search.csv"); await WriteCsvRow(csvWriter, headers); do { string? pageCursor = cursor; PaginatedTweets page = await client.X.Tweets.Search( new TweetSearchParams { Q = query, Cursor = cursor, QueryType = QueryType.Latest, } ); foreach (SearchTweet tweet in page.Tweets) { Dictionary row = new() { ["source"] = "xquik.csharp.search", ["query"] = query, ["tweet_id"] = tweet.ID, ["text"] = tweet.Text, ["author_id"] = tweet.Author?.ID, ["author_username"] = tweet.Author?.Username, ["author_name"] = tweet.Author?.Name, ["created_at"] = tweet.CreatedAt, ["like_count"] = tweet.LikeCount ?? 0, ["reply_count"] = tweet.ReplyCount ?? 0, ["retweet_count"] = tweet.RetweetCount ?? 0, ["quote_count"] = tweet.QuoteCount ?? 0, ["view_count"] = tweet.ViewCount ?? 0, ["bookmark_count"] = tweet.BookmarkCount ?? 0, ["is_note_tweet"] = tweet.IsNoteTweet ?? false, ["page_index"] = pageIndex, ["page_cursor"] = pageCursor, ["next_cursor"] = page.HasNextPage ? page.NextCursor : null, ["has_next_page"] = page.HasNextPage, }; await jsonlWriter.WriteLineAsync(JsonSerializer.Serialize(row)); await WriteCsvRow(csvWriter, headers.Select(header => row[header])); } cursor = page.HasNextPage ? page.NextCursor : null; pageIndex++; } while (!string.IsNullOrEmpty(cursor)); static async Task WriteCsvRow(StreamWriter writer, IEnumerable values) { static string Escape(object? value) { string cell = value?.ToString() ?? ""; return "\"" + cell.Replace("\"", "\"\"") + "\""; } await writer.WriteLineAsync(string.Join(",", values.Select(Escape))); } ``` ### Request mapping > [card] Q > > C# property `Q` maps to REST `q`. Use it for an X (Twitter) search query. Examples are `from:username`, a keyword, hashtag, or boolean operator query. > [card] Limit > > C# property `Limit` maps to REST `limit`. Use it as a 1 to 200 upper bound for a bounded pull. If `page.HasNextPage` is true, keep the same `Q`, filters, `QueryType`, and `Limit`. Do so when you continue with `page.NextCursor`. > [card] Cursor > > C# property `Cursor` maps to REST `cursor`. Pass the opaque cursor from `page.NextCursor` to request the next page. > [card] SinceTime > > C# property `SinceTime` maps to REST `sinceTime`. Use it as the ISO 8601 lower bound for tweet creation time. > [card] UntilTime > > C# property `UntilTime` maps to REST `untilTime`. Use it as the ISO 8601 upper bound for tweet creation time. > [card] QueryType > > C# property `QueryType` maps to REST `queryType`. Use `QueryType.Latest` for chronological search or `QueryType.Top` for engagement-ranked search. ### Returned data & handoff `client.X.Tweets.Search` returns `PaginatedTweets`. Use `page.Tweets` for the tweet array. Use `page.HasNextPage` to decide whether another page exists. Use `page.NextCursor` as the checkpoint for the next request. For bounded pulls that return fewer tweets than `Limit`, pass `page.NextCursor` back as `Cursor`. Send the same query, filters, `QueryType`, and `Limit` with that cursor. Each `SearchTweet` includes typed properties such as `ID`, `Text`, `Author`, and `CreatedAt`. Others are `LikeCount`, `ReplyCount`, `RetweetCount`, `QuoteCount`, `ViewCount`, and `BookmarkCount`. It also includes `IsNoteTweet` when available. Project `page.Tweets` into JSON Lines and CSV rows with `tweet_id`, `author_username`, and engagement counts. Rows also carry `page_index`, `page_cursor`, `next_cursor`, and `has_next_page`. Workers can then resume. They can also load the same records into XLSX, CRM, warehouse, or agent workflows. Tweet search costs 1 credit per tweet returned. Remaining credits may not cover a bounded `Limit` request. If so, the API can return fewer tweets. If 0 paid results are affordable, it returns `402 insufficient_credits`. The SDK retries connection errors, 408, 409, 429, and 5xx responses. It does so 2 times by default. For explicit `Limit` pulls, resume with the same query, filters, `QueryType`, and `Limit`. Only `Cursor` changes. ## Next steps * [C# SDK setup](/sdks/csharp-x-api-sdk) * [Follower export](/sdks/csharp-follower-export) * [Media tweets](/sdks/csharp-media-tweets) # Twitter API C# SDK for tweet search & exports Source: https://docs.xquik.com/sdks/csharp-x-api-sdk Use the Xquik C# SDK to search tweets, export tweet replies to JSON Lines, CSV, or XLSX, post media tweets, upload media, send DMs, and run .NET X API workers. > For the complete documentation index, see [llms.txt](/llms.txt). Use typed .NET Standard 2.0+ calls in services, workers, console tools, or ASP.NET. Search X (Twitter) tweets, export followers, monitor, post media, or send DMs. Or feed queues, CRMs, and reports. | C# worker task | SDK call | Durable checkpoint | | - | - | - | | Search tweets | `client.X.Tweets.Search` | Store `page.NextCursor` after every page. | | Estimate follower or reply exports | `client.Extractions.EstimateCost` | Store the estimate and `Allowed` decision. | | Start an extraction | `client.Extractions.Run` | Save `job.ID` immediately. | | Retrieve saved rows | `client.Extractions.Retrieve` | Keep `NextCursor` while `HasMore` is true. | | Export CSV, JSON, or XLSX | `client.Extractions.ExportResults` | Record the job ID, format, and file destination. | | Create a tweet | `client.X.Tweets.WithRawResponse.Create` | Store the write action ID and terminal state. | ## Install The NuGet package excludes `GET /support/attachments/{id}`. Use REST for that binary download. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} dotnet add package XTwitterScraper ``` ## Authenticate ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` `new XTwitterScraperClient()` reads `X_TWITTER_SCRAPER_API_KEY`, `X_TWITTER_SCRAPER_BEARER_TOKEN`, and `X_TWITTER_SCRAPER_BASE_URL`. ## Basic example Search tweets and write durable JSON Lines handoff rows. ```csharp theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} using System.Text.Json; using XTwitterScraper; using XTwitterScraper.Models; using XTwitterScraper.Models.X.Tweets; XTwitterScraperClient client = new(); TweetSearchParams parameters = new() { Q = "from:username webhook OR SDK", Limit = 10, }; PaginatedTweets page = await client.X.Tweets.Search(parameters); foreach (SearchTweet tweet in page.Tweets) { var row = new { tweet_id = tweet.ID, text = tweet.Text, author_username = tweet.Author?.Username, created_at = tweet.CreatedAt, }; await Console.Out.WriteLineAsync(JsonSerializer.Serialize(row)); } ``` ## C# SDK workflows | Workflow | What it does | | - | - | | [Tweet search](/sdks/csharp-tweet-search) | Search tweets, follow cursors & save JSON Lines, CSV, or XLSX files. | | [Follower export](/sdks/csharp-follower-export) | Run a follower extraction & save CSV, JSON, or XLSX files. | | [Media tweets](/sdks/csharp-media-tweets) | Upload media, post media tweets & send DM attachments. | ## Tweet replies workflow to CSV, JSON, or XLSX Use this workflow when a .NET worker needs every reply on a public tweet. It writes them to a durable file for moderation review or customer support triage. The file can also feed an analyst export or a warehouse loader. `client.Extractions.EstimateCost` and `client.Extractions.Run` map to the extraction workflow. For tweet replies, use `ExtractionEstimateCostParamsToolType.ReplyExtractor` and `ExtractionRunParamsToolType.ReplyExtractor`. `reply_extractor` requires `TargetTweetID`. `client.Extractions.Retrieve` returns `Results`, `HasMore`, and `NextCursor` for pagination. `client.Extractions.ExportResults` returns an `HttpResponse`. Read CSV and JSON as strings, and copy XLSX from the response stream. Reuse the follower export loop above. Change only the required target, tool type, and output names. ```csharp theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} string targetTweetID = "1893704267862470862"; ExtractionEstimateCostResponse estimate = await client.Extractions.EstimateCost( new ExtractionEstimateCostParams { ToolType = ExtractionEstimateCostParamsToolType.ReplyExtractor, TargetTweetID = targetTweetID, } ); ExtractionRunResponse job = await client.Extractions.Run( new ExtractionRunParams { ToolType = ExtractionRunParamsToolType.ReplyExtractor, TargetTweetID = targetTweetID, } ); using StreamWriter writer = File.CreateText("xquik-replies.jsonl"); ExtractionRetrieveResponse page = await client.Extractions.Retrieve( job.ID, new ExtractionRetrieveParams { Cursor = cursor, Limit = 1000 } ); foreach (var reply in page.Results) { await writer.WriteLineAsync(JsonSerializer.Serialize(reply)); } using HttpResponse csvResponse = await client.Extractions.ExportResults( job.ID, new ExtractionExportResultsParams { Format = Format.Csv } ); await File.WriteAllTextAsync("xquik-replies.csv", await csvResponse.ReadAsString()); ``` Keep the same `estimate.Allowed` credit branch from the follower export workflow before calling `Run`. Store `job.ID` on the queue job, ticket, or warehouse batch before polling. With it, another worker can resume with `client.Extractions.Retrieve`. Keep `page.NextCursor` as the checkpoint when you stream replies to JSON Lines. Pass it back as `Cursor` on the next `ExtractionRetrieveParams` call. Repeat the export with `new ExtractionExportResultsParams { Format = Format.Json }` and `File.WriteAllTextAsync("xquik-replies.json", await jsonResponse.ReadAsString())`. For XLSX, use `new ExtractionExportResultsParams { Format = Format.Xlsx }`, `File.Create("xquik-replies.xlsx")`, and stream-copy the response body. 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. The cost is 1 credit per reply extracted or returned. ## Error handling The C# SDK throws generated exception types for non-success responses and connection failures. > [card] 400 Bad request > > Throws `XTwitterScraperBadRequestException`. > [card] 401 Unauthorized > > Throws `XTwitterScraperUnauthorizedException`. > [card] 403 Forbidden > > Throws `XTwitterScraperForbiddenException`. > [card] 404 Not found > > Throws `XTwitterScraperNotFoundException`. > [card] 422 Validation error > > Throws `XTwitterScraperUnprocessableEntityException`. > [card] 429 Rate limited > > Throws `XTwitterScraperRateLimitException`. > [card] 5xx server error > > Throws `XTwitterScraper5xxException`. Use the [error handling guide](/guides/error-handling) for response body fields and retry recommendations. ## Pagination Paginated responses expose generated fields such as `HasNextPage`. Pass cursor parameters from the previous response when an endpoint supports cursor pagination. ```csharp theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} if (tweets.HasNextPage) { await Console.Error.WriteLineAsync("More results are available"); } ``` ## Webhooks & references * [Search Tweets](/api-reference/x/search-tweets) * [Create Tweet](/api-reference/x-write/create-tweet) * [Upload Media](/api-reference/x-write/upload-media) * [Send Direct Message](/api-reference/x-write/send-dm) * [Create Monitor](/api-reference/monitors/create) * [Webhook Overview](/webhooks/overview) * [Verify HMAC Signatures](/webhooks/verification) * [REST API Overview](/api-reference/overview) * [Source Repository](https://github.com/Xquik-dev/x-twitter-scraper-csharp) # Golang X (Twitter) API SDK, the Xquik Go SDK Source: https://docs.xquik.com/sdks/go Search tweets and export JSON Lines, CSV, or XLSX with the Xquik Go SDK. Post media tweets, upload media, send DMs, and run Go X (Twitter) API workers. > For the complete documentation index, see [llms.txt](/llms.txt). Use typed Go requests to search tweets and export followers or replies. Send JSON Lines, CSV, or XLSX files to workers, queues, and analysts. | Go task | SDK call | Save | | - | - | - | | Search tweets | `client.X.Tweets.Search` | `NextCursor` | | Export followers | `client.Extractions.Run` | `job.ID` | ## Install ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} go get github.com/Xquik-dev/x-twitter-scraper-go ``` ## Authenticate ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} client := xtwitterscraper.NewClient( option.WithAPIKey(os.Getenv("X_TWITTER_SCRAPER_API_KEY")), ) ``` ## Basic example Search tweets and write durable JSON Lines handoff rows. ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "context" "encoding/json" "os" "github.com/Xquik-dev/x-twitter-scraper-go" "github.com/Xquik-dev/x-twitter-scraper-go/option" ) func main() { client := xtwitterscraper.NewClient( option.WithAPIKey(os.Getenv("X_TWITTER_SCRAPER_API_KEY")), ) page, err := client.X.Tweets.Search(context.Background(), xtwitterscraper.XTweetSearchParams{ Q: "from:username webhook OR SDK", Limit: xtwitterscraper.Int(10), }) if err != nil { panic(err) } encoder := json.NewEncoder(os.Stdout) for _, tweet := range page.Tweets { row := map[string]string{ "tweet_id": tweet.ID, "text": tweet.Text, "author_username": tweet.Author.Username, "created_at": tweet.CreatedAt, } if err := encoder.Encode(row); err != nil { panic(err) } } } ``` ## Go SDK workflows | Workflow | What it does | | - | - | | [Tweet search](/sdks/go-tweet-search) | Search tweets, follow cursors & save JSON Lines, CSV, or XLSX files. | | [Follower export](/sdks/go-follower-export) | Run a follower extraction & save CSV, JSON, or XLSX files. | | [Media tweets](/sdks/go-media-tweets) | Upload media, post media tweets & send DM attachments. | ## Tweet replies workflow to CSV, JSON, or XLSX This workflow gets every reply under one tweet. It produces a saved extraction, JSON Lines handoff, or CSV, JSON, or XLSX export. Use it when a Go worker, queue consumer, or agent service needs that. It calls `POST /extractions/estimate` through `client.Extractions.EstimateCost` and creates the job with `client.Extractions.Run`. It reads rows with `client.Extractions.Get` and downloads files with `client.Extractions.ExportResults`. Reuse the polling, `writeRows`, and `writeExport` helpers from the follower workflow. Only the tool type, target field, and output filenames change. ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} targetTweetID := "1893704267862470862" estimate, err := client.Extractions.EstimateCost(ctx, xtwitterscraper.ExtractionEstimateCostParams{ ToolType: xtwitterscraper.ExtractionEstimateCostParamsToolTypeReplyExtractor, TargetTweetID: xtwitterscraper.String(targetTweetID), }) if err != nil { panic(err) } if !estimate.Allowed { panic("insufficient credits for reply extraction") } job, err := client.Extractions.Run(ctx, xtwitterscraper.ExtractionRunParams{ ToolType: xtwitterscraper.ExtractionRunParamsToolTypeReplyExtractor, TargetTweetID: xtwitterscraper.String(targetTweetID), }) if err != nil { panic(err) } // Run the same polling loop from the follower workflow before exporting rows. writeRows(ctx, client, job.ID, "xquik-replies.jsonl") writeExport(ctx, client, job.ID, xtwitterscraper.ExtractionExportResultsParamsFormatCsv, "xquik-replies.csv") writeExport(ctx, client, job.ID, xtwitterscraper.ExtractionExportResultsParamsFormatJson, "xquik-replies.json") writeExport(ctx, client, job.ID, xtwitterscraper.ExtractionExportResultsParamsFormatXlsx, "xquik-replies.xlsx") ``` `reply_extractor` requires `TargetTweetID`. `client.Extractions.Get` returns `Results`, `HasMore`, and `NextCursor`. The shared `writeRows` helper passes `NextCursor` back as `Cursor`. It repeats until all stored rows are written. 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. ## Cost, limits & retries Tweet search costs 1 credit per tweet returned. Remaining credits may not cover the requested page. If so, the API can return fewer tweets than `Limit`. If 0 paid results are affordable, it returns `402 insufficient_credits`. Xquik rate-limits read calls. `429` responses include `Retry-After`. Generated Go methods return `error` for connection failures and non-success responses. Retry connection errors, 408, 409, 429, and 5xx responses with backoff. Do not retry 400, 401, 403, 404, or 422 until you fix the cause. The cause is a request, authentication, permission, or input issue. ## Error handling Generated Go methods return `error` for connection failures and non-success API responses. Check the concrete error type from the SDK when you need status-code specific handling. Use the [error handling guide](/guides/error-handling) for response semantics. Common retryable cases are connection errors, 408, 409, 429, and 5xx responses. ## Pagination List and search responses expose generated pagination fields such as `HasNextPage`. Pass cursor parameters from the previous response when the endpoint supports cursor pagination. ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} if tweets.HasNextPage { fmt.Println("More results are available") } ``` ## Webhooks & references * [Search Tweets](/api-reference/x/search-tweets) * [Create Tweet](/api-reference/x-write/create-tweet) * [Get Write Action Status](/api-reference/x-write/get-write-action-status) * [Upload Media](/api-reference/x-write/upload-media) * [Send Direct Message](/api-reference/x-write/send-dm) * [Webhook Overview](/webhooks/overview) * [Verify HMAC Signatures](/webhooks/verification) * [Twitter Scraper API Overview](/api-reference/overview) * Download the OpenAPI schema with `curl -o openapi.json https://xquik.com/openapi.json` * [Source Repository](https://github.com/Xquik-dev/x-twitter-scraper-go) # X (Twitter) API Go follower export to CSV & XLSX Source: https://docs.xquik.com/sdks/go-follower-export Export X (Twitter) followers with the Xquik Go SDK. Estimate the job, run the extraction, and save CSV, JSON, or XLSX files for your team and your CRM tools. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Go SDK setup](/sdks/go), which covers install and authentication. ## Follower export workflow to CSV, JSON, or XLSX Use this workflow when a Go worker needs an owned follower list. It feeds CRM imports, warehouse loads, analyst CSVs, XLSX workbooks, or resumable JSON handoffs. The workflow calls `POST /extractions/estimate` through `client.Extractions.EstimateCost` and creates the job with `client.Extractions.Run`. It reads saved rows with `client.Extractions.Get` and downloads files with `client.Extractions.ExportResults`. > [!NOTE] > > `client.Extractions.Run` returns the queued `202 Accepted` receipt from `POST /extractions`. Go exposes REST `id`, `toolType`, and `status: "running"` as `job.ID`, `job.ToolType`, and `job.Status`. Store `job.ID` immediately, then poll `client.Extractions.Get` before reading pages or calling `client.Extractions.ExportResults`. Credit reservation happens after the job starts. Available credits can change after `EstimateCost`. If they did, the run can fetch only the affordable count before export. In that case it can instead mark the job `failed` with `insufficient_credits`. ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "context" "encoding/json" "io" "os" "time" "github.com/Xquik-dev/x-twitter-scraper-go" "github.com/Xquik-dev/x-twitter-scraper-go/option" ) func main() { ctx := context.Background() client := xtwitterscraper.NewClient( option.WithAPIKey(os.Getenv("X_TWITTER_SCRAPER_API_KEY")), ) targetUsername := "username" estimate, err := client.Extractions.EstimateCost(ctx, xtwitterscraper.ExtractionEstimateCostParams{ ToolType: xtwitterscraper.ExtractionEstimateCostParamsToolTypeFollowerExplorer, TargetUsername: xtwitterscraper.String(targetUsername), }) if err != nil { panic(err) } if !estimate.Allowed { panic("insufficient credits for follower export") } job, err := client.Extractions.Run(ctx, xtwitterscraper.ExtractionRunParams{ ToolType: xtwitterscraper.ExtractionRunParamsToolTypeFollowerExplorer, TargetUsername: xtwitterscraper.String(targetUsername), }) if err != nil { panic(err) } for { page, err := client.Extractions.Get(ctx, job.ID, xtwitterscraper.ExtractionGetParams{ Limit: xtwitterscraper.Int(1000), }) if err != nil { panic(err) } status, _ := page.Job["status"].(string) if status == "completed" { break } if status == "failed" { panic("follower export failed") } time.Sleep(10 * time.Second) } writeRows(ctx, client, job.ID, "xquik-followers.jsonl") writeExport(ctx, client, job.ID, xtwitterscraper.ExtractionExportResultsParamsFormatCsv, "xquik-followers.csv") writeExport(ctx, client, job.ID, xtwitterscraper.ExtractionExportResultsParamsFormatJson, "xquik-followers.json") writeExport(ctx, client, job.ID, xtwitterscraper.ExtractionExportResultsParamsFormatXlsx, "xquik-followers.xlsx") } func writeRows( ctx context.Context, client xtwitterscraper.Client, jobID string, filename string, ) { out, err := os.Create(filename) if err != nil { panic(err) } defer out.Close() encoder := json.NewEncoder(out) cursor := "" for { params := xtwitterscraper.ExtractionGetParams{ Limit: xtwitterscraper.Int(1000), } if cursor != "" { params.Cursor = xtwitterscraper.String(cursor) } page, err := client.Extractions.Get(ctx, jobID, params) if err != nil { panic(err) } for _, row := range page.Results { if err := encoder.Encode(row); err != nil { panic(err) } } if !page.HasMore || page.NextCursor == "" { break } cursor = page.NextCursor } } func writeExport( ctx context.Context, client xtwitterscraper.Client, jobID string, format xtwitterscraper.ExtractionExportResultsParamsFormat, filename string, ) { response, err := client.Extractions.ExportResults(ctx, jobID, xtwitterscraper.ExtractionExportResultsParams{ Format: format, }) if err != nil { panic(err) } defer response.Body.Close() out, err := os.Create(filename) if err != nil { panic(err) } defer out.Close() if _, err := io.Copy(out, response.Body); err != nil { panic(err) } } ``` `follower_explorer` requires `TargetUsername`. Store `job.ID`, `targetUsername`, `estimate.EstimatedResults`, and `estimate.Source` before polling. With them, a worker restart can resume the same follower export. `client.Extractions.Get` returns `Results`, `HasMore`, and `NextCursor`. Pass `NextCursor` back as `Cursor` when you need stored JSON pages before exporting files. Use `xquik-followers.jsonl` for queue replay or warehouse loads and `xquik-followers.json` for app ingestion. Use `xquik-followers.csv` for CRM import and `xquik-followers.xlsx` for analyst handoff. Map exported `User ID` or row `xUserId` as the CRM unique key. The cost is 1 credit per follower extracted or returned. Exports are free after the extraction job exists. ## Next steps * [Go SDK setup](/sdks/go) * [Tweet search](/sdks/go-tweet-search) * [Media tweets](/sdks/go-media-tweets) # X (Twitter) API Go media tweets & DM attachments Source: https://docs.xquik.com/sdks/go-media-tweets Upload media with the Xquik Go SDK, post tweets with photos or video, and send DM attachments from a connected X (Twitter) account in your own apps and bots. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Go SDK setup](/sdks/go), which covers install and authentication. ## Workflow to post media tweets and DM attachments Use this workflow to post a media tweet or reply. It can also DM 1 uploaded media item. Tweet and reply media posts use public media URLs directly on `client.X.Tweets.New`. Send up to 4 image URLs or exactly 1 MP4 video URL. The video can be up to 100 MB. Do not mix video with other media. Do not upload first when the media URL is already public. ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} type writeActionBilling struct { Charged bool `json:"charged"` ChargedCredits string `json:"chargedCredits"` } type writeActionRequest struct { Hash *string `json:"hash"` } type writeActionResult struct { ID string `json:"id"` } type tweetCreatePayload struct { ID string `json:"id"` Status string `json:"status"` Terminal bool `json:"terminal"` SafeToRetry bool `json:"safeToRetry"` StatusURL string `json:"statusUrl"` Request writeActionRequest `json:"request"` Billing writeActionBilling `json:"billing"` Result *writeActionResult `json:"result"` TweetID string `json:"tweetId"` } func createTweetHandoff(action tweetCreatePayload, base map[string]any) map[string]any { var resultID any if action.Result != nil { resultID = action.Result.ID } else if action.TweetID != "" { resultID = action.TweetID } poll := any(nil) if !action.Terminal { poll = action.StatusURL } handoff := map[string]any{ "status": action.Status, "terminal": action.Terminal, "safe_to_retry": action.SafeToRetry, "write_action_id": action.ID, "request_hash": action.Request.Hash, "tweet_id": resultID, "charged": action.Billing.Charged, "charged_credits": action.Billing.ChargedCredits, "poll": poll, } for key, value := range base { handoff[key] = value } return handoff } ``` Use `option.WithResponseBodyInto` to capture the durable write action. Send a unique `Idempotency-Key`. Store `id`, `request.hash`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} ctx := context.Background() var tweetPayload tweetCreatePayload _, err := client.X.Tweets.New(ctx, xtwitterscraper.XTweetNewParams{ Account: "@username", Text: xtwitterscraper.String("New demo video is live."), Media: []string{"https://example.com/product-demo.mp4"}, }, option.WithResponseBodyInto(&tweetPayload)) if err != nil { panic(err) } tweetHandoff := createTweetHandoff(tweetPayload, map[string]any{ "account": "@username", "media": []string{"https://example.com/product-demo.mp4"}, }) if err := json.NewEncoder(os.Stdout).Encode(tweetHandoff); err != nil { panic(err) } ``` To post an image reply, add `ReplyToTweetID`. ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} var replyPayload tweetCreatePayload _, err := client.X.Tweets.New(ctx, xtwitterscraper.XTweetNewParams{ Account: "@username", Text: xtwitterscraper.String("Here is the requested screenshot."), ReplyToTweetID: xtwitterscraper.String("1893704267862470862"), Media: []string{"https://example.com/export-preview.png"}, }, option.WithResponseBodyInto(&replyPayload)) if err != nil { panic(err) } replyHandoff := createTweetHandoff(replyPayload, map[string]any{ "account": "@username", "reply_to_tweet_id": "1893704267862470862", "media": []string{"https://example.com/export-preview.png"}, }) if err := json.NewEncoder(os.Stdout).Encode(replyHandoff); err != nil { panic(err) } ``` For DM attachments, upload the local file first. Then pass the returned `media.MediaID` as the only `MediaIDs` item. ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} file, err := os.Open("./handoff.png") if err != nil { panic(err) } defer file.Close() media, err := client.X.Media.Upload(context.Background(), xtwitterscraper.XMediaUploadParams{ Account: "@username", File: file, }) if err != nil { panic(err) } dm, err := client.X.Dm.Send(context.Background(), "44196397", xtwitterscraper.XDmSendParams{ Account: "@username", Text: "Here is the asset.", MediaIDs: []string{media.MediaID}, }) if err != nil { panic(err) } dmHandoff := map[string]any{ "status": "sent", "message_id": dm.MessageID, "media_id": media.MediaID, "account": "@username", "user_id": "44196397", } if err := json.NewEncoder(os.Stdout).Encode(dmHandoff); err != nil { panic(err) } ``` `client.X.Tweets.New` returns `TweetID` for confirmed posts. Raw create responses can also include the pending write fields above. That happens when confirmation is still running. `client.X.Media.Upload` returns `media.MediaID` for DM attachments. `client.X.Dm.Send` returns `dm.MessageID` for support tickets, CRM records, queue jobs, or agent memory. Keep DM body text in private systems. Shared logs, public artifacts, queue status, and agent handoffs should omit full DM bodies. They should store `message_id`, optional `media_id`, `account`, `user_id`, and send status instead. Leave `ReplyToMessageID` unset even if generated SDK params expose it. The REST endpoint rejects DM reply threading. `client.X.Dm.DeleteMessage` [deletes a DM](/api-reference/x-write/delete-dm). Text-only tweet and reply writes cost 30 credits. Tweet media adds 2 credits per started MB across attached files. Uploading media costs 10 credits. Sending the DM costs 10 credits. Do not pass uploaded `MediaID` values to `client.X.Tweets.New`. That method uses `Media` with public media URLs. ### REST routes | Task | REST route | Reference | | - | - | - | | Post a media tweet or reply | `POST /x/tweets` | [Create tweet](/api-reference/x-write/create-tweet) | | Upload a local file | `POST /x/media` | [Upload media](/api-reference/x-write/upload-media) | | Send a DM attachment | `POST /x/dm/{userId}` | [Send DM](/api-reference/x-write/send-dm) | | Check a write action | `GET /x/write-actions/{id}` | [Write action status](/api-reference/x-write/get-write-action-status) | | Delete a DM | `DELETE /x/dm/{userId}/messages/{messageId}` | [Delete DM](/api-reference/x-write/delete-dm) | ## Next steps * [Go SDK setup](/sdks/go) * [Tweet search](/sdks/go-tweet-search) * [Follower export](/sdks/go-follower-export) # X (Twitter) API Go tweet search to CSV & JSON lines Source: https://docs.xquik.com/sdks/go-tweet-search Search tweets with the Xquik Go SDK, follow cursors, and save rows as JSON Lines, CSV, or XLSX for workers, queues, and analysts in your own apps and jobs. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Go SDK setup](/sdks/go), which covers install and authentication. ## Tweet search workflow to JSON Lines, CSV, or XLSX Search newest tweets with `client.X.Tweets.Search` through `GET /x/tweets/search`. Write each tweet as a JSON line for queues, data lakes, CSV, or XLSX. ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "context" "encoding/json" "os" "github.com/Xquik-dev/x-twitter-scraper-go" "github.com/Xquik-dev/x-twitter-scraper-go/option" ) func main() { client := xtwitterscraper.NewClient( option.WithAPIKey(os.Getenv("X_TWITTER_SCRAPER_API_KEY")), ) out, err := os.Create("xquik-tweet-search.jsonl") if err != nil { panic(err) } defer out.Close() encoder := json.NewEncoder(out) cursor := "" for { params := xtwitterscraper.XTweetSearchParams{ Q: "from:username webhook OR SDK", QueryType: xtwitterscraper.XTweetSearchParamsQueryTypeLatest, } if cursor != "" { params.Cursor = xtwitterscraper.String(cursor) } page, err := client.X.Tweets.Search(context.Background(), params) if err != nil { panic(err) } for _, tweet := range page.Tweets { if err := encoder.Encode(tweet); err != nil { panic(err) } } if !page.HasNextPage || page.NextCursor == "" { break } cursor = page.NextCursor } } ``` The example builds an `XTweetSearchParams` request so the Go fields stay aligned with `GET /x/tweets/search`. The generated params map directly to the REST endpoint. > [card] Q > > Go field `Q` maps to REST `q`. It holds the required X (Twitter) search query with keywords, handles, hashtags, or operators. > [card] Limit > > Go field `Limit` maps to REST `limit`. Use it as a 1 to 200 upper bound for a bounded pull. If `page.HasNextPage` is true, keep the same `Q`, filters, `QueryType`, and `Limit`. Then continue with `page.NextCursor`. > [card] Cursor > > Go field `Cursor` maps to REST `cursor`. Pass the opaque cursor from `NextCursor` to request the next page. > [card] SinceTime > > Go field `SinceTime` maps to REST `sinceTime`. Use the inclusive ISO bound on every page. > [card] UntilTime > > Go field `UntilTime` maps to REST `untilTime`. Use the exclusive ISO bound on every page. > [card] QueryType > > Go field `QueryType` maps to REST `queryType`. Use `Latest` for chronological results or `Top` for engagement-ranked results. ## Returned data & handoff `client.X.Tweets.Search` returns `PaginatedTweets`. > [card] Tweets > > JSON field `tweets`. Contains tweet records with `ID`, `Text`, `Author`, and `CreatedAt`. Records also carry `LikeCount`, `ReplyCount`, `RetweetCount`, `QuoteCount`, `BookmarkCount`, `ViewCount`, and `IsNoteTweet` when available. > [card] HasNextPage > > Go field `HasNextPage`. JSON field `has_next_page`. Tells your worker whether another page exists. > [card] NextCursor > > JSON field `next_cursor`. Store it only when `page.HasNextPage` is true. For bounded pulls that return fewer tweets than `Limit`, pass it back as `Cursor`. Send the same query, filters, `QueryType`, and `Limit` with that cursor. Write `Tweets` as JSON Lines to `xquik-tweet-search.jsonl` for queues and data lakes. Transform the projected records into CSV for analysts. When account teams need spreadsheets, produce XLSX from those rows. Pass `ID`, `Text`, `Author.Username`, `CreatedAt`, and engagement counts into your CRM or enrichment pipeline. For explicit `Limit` pulls, resume with the same query, filters, `QueryType`, and `Limit`. Only `Cursor` changes. ## Next steps * [Go SDK setup](/sdks/go) * [Follower export](/sdks/go-follower-export) * [Media tweets](/sdks/go-media-tweets) # Twitter API Java SDK for tweet search & exports Source: https://docs.xquik.com/sdks/java Use the Xquik Java SDK to search tweets, export JSON Lines, CSV, or XLSX, post media tweets, upload media, send DMs, and run JVM X API workers. See examples. > For the complete documentation index, see [llms.txt](/llms.txt). Use the Java X (Twitter) API SDK in Java 8+ applications. It provides generated JVM models, builders, sync calls, async calls, and typed exceptions. It also provides retries and file upload helpers. It fits JVM services, Spring workers, queue consumers, and cron jobs. Search tweets, export followers, monitor tweets, post media, upload files, or send direct messages. Hand tweet, follower, reply, and profile rows to analytics or CRM systems. | Java worker task | SDK call | Durable checkpoint | | - | - | - | | Search tweets | `client.x().tweets().search` | Store `page.nextCursor()` after every page. | | Estimate follower or reply exports | `client.extractions().estimateCost` | Store the estimate and `allowed()` decision. | | Start an extraction | `client.extractions().run` | Save `job.id()` immediately. | | Retrieve saved rows | `client.extractions().retrieve` | Keep `nextCursor()` while `hasMore()` is true. | | Export CSV, JSON, or XLSX | `client.extractions().exportResults` | Record the job ID, format, and file destination. | | Create a tweet | `client.x().tweets().withRawResponse().create` | Store the write action ID and terminal state. | ## Install Add the Gradle dependency from [Maven Central](https://repo1.maven.org/maven2/com/xquik/api/x-twitter-scraper-java/). ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} implementation("com.xquik.api:x-twitter-scraper-java:0.10.3") ``` Or add the Maven dependency. ```xml theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} com.xquik.api x-twitter-scraper-java 0.10.3 ``` ## Authenticate ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` Build the client from the environment. ```java theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} XTwitterScraperClient client = XTwitterScraperOkHttpClient.fromEnv(); ``` It reads `X_TWITTER_SCRAPER_API_KEY`, `X_TWITTER_SCRAPER_BEARER_TOKEN`, and `X_TWITTER_SCRAPER_BASE_URL`. ## Basic example Search tweets and write durable JSON Lines handoff rows. ```java theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import com.fasterxml.jackson.databind.ObjectMapper; import com.x_twitter_scraper.api.client.XTwitterScraperClient; import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient; import com.x_twitter_scraper.api.models.PaginatedTweets; import com.x_twitter_scraper.api.models.SearchTweet; import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams; import java.util.LinkedHashMap; import java.util.Map; XTwitterScraperClient client = XTwitterScraperOkHttpClient.fromEnv(); ObjectMapper objectMapper = new ObjectMapper(); TweetSearchParams params = TweetSearchParams.builder() .q("from:username webhook OR SDK") .limit(10L) .build(); PaginatedTweets page = client.x().tweets().search(params); for (SearchTweet tweet : page.tweets()) { Map row = new LinkedHashMap<>(); row.put("tweet_id", tweet.id()); row.put("text", tweet.text()); row.put("author_username", tweet.author().map(SearchTweet.Author::username).orElse(null)); row.put("created_at", tweet.createdAt().orElse(null)); System.out.println(objectMapper.writeValueAsString(row)); } ``` ## Java SDK workflows | Workflow | What it does | | - | - | | [Tweet search](/sdks/java-tweet-search) | Search tweets, follow cursors & save JSON Lines, CSV, or XLSX files. | | [Follower export](/sdks/java-follower-export) | Run a follower extraction & save CSV, JSON, or XLSX files. | | [Media tweets](/sdks/java-media-tweets) | Upload media, post media tweets & send DM attachments. | ## Tweet replies workflow to CSV, JSON, or XLSX Use this workflow when a Java worker needs every reply as a durable file. The parent can be a campaign, support thread, launch post, or incident update. `reply_extractor` requires `targetTweetId`. Estimate first, run the job, and poll `retrieve`. Then export the completed job as CSV, JSON, or XLSX. Reuse the follower export loop above. Change only the required target, tool type, and output names. ```java theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} String targetTweetId = "1893704267862470862"; ExtractionEstimateCostResponse estimate = client.extractions().estimateCost( ExtractionEstimateCostParams.builder() .toolType(ExtractionEstimateCostParams.ToolType.REPLY_EXTRACTOR) .targetTweetId(targetTweetId) .build() ); ExtractionRunResponse job = client.extractions().run( ExtractionRunParams.builder() .toolType(ExtractionRunParams.ToolType.REPLY_EXTRACTOR) .targetTweetId(targetTweetId) .build() ); ExtractionRetrieveParams.Builder pageParams = ExtractionRetrieveParams.builder() .id(job.id()) .limit(1000L); if (cursor != null && !cursor.isEmpty()) { pageParams.cursor(cursor); } ExtractionRetrieveResponse page = client.extractions().retrieve(pageParams.build()); ``` Store `job.id()` before polling. A queue retry uses it to resume the read. After completion, it can repeat the export. ```java theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} client.extractions().retrieve(job.id()) client.extractions().exportResults(...) ``` Stream `page.results()` to `Paths.get("xquik-replies.jsonl")`. Keep `page.nextCursor()` as the checkpoint while streaming replies to JSON Lines. Pass it back as `cursor` on the next page request. The code above builds that request with the `ExtractionRetrieveParams` builder. Keep the same `estimate.allowed()` credit branch from the follower export workflow before calling `run`. Export the completed job with the same helper used above. ```java theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} try (HttpResponse export = client.extractions().exportResults( ExtractionExportResultsParams.builder() .id(job.id()) .format(ExtractionExportResultsParams.Format.CSV) .build() )) { Files.copy( export.body(), Paths.get("xquik-replies.csv"), StandardCopyOption.REPLACE_EXISTING ); } ``` Repeat the export with each format to write `Paths.get("xquik-replies.json")` and `Paths.get("xquik-replies.xlsx")`. ```java theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} ExtractionExportResultsParams.Format.JSON ExtractionExportResultsParams.Format.XLSX ``` 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. ## Error handling The Java SDK throws unchecked exceptions. * **400 Bad request.** Throws `BadRequestException`. * **401 Unauthorized.** Throws `UnauthorizedException`. * **403 Permission denied.** Throws `PermissionDeniedException`. * **404 Not found.** Throws `NotFoundException`. * **422 Validation error.** Throws `UnprocessableEntityException`. * **429 Rate limited.** Throws `RateLimitException`. * **5xx server error.** Throws `InternalServerException`. Connection and I/O failures use `XTwitterScraperIoException`. All SDK exceptions inherit from `XTwitterScraperException`. ## Pagination Paginated responses expose generated fields such as `hasNextPage`. Use the endpoint cursor fields documented in the API reference when requesting more pages. ```java theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} if (tweets.hasNextPage()) { System.err.println("More results are available"); } ``` ## Webhooks & references * [Search Tweets](/api-reference/x/search-tweets) * [Create Tweet](/api-reference/x-write/create-tweet) * [Get Write Action Status](/api-reference/x-write/get-write-action-status) * [Upload Media](/api-reference/x-write/upload-media) * [Send Direct Message](/api-reference/x-write/send-dm) * [Create Monitor](/api-reference/monitors/create) * [Webhook Overview](/webhooks/overview) * [Verify HMAC Signatures](/webhooks/verification) * [REST API Overview](/api-reference/overview) * [Source Repository](https://github.com/Xquik-dev/x-twitter-scraper-java) # X (Twitter) API Java follower export to CSV & XLSX Source: https://docs.xquik.com/sdks/java-follower-export Export X (Twitter) followers with the Xquik Java SDK. Estimate the job, run the extraction, and save CSV, JSON, or XLSX files for your team and your CRM tools. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Java SDK setup](/sdks/java), which covers install and authentication. ## Follower export workflow to CSV, JSON, or XLSX Export followers for CRM, warehouses, account scoring, CSV, XLSX, or resumable JSON. `client.extractions().estimateCost` maps to `POST /extractions/estimate`, and `client.extractions().run` maps to `POST /extractions`. `client.extractions().retrieve` maps to `GET /extractions/{id}`, and `client.extractions().exportResults` maps to `GET /extractions/{id}/export`. For follower exports, `follower_explorer` requires `targetUsername`. > [!NOTE] > > `client.extractions().run` returns the queued `202 Accepted` receipt from `POST /extractions`. Java exposes REST `id`, `toolType`, and `status: "running"` as `job.id()`, `job.toolType()`, and `job._status()`. Store `job.id()` immediately, then poll `client.extractions().retrieve` before reading pages or calling `client.extractions().exportResults`. Credit reservation happens after the job starts. Available credits can change after `estimateCost`. If they did, the run can fetch only the affordable count before export. In that case it can instead mark the job `failed` with `insufficient_credits`. ```java theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import com.fasterxml.jackson.databind.ObjectMapper; import com.x_twitter_scraper.api.client.XTwitterScraperClient; import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient; import com.x_twitter_scraper.api.core.JsonValue; import com.x_twitter_scraper.api.core.http.HttpResponse; import com.x_twitter_scraper.api.models.extractions.ExtractionEstimateCostParams; import com.x_twitter_scraper.api.models.extractions.ExtractionEstimateCostResponse; import com.x_twitter_scraper.api.models.extractions.ExtractionExportResultsParams; import com.x_twitter_scraper.api.models.extractions.ExtractionRetrieveParams; import com.x_twitter_scraper.api.models.extractions.ExtractionRetrieveResponse; import com.x_twitter_scraper.api.models.extractions.ExtractionRunParams; import com.x_twitter_scraper.api.models.extractions.ExtractionRunResponse; import java.io.BufferedWriter; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; XTwitterScraperClient client = XTwitterScraperOkHttpClient.fromEnv(); ObjectMapper objectMapper = new ObjectMapper(); String targetUsername = "username"; ExtractionEstimateCostResponse estimate = client.extractions().estimateCost( ExtractionEstimateCostParams.builder() .toolType(ExtractionEstimateCostParams.ToolType.FOLLOWER_EXPLORER) .targetUsername(targetUsername) .build() ); if (!estimate.allowed()) { throw new IllegalStateException( "Follower export requires " + estimate.creditsRequired() + " credits." ); } ExtractionRunResponse job = client.extractions().run( ExtractionRunParams.builder() .toolType(ExtractionRunParams.ToolType.FOLLOWER_EXPLORER) .targetUsername(targetUsername) .build() ); boolean completed = false; for (int attempt = 0; attempt < 120; attempt++) { ExtractionRetrieveResponse statusPage = client.extractions().retrieve(job.id()); JsonValue statusValue = statusPage.job()._additionalProperties().get("status"); String status = statusValue == null ? "unknown" : statusValue.asString().orElse("unknown"); if ("completed".equals(status)) { completed = true; break; } if ("failed".equals(status)) { throw new IllegalStateException("Follower export failed."); } Thread.sleep(10_000L); } if (!completed) { throw new IllegalStateException("Follower export did not complete before timeout."); } String cursor = null; try (BufferedWriter writer = Files.newBufferedWriter( Paths.get("xquik-followers.jsonl"), StandardCharsets.UTF_8 )) { do { ExtractionRetrieveParams.Builder pageParams = ExtractionRetrieveParams.builder() .id(job.id()) .limit(1000L); if (cursor != null && !cursor.isEmpty()) { pageParams.cursor(cursor); } ExtractionRetrieveResponse page = client.extractions().retrieve(pageParams.build()); for (ExtractionRetrieveResponse.Result row : page.results()) { writer.write(objectMapper.writeValueAsString(row._additionalProperties())); writer.newLine(); } cursor = page.hasMore() ? page.nextCursor().orElse(null) : null; } while (cursor != null && !cursor.isEmpty()); } try (HttpResponse export = client.extractions().exportResults( ExtractionExportResultsParams.builder() .id(job.id()) .format(ExtractionExportResultsParams.Format.CSV) .build() )) { Files.copy( export.body(), Paths.get("xquik-followers.csv"), StandardCopyOption.REPLACE_EXISTING ); } try (HttpResponse export = client.extractions().exportResults( ExtractionExportResultsParams.builder() .id(job.id()) .format(ExtractionExportResultsParams.Format.JSON) .build() )) { Files.copy( export.body(), Paths.get("xquik-followers.json"), StandardCopyOption.REPLACE_EXISTING ); } try (HttpResponse export = client.extractions().exportResults( ExtractionExportResultsParams.builder() .id(job.id()) .format(ExtractionExportResultsParams.Format.XLSX) .build() )) { Files.copy( export.body(), Paths.get("xquik-followers.xlsx"), StandardCopyOption.REPLACE_EXISTING ); } ``` Store `job.id()`, `targetUsername`, `estimate.estimatedResults()`, and `estimate.source()` before polling so retries can resume the extraction. `client.extractions().retrieve` returns `results()`, `hasMore()`, and `nextCursor()`. Pass `nextCursor()` back as `cursor` to page through large follower lists. Map exported `User ID` or row `xUserId` as the CRM unique key. Use `xquik-followers.jsonl` for queue replay or warehouse loads and `xquik-followers.json` for app ingestion. Use `xquik-followers.csv` for CRM import and `xquik-followers.xlsx` for analyst handoff. The cost is 1 credit per follower extracted or returned. Exports are free after the extraction job exists. ## Next steps * [Java SDK setup](/sdks/java) * [Tweet search](/sdks/java-tweet-search) * [Media tweets](/sdks/java-media-tweets) # X (Twitter) API Java media tweets & DM attachments Source: https://docs.xquik.com/sdks/java-media-tweets Upload media with the Xquik Java SDK, post tweets with photos or video, and send DM attachments from a connected X (Twitter) account in your own apps and bots. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Java SDK setup](/sdks/java), which covers install and authentication. ## Workflow to post media tweets and DM attachments Use this workflow to post a media tweet or reply. It can also DM an uploaded local file. `client.x().tweets().create` maps to `POST /x/tweets`. Pass public media URLs through `.addMedia()` or `.media()`. Send up to 4 image URLs or exactly 1 MP4 video URL. The video can be up to 100 MB. Do not mix video with other media. For replies, set `.replyToTweetId()` to the parent tweet ID. `client.x().media().upload` maps to `POST /x/media`. Use `media.mediaId()` only for the one-item DM `.addMediaId()` handoff. ```java theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.x_twitter_scraper.api.client.XTwitterScraperClient; import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient; import com.x_twitter_scraper.api.core.http.HttpResponseFor; import com.x_twitter_scraper.api.models.x.dm.DmSendParams; import com.x_twitter_scraper.api.models.x.dm.DmSendResponse; import com.x_twitter_scraper.api.models.x.media.MediaUploadParams; import com.x_twitter_scraper.api.models.x.media.MediaUploadResponse; import com.x_twitter_scraper.api.models.x.tweets.TweetCreateParams; import com.x_twitter_scraper.api.models.x.tweets.TweetCreateResponse; import java.nio.file.Paths; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; XTwitterScraperClient client = XTwitterScraperOkHttpClient.fromEnv(); ObjectMapper objectMapper = new ObjectMapper(); static Map createTweetHandoff( Map payload, Map base ) { Map handoff = new LinkedHashMap<>(); Map billing = (Map) payload.get("billing"); Map request = (Map) payload.get("request"); Map result = (Map) payload.get("result"); boolean terminal = Boolean.TRUE.equals(payload.get("terminal")); handoff.put("status", payload.get("status")); handoff.put("terminal", terminal); handoff.put("safe_to_retry", payload.get("safeToRetry")); handoff.put("write_action_id", payload.get("id")); handoff.put("request_hash", request.get("hash")); handoff.put("tweet_id", result == null ? payload.get("tweetId") : result.get("id")); handoff.put("charged", billing.get("charged")); handoff.put("charged_credits", billing.get("chargedCredits")); handoff.put("poll", terminal ? null : payload.get("statusUrl")); handoff.putAll(base); return handoff; } Map tweetPayload; try (HttpResponseFor response = client.x().tweets().withRawResponse().create( TweetCreateParams.builder() .account("@username") .text("Shipping the weekly X API video.") .addMedia("https://static.example.com/reports/x-api-export.mp4") .build() )) { tweetPayload = objectMapper.readValue( response.body(), new TypeReference>() {} ); } Map tweetBase = new LinkedHashMap<>(); tweetBase.put("account", "@username"); tweetBase.put("media", List.of("https://static.example.com/reports/x-api-export.mp4")); Map tweetHandoff = createTweetHandoff(tweetPayload, tweetBase); Map replyPayload; try (HttpResponseFor response = client.x().tweets().withRawResponse().create( TweetCreateParams.builder() .account("@username") .text("Here is the chart behind the update.") .addMedia("https://static.example.com/reports/reply-chart.png") .replyToTweetId("1893704267862470862") .build() )) { replyPayload = objectMapper.readValue( response.body(), new TypeReference>() {} ); } Map replyBase = new LinkedHashMap<>(); replyBase.put("account", "@username"); replyBase.put("reply_to_tweet_id", "1893704267862470862"); replyBase.put("media", List.of("https://static.example.com/reports/reply-chart.png")); Map replyHandoff = createTweetHandoff(replyPayload, replyBase); MediaUploadResponse media = client.x().media().upload( MediaUploadParams.builder() .account("@username") .file(Paths.get("handoff.png")) .build() ); DmSendResponse dm = client.x().dm().send( "44196397", DmSendParams.builder() .account("@username") .text("Here is the requested asset.") .addMediaId(media.mediaId()) .build() ); Map dmHandoff = new LinkedHashMap<>(); dmHandoff.put("status", "sent"); dmHandoff.put("message_id", dm.messageId()); dmHandoff.put("media_id", media.mediaId()); dmHandoff.put("account", "@username"); dmHandoff.put("user_id", "44196397"); System.out.println(objectMapper.writeValueAsString(tweetHandoff)); System.out.println(objectMapper.writeValueAsString(replyHandoff)); System.out.println(objectMapper.writeValueAsString(dmHandoff)); ``` Use `client.x().tweets().withRawResponse().create(...)` to capture the durable write action. Send a unique `Idempotency-Key`. Store `id`, `request.hash`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. Keep DM body text in private systems. Shared logs and handoffs should store `message_id`, optional `media_id`, `account`, `user_id`, and lifecycle status. Leave `replyToMessageId` unset because the REST endpoint rejects DM reply threading. `client.x().dm().deleteMessage` [deletes a DM](/api-reference/x-write/delete-dm). Use public media URLs with `client.x().tweets().create`. Do not pass uploaded `media.mediaId()` values to tweet creation. ### REST routes | Task | REST route | Reference | | - | - | - | | Post a media tweet or reply | `POST /x/tweets` | [Create tweet](/api-reference/x-write/create-tweet) | | Upload a local file | `POST /x/media` | [Upload media](/api-reference/x-write/upload-media) | | Send a DM attachment | `POST /x/dm/{userId}` | [Send DM](/api-reference/x-write/send-dm) | | Check a write action | `GET /x/write-actions/{id}` | [Write action status](/api-reference/x-write/get-write-action-status) | | Delete a DM | `DELETE /x/dm/{userId}/messages/{messageId}` | [Delete DM](/api-reference/x-write/delete-dm) | ## Next steps * [Java SDK setup](/sdks/java) * [Tweet search](/sdks/java-tweet-search) * [Follower export](/sdks/java-follower-export) # X (Twitter) API Java tweet search to CSV & JSONL Source: https://docs.xquik.com/sdks/java-tweet-search Search tweets with the Xquik Java SDK, follow cursors, and save rows as JSON Lines, CSV, or XLSX for workers, queues, and analysts in your own apps and jobs. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Java SDK setup](/sdks/java), which covers install and authentication. ## Tweet search workflow to JSON Lines, CSV, or XLSX Export tweet search from Java services, Spring Batch, scheduled workers, or queues. Save files for data lakes, CRM enrichment, CSV, XLSX, or downstream processing. `client.x().tweets().search` calls `GET /x/tweets/search`. Build `TweetSearchParams` with the REST query parameters `.q()`, `.limit()`, `.cursor()`, `.sinceTime()`, `.untilTime()`, and `.queryType()`. ```java theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import com.fasterxml.jackson.databind.ObjectMapper; import com.x_twitter_scraper.api.client.XTwitterScraperClient; import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient; import com.x_twitter_scraper.api.models.PaginatedTweets; import com.x_twitter_scraper.api.models.SearchTweet; import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams; import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams.QueryType; import java.io.BufferedWriter; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; XTwitterScraperClient client = XTwitterScraperOkHttpClient.fromEnv(); ObjectMapper objectMapper = new ObjectMapper(); String query = "from:username webhook OR SDK"; String cursor = null; int pageIndex = 0; List headers = Arrays.asList( "source", "query", "tweet_id", "text", "author_id", "author_username", "author_name", "created_at", "like_count", "reply_count", "retweet_count", "quote_count", "view_count", "bookmark_count", "is_note_tweet", "page_index", "page_cursor", "next_cursor", "has_next_page" ); try ( BufferedWriter jsonlWriter = Files.newBufferedWriter( Paths.get("xquik-tweet-search.jsonl"), StandardCharsets.UTF_8 ); BufferedWriter csvWriter = Files.newBufferedWriter( Paths.get("xquik-tweet-search.csv"), StandardCharsets.UTF_8 ) ) { writeCsvRow(csvWriter, headers); do { String pageCursor = cursor; TweetSearchParams.Builder builder = TweetSearchParams.builder() .q(query) .queryType(QueryType.LATEST); if (cursor != null && !cursor.isEmpty()) { builder.cursor(cursor); } PaginatedTweets page = client.x().tweets().search(builder.build()); for (SearchTweet tweet : page.tweets()) { Map row = new LinkedHashMap<>(); row.put("source", "xquik.java.search"); row.put("query", query); row.put("tweet_id", tweet.id()); row.put("text", tweet.text()); row.put("author_id", tweet.author().map(SearchTweet.Author::id).orElse(null)); row.put("author_username", tweet.author().map(SearchTweet.Author::username).orElse(null)); row.put("author_name", tweet.author().map(SearchTweet.Author::name).orElse(null)); row.put("created_at", tweet.createdAt().orElse(null)); row.put("like_count", tweet.likeCount().orElse(0L)); row.put("reply_count", tweet.replyCount().orElse(0L)); row.put("retweet_count", tweet.retweetCount().orElse(0L)); row.put("quote_count", tweet.quoteCount().orElse(0L)); row.put("view_count", tweet.viewCount().orElse(0L)); row.put("bookmark_count", tweet.bookmarkCount().orElse(0L)); row.put("is_note_tweet", tweet.isNoteTweet().orElse(false)); row.put("page_index", pageIndex); row.put("page_cursor", pageCursor); row.put("next_cursor", page.hasNextPage() ? page.nextCursor() : null); row.put("has_next_page", page.hasNextPage()); List csvRow = new ArrayList<>(); for (String header : headers) { csvRow.add(row.get(header)); } jsonlWriter.write(objectMapper.writeValueAsString(row)); jsonlWriter.newLine(); writeCsvRow(csvWriter, csvRow); } pageIndex++; cursor = page.hasNextPage() ? page.nextCursor() : null; } while (cursor != null && !cursor.isEmpty()); } static void writeCsvRow(BufferedWriter writer, List values) throws IOException { for (int index = 0; index < values.size(); index++) { if (index > 0) { writer.write(","); } Object value = values.get(index); String cell = value == null ? "" : String.valueOf(value); writer.write("\"" + cell.replace("\"", "\"\"") + "\""); } writer.newLine(); } ``` ### Request mapping > [card] .q() > > Java builder method `.q()` maps to REST `q`. Use it for an X (Twitter) search query. Examples are `from:username`, a keyword, hashtag, or boolean operator query. > [card] .limit() > > Java builder method `.limit()` maps to REST `limit`. Use it as a 1 to 200 upper bound for a bounded pull. If `page.hasNextPage()` is true, keep the same `.q()`, filters, `.queryType()`, and `.limit()`. Do so when you continue with `page.nextCursor()`. > [card] .cursor() > > Java builder method `.cursor()` maps to REST `cursor`. Pass the opaque cursor from `page.nextCursor()` to request the next page. > [card] .sinceTime() > > Java builder method `.sinceTime()` maps to REST `sinceTime`. Use it as the ISO 8601 lower bound for tweet creation time. > [card] .untilTime() > > Java builder method `.untilTime()` maps to REST `untilTime`. Use it as the ISO 8601 upper bound for tweet creation time. > [card] .queryType() > > Java builder method `.queryType()` maps to REST `queryType`. Use `QueryType.LATEST` for chronological search or `QueryType.TOP` for engagement-ranked search. ### Returned data & handoff `client.x().tweets().search` returns `PaginatedTweets`. Use `page.tweets()` for the tweet list. Use `page.hasNextPage()` to decide whether another page exists. Use `page.nextCursor()` as the checkpoint for the next request. For bounded pulls that return fewer tweets than the requested `.limit()`, resume from `page.nextCursor()`. To do that, pass `page.nextCursor()` back as `.cursor()`. Send the same query, filters, `QueryType`, and `.limit()` with that cursor. Each `SearchTweet` includes generated accessors such as `id()`, `text()`, `author()`, and `createdAt()`. Others are `likeCount()`, `replyCount()`, `retweetCount()`, `quoteCount()`, `viewCount()`, and `bookmarkCount()`. It also includes `isNoteTweet()` when available. Project `page.tweets()` into JSON Lines and CSV rows with `tweet_id`, `author_username`, and engagement counts. Rows also carry `page_index`, `page_cursor`, `next_cursor`, and `has_next_page`. Workers can then resume. They can also load the same records into XLSX, CRM, warehouse, or agent workflows. Tweet search costs 1 credit per tweet returned. Remaining credits may not cover a bounded `.limit()` request. If so, the API can return fewer tweets. If 0 paid results are affordable, it returns `402 insufficient_credits`. The SDK supports `withOptions()` for retry and request settings. For explicit `.limit()` pulls, resume with the same query, filters, `QueryType`, and `.limit()`. Only `.cursor()` changes. ## Next steps * [Java SDK setup](/sdks/java) * [Follower export](/sdks/java-follower-export) * [Media tweets](/sdks/java-media-tweets) # Kotlin X (Twitter) API SDK for search & exports Source: https://docs.xquik.com/sdks/kotlin Use Xquik's Kotlin SDK to search tweets, export JSON Lines, CSV, or XLSX, post media tweets, upload media, send DMs, and build durable JVM X API workers. > For the complete documentation index, see [llms.txt](/llms.txt). ## Distinct Kotlin fit Use Kotlin for nullable models, builders, sync and async calls, and JVM workers. Use Java for Java services or C# for .NET. Use the Kotlin SDK for generated JVM models, nullable values, and builders. Use it for sync calls, async calls, typed exceptions, retries, and file upload helpers. It fits Ktor workers, Spring jobs, queue consumers, and scheduled tasks. Search tweets, export followers, monitor tweets, post media, upload files, or send direct messages. Hand tweet, follower, reply, and profile rows to downstream systems. | Kotlin task | SDK call | Save | | - | - | - | | Search tweets | `client.x().tweets().search` | Store `page.nextCursor()` after every page. | | Estimate exports | `client.extractions().estimateCost` | Store the estimate and `allowed()` decision. | | Start an extraction | `client.extractions().run` | Save `job.id()` immediately. | | Retrieve saved rows | `client.extractions().retrieve` | Keep `nextCursor()` while `hasMore()` is true. | | Export CSV, JSON, or XLSX | `client.extractions().exportResults` | Record the job ID, format, and file destination. | | Create a tweet | `client.x().tweets().withRawResponse().create` | Store the write action ID and terminal state. | ## Install Add the Gradle dependency from [Maven Central](https://repo1.maven.org/maven2/com/xquik/api/x-twitter-scraper-kotlin/). ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} implementation("com.xquik.api:x-twitter-scraper-kotlin:0.9.3") ``` Or add the Maven dependency. ```xml theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} com.xquik.api x-twitter-scraper-kotlin 0.9.3 ``` ## Authenticate ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` Build the client from the environment. ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} val client = XTwitterScraperOkHttpClient.fromEnv() ``` It reads `X_TWITTER_SCRAPER_API_KEY`, `X_TWITTER_SCRAPER_BEARER_TOKEN`, and `X_TWITTER_SCRAPER_BASE_URL`. ## Basic example Search tweets and write durable JSON Lines handoff rows. ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import com.fasterxml.jackson.databind.ObjectMapper import com.x_twitter_scraper.api.client.XTwitterScraperClient import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient import com.x_twitter_scraper.api.models.PaginatedTweets import com.x_twitter_scraper.api.models.SearchTweet import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams val client: XTwitterScraperClient = XTwitterScraperOkHttpClient.fromEnv() val objectMapper = ObjectMapper() val params: TweetSearchParams = TweetSearchParams.builder() .q("from:username webhook OR SDK") .limit(10L) .build() val page: PaginatedTweets = client.x().tweets().search(params) for (tweet: SearchTweet in page.tweets()) { val row = linkedMapOf( "tweet_id" to tweet.id(), "text" to tweet.text(), "author_username" to tweet.author()?.username(), "created_at" to tweet.createdAt(), ) println(objectMapper.writeValueAsString(row)) } ``` ## Kotlin SDK workflows | Workflow | What it does | | - | - | | [Tweet search](/sdks/kotlin-tweet-search) | Search tweets, follow cursors & save JSON Lines, CSV, or XLSX files. | | [Follower export](/sdks/kotlin-follower-export) | Run a follower extraction & save CSV, JSON, or XLSX files. | | [Media tweets](/sdks/kotlin-media-tweets) | Upload media, post media tweets & send DM attachments. | ## Tweet replies workflow to CSV, JSON, or XLSX Use this workflow when a Kotlin worker needs every reply as a durable file. The parent can be a campaign, support thread, launch post, or incident update. `reply_extractor` requires `targetTweetId`. Estimate first, run the job, and poll `retrieve`. Then export the completed job as CSV, JSON, or XLSX. Reuse the follower export loop above. Change only the required target, tool type, and output names. ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} val targetTweetId = "1893704267862470862" val estimate: ExtractionEstimateCostResponse = client.extractions().estimateCost( ExtractionEstimateCostParams.builder() .toolType(ExtractionEstimateCostParams.ToolType.REPLY_EXTRACTOR) .targetTweetId(targetTweetId) .build() ) val job: ExtractionRunResponse = client.extractions().run( ExtractionRunParams.builder() .toolType(ExtractionRunParams.ToolType.REPLY_EXTRACTOR) .targetTweetId(targetTweetId) .build() ) val pageParams = ExtractionRetrieveParams.builder() .id(job.id()) .limit(1000L) if (!cursor.isNullOrEmpty()) { pageParams.cursor(cursor) } val page: ExtractionRetrieveResponse = client.extractions().retrieve(pageParams.build()) ``` Store `job.id()` before polling. A queue retry uses it to resume the read. After completion, it can repeat the export. ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} client.extractions().retrieve(job.id()) client.extractions().exportResults(...) ``` Stream `page.results()` to `Paths.get("xquik-replies.jsonl")`. Keep `page.nextCursor()` as the checkpoint while streaming replies to JSON Lines. Pass it back as `cursor` on the next page request. The code above builds that request with the `ExtractionRetrieveParams` builder. Keep the same `estimate.allowed()` credit branch from the follower export workflow before calling `run`. Export the completed job with the same helper used above. ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} client.extractions().exportResults( ExtractionExportResultsParams.builder() .id(job.id()) .format(ExtractionExportResultsParams.Format.CSV) .build() ).use { export -> Files.copy(export.body(), Paths.get("xquik-replies.csv"), StandardCopyOption.REPLACE_EXISTING) } ``` Repeat the export with each format to write `Paths.get("xquik-replies.json")` and `Paths.get("xquik-replies.xlsx")`. ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} ExtractionExportResultsParams.Format.JSON ExtractionExportResultsParams.Format.XLSX ``` 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. The cost is 1 credit per reply extracted or returned. ## Error handling The Kotlin SDK uses the same generated exception hierarchy as the Java SDK. * **400 Bad request.** Throws `BadRequestException`. * **401 Unauthorized.** Throws `UnauthorizedException`. * **403 Permission denied.** Throws `PermissionDeniedException`. * **404 Not found.** Throws `NotFoundException`. * **422 Validation error.** Throws `UnprocessableEntityException`. * **429 Rate limited.** Throws `RateLimitException`. * **5xx server error.** Throws `InternalServerException`. Connection and I/O failures use `XTwitterScraperIoException`. All SDK exceptions inherit from `XTwitterScraperException`. ## Pagination Paginated responses expose generated fields such as `hasNextPage`. Use endpoint cursor parameters from the API reference for later requests. ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} if (tweets.hasNextPage()) { System.err.println("More results are available") } ``` ## Webhooks & references * [Search Tweets](/api-reference/x/search-tweets) * [Create Tweet](/api-reference/x-write/create-tweet) * [Get Write Action Status](/api-reference/x-write/get-write-action-status) * [Upload Media](/api-reference/x-write/upload-media) * [Send Direct Message](/api-reference/x-write/send-dm) * [Create Monitor](/api-reference/monitors/create) * [Webhook Overview](/webhooks/overview) * [Verify HMAC Signatures](/webhooks/verification) * [REST API Overview](/api-reference/overview) * [Source Repository](https://github.com/Xquik-dev/x-twitter-scraper-kotlin) # X (Twitter) API Kotlin follower export to CSV & XLSX Source: https://docs.xquik.com/sdks/kotlin-follower-export Export X (Twitter) followers with the Xquik Kotlin SDK. Estimate the job, run the extraction, and save CSV, JSON, or XLSX files for your team and your CRM. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Kotlin SDK setup](/sdks/kotlin), which covers install and authentication. ## Follower export workflow to CSV, JSON, or XLSX Use this workflow when a Kotlin worker needs an owned follower list. It feeds CRMs, warehouses, account scoring, analyst CSVs, XLSX workbooks, or resumable JSON handoffs. `client.extractions().estimateCost` maps to `POST /extractions/estimate`, and `client.extractions().run` maps to `POST /extractions`. `client.extractions().retrieve` maps to `GET /extractions/{id}`, and `client.extractions().exportResults` maps to `GET /extractions/{id}/export`. For follower exports, `follower_explorer` requires `targetUsername`. > [!NOTE] > > `client.extractions().run` returns the queued `202 Accepted` receipt from `POST /extractions`. Kotlin exposes REST `id`, `toolType`, and `status: "running"` as `job.id()`, `job.toolType()`, and `job._status()`. Store `job.id()` immediately, then poll `client.extractions().retrieve` before reading pages or calling `client.extractions().exportResults`. Credit reservation happens after the job starts. Available credits can change after `estimateCost`. If they did, the run can fetch only the affordable count before export. In that case it can instead mark the job `failed` with `insufficient_credits`. ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import com.fasterxml.jackson.databind.ObjectMapper import com.x_twitter_scraper.api.client.XTwitterScraperClient import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient import com.x_twitter_scraper.api.models.extractions.ExtractionEstimateCostParams import com.x_twitter_scraper.api.models.extractions.ExtractionEstimateCostResponse import com.x_twitter_scraper.api.models.extractions.ExtractionExportResultsParams import com.x_twitter_scraper.api.models.extractions.ExtractionRetrieveParams import com.x_twitter_scraper.api.models.extractions.ExtractionRetrieveResponse import com.x_twitter_scraper.api.models.extractions.ExtractionRunParams import com.x_twitter_scraper.api.models.extractions.ExtractionRunResponse import java.nio.charset.StandardCharsets import java.nio.file.Files import java.nio.file.Paths import java.nio.file.StandardCopyOption val client: XTwitterScraperClient = XTwitterScraperOkHttpClient.fromEnv() val objectMapper = ObjectMapper() val targetUsername = "username" val estimate: ExtractionEstimateCostResponse = client.extractions().estimateCost( ExtractionEstimateCostParams.builder() .toolType(ExtractionEstimateCostParams.ToolType.FOLLOWER_EXPLORER) .targetUsername(targetUsername) .build() ) if (!estimate.allowed()) { error("Follower export requires ${estimate.creditsRequired()} credits.") } val job: ExtractionRunResponse = client.extractions().run( ExtractionRunParams.builder() .toolType(ExtractionRunParams.ToolType.FOLLOWER_EXPLORER) .targetUsername(targetUsername) .build() ) var completed = false var attempts = 0 while (!completed && attempts < 120) { val statusPage = client.extractions().retrieve(job.id()) val status = statusPage.job()._additionalProperties()["status"]?.asString() ?: "unknown" if (status == "completed") { completed = true } else if (status == "failed") { error("Follower export failed.") } else { Thread.sleep(10_000L) } attempts += 1 } if (!completed) { error("Follower export did not complete before timeout.") } var cursor: String? = null Files.newBufferedWriter(Paths.get("xquik-followers.jsonl"), StandardCharsets.UTF_8).use { writer -> do { val pageParams = ExtractionRetrieveParams.builder() .id(job.id()) .limit(1000L) if (!cursor.isNullOrEmpty()) { pageParams.cursor(cursor) } val page: ExtractionRetrieveResponse = client.extractions().retrieve(pageParams.build()) for (row in page.results()) { writer.write(objectMapper.writeValueAsString(row._additionalProperties())) writer.newLine() } cursor = if (page.hasMore()) page.nextCursor() else null } while (!cursor.isNullOrEmpty()) } client.extractions().exportResults( ExtractionExportResultsParams.builder() .id(job.id()) .format(ExtractionExportResultsParams.Format.CSV) .build() ).use { export -> Files.copy(export.body(), Paths.get("xquik-followers.csv"), StandardCopyOption.REPLACE_EXISTING) } client.extractions().exportResults( ExtractionExportResultsParams.builder() .id(job.id()) .format(ExtractionExportResultsParams.Format.JSON) .build() ).use { export -> Files.copy(export.body(), Paths.get("xquik-followers.json"), StandardCopyOption.REPLACE_EXISTING) } client.extractions().exportResults( ExtractionExportResultsParams.builder() .id(job.id()) .format(ExtractionExportResultsParams.Format.XLSX) .build() ).use { export -> Files.copy(export.body(), Paths.get("xquik-followers.xlsx"), StandardCopyOption.REPLACE_EXISTING) } ``` Store `job.id()`, `targetUsername`, `estimate.estimatedResults()`, and `estimate.source()` before polling so retries can resume the extraction. `client.extractions().retrieve` returns `results()`, `hasMore()`, and `nextCursor()`. Pass `nextCursor()` back as `cursor` to page large follower lists. Map exported `User ID` or row `xUserId` as the CRM unique key. Use `xquik-followers.jsonl` for queue replay or warehouse loads and `xquik-followers.json` for app ingestion. Use `xquik-followers.csv` for CRM import and `xquik-followers.xlsx` for analyst handoff. The cost is 1 credit per follower extracted or returned. Exports are free after the extraction job exists. ## Next steps * [Kotlin SDK setup](/sdks/kotlin) * [Tweet search](/sdks/kotlin-tweet-search) * [Media tweets](/sdks/kotlin-media-tweets) # X (Twitter) API Kotlin media tweets & DM attachments Source: https://docs.xquik.com/sdks/kotlin-media-tweets Upload media with the Xquik Kotlin SDK, post tweets with photos or video, and send DM attachments from a connected X (Twitter) account in your own apps. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Kotlin SDK setup](/sdks/kotlin), which covers install and authentication. ## Workflow to post media tweets and DM attachments Use this workflow to post a media tweet or reply. It can also DM an uploaded local file. `client.x().tweets().create` maps to `POST /x/tweets`. Pass public media URLs through `.addMedia()` or `.media()`. Send up to 4 image URLs or exactly 1 MP4 video URL. The video can be up to 100 MB. Do not mix video with other media. For replies, set `.replyToTweetId()` to the parent tweet ID. `client.x().media().upload` maps to `POST /x/media`. Use `media.mediaId()` only for the one-item DM `.addMediaId()` handoff. ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import com.fasterxml.jackson.core.type.TypeReference import com.fasterxml.jackson.databind.ObjectMapper import com.x_twitter_scraper.api.client.XTwitterScraperClient import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient import com.x_twitter_scraper.api.core.http.HttpResponseFor import com.x_twitter_scraper.api.models.x.dm.DmSendParams import com.x_twitter_scraper.api.models.x.dm.DmSendResponse import com.x_twitter_scraper.api.models.x.media.MediaUploadParams import com.x_twitter_scraper.api.models.x.media.MediaUploadResponse import com.x_twitter_scraper.api.models.x.tweets.TweetCreateParams import com.x_twitter_scraper.api.models.x.tweets.TweetCreateResponse import java.nio.file.Paths val client: XTwitterScraperClient = XTwitterScraperOkHttpClient.fromEnv() val objectMapper = ObjectMapper() fun createTweetHandoff( payload: Map, base: Map, ): Map { val handoff = linkedMapOf() val billing = payload["billing"] as Map<*, *> val request = payload["request"] as Map<*, *> val result = payload["result"] as? Map<*, *> val terminal = payload["terminal"] == true handoff["status"] = payload["status"] handoff["terminal"] = terminal handoff["safe_to_retry"] = payload["safeToRetry"] handoff["write_action_id"] = payload["id"] handoff["request_hash"] = request["hash"] handoff["tweet_id"] = result?.get("id") ?: payload["tweetId"] handoff["charged"] = billing["charged"] handoff["charged_credits"] = billing["chargedCredits"] handoff["poll"] = if (terminal) null else payload["statusUrl"] handoff.putAll(base) return handoff } val tweetPayload: Map = client.x().tweets().withRawResponse().create( TweetCreateParams.builder() .account("@username") .text("Shipping the weekly X API video.") .addMedia("https://static.example.com/reports/x-api-export.mp4") .build() ).use { response: HttpResponseFor -> objectMapper.readValue( response.body(), object : TypeReference>() {}, ) } val tweetHandoff = createTweetHandoff( tweetPayload, linkedMapOf( "account" to "@username", "media" to listOf("https://static.example.com/reports/x-api-export.mp4"), ), ) val replyPayload: Map = client.x().tweets().withRawResponse().create( TweetCreateParams.builder() .account("@username") .text("Here is the chart behind the update.") .addMedia("https://static.example.com/reports/reply-chart.png") .replyToTweetId("1893704267862470862") .build() ).use { response: HttpResponseFor -> objectMapper.readValue( response.body(), object : TypeReference>() {}, ) } val replyHandoff = createTweetHandoff( replyPayload, linkedMapOf( "account" to "@username", "reply_to_tweet_id" to "1893704267862470862", "media" to listOf("https://static.example.com/reports/reply-chart.png"), ), ) val media: MediaUploadResponse = client.x().media().upload( MediaUploadParams.builder() .account("@username") .file(Paths.get("handoff.png")) .build() ) val dm: DmSendResponse = client.x().dm().send( "44196397", DmSendParams.builder() .account("@username") .text("Here is the requested asset.") .addMediaId(media.mediaId()) .build() ) val dmHandoff = linkedMapOf( "status" to "sent", "message_id" to dm.messageId(), "media_id" to media.mediaId(), "account" to "@username", "user_id" to "44196397", ) println(objectMapper.writeValueAsString(tweetHandoff)) println(objectMapper.writeValueAsString(replyHandoff)) println(objectMapper.writeValueAsString(dmHandoff)) ``` Use `client.x().tweets().withRawResponse().create(...)` to capture the durable write action. Send a unique `Idempotency-Key`. Store `id`, `request.hash`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. Keep DM body text in private systems. Shared logs and handoffs should store `message_id`, optional `media_id`, `account`, `user_id`, and lifecycle status. Leave `replyToMessageId` unset because the REST endpoint rejects DM reply threading. `client.x().dm().deleteMessage` [deletes a DM](/api-reference/x-write/delete-dm). Use public media URLs with `client.x().tweets().create`. Do not pass uploaded `media.mediaId()` values to tweet creation. ### REST routes | Task | REST route | Reference | | - | - | - | | Post a media tweet or reply | `POST /x/tweets` | [Create tweet](/api-reference/x-write/create-tweet) | | Upload a local file | `POST /x/media` | [Upload media](/api-reference/x-write/upload-media) | | Send a DM attachment | `POST /x/dm/{userId}` | [Send DM](/api-reference/x-write/send-dm) | | Check a write action | `GET /x/write-actions/{id}` | [Write action status](/api-reference/x-write/get-write-action-status) | | Delete a DM | `DELETE /x/dm/{userId}/messages/{messageId}` | [Delete DM](/api-reference/x-write/delete-dm) | ## Next steps * [Kotlin SDK setup](/sdks/kotlin) * [Tweet search](/sdks/kotlin-tweet-search) * [Follower export](/sdks/kotlin-follower-export) # X (Twitter) API Kotlin tweet search to CSV & JSONL Source: https://docs.xquik.com/sdks/kotlin-tweet-search Search tweets with the Xquik Kotlin SDK, follow cursors, and save rows as JSON Lines, CSV, or XLSX for workers, queues, and analysts in your own apps and jobs. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Kotlin SDK setup](/sdks/kotlin), which covers install and authentication. ## Tweet search workflow to JSON Lines, CSV, or XLSX Export tweet search from Kotlin services, scheduled workers, queues, or agents. Save files for data lakes, CRM enrichment, CSV, XLSX, or downstream processing. `client.x().tweets().search` calls `GET /x/tweets/search`. Build `TweetSearchParams` with the REST query parameters `.q()`, `.limit()`, `.cursor()`, `.sinceTime()`, `.untilTime()`, and `.queryType()`. ```kotlin theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import com.fasterxml.jackson.databind.ObjectMapper import com.x_twitter_scraper.api.client.XTwitterScraperClient import com.x_twitter_scraper.api.client.okhttp.XTwitterScraperOkHttpClient import com.x_twitter_scraper.api.models.PaginatedTweets import com.x_twitter_scraper.api.models.SearchTweet import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams import com.x_twitter_scraper.api.models.x.tweets.TweetSearchParams.QueryType import java.io.BufferedWriter import java.nio.charset.StandardCharsets import java.nio.file.Files import java.nio.file.Paths val client: XTwitterScraperClient = XTwitterScraperOkHttpClient.fromEnv() val objectMapper = ObjectMapper() val query = "from:username webhook OR SDK" var cursor: String? = null var pageIndex = 0 val headers = listOf( "source", "query", "tweet_id", "text", "author_id", "author_username", "author_name", "created_at", "like_count", "reply_count", "retweet_count", "quote_count", "view_count", "bookmark_count", "is_note_tweet", "page_index", "page_cursor", "next_cursor", "has_next_page", ) Files.newBufferedWriter(Paths.get("xquik-tweet-search.jsonl"), StandardCharsets.UTF_8).use { jsonlWriter -> Files.newBufferedWriter(Paths.get("xquik-tweet-search.csv"), StandardCharsets.UTF_8).use { csvWriter -> writeCsvRow(csvWriter, headers) do { val pageCursor = cursor val builder = TweetSearchParams.builder() .q(query) .queryType(QueryType.LATEST) if (!cursor.isNullOrEmpty()) { builder.cursor(cursor) } val page: PaginatedTweets = client.x().tweets().search(builder.build()) for (tweet: SearchTweet in page.tweets()) { val author = tweet.author() val row = linkedMapOf( "source" to "xquik.kotlin.search", "query" to query, "tweet_id" to tweet.id(), "text" to tweet.text(), "author_id" to author?.id(), "author_username" to author?.username(), "author_name" to author?.name(), "created_at" to tweet.createdAt(), "like_count" to (tweet.likeCount() ?: 0L), "reply_count" to (tweet.replyCount() ?: 0L), "retweet_count" to (tweet.retweetCount() ?: 0L), "quote_count" to (tweet.quoteCount() ?: 0L), "view_count" to (tweet.viewCount() ?: 0L), "bookmark_count" to (tweet.bookmarkCount() ?: 0L), "is_note_tweet" to (tweet.isNoteTweet() ?: false), "page_index" to pageIndex, "page_cursor" to pageCursor, "next_cursor" to if (page.hasNextPage()) page.nextCursor() else null, "has_next_page" to page.hasNextPage(), ) jsonlWriter.write(objectMapper.writeValueAsString(row)) jsonlWriter.newLine() writeCsvRow(csvWriter, headers.map { header -> row[header] }) } pageIndex++ cursor = if (page.hasNextPage()) page.nextCursor() else null } while (!cursor.isNullOrEmpty()) } } fun writeCsvRow(writer: BufferedWriter, values: List) { writer.write( values.joinToString(",") { value -> val cell = value?.toString() ?: "" "\"" + cell.replace("\"", "\"\"") + "\"" } ) writer.newLine() } ``` ### Request mapping > [card] .q() > > Kotlin builder method `.q()` maps to REST `q`. Use it for an X (Twitter) search query. Examples are `from:username`, a keyword, hashtag, or boolean operator query. > [card] .limit() > > Kotlin builder method `.limit()` maps to REST `limit`. Use it as a 1 to 200 upper bound for a bounded pull. If `page.hasNextPage()` is true, keep the same `.q()`, filters, `.queryType()`, and `.limit()`. Then continue with `page.nextCursor()`. > [card] .cursor() > > Kotlin builder method `.cursor()` maps to REST `cursor`. Pass the opaque cursor from `page.nextCursor()` to request the next page. > [card] .sinceTime() > > Kotlin builder method `.sinceTime()` maps to REST `sinceTime`. Use it as the ISO 8601 lower bound for tweet creation time. > [card] .untilTime() > > Kotlin builder method `.untilTime()` maps to REST `untilTime`. Use it as the ISO 8601 upper bound for tweet creation time. > [card] .queryType() > > Kotlin builder method `.queryType()` maps to REST `queryType`. Use `QueryType.LATEST` for chronological search or `QueryType.TOP` for engagement-ranked search. ### Returned data & handoff `client.x().tweets().search` returns `PaginatedTweets`. Use `page.tweets()` for the tweet list. Use `page.hasNextPage()` to decide whether another page exists. Use `page.nextCursor()` as the checkpoint for the next request. For bounded pulls that return fewer tweets than the requested `.limit()`, keep paging. Then pass `page.nextCursor()` back as `.cursor()` with the same query, filters, `QueryType`, and `.limit()`. Each `SearchTweet` includes generated accessors such as `id()`, `text()`, `author()`, and `createdAt()`. It also has `likeCount()`, `replyCount()`, `retweetCount()`, `quoteCount()`, `viewCount()`, `bookmarkCount()`, and `isNoteTweet()` when available. Project `page.tweets()` into JSON Lines and CSV rows. Rows carry `tweet_id`, `author_username`, engagement counts, `page_index`, `page_cursor`, `next_cursor`, and `has_next_page`. Workers can then resume or load the same records. They can load them into XLSX, CRM, warehouse, or agent workflows. Tweet search costs 1 credit per tweet returned. Remaining credits may not cover a bounded `.limit()` request. If so, the API can return fewer tweets. If 0 paid results are affordable, it returns `402 insufficient_credits`. The SDK supports `withOptions()` for retry and request settings. For explicit `.limit()` pulls, resume with the same query, filters, `QueryType`, and `.limit()`. Only `.cursor()` changes. ## Next steps * [Kotlin SDK setup](/sdks/kotlin) * [Follower export](/sdks/kotlin-follower-export) * [Media tweets](/sdks/kotlin-media-tweets) # PHP X (Twitter) API SDK for tweet search & exports Source: https://docs.xquik.com/sdks/php Use Xquik's PHP SDK to search tweets, export replies to JSON Lines, CSV, or XLSX, post media tweets, upload media, send DMs, and run durable X API workers. > For the complete documentation index, see [llms.txt](/llms.txt). Use PHP 8.1+ named parameters and typed exceptions in Laravel or Symfony workers. Search tweets, export followers or replies, post media, upload files, and send DMs. | PHP task | SDK call | Save | | - | - | - | | Search tweets | `$client->x->tweets->search()` | `$page->nextCursor` | | Export followers | `$client->extractions->run()` | `$job->id` | ## Install ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} composer require xquik/x-twitter-scraper ``` If your project needs the GitHub source, add the repository in `composer.json`. The [source repository](https://github.com/Xquik-dev/x-twitter-scraper-php) shows the entry. ## Authenticate ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` ## Basic example Search tweets and write durable JSON Lines handoff rows. ```php theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x->tweets->search( q: 'from:username webhook OR SDK', limit: 10, ); foreach ($page->tweets as $tweet) { $row = [ 'tweet_id' => $tweet->id, 'text' => $tweet->text, 'author_username' => $tweet->author?->username, 'created_at' => $tweet->createdAt, ]; echo json_encode($row, JSON_THROW_ON_ERROR) . PHP_EOL; } ``` ## PHP SDK workflows | Workflow | What it does | | - | - | | [Tweet search](/sdks/php-tweet-search) | Search tweets, follow cursors & save JSON Lines, CSV, or XLSX files. | | [Follower export](/sdks/php-follower-export) | Run a follower extraction & save CSV, JSON, or XLSX files. | | [Media tweets](/sdks/php-media-tweets) | Upload media, post media tweets & send DM attachments. | ## Tweet replies workflow to CSV, JSON, or XLSX Use this workflow when a PHP worker needs every reply on a public tweet. The worker needs them in a durable file. The file can feed moderation review or customer support triage. It can also feed an analyst export or a warehouse loader. `$client->extractions->estimateCost()` and `$client->extractions->run()` map to the extraction workflow. For tweet replies, use `ToolType::REPLY_EXTRACTOR`. `reply_extractor` requires `targetTweetID`. `$client->extractions->retrieve()` returns `results`, `hasMore`, and `nextCursor` for pagination. `$client->extractions->exportResults()` returns the completed job as a string. It supports `CSV`, `JSON`, and `XLSX` export formats. Reuse the polling, JSON Lines pagination, and export structure from the follower workflow. Only the tool type, target field, and filenames change. ```php theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} $targetTweetID = '1893704267862470862'; $estimate = $client->extractions->estimateCost( toolType: EstimateToolType::REPLY_EXTRACTOR, targetTweetID: $targetTweetID, ); if (!$estimate->allowed) { throw new RuntimeException('Insufficient credits for reply extraction.'); } $job = $client->extractions->run( toolType: RunToolType::REPLY_EXTRACTOR, targetTweetID: $targetTweetID, ); // Run the same polling loop and JSONL pagination loop from the follower workflow. // Set the JSON Lines destination to fopen('xquik-replies.jsonl', 'wb'). file_put_contents( 'xquik-replies.csv', $client->extractions->exportResults($job->id, format: ExportFormat::CSV), ); file_put_contents( 'xquik-replies.json', $client->extractions->exportResults($job->id, format: ExportFormat::JSON), ); file_put_contents( 'xquik-replies.xlsx', $client->extractions->exportResults($job->id, format: ExportFormat::XLSX), ); ``` The cost is 1 credit per reply extracted or returned. Store `$job->id` on the queue job, ticket, or warehouse batch before polling. With that ID, another worker can resume by calling `$client->extractions->retrieve()`. Keep `$page->nextCursor` as the checkpoint. Pass it back as `cursor` when you stream replies to JSON Lines. 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. ## Error handling The SDK throws subclasses of `XTwitterScraper\Core\Exceptions\APIException`. > [card] 400 Bad request > > Throws `BadRequestException`. > [card] 401 Unauthorized > > Throws `AuthenticationException`. > [card] 403 Permission denied > > Throws `PermissionDeniedException`. > [card] 404 Not found > > Throws `NotFoundException`. > [card] 422 Validation error > > Throws `UnprocessableEntityException`. > [card] 429 Rate limited > > Throws `RateLimitException`. > [card] 5xx server error > > Throws `InternalServerException`. ```php theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} account->retrieve(); } catch (APIConnectionException $e) { fwrite(STDERR, "Connection failed\n"); } catch (APIStatusException $e) { fwrite(STDERR, $e->getMessage() . PHP_EOL); } ``` ## Pagination Paginated responses expose fields such as `hasNextPage`. Pass the endpoint's cursor fields when requesting more pages. ```php theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x->tweets->search(q: 'xquik', limit: 20); if ($page->hasNextPage) { fwrite(STDERR, "More results are available\n"); } ``` ## Webhooks & references * [Search Tweets](/api-reference/x/search-tweets) * [Create Tweet](/api-reference/x-write/create-tweet) * [Upload Media](/api-reference/x-write/upload-media) * [Send Direct Message](/api-reference/x-write/send-dm) * [Create Monitor](/api-reference/monitors/create) * [Webhook Overview](/webhooks/overview) * [Verify HMAC Signatures](/webhooks/verification) * [REST API Overview](/api-reference/overview) * [Source Repository](https://github.com/Xquik-dev/x-twitter-scraper-php) # X (Twitter) API PHP follower export to CSV & XLSX Source: https://docs.xquik.com/sdks/php-follower-export Export X (Twitter) followers with the Xquik PHP SDK. Estimate the job, run the extraction, and save CSV, JSON, or XLSX files for your team and your CRM tools. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [PHP SDK setup](/sdks/php), which covers install and authentication. ## Follower export workflow to CSV, JSON, or XLSX Use this workflow when PHP code needs an owned follower list. That code can be a worker, Laravel command, Symfony console command, or cron job. The list can feed CRM import, warehouse loading, or account scoring. It can also feed an analyst CSV, XLSX delivery, or a resumable JSON handoff. `$client->extractions->estimateCost()` maps to `POST /extractions/estimate`. `$client->extractions->run()` maps to `POST /extractions`. `$client->extractions->retrieve()` maps to `GET /extractions/{id}`. `$client->extractions->exportResults()` maps to `GET /extractions/{id}/export`. For follower exports, `follower_explorer` requires `targetUsername`. > [!NOTE] > > `$client->extractions->run()` returns the queued `202 Accepted` receipt from `POST /extractions`. PHP exposes REST `id`, `toolType`, and `status: "running"` as `$job->id`, `$job->toolType`, and `$job->status`. Store `$job->id` immediately, then poll `$client->extractions->retrieve()` before reading pages or calling `$client->extractions->exportResults()`. Credit reservation happens after the job starts. Available credits may have changed since `estimateCost`. If so, the run can fetch only the affordable count before export. Or it can mark the job `failed` with `insufficient_credits`. ```php theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} extractions->estimateCost( toolType: EstimateToolType::FOLLOWER_EXPLORER, targetUsername: $targetUsername, ); if (!$estimate->allowed) { throw new RuntimeException("Follower export requires {$estimate->creditsRequired} credits."); } $job = $client->extractions->run( toolType: RunToolType::FOLLOWER_EXPLORER, targetUsername: $targetUsername, ); $completed = false; for ($attempt = 0; $attempt < 120; $attempt++) { $statusPage = $client->extractions->retrieve($job->id, limit: 1); $status = $statusPage->job['status'] ?? null; if ('completed' === $status) { $completed = true; break; } if ('failed' === $status) { throw new RuntimeException('Follower export failed.'); } sleep(10); } if (!$completed) { throw new RuntimeException('Follower export did not complete before timeout.'); } $cursor = null; $handle = fopen('xquik-followers.jsonl', 'wb'); if (false === $handle) { throw new RuntimeException('Could not open xquik-followers.jsonl'); } try { do { $page = $client->extractions->retrieve($job->id, cursor: $cursor, limit: 1000); foreach ($page->results as $user) { fwrite( $handle, json_encode($user, JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR) . PHP_EOL ); } $cursor = $page->hasMore ? $page->nextCursor : null; } while (null !== $cursor && '' !== $cursor); } finally { fclose($handle); } file_put_contents( 'xquik-followers.csv', $client->extractions->exportResults($job->id, format: ExportFormat::CSV), ); file_put_contents( 'xquik-followers.json', $client->extractions->exportResults($job->id, format: ExportFormat::JSON), ); file_put_contents( 'xquik-followers.xlsx', $client->extractions->exportResults($job->id, format: ExportFormat::XLSX), ); ``` Store `$job->id`, `$targetUsername`, `$estimate->estimatedResults`, and `$estimate->source` before polling. With them, another queue worker can resume without rerunning the extraction. `$client->extractions->retrieve()` returns `$page->results`, `$page->hasMore`, and `$page->nextCursor`. Pass `$page->nextCursor` back as `cursor` to page through large follower lists. Map exported `User ID` or row `xUserId` as the CRM unique key. Use `xquik-followers.jsonl` for queue replay or warehouse loads, and `xquik-followers.json` for app ingestion. Use `xquik-followers.csv` for CRM import and `xquik-followers.xlsx` for analyst handoff. The cost is 1 credit per follower extracted or returned. Exports cost no credits after the extraction job exists. ## Next steps * [PHP SDK setup](/sdks/php) * [Tweet search](/sdks/php-tweet-search) * [Media tweets](/sdks/php-media-tweets) # X (Twitter) API PHP media tweets & DM attachments Source: https://docs.xquik.com/sdks/php-media-tweets Upload media with the Xquik PHP SDK, post tweets with photos or video, and send DM attachments from a connected X (Twitter) account in your own apps and bots. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [PHP SDK setup](/sdks/php), which covers install and authentication. ## Workflow to post media tweets and DM attachments Use this workflow when a PHP app needs to publish a media tweet. Use it too when the app replies with media. It also covers a direct message with an uploaded local file. `POST /x/tweets` accepts public media URLs through `media`. Send up to 4 image URLs or exactly 1 MP4 video URL. The video can be up to 100 MB. Do not mix video with other media. For replies, set `replyToTweetID` to the parent tweet ID. `$client->x->media->upload()` maps to `POST /x/media`. Use its `$media->mediaID` only for the one-item `mediaIDs` array on `$client->x->dm->send()`. Use `$client->x->tweets->raw->create()` to capture the durable write action. Send a unique `Idempotency-Key`. Store `id`, `request.hash`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. ```php theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} $payload * * @return array */ function createTweetHandoff(Client $client, array $payload): array { $response = $client->x->tweets->raw->create(params: $payload); $action = json_decode( (string) $response->getBody(), true, flags: JSON_THROW_ON_ERROR, ); $result = $action['result'] ?? []; return [ 'status' => $action['status'], 'terminal' => $action['terminal'], 'safe_to_retry' => $action['safeToRetry'], 'write_action_id' => $action['id'], 'request_hash' => $action['request']['hash'], 'tweet_id' => $result['id'] ?? $action['tweetId'] ?? null, 'charged' => $action['billing']['charged'], 'charged_credits' => $action['billing']['chargedCredits'], 'poll' => $action['terminal'] ? null : $action['statusUrl'], ]; } $client = new Client( apiKey: getenv('X_TWITTER_SCRAPER_API_KEY') ?: '' ); $tweetHandoff = createTweetHandoff($client, [ 'account' => '@username', 'text' => 'Shipping the weekly X API video.', 'media' => ['https://static.example.com/reports/x-api-export.mp4'], ]); $replyHandoff = createTweetHandoff($client, [ 'account' => '@username', 'text' => 'Here is the chart behind the update.', 'media' => ['https://static.example.com/reports/reply-chart.png'], 'replyToTweetID' => $tweetHandoff['tweet_id'] ?? '1893704267862470862', ]); $localFile = fopen('handoff.png', 'rb'); if (false === $localFile) { throw new RuntimeException('Could not open handoff.png'); } try { $media = $client->x->media->upload( account: '@username', file: FileParam::fromResource($localFile), ); } finally { fclose($localFile); } $dm = $client->x->dm->send( '44196397', account: '@username', text: 'Here is the requested asset.', mediaIDs: [$media->mediaID], ); $dmHandoff = [ 'message_id' => $dm->messageID, 'media_id' => $media->mediaID, 'user_id' => '44196397', 'account' => '@username', 'status' => 'sent', ]; fwrite( STDOUT, json_encode( [ 'tweet_handoff' => $tweetHandoff, 'reply_handoff' => $replyHandoff, 'dm_handoff' => $dmHandoff, ], JSON_THROW_ON_ERROR ) . PHP_EOL ); ``` Store `write_action_id` and `charged_credits`. Before retrying a pending tweet or reply, poll [Get Write Action Status](/api-reference/x-write/get-write-action-status). Store `tweet_id` on the CMS, queue job, or agent state after confirmed writes. Store `$dm->messageID`, `$media->mediaID`, `account`, `user_id`, and send status. Put them on the support ticket or CRM note. Keep DM body text in private systems. Shared logs, public artifacts, queue status, and agent handoffs should omit full DM bodies. They should store `message_id`, optional `media_id`, `account`, `user_id`, and send status. Leave generated `replyToMessageID` unset even if SDK params expose it. The REST endpoint rejects DM reply threading. Text-only tweet and reply writes cost 30 credits. Tweet media adds 2 credits per started MB across attached files. Uploading media costs 10 credits. Sending the DM costs 10 credits. Do not pass uploaded `$media->mediaID` values to `$client->x->tweets->create()`. That method uses `media` with public media URLs. `$client->x->dm->deleteMessage()` [deletes a DM](/api-reference/x-write/delete-dm). ### REST routes | Task | REST route | Reference | | - | - | - | | Post a media tweet or reply | `POST /x/tweets` | [Create tweet](/api-reference/x-write/create-tweet) | | Upload a local file | `POST /x/media` | [Upload media](/api-reference/x-write/upload-media) | | Send a DM attachment | `POST /x/dm/{userId}` | [Send DM](/api-reference/x-write/send-dm) | | Check a write action | `GET /x/write-actions/{id}` | [Write action status](/api-reference/x-write/get-write-action-status) | | Delete a DM | `DELETE /x/dm/{userId}/messages/{messageId}` | [Delete DM](/api-reference/x-write/delete-dm) | ## Next steps * [PHP SDK setup](/sdks/php) * [Tweet search](/sdks/php-tweet-search) * [Follower export](/sdks/php-follower-export) # X (Twitter) API PHP tweet search to CSV & JSON lines Source: https://docs.xquik.com/sdks/php-tweet-search Search tweets with the Xquik PHP SDK, follow cursors, and save rows as JSON Lines, CSV, or XLSX for workers, queues, and analysts in your own apps and jobs. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [PHP SDK setup](/sdks/php), which covers install and authentication. ## Tweet search workflow to JSON Lines, CSV, or XLSX Use this workflow when PHP code needs tweet search results in a durable file. That code can be a worker, Laravel command, Symfony console command, or cron job. The file can feed a queue, warehouse loader, or analyst CSV export. It can also feed an XLSX workbook or a CRM enrichment step. `$client->x->tweets->search()` calls `GET /x/tweets/search`. The generated parameter model is `TweetSearchParams`. The service method exposes the same request controls as named arguments. They are `q`, `limit`, `cursor`, `sinceTime`, `untilTime`, and `queryType`. ```php theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} x->tweets->search( q: $query, cursor: $cursor, queryType: QueryType::LATEST, ); foreach ($page->tweets as $tweet) { /** @var SearchTweet $tweet */ $row = [ 'source' => 'xquik.php.search', 'query' => $query, 'tweet_id' => $tweet->id, 'text' => $tweet->text, 'author_id' => $tweet->author?->id, 'author_username' => $tweet->author?->username, 'author_name' => $tweet->author?->name, 'created_at' => $tweet->createdAt, 'like_count' => $tweet->likeCount ?? 0, 'reply_count' => $tweet->replyCount ?? 0, 'retweet_count' => $tweet->retweetCount ?? 0, 'quote_count' => $tweet->quoteCount ?? 0, 'view_count' => $tweet->viewCount ?? 0, 'bookmark_count' => $tweet->bookmarkCount ?? 0, 'is_note_tweet' => $tweet->isNoteTweet ?? false, 'page_index' => $pageIndex, 'page_cursor' => $pageCursor, 'next_cursor' => '' === $page->nextCursor ? null : $page->nextCursor, 'has_next_page' => $page->hasNextPage, ]; $csvRow = []; foreach ($headers as $header) { $csvRow[] = $row[$header]; } fputcsv($csvHandle, $csvRow); fwrite( $jsonlHandle, json_encode($row, JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR) . PHP_EOL ); } $cursor = $page->hasNextPage ? $page->nextCursor : null; $pageIndex++; } while (null !== $cursor && '' !== $cursor); } finally { fclose($jsonlHandle); fclose($csvHandle); } ``` ### Request mapping > [card] q > > PHP argument `q` maps to REST `q`. It takes an X (Twitter) search query. Examples are `from:username`, a keyword, hashtag, or boolean operator query. > [card] limit > > PHP argument `limit` maps to REST `limit`. Use it as a 1 to 200 upper bound for a bounded pull. If `$page->hasNextPage` is true, keep the same `q`, filters, `queryType`, and `limit`. That applies when you continue with `$page->nextCursor`. > [card] cursor > > PHP argument `cursor` maps to REST `cursor`. Pass the opaque cursor from `$page->nextCursor` to request the next page. > [card] sinceTime > > PHP argument `sinceTime` maps to REST `sinceTime`. Use the inclusive ISO bound on every page. > [card] untilTime > > PHP argument `untilTime` maps to REST `untilTime`. Use the exclusive ISO bound on every page. > [card] queryType > > PHP argument `queryType` maps to REST `queryType`. Use `QueryType::LATEST` for chronological search or `QueryType::TOP` for engagement-ranked search. ### Returned data & handoff `$client->x->tweets->search()` returns `PaginatedTweets`. Use `$page->tweets` for the tweet array. `$page->hasNextPage` tells you whether another page exists. Use `$page->nextCursor` as the checkpoint for the next request. For bounded pulls that return fewer tweets than `limit`, pass `$page->nextCursor` back as `cursor`. Send the same query, filters, `queryType`, and `limit` with it. Each `SearchTweet` includes typed properties such as `$id`, `$text`, `$author`, and `$createdAt`. It also includes `$likeCount`, `$replyCount`, `$retweetCount`, `$quoteCount`, `$bookmarkCount`, `$viewCount`, and `$isNoteTweet` when available. Project `$page->tweets` into JSON Lines and CSV rows. Each row holds `tweet_id`, `author_username`, engagement counts, `page_index`, `page_cursor`, `next_cursor`, and `has_next_page`. Workers can then resume. Or they can load the same records into XLSX, CRM, warehouse, or agent workflows. Tweet search costs 1 credit per tweet returned. If credits cannot cover a bounded `limit` request, the API can return fewer tweets. If credits cover 0 results, it returns `402 insufficient_credits`. The SDK retries connection errors, timeouts, 408, 409, 429, and 5xx responses by default. The default is 2 retries. For explicit `limit` pulls, resume with the same query, filters, `queryType`, and `limit`. Only `cursor` changes. ## Next steps * [PHP SDK setup](/sdks/php) * [Follower export](/sdks/php-follower-export) * [Media tweets](/sdks/php-media-tweets) # X (Twitter) API for Python, the Xquik Python SDK Source: https://docs.xquik.com/sdks/python Use the Xquik Python SDK to search tweets, export CSV, JSON Lines, or XLSX, post tweets, upload media, send DMs, and build X API workers. See code examples. > For the complete documentation index, see [llms.txt](/llms.txt). ## Distinct Python fit Choose Python for typed synchronous or asynchronous clients. It fits scripts, notebooks, workers, pandas pipelines, and agent tools. Use TypeScript when the runtime and downstream models are Node.js-based. Use the Python SDK for typed sync or async access to Xquik. It works from scripts, notebooks, workers, agent tools, and backend services. Use this page when Python must search tweets. Use it too for tweet exports to CSV, JSON Lines, or XLSX. Python can export followers, post tweets, upload media, or send DMs. It can also monitor tweets. It can load records into pandas, a warehouse, a queue, CRM, or an agent. | Python task | SDK call | Save | | - | - | - | | Search tweets | `client.x.tweets.search` | `next_cursor` | | Export followers | `client.extractions.run` | `job.id` | ## Install ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} pip install x_twitter_scraper ``` ## Authenticate ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import os from x_twitter_scraper import XTwitterScraper client = XTwitterScraper( api_key=os.environ.get("X_TWITTER_SCRAPER_API_KEY"), ) ``` ## Basic example Search tweets and write durable JSON Lines handoff rows. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import sys from x_twitter_scraper import XTwitterScraper client = XTwitterScraper() page = client.x.tweets.search( q="from:username webhook OR SDK", limit=10, ) for tweet in page.tweets: row = { "tweet_id": tweet.id, "text": tweet.text, "author_username": tweet.author.username if tweet.author else None, "created_at": tweet.created_at, } sys.stdout.write(json.dumps(row, ensure_ascii=False) + "\n") ``` Async clients use the same generated method names. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import asyncio import json import sys from x_twitter_scraper import AsyncXTwitterScraper client = AsyncXTwitterScraper() async def main() -> None: page = await client.x.tweets.search(q="xquik", limit=10) for tweet in page.tweets: row = { "tweet_id": tweet.id, "text": tweet.text, "author_username": tweet.author.username if tweet.author else None, "created_at": tweet.created_at, } sys.stdout.write(json.dumps(row, ensure_ascii=False) + "\n") asyncio.run(main()) ``` ## Python SDK workflows | Workflow | What it does | | - | - | | [Tweet search](/sdks/python-tweet-search) | Search tweets, follow cursors & save JSON Lines, CSV, or XLSX files. | | [Follower export](/sdks/python-follower-export) | Run a follower extraction & save CSV, JSON, or XLSX files. | | [Media tweets](/sdks/python-media-tweets) | Upload media, post media tweets & send DM attachments. | ## Tweet replies workflow to CSV, JSON, or XLSX Use this workflow when Python code needs every reply under one tweet. It fits a script, notebook, worker, or agent tool. The replies come as a saved extraction or a JSON Lines handoff. They can also come as a CSV, JSON, or XLSX file export. It uses `client.extractions.estimate_cost`, `run`, `retrieve`, and `export_results`. Reuse the polling, row pagination, and export structure from the follower workflow. Only the tool type, target field, and output filenames change. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} target_tweet_id = "1893704267862470862" estimate = client.extractions.estimate_cost( tool_type="reply_extractor", target_tweet_id=target_tweet_id, ) if not estimate.allowed: raise RuntimeError("Insufficient credits for reply extraction.") job = client.extractions.run( tool_type="reply_extractor", target_tweet_id=target_tweet_id, ) # Run the same polling and JSONL pagination loops from the follower workflow. # Set the JSON Lines destination to Path("xquik-replies.jsonl"). client.extractions.export_results(job.id, format="csv").write_to_file( Path("xquik-replies.csv"), ) client.extractions.export_results(job.id, format="json").write_to_file( Path("xquik-replies.json"), ) client.extractions.export_results(job.id, format="xlsx").write_to_file( Path("xquik-replies.xlsx"), ) ``` `reply_extractor` requires `target_tweet_id`. `client.extractions.retrieve` returns `results`, `has_more`, and `next_cursor`. The shared pagination loop passes `next_cursor` 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.export_results` supports `csv`, `json`, and `xlsx` for file handoff. The cost is 1 credit per reply extracted or returned. ## Cost, limits & retries Tweet search costs 1 credit per tweet returned. If credits cannot cover a bounded `limit` 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. ## Error handling All SDK exceptions inherit from `x_twitter_scraper.APIError`. > [card] 400 Bad request > > Raises `BadRequestError`. > [card] 401 Unauthenticated > > Raises `AuthenticationError`. > [card] 403 Permission denied > > Raises `PermissionDeniedError`. > [card] 404 Not found > > Raises `NotFoundError`. > [card] 422 Unprocessable entity > > Raises `UnprocessableEntityError`. > [card] 429 Rate limited > > Raises `RateLimitError`. > [card] 5xx server error > > Raises `InternalServerError`. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import x_twitter_scraper try: account = client.account.retrieve() except x_twitter_scraper.APIConnectionError as exc: print(f"Connection failed: {exc.__cause__}") except x_twitter_scraper.APIStatusError as exc: print(f"HTTP {exc.status_code}") ``` The client retries connection errors, 408, 409, 429, and 5xx responses by default. Pass `max_retries` when constructing the client to change retry behavior. ## Pagination List endpoints return page models with `has_next_page` and cursor fields. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} page = client.x.tweets.search(q="xquik", limit=20) if page.has_next_page: print("More results are available") ``` ## Webhooks & references * [Search Tweets](/api-reference/x/search-tweets) * [Create Extraction](/api-reference/extractions/create) * [Get Extraction](/api-reference/extractions/twitter-extraction-results) * [Export Extraction](/api-reference/extractions/export) * [Create Tweet](/api-reference/x-write/create-tweet) * [Get Write Action Status](/api-reference/x-write/get-write-action-status) * [Upload Media](/api-reference/x-write/upload-media) * [Send Direct Message](/api-reference/x-write/send-dm) * [Webhook Overview](/webhooks/overview) * [Verify HMAC Signatures](/webhooks/verification) * [Twitter Scraper API Overview](/api-reference/overview) * Download the OpenAPI schema with `curl -o openapi.json https://xquik.com/openapi.json` * [Source Repository](https://github.com/Xquik-dev/x-twitter-scraper-python) # X (Twitter) API Python follower export to CSV & XLSX Source: https://docs.xquik.com/sdks/python-follower-export Export X (Twitter) followers with the Xquik Python SDK. Estimate the job, run the extraction, and save CSV, JSON, or XLSX files for your team and your CRM. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Python SDK setup](/sdks/python), which covers install and authentication. ## Follower export workflow to CSV, JSON, or XLSX Use this workflow when Python code needs an owned follower list. It fits a script, notebook, worker, or agent tool. Use the list for a CRM import, warehouse load, or analyst CSV file. You can also deliver it as an XLSX workbook or resumable JSON handoff. The workflow calls `POST /extractions/estimate` through `client.extractions.estimate_cost`. It creates the job with `client.extractions.run`. It reads saved rows with `client.extractions.retrieve`. It downloads files with `client.extractions.export_results`. > [!NOTE] > > `client.extractions.run` returns the queued `202 Accepted` receipt from `POST /extractions`. Python exposes REST `id`, `toolType`, and `status: "running"` as `job.id`, `job.tool_type`, and `job.status`. Store `job.id` immediately, then poll `client.extractions.retrieve` before reading pages or calling `client.extractions.export_results`. Credit reservation happens after the job starts. If available credits changed since `estimate_cost`, the run has 2 outcomes. It can fetch only the affordable count before export. Or it can mark the job `failed` with `insufficient_credits`. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import time from pathlib import Path from x_twitter_scraper import XTwitterScraper client = XTwitterScraper() target_username = "username" estimate = client.extractions.estimate_cost( tool_type="follower_explorer", target_username=target_username, ) if not estimate.allowed: raise RuntimeError("Insufficient credits for follower export.") job = client.extractions.run( tool_type="follower_explorer", target_username=target_username, ) while True: status_page = client.extractions.retrieve(job.id, limit=1) status = status_page.job.get("status") if status == "completed": break if status == "failed": raise RuntimeError("Follower export failed.") time.sleep(10) cursor = None with Path("xquik-followers.jsonl").open("w", encoding="utf-8") as jsonl_file: while True: page = client.extractions.retrieve(job.id, limit=1000, cursor=cursor) for row in page.results: jsonl_file.write(json.dumps(row, ensure_ascii=False) + "\n") if not page.has_more or not page.next_cursor: break cursor = page.next_cursor client.extractions.export_results(job.id, format="csv").write_to_file( Path("xquik-followers.csv"), ) client.extractions.export_results(job.id, format="json").write_to_file( Path("xquik-followers.json"), ) client.extractions.export_results(job.id, format="xlsx").write_to_file( Path("xquik-followers.xlsx"), ) ``` `follower_explorer` requires `target_username`. Store `job.id`, `target_username`, `estimate.estimated_results`, and `estimate.source` before polling. With them, a notebook restart, queue retry, or worker restart can resume that export. `client.extractions.retrieve` returns `results`, `has_more`, and `next_cursor`. Pass `next_cursor` back as `cursor` when you need stored JSON pages before exporting files. Use `xquik-followers.jsonl` for queue replay or warehouse loads, and `xquik-followers.json` for app ingestion. Use `xquik-followers.csv` for CRM import and `xquik-followers.xlsx` for analyst handoff. Map exported `User ID` or row `xUserId` as the CRM unique key. The cost is 1 credit per follower extracted or returned. Exports cost no credits after the extraction job exists. ## Next steps * [Python SDK setup](/sdks/python) * [Tweet search](/sdks/python-tweet-search) * [Media tweets](/sdks/python-media-tweets) # X (Twitter) API Python media tweets & DM attachments Source: https://docs.xquik.com/sdks/python-media-tweets Upload media with the Xquik Python SDK, post tweets with photos or video, and send DM attachments from a connected X (Twitter) account in your own apps. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Python SDK setup](/sdks/python), which covers install and authentication. ## Workflow to post media tweets and DM attachments Use this workflow to post a media tweet or reply. Use it too to DM 1 uploaded media item. Tweet and reply media posts use public media URLs directly on `client.x.tweets.create`. Send up to 4 image URLs or exactly 1 MP4 video URL. The video can be up to 100 MB. Do not mix video with other media. Do not upload first when the media URL is already public. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import sys from typing import Any from x_twitter_scraper import XTwitterScraper client = XTwitterScraper() def create_tweet_handoff( action: dict[str, Any], base: dict[str, Any], ) -> dict[str, Any]: result = action.get("result") or {} return { "status": action["status"], "terminal": action["terminal"], "safe_to_retry": action["safeToRetry"], "write_action_id": action["id"], "request_hash": action["request"]["hash"], "tweet_id": result.get("id") or action.get("tweetId"), "charged": action["billing"]["charged"], "charged_credits": action["billing"]["chargedCredits"], "poll": None if action["terminal"] else action["statusUrl"], **base, } ``` Use `with_raw_response.create` to capture the durable write action. Send a unique `Idempotency-Key`. Store `id`, `request.hash`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} response = client.x.tweets.with_raw_response.create( account="@username", text="New demo video is live.", media=["https://example.com/product-demo.mp4"], ) payload = response.json() tweet_handoff = create_tweet_handoff( payload, { "account": "@username", "media": ["https://example.com/product-demo.mp4"], }, ) sys.stdout.write(json.dumps(tweet_handoff, ensure_ascii=False) + "\n") ``` To post an image reply, add `reply_to_tweet_id`. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} response = client.x.tweets.with_raw_response.create( account="@username", text="Here is the requested screenshot.", reply_to_tweet_id="1893704267862470862", media=["https://example.com/export-preview.png"], ) payload = response.json() reply_handoff = create_tweet_handoff( payload, { "account": "@username", "reply_to_tweet_id": "1893704267862470862", "media": ["https://example.com/export-preview.png"], }, ) sys.stdout.write(json.dumps(reply_handoff, ensure_ascii=False) + "\n") ``` For DM attachments, upload the local file first. Then pass the returned `media.media_id` as the only `media_ids` item. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import json import sys from pathlib import Path media = client.x.media.upload( account="@username", file=Path("./handoff.png"), ) dm = client.x.dm.send( user_id="44196397", account="@username", text="Here is the asset.", media_ids=[media.media_id], ) dm_handoff = { "status": "sent", "message_id": dm.message_id, "media_id": media.media_id, "account": "@username", "user_id": "44196397", } sys.stdout.write(json.dumps(dm_handoff, ensure_ascii=False) + "\n") ``` `client.x.tweets.create` returns `tweet.tweet_id` for confirmed posts. Raw create responses can also include the pending write fields above while confirmation runs. `client.x.media.upload` returns `media.media_id` for DM attachments. `client.x.dm.send` returns `dm.message_id` for support tickets, CRM records, queue jobs, or agent memory. Keep DM body text in private systems. Shared logs, public artifacts, queue status, and agent handoffs should omit full DM bodies. They should store `message_id`, optional `media_id`, `account`, `user_id`, and send status. Leave `reply_to_message_id` unset even if generated SDK types expose it. The REST endpoint rejects DM reply threading. `client.x.dm.delete_message` [deletes a DM](/api-reference/x-write/delete-dm). Text-only tweet and reply writes cost 30 credits. Tweet media adds 2 credits per started MB across attached files. Uploading media costs 10 credits. Sending the DM costs 10 credits. Do not pass uploaded `media.media_id` values to `client.x.tweets.create`. That method uses `media` with public media URLs. ### REST routes | Task | REST route | Reference | | - | - | - | | Post a media tweet or reply | `POST /x/tweets` | [Create tweet](/api-reference/x-write/create-tweet) | | Upload a local file | `POST /x/media` | [Upload media](/api-reference/x-write/upload-media) | | Send a DM attachment | `POST /x/dm/{userId}` | [Send DM](/api-reference/x-write/send-dm) | | Check a write action | `GET /x/write-actions/{id}` | [Write action status](/api-reference/x-write/get-write-action-status) | | Delete a DM | `DELETE /x/dm/{userId}/messages/{messageId}` | [Delete DM](/api-reference/x-write/delete-dm) | ## Next steps * [Python SDK setup](/sdks/python) * [Tweet search](/sdks/python-tweet-search) * [Follower export](/sdks/python-follower-export) # X (Twitter) API Python tweet search to CSV & JSONL Source: https://docs.xquik.com/sdks/python-tweet-search Search tweets with the Xquik Python SDK, follow cursors, and save rows as JSON Lines, CSV, or XLSX for workers, queues, and analysts in your own apps and jobs. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Python SDK setup](/sdks/python), which covers install and authentication. ## Tweet search workflow to CSV, JSON Lines, or XLSX Search with `client.x.tweets.search`, `GET /x/tweets/search`, and generated `TweetSearchParams`. Save CSV and JSON Lines for notebooks, workers, agents, queues, warehouses, and replay. ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import csv import json from pathlib import Path from x_twitter_scraper import XTwitterScraper client = XTwitterScraper() query = "from:username webhook OR SDK" csv_output = Path("xquik-tweet-search.csv") jsonl_output = Path("xquik-tweet-search.jsonl") cursor = None page_index = 0 with csv_output.open("w", newline="", encoding="utf-8") as csv_file, jsonl_output.open( "w", encoding="utf-8", ) as jsonl_file: writer = csv.DictWriter( csv_file, fieldnames=[ "source", "query", "tweet_id", "text", "author_id", "author_username", "author_name", "created_at", "like_count", "reply_count", "retweet_count", "quote_count", "view_count", "bookmark_count", "is_note_tweet", "page_index", "page_cursor", "next_cursor", "has_next_page", ], ) writer.writeheader() while True: page_cursor = cursor page = client.x.tweets.search( q=query, query_type="Latest", cursor=cursor, ) for tweet in page.tweets: row = { "source": "xquik.python.search", "query": query, "tweet_id": tweet.id, "text": tweet.text, "author_id": tweet.author.id if tweet.author else None, "author_username": tweet.author.username if tweet.author else None, "author_name": tweet.author.name if tweet.author else None, "created_at": tweet.created_at, "like_count": tweet.like_count or 0, "reply_count": tweet.reply_count or 0, "retweet_count": tweet.retweet_count or 0, "quote_count": tweet.quote_count or 0, "view_count": tweet.view_count or 0, "bookmark_count": tweet.bookmark_count or 0, "is_note_tweet": tweet.is_note_tweet or False, "page_index": page_index, "page_cursor": page_cursor, "next_cursor": page.next_cursor or None, "has_next_page": page.has_next_page, } writer.writerow(row) jsonl_file.write(json.dumps(row, ensure_ascii=False) + "\n") if not page.has_next_page or not page.next_cursor: break cursor = page.next_cursor page_index += 1 ``` The method accepts the same query inputs as the REST endpoint. > [card] q > > Python argument `q` maps to REST `q`. It holds the required X (Twitter) search query with keywords, handles, hashtags, or operators. > [card] limit > > Python argument `limit` maps to REST `limit`. Use it as a 1 to 200 upper bound for a bounded pull. If `page.has_next_page` is true, keep the same `q`, filters, `query_type`, and `limit`. That applies when you continue with `page.next_cursor`. > [card] cursor > > Python argument `cursor` maps to REST `cursor`. Pass the opaque cursor from `page.next_cursor` to request the next page. > [card] since_time > > Python argument `since_time` maps to REST `sinceTime`. Use it as the ISO 8601 lower time bound. > [card] until_time > > Python argument `until_time` maps to REST `untilTime`. Use it as the ISO 8601 upper time bound. > [card] query_type > > Python argument `query_type` maps to REST `queryType`. Use `Latest` for chronological results or `Top` for engagement-ranked results. ## Returned data & handoff `client.x.tweets.search` returns a `PaginatedTweets` Pydantic model. > [card] page.tweets > > JSON field `tweets`. Contains `SearchTweet` records with `id`, `text`, optional `author`, and `created_at`. Records also carry `like_count`, `reply_count`, `retweet_count`, `quote_count`, `bookmark_count`, `view_count`, and `is_note_tweet` when available. > [card] page.has_next_page > > Python field `page.has_next_page`. JSON field `has_next_page`. Tells your script whether another page exists. > [card] page.next_cursor > > JSON field `next_cursor`. Store it only when `page.has_next_page` is true. For bounded pulls that return fewer tweets than `limit`, pass it back as `cursor`. Send the same query, filters, `query_type`, and `limit` with it. Project `page.tweets` into CSV rows for analysts. Project them into JSON Lines rows in `xquik-tweet-search.jsonl` for queues and data lakes. If account teams need an XLSX workbook, load those rows into pandas or openpyxl. Store `tweet_id`, `author_username`, engagement counts, `page_index`, `page_cursor`, `next_cursor`, and `has_next_page`. With them, scripts resume from the last saved cursor without replaying raw SDK models. For explicit `limit` pulls, resume with the same query, filters, `query_type`, and `limit`. Only `cursor` changes. ## Next steps * [Python SDK setup](/sdks/python) * [Follower export](/sdks/python-follower-export) * [Media tweets](/sdks/python-media-tweets) # Ruby X (Twitter) API SDK for tweet search & exports Source: https://docs.xquik.com/sdks/ruby Use the Xquik Ruby SDK to search tweets, export CSV, JSON Lines, or XLSX, post tweets, upload media, send DMs, and run durable Rails or Sidekiq X API jobs. > For the complete documentation index, see [llms.txt](/llms.txt). The Ruby SDK is for Ruby 3.2+ applications. Use it for typed REST access, retries, Yard docs, RBS, RBI, and connection pooling. Use this page when Ruby code must search tweets. That code can be a Ruby app, Rails job, or Sidekiq worker. Use the page too for tweet exports to CSV, JSON Lines, or XLSX. The code can also export followers, upload media, send DMs, or monitor tweets. It can load records into a warehouse, CRM, queue, or agent. | Ruby task | SDK call | Save | | - | - | - | | Search tweets | `client.x.tweets.search` | `next_cursor` | | Export followers | `client.extractions.run` | `job.id` | ## Install ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} gem install x-twitter-scraper ``` Or add it to your Gemfile. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} gem "x-twitter-scraper", "~> 0.12" ``` ## Authenticate ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` ## Basic example Search tweets and write durable JSON Lines handoff rows. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} require "json" require "x_twitter_scraper" client = XTwitterScraper::Client.new( api_key: ENV["X_TWITTER_SCRAPER_API_KEY"] ) page = client.x.tweets.search( q: "from:username webhook OR SDK", limit: 10 ) page.tweets.each do |tweet| row = { tweet_id: tweet.id, text: tweet.text, author_username: tweet.author&.username, created_at: tweet.created_at } puts(JSON.generate(row)) end ``` ## Ruby SDK workflows | Workflow | What it does | | - | - | | [Tweet search](/sdks/ruby-tweet-search) | Search tweets, follow cursors & save JSON Lines, CSV, or XLSX files. | | [Follower export](/sdks/ruby-follower-export) | Run a follower extraction & save CSV, JSON, or XLSX files. | | [Media tweets](/sdks/ruby-media-tweets) | Upload media, post media tweets & send DM attachments. | ## Tweet replies workflow to CSV, JSON, or XLSX Use this workflow when Ruby code needs every reply under one tweet. That code can be a Ruby app, Rails job, Sidekiq worker, or agent tool. The replies can come as a saved extraction or a JSON Lines handoff. They can also come as a CSV, JSON, or XLSX file export. Reuse the polling, JSON Lines pagination, and export structure from the follower workflow. Only the tool type, target field, and filenames change. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} target_tweet_id = "1893704267862470862" estimate = client.extractions.estimate_cost( tool_type: :reply_extractor, target_tweet_id: target_tweet_id ) raise "Insufficient credits for reply extraction." unless estimate.allowed job = client.extractions.run( tool_type: :reply_extractor, target_tweet_id: target_tweet_id ) # Run the same polling and JSONL pagination loops from the follower workflow. # Set the JSON Lines destination to File.open("xquik-replies.jsonl", "w"). csv_response = client.extractions.export_results(job.id, format_: :csv) csv_response.rewind File.binwrite("xquik-replies.csv", csv_response.read) json_response = client.extractions.export_results(job.id, format_: :json) json_response.rewind File.binwrite("xquik-replies.json", json_response.read) xlsx_response = client.extractions.export_results(job.id, format_: :xlsx) xlsx_response.rewind File.binwrite("xquik-replies.xlsx", xlsx_response.read) ``` `reply_extractor` requires `target_tweet_id`. `client.extractions.retrieve` returns `results`, `has_more`, and `next_cursor`. The shared pagination loop passes `next_cursor` 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. The export call above takes `:csv`, `:json`, or `:xlsx` as `format_` for file handoff. The cost is 1 credit per reply extracted or returned. ## Cost, limits & retries Tweet search costs 1 credit per tweet returned. If credits cannot cover a bounded `limit` request, the API can return fewer tweets. If credits cover 0 results, it returns `402 insufficient_credits`. Xquik rate-limits read calls. `429` responses include `Retry-After`. The client retries connection errors, timeouts, 408, 409, 429, and 5xx responses by default. Handle the rate limit error with backoff. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} rescue XTwitterScraper::Errors::RateLimitError ``` Fix 400, 401, 403, 404, or 422 responses before retrying. ## Error handling All SDK errors inherit from 1 class. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} XTwitterScraper::Errors::APIError ``` > [card] 400 Bad request > > Raises `BadRequestError`. > [card] 401 Unauthenticated > > Raises `AuthenticationError`. > [card] 403 Permission denied > > Raises `PermissionDeniedError`. > [card] 404 Not found > > Raises `NotFoundError`. > [card] 422 Unprocessable entity > > Raises `UnprocessableEntityError`. > [card] 429 Rate limited > > Raises `RateLimitError`. > [card] 5xx server error > > Raises `InternalServerError`. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} begin account = client.account.retrieve rescue XTwitterScraper::Errors::APIConnectionError => e warn("Connection failed: #{e.cause}") rescue XTwitterScraper::Errors::APIStatusError => e warn("HTTP #{e.status}") end ``` ## Pagination Paginated responses expose fields such as `has_next_page`. Pass the endpoint's cursor fields when requesting more pages. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} page = client.x.tweets.search(q: "xquik", limit: 20) puts("More results are available") if page.has_next_page ``` ## Webhooks & references * [Search Tweets](/api-reference/x/search-tweets) * [Create Tweet](/api-reference/x-write/create-tweet) * [Upload Media](/api-reference/x-write/upload-media) * [Send Direct Message](/api-reference/x-write/send-dm) * [Create Monitor](/api-reference/monitors/create) * [Webhook Overview](/webhooks/overview) * [Verify HMAC Signatures](/webhooks/verification) * [REST API Overview](/api-reference/overview) * [Source Repository](https://github.com/Xquik-dev/x-twitter-scraper-ruby) # X (Twitter) API Ruby follower export to CSV & XLSX Source: https://docs.xquik.com/sdks/ruby-follower-export Export X (Twitter) followers with the Xquik Ruby SDK. Estimate the job, run the extraction, and save CSV, JSON, or XLSX files for your team and your CRM tools. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Ruby SDK setup](/sdks/ruby), which covers install and authentication. ## Follower export workflow to CSV, JSON, or XLSX Use this workflow when Ruby code needs an owned follower list. That code can be a Ruby app, Rails job, Sidekiq worker, or agent tool. The list can feed a CRM import, warehouse load, or analyst CSV file. It can also feed an XLSX workbook or resumable JSON handoff. The workflow calls `POST /extractions/estimate` through `client.extractions.estimate_cost`. It creates the job with `client.extractions.run`. It reads saved rows with `client.extractions.retrieve`. It downloads files with `client.extractions.export_results`. > [!NOTE] > > `client.extractions.run` returns the queued `202 Accepted` receipt from `POST /extractions`. Ruby exposes REST `id`, `toolType`, and `status: "running"` as `job.id`, `job.tool_type`, and `job.status`. Store `job.id` immediately, then poll `client.extractions.retrieve` before reading pages or calling `client.extractions.export_results`. Credit reservation happens after the job starts. Available credits may have changed since `estimate_cost`. If so, the run can fetch only the affordable count before export. Or it can mark the job `failed` with `insufficient_credits`. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} require "json" require "x_twitter_scraper" client = XTwitterScraper::Client.new( api_key: ENV["X_TWITTER_SCRAPER_API_KEY"] ) target_username = "username" estimate = client.extractions.estimate_cost( tool_type: :follower_explorer, target_username: target_username ) raise "Insufficient credits for follower export." unless estimate.allowed job = client.extractions.run( tool_type: :follower_explorer, target_username: target_username ) loop do status_page = client.extractions.retrieve(job.id, limit: 1) status = status_page.job[:status] || status_page.job["status"] break if status == "completed" raise "Follower export failed." if status == "failed" sleep 10 end cursor = nil File.open("xquik-followers.jsonl", "w") do |jsonl| loop do page = client.extractions.retrieve(job.id, limit: 1000, cursor: cursor) page.results.each do |row| jsonl.puts(JSON.generate(row)) end break unless page.has_more && page.next_cursor.to_s != "" cursor = page.next_cursor end end csv_response = client.extractions.export_results(job.id, format_: :csv) csv_response.rewind File.binwrite("xquik-followers.csv", csv_response.read) json_response = client.extractions.export_results(job.id, format_: :json) json_response.rewind File.binwrite("xquik-followers.json", json_response.read) xlsx_response = client.extractions.export_results(job.id, format_: :xlsx) xlsx_response.rewind File.binwrite("xquik-followers.xlsx", xlsx_response.read) ``` `follower_explorer` requires `target_username`. Store `job.id`, `target_username`, `estimate.estimated_results`, and `estimate.source` before polling. That lets a Sidekiq retry, Rails job retry, or worker restart resume that job. `client.extractions.retrieve` returns `results`, `has_more`, and `next_cursor`. Pass `next_cursor` back as `cursor` when you need stored JSON pages before exporting files. Map exported `User ID` or row `xUserId` as the CRM unique key. Use `xquik-followers.jsonl` for queue replay or warehouse loads, and `xquik-followers.json` for app ingestion. Use `xquik-followers.csv` for CRM import and `xquik-followers.xlsx` for analyst handoff. The cost is 1 credit per follower extracted or returned. Exports cost no credits after the extraction job exists. ## Next steps * [Ruby SDK setup](/sdks/ruby) * [Tweet search](/sdks/ruby-tweet-search) * [Media tweets](/sdks/ruby-media-tweets) # X (Twitter) API Ruby media tweets & DM attachments Source: https://docs.xquik.com/sdks/ruby-media-tweets Upload media with the Xquik Ruby SDK, post tweets with photos or video, and send DM attachments from a connected X (Twitter) account in your own apps and bots. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Ruby SDK setup](/sdks/ruby), which covers install and authentication. ## Workflow to post media tweets and DM attachments Use this workflow when Ruby code needs to post a media-backed tweet. That code can be a Ruby app, Rails job, Sidekiq worker, or agent service. Use it too when the code replies with media. It also covers sending one uploaded media item in a DM. Tweet and reply media posts use public media URLs directly on `POST /x/tweets`. Send up to 4 image URLs or exactly 1 MP4 video URL. The video can be up to 100 MB. Do not mix video with other media. Do not upload first when the media URL is already public. Use `client.request` to capture the durable write action. Send a unique `Idempotency-Key`. Store `id`, `request.hash`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} def create_tweet_handoff(client, payload) response = client.request( method: :post, path: "x/tweets", body: payload ) result = response.fetch(:result, {}) || {} { "status" => response.fetch(:status), "terminal" => response.fetch(:terminal), "safe_to_retry" => response.fetch(:safeToRetry), "write_action_id" => response.fetch(:id), "request_hash" => response.dig(:request, :hash), "tweet_id" => result[:id] || response[:tweetId], "charged" => response.dig(:billing, :charged), "charged_credits" => response.dig(:billing, :chargedCredits), "poll" => response.fetch(:terminal) ? nil : response.fetch(:statusUrl) } end tweet_handoff = create_tweet_handoff( client, { account: "@username", text: "New demo video is live.", media: ["https://example.com/product-demo.mp4"] } ) puts(JSON.generate(tweet_handoff)) ``` To post an image reply, add `reply_to_tweet_id`. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} reply_handoff = create_tweet_handoff( client, { account: "@username", text: "Here is the requested screenshot.", reply_to_tweet_id: "1893704267862470862", media: ["https://example.com/export-preview.png"] } ) puts(JSON.generate(reply_handoff)) ``` For DM attachments, upload the local file first. Then pass the returned `media.media_id` as the only `media_ids` item. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} File.open("./handoff.png", "rb") do |file| media = client.x.media.upload( account: "@username", file: file ) dm = client.x.dm.send_( "44196397", account: "@username", text: "Here is the asset.", media_ids: [media.media_id] ) dm_handoff = { message_id: dm.message_id, media_id: media.media_id, user_id: "44196397", account: "@username", status: "sent" } puts(JSON.generate(dm_handoff)) end ``` Store `write_action_id` and `charged_credits`. Before retrying a pending tweet or reply, poll [Get Write Action Status](/api-reference/x-write/get-write-action-status). `client.x.tweets.create` returns `tweet.tweet_id` for confirmed-only flows. `client.x.media.upload` returns `media.media_id` for DM attachments. `client.x.dm.send_` returns `dm.message_id` for support tickets, CRM records, queue jobs, or agent memory. Keep DM body text in private systems. Shared logs, public artifacts, queue status, and agent handoffs should omit full DM bodies. They should store `message_id`, optional `media_id`, `account`, `user_id`, and send status. Leave generated `reply_to_message_id` unset even if SDK params expose it. The REST endpoint rejects DM reply threading. `client.x.dm.delete_message` [deletes a DM](/api-reference/x-write/delete-dm). Text-only tweet and reply writes cost 30 credits. Tweet media adds 2 credits per started MB across attached files. Uploading media costs 10 credits. Sending the DM costs 10 credits. Do not pass uploaded `media.media_id` values to `client.x.tweets.create`. That method uses `media` with public media URLs. ### REST routes | Task | REST route | Reference | | - | - | - | | Post a media tweet or reply | `POST /x/tweets` | [Create tweet](/api-reference/x-write/create-tweet) | | Upload a local file | `POST /x/media` | [Upload media](/api-reference/x-write/upload-media) | | Send a DM attachment | `POST /x/dm/{userId}` | [Send DM](/api-reference/x-write/send-dm) | | Check a write action | `GET /x/write-actions/{id}` | [Write action status](/api-reference/x-write/get-write-action-status) | | Delete a DM | `DELETE /x/dm/{userId}/messages/{messageId}` | [Delete DM](/api-reference/x-write/delete-dm) | ## Next steps * [Ruby SDK setup](/sdks/ruby) * [Tweet search](/sdks/ruby-tweet-search) * [Follower export](/sdks/ruby-follower-export) # X (Twitter) API Ruby tweet search to CSV & JSONL Source: https://docs.xquik.com/sdks/ruby-tweet-search Search tweets with the Xquik Ruby SDK, follow cursors, and save rows as JSON Lines, CSV, or XLSX for workers, queues, and analysts in your own apps and jobs. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [Ruby SDK setup](/sdks/ruby), which covers install and authentication. ## Tweet search workflow to CSV, JSON Lines, or XLSX Search with `client.x.tweets.search`, `GET /x/tweets/search`, and generated `XTwitterScraper::X::TweetSearchParams`. Save CSV and JSON Lines for Ruby workers, Rails, Sidekiq, agents, warehouses, and replay. ```ruby theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} require "csv" require "json" require "x_twitter_scraper" client = XTwitterScraper::Client.new( api_key: ENV["X_TWITTER_SCRAPER_API_KEY"] ) query = "from:username webhook OR SDK" cursor = nil page_index = 0 headers = [ "source", "query", "tweet_id", "text", "author_id", "author_username", "author_name", "created_at", "like_count", "reply_count", "retweet_count", "quote_count", "view_count", "bookmark_count", "is_note_tweet", "page_index", "page_cursor", "next_cursor", "has_next_page" ] CSV.open("xquik-tweet-search.csv", "w", write_headers: true, headers: headers) do |csv| File.open("xquik-tweet-search.jsonl", "w") do |jsonl| loop do page_cursor = cursor page = client.x.tweets.search( q: query, query_type: :Latest, cursor: cursor ) page.tweets.each do |tweet| row = { "source" => "xquik.ruby.search", "query" => query, "tweet_id" => tweet.id, "text" => tweet.text, "author_id" => tweet.author&.id, "author_username" => tweet.author&.username, "author_name" => tweet.author&.name, "created_at" => tweet.created_at, "like_count" => tweet.like_count || 0, "reply_count" => tweet.reply_count || 0, "retweet_count" => tweet.retweet_count || 0, "quote_count" => tweet.quote_count || 0, "view_count" => tweet.view_count || 0, "bookmark_count" => tweet.bookmark_count || 0, "is_note_tweet" => tweet.is_note_tweet || false, "page_index" => page_index, "page_cursor" => page_cursor, "next_cursor" => page.next_cursor == "" ? nil : page.next_cursor, "has_next_page" => page.has_next_page } csv << headers.map { |header| row.fetch(header) } jsonl.puts(JSON.generate(row)) end break unless page.has_next_page && page.next_cursor != "" cursor = page.next_cursor page_index += 1 end end end ``` The generated params map directly to the REST endpoint. > [card] q > > Ruby keyword `q` maps to REST `q`. It holds the required X (Twitter) search query with keywords, handles, hashtags, or operators. > [card] limit > > Ruby keyword `limit` maps to REST `limit`. Use it as a 1 to 200 upper bound for a bounded pull. If `page.has_next_page` is true, keep the same `q`, filters, `query_type`, and `limit`. That applies when you continue with `page.next_cursor`. > [card] cursor > > Ruby keyword `cursor` maps to REST `cursor`. Pass the opaque cursor from `page.next_cursor` to request the next page. > [card] since_time > > Ruby keyword `since_time` maps to REST `sinceTime`. Use it as the ISO 8601 lower time bound. > [card] until_time > > Ruby keyword `until_time` maps to REST `untilTime`. Use it as the ISO 8601 upper time bound. > [card] query_type > > Ruby keyword `query_type` maps to REST `queryType`. Use `:Latest` for chronological results or `:Top` for engagement-ranked results. ## Returned data & handoff `client.x.tweets.search` returns `XTwitterScraper::PaginatedTweets`. > [card] page.tweets > > JSON field `tweets`. Contains `SearchTweet` records with `id`, `text`, optional `author`, and `created_at`. Records also carry `like_count`, `reply_count`, `retweet_count`, `quote_count`, `bookmark_count`, `view_count`, and `is_note_tweet` when available. > [card] page.has_next_page > > Ruby field `page.has_next_page`. JSON field `has_next_page`. Tells your worker whether another page exists. > [card] page.next_cursor > > JSON field `next_cursor`. Store it only when `page.has_next_page` is true. For bounded pulls that return fewer tweets than `limit`, pass it back as `cursor`. Send the same query, filters, `query_type`, and `limit` with it. Project `page.tweets` into CSV rows for analysts. Project them into JSON Lines rows for queues and data lakes. Store `tweet_id`, `author_username`, engagement counts, `page_index`, `page_cursor`, `next_cursor`, and `has_next_page` in `xquik-tweet-search.jsonl`. Workers can then resume. Or they can load the same records into XLSX, CRM, warehouse, or agent workflows. For explicit `limit` pulls, resume with the same query, filters, `query_type`, and `limit`. Only `cursor` changes. ## Next steps * [Ruby SDK setup](/sdks/ruby) * [Follower export](/sdks/ruby-follower-export) * [Media tweets](/sdks/ruby-media-tweets) # Terraform X (Twitter) provider, monitors & webhooks Source: https://docs.xquik.com/sdks/terraform Install Xquik's Terraform provider and manage X monitors, signed webhooks, tweet actions, API keys, and durable automation state as infrastructure across teams. > For the complete documentation index, see [llms.txt](/llms.txt). Use the Terraform provider to manage Xquik resources with your infrastructure code. Platform teams can review account monitors, HMAC webhooks, API keys, and drafts. They can also review tweet actions, profile updates, and support workflows. Each review uses the same state process. ## Install Install from the [Terraform Registry](https://registry.terraform.io/providers/Xquik-dev/x-twitter-scraper/latest). Declare the provider. ```hcl theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} terraform { required_providers { x-twitter-scraper = { source = "Xquik-dev/x-twitter-scraper" version = "~> 0.9.0" } } } provider "x-twitter-scraper" { api_key = var.xquik_api_key } ``` Run `terraform init` before planning or applying resources. ## Authenticate Use variables or environment variables for credentials. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" export X_TWITTER_SCRAPER_BEARER_TOKEN="YOUR_OAUTH_TOKEN" ``` Prefer environment variables for credentials. If you pass credentials through Terraform variables, mark them `sensitive = true`. In that case, also use an encrypted remote state backend. ## Tweet monitor workflow to signed webhooks Use this workflow when Terraform should own a production tweet monitor and webhook endpoint. The endpoint receives signed events. They feed queues, incident tools, social listening dashboards, or CRM enrichment. The provider resources map to the REST API. `x-twitter-scraper_monitor` creates an account monitor through `POST /monitors`. `x-twitter-scraper_webhook` creates a signed webhook through `POST /webhooks`. Both resources use Terraform snake_case arguments that map to the API request fields. ```hcl theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} variable "webhook_url" { type = string } variable "xquik_api_key" { type = string sensitive = true } provider "x-twitter-scraper" { api_key = var.xquik_api_key } resource "x-twitter-scraper_webhook" "alerts" { url = var.webhook_url event_types = ["tweet.new", "tweet.reply"] is_active = true } resource "x-twitter-scraper_monitor" "xquik_account" { username = "username" event_types = ["tweet.new", "tweet.reply"] is_active = true } output "monitor_id" { value = x-twitter-scraper_monitor.xquik_account.id } output "webhook_id" { value = x-twitter-scraper_webhook.alerts.id } output "webhook_secret" { value = x-twitter-scraper_webhook.alerts.secret sensitive = true } ``` ### Request mapping > [card] Monitor resource > > Terraform resource `x-twitter-scraper_monitor` maps to `POST /monitors`. It requires `username` and `event_types` and accepts optional `is_active`. It returns `id`, `x_user_id`, `is_active`, and `created_at` in state. > [card] Webhook resource > > Terraform resource `x-twitter-scraper_webhook` maps to `POST /webhooks`. It requires `url` and `event_types` and accepts optional `is_active`. It returns `id`, `secret`, and `created_at` in state. > [card] Event data source > > Terraform data source `x-twitter-scraper_event` reads one stored monitor event. It requires `id` and returns `type`, `username`, `monitor_id`, `occurred_at`, `x_event_id`, and `data`. Tweet event types include `tweet.new`, `tweet.reply`, `tweet.quote`, and `tweet.retweet`. [Create Monitor](/api-reference/monitors/create) lists every type. Webhook URLs must use HTTPS and be reachable from the public internet. ### Returned data & handoff Operators may need to pause, update, or delete the monitor through Terraform. After `terraform apply`, hand them `monitor_id`. Hand `webhook_id` to delivery dashboards and support playbooks. Store `webhook_secret` in a secret manager. Use it to verify `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce` on every delivery. Production webhook payloads include `deliveryId` and `streamEventId`. Store `deliveryId` for receiver idempotency. Store `streamEventId` when monitor events need exactly-once processing across retries or endpoint changes. Use `GET /webhooks/{id}/deliveries` to inspect retry state by webhook after apply. Synthetic `webhook.test` requests verify signing only. They omit those production idempotency fields. Webhook operations are free. Active monitors check every second and cost 30 credits per monitor-hour. Creating one requires the credits of the first monitor hour. Monitors may pause when credits run out. ### State & secrets Terraform state can contain the webhook `secret` returned at creation time. Use an encrypted backend and restrict state access. Mark every output that references the secret as `sensitive = true`. If you lose or expose the secret, delete and recreate the webhook. Terraform then receives a new signing secret. ## Workflow to declare media tweets and replies Use `x-twitter-scraper_x_tweet` when a reviewed infrastructure apply must create one durable tweet or reply. The resource maps to `POST /x/tweets` and accepts public media URLs in `media`. It stores the confirmed `tweet_id` in Terraform state. ```hcl theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} resource "x-twitter-scraper_x_tweet" "launch_reply" { account = "myxhandle" text = "Launch assets are ready" reply_to_tweet_id = "1893456789012345678" media = ["https://example.com/product-demo.mp4"] } output "launch_reply_tweet_id" { value = x-twitter-scraper_x_tweet.launch_reply.tweet_id } ``` ### Tweet resource mapping > [card] Tweet resource > > Terraform resource `x-twitter-scraper_x_tweet` maps to `POST /x/tweets`. It requires `account` and accepts optional `text`, `reply_to_tweet_id`, `is_note_tweet`, and `media`. It returns `tweet_id` plus tweet details that state only reads. > [card] Media boundary > > The `media` argument is for public image URLs or exactly 1 public MP4 URL. Text-only tweets and replies cost 30 credits. Attached media adds 2 credits per started MB. Do not pass uploaded media IDs to this resource. They expire 24 hours after upload, and Terraform has no upload resource. > [!WARNING] > > Generated provider docs may list `media_ids` on `x-twitter-scraper_x_tweet`. Use `media` with public image or MP4 URLs for tweets. Uploaded media IDs expire after 24 hours, so keep them out of Terraform state. Send them through REST, MCP tools, or a generated SDK. ### Tweet handoff After `terraform apply`, hand off `tweet_id`, `reply_to_tweet_id`, `account`, and the original `media` URLs. They go to the system that needs to reconcile the post. That can be a queue, release record, CRM note, or incident timeline. Keep the media URLs in your own system. That way, a later state refresh does not become the only audit trail. Terraform state for `x-twitter-scraper_x_tweet` does not expose durable write action fields. It does not expose media upload resources or resources that send direct messages either. A worker may need to store lifecycle handoffs or returned DM `message_id`. It may also need to upload local media for one-item DM `media_ids`. In those cases, use the REST API, MCP tools, or a generated SDK. ## Error handling Terraform prints provider errors during plan and apply. REST API response semantics match the [error handling guide](/guides/error-handling). ## State & pagination Terraform tracks resource state in your configured backend. Data sources and resources use the generated provider schema. Review the generated docs in the [provider repository](https://github.com/Xquik-dev/terraform-provider-x-twitter-scraper/tree/main/docs) before adding resources to production state. Do not hand off extraction files through Terraform. Write reply, follower, or tweet search exports as CSV, JSON, XLSX, or JSON Lines. Do it with the REST extraction endpoints, CLI, MCP tools, or generated SDKs. Reserve Terraform state for lasting resources and IDs that need plan and apply review. ## Webhooks & references * [REST API Overview](/api-reference/overview) * [API Authentication](/api-reference/authentication) * [Webhook Overview](/webhooks/overview) * [Verify HMAC Signatures](/webhooks/verification) * [Terraform Registry](https://registry.terraform.io/providers/Xquik-dev/x-twitter-scraper/latest) & [Source](https://github.com/Xquik-dev/terraform-provider-x-twitter-scraper) # TypeScript X (Twitter) API SDK for tweet automation Source: https://docs.xquik.com/sdks/typescript Use the Xquik TypeScript SDK to search tweets, export JSON Lines, CSV, or XLSX, post media tweets, upload media, send DMs, and run Node.js X API workers. > For the complete documentation index, see [llms.txt](/llms.txt). The TypeScript SDK covers Xquik REST API workflows in Node.js, Bun, or server-side TypeScript. Use it when you want typed request parameters, response models, retries, and autocomplete. Use this page when a TypeScript service must search tweets. Use it too for tweet exports to JSON Lines, CSV, or XLSX. The service can export followers and profiles, post media tweets, or send DMs. It can also monitor tweets or send records downstream. | TypeScript task | SDK call | Save | | - | - | - | | Search tweets | `client.x.tweets.search` | `nextCursor` | | Export followers | `client.extractions.run` | `job.id` | ## Install ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} npm install x-twitter-scraper ``` ## Authenticate ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} export X_TWITTER_SCRAPER_API_KEY="xq_YOUR_KEY_HERE" ``` ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import XTwitterScraper from "x-twitter-scraper"; const client = new XTwitterScraper({ apiKey: process.env["X_TWITTER_SCRAPER_API_KEY"], }); ``` ## Basic example Search tweets and write durable JSON Lines handoff rows. ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import XTwitterScraper from "x-twitter-scraper"; const client = new XTwitterScraper(); const page = await client.x.tweets.search({ q: "from:username webhook OR SDK", limit: 10, }); const tweetRows = page.tweets.map((tweet) => ({ tweet_id: tweet.id, text: tweet.text, author_username: tweet.author?.username, created_at: tweet.createdAt, })); for (const row of tweetRows) { process.stdout.write(`${JSON.stringify(row)}\n`); } ``` ## TypeScript SDK workflows | Workflow | What it does | | - | - | | [Tweet search](/sdks/typescript-tweet-search) | Search tweets, follow cursors & save JSON Lines, CSV, or XLSX files. | | [Follower export](/sdks/typescript-follower-export) | Run a follower extraction & save CSV, JSON, or XLSX files. | | [Media tweets](/sdks/typescript-media-tweets) | Upload media, post media tweets & send DM attachments. | ## 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 uses `client.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. ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const targetTweetId = "1893704267862470862"; const estimate = await client.extractions.estimateCost({ toolType: "reply_extractor", targetTweetId, }); if (!estimate.allowed) { throw new Error("Insufficient credits for reply extraction."); } const job = await client.extractions.run({ toolType: "reply_extractor", targetTweetId, }); // Run the same polling and JSONL pagination loops from the follower workflow. // Set the JSON Lines destination to await open("xquik-replies.jsonl", "w"). const csv = await client.extractions.exportResults(job.id, { format: "csv" }); await writeFile("xquik-replies.csv", Buffer.from(await csv.arrayBuffer())); const json = await client.extractions.exportResults(job.id, { format: "json" }); await writeFile("xquik-replies.json", Buffer.from(await json.arrayBuffer())); const xlsx = await client.extractions.exportResults(job.id, { format: "xlsx" }); await writeFile("xquik-replies.xlsx", Buffer.from(await xlsx.arrayBuffer())); ``` `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. > [card] 400 Bad request > > Throws `BadRequestError`. > [card] 401 Unauthenticated > > Throws `AuthenticationError`. > [card] 403 Permission denied > > Throws `PermissionDeniedError`. > [card] 404 Not found > > Throws `NotFoundError`. > [card] 422 Unprocessable entity > > Throws `UnprocessableEntityError`. > [card] 429 Rate limited > > Throws `RateLimitError`. > [card] 5xx server error > > Throws `InternalServerError`. ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import XTwitterScraper from "x-twitter-scraper"; const client = new XTwitterScraper(); try { await client.account.retrieve(); } catch (error) { if (error instanceof XTwitterScraper.APIError) { process.stderr.write(`HTTP ${error.status}\n`); } else { process.stderr.write("Network or timeout error\n"); } } ``` The client retries connection errors, 408, 409, 429, and 5xx responses by default. Set `maxRetries` to tune retry behavior. ## Cost, limits & retries Tweet search costs 1 credit per tweet returned. If credits cannot cover a bounded `limit` 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, check `has_next_page`. Then pass the generated cursor fields documented on each endpoint. ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const firstPage = await client.x.tweets.search({ q: "xquik", limit: 20 }); if (firstPage.has_next_page) { process.stderr.write("More results are available\n"); } ``` ## Webhooks & references * [Webhook Overview](/webhooks/overview) * [Verify HMAC Signatures](/webhooks/verification) * [Twitter Scraper API Overview](/api-reference/overview) * Download the OpenAPI schema with `curl -o openapi.json https://xquik.com/openapi.json` * [Source Repository](https://github.com/Xquik-dev/x-twitter-scraper-typescript) # X (Twitter) API TypeScript follower export to CSV Source: https://docs.xquik.com/sdks/typescript-follower-export Export X (Twitter) followers with the Xquik TypeScript SDK. Estimate the job, run the extraction, and save CSV, JSON, or XLSX files for your team and your CRM. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [TypeScript SDK setup](/sdks/typescript), which covers install and authentication. ## Follower export workflow to CSV, JSON, or XLSX Use this workflow when a worker needs an owned follower list. It fits Node.js, Bun, and queue workers. Use the list for CRM import, warehouse loading, account scoring, or analyst CSV. You can also deliver it as an XLSX workbook or a resumable JSON handoff. The workflow calls `POST /extractions/estimate` through `client.extractions.estimateCost`. It creates the job with `client.extractions.run`. It reads saved rows with `client.extractions.retrieve`. It downloads files with `client.extractions.exportResults`. > [!NOTE] > > `client.extractions.run` returns the queued `202 Accepted` receipt from `POST /extractions`. The receipt holds `id`, `toolType`, and `status: "running"`. Store `job.id` immediately, then poll `client.extractions.retrieve` before reading pages or calling `client.extractions.exportResults`. Credit reservation happens after the job starts. If available credits changed since `estimateCost`, the API has 2 options. It can set `resultsLimit` to the affordable count before fetching rows. Or it can mark the job `failed` with `insufficient_credits`. ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { open, writeFile } from "node:fs/promises"; import XTwitterScraper from "x-twitter-scraper"; const client = new XTwitterScraper(); const targetUsername = "username"; const sleep = (ms: number): Promise => new Promise((resolve) => setTimeout(resolve, ms)); const estimate = await client.extractions.estimateCost({ toolType: "follower_explorer", targetUsername, }); if (!estimate.allowed) { throw new Error("Insufficient credits for follower export."); } const job = await client.extractions.run({ toolType: "follower_explorer", targetUsername, }); while (true) { const statusPage = await client.extractions.retrieve(job.id, { limit: 1 }); const status = statusPage.job["status"]; if (status === "completed") { break; } if (status === "failed") { throw new Error("Follower export failed."); } await sleep(10000); } let cursor: string | undefined; const jsonl = await open("xquik-followers.jsonl", "w"); try { while (true) { const page = await client.extractions.retrieve(job.id, { limit: 1000, cursor, }); for (const row of page.results) { await jsonl.write(`${JSON.stringify(row)}\n`); } if (!page.hasMore || !page.nextCursor) { break; } cursor = page.nextCursor; } } finally { await jsonl.close(); } const csv = await client.extractions.exportResults(job.id, { format: "csv" }); await writeFile("xquik-followers.csv", Buffer.from(await csv.arrayBuffer())); const json = await client.extractions.exportResults(job.id, { format: "json" }); await writeFile("xquik-followers.json", Buffer.from(await json.arrayBuffer())); const xlsx = await client.extractions.exportResults(job.id, { format: "xlsx" }); await writeFile("xquik-followers.xlsx", Buffer.from(await xlsx.arrayBuffer())); ``` `follower_explorer` requires `targetUsername`. Store `job.id`, `targetUsername`, `estimate.estimatedResults`, and `estimate.source` before polling. With them, a queue retry, worker restart, or agent handoff can resume that export. `client.extractions.retrieve` returns `results`, `hasMore`, and `nextCursor`. Pass `nextCursor` back as `cursor` when you need stored JSON pages before exporting files. Use `xquik-followers.jsonl` for queue replay or warehouse loads, and `xquik-followers.json` for app ingestion. Use `xquik-followers.csv` for CRM import and `xquik-followers.xlsx` for analyst handoff. Map exported `User ID` or row `xUserId` as the CRM unique key. The cost is 1 credit per follower extracted or returned. Exports cost no credits after the extraction job exists. ## Next steps * [TypeScript SDK setup](/sdks/typescript) * [Tweet search](/sdks/typescript-tweet-search) * [Media tweets](/sdks/typescript-media-tweets) # X (Twitter) API TypeScript media tweets & DM media Source: https://docs.xquik.com/sdks/typescript-media-tweets Upload media with the Xquik TypeScript SDK, post tweets with photos or video, and send DM attachments from a connected X (Twitter) account in your own apps. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [TypeScript SDK setup](/sdks/typescript), which covers install and authentication. ## Workflow to post media tweets and DM attachments Use this workflow when a TypeScript worker, support queue, or agent service sends media. It can post a media-backed tweet or reply with media. It can also send one uploaded media item in a DM. Tweet and reply media posts use public media URLs directly on `client.x.tweets.create`. Send up to 4 image URLs or exactly 1 MP4 video URL. The video can be up to 100 MB. Do not mix video with other media. Do not upload first when the media URL is already public. ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} interface TweetWriteAction { id: string; status: string; terminal: boolean; safeToRetry: boolean; statusUrl: string; request: { hash: string | null }; billing: { charged: boolean; chargedCredits: string }; result: { id?: string } | null; tweetId?: string; } function createTweetHandoff( action: TweetWriteAction, base: { account: string; media: string[]; reply_to_tweet_id?: string; }, ) { const thread = base.reply_to_tweet_id ? { reply_to_tweet_id: base.reply_to_tweet_id } : {}; return { status: action.status, terminal: action.terminal, safe_to_retry: action.safeToRetry, write_action_id: action.id, request_hash: action.request.hash, tweet_id: action.result?.id ?? action.tweetId ?? null, charged: action.billing.charged, charged_credits: action.billing.chargedCredits, poll: action.terminal ? null : action.statusUrl, ...base, ...thread, }; } ``` Capture the durable write action from the raw response. Send a unique `Idempotency-Key`. Store `id`, `request.hash`, `billing`, `result`, and `statusUrl`. Poll while `terminal` is false. Retry only when `safeToRetry` is true, using a new key. ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const tweet = (await client.x.tweets.create({ account: "@username", text: "New demo video is live.", media: ["https://example.com/product-demo.mp4"], })) as TweetWriteAction; const tweetHandoff = createTweetHandoff(tweet, { account: "@username", media: ["https://example.com/product-demo.mp4"], }); process.stdout.write(`${JSON.stringify(tweetHandoff)}\n`); ``` To post an image reply, add `reply_to_tweet_id`. ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const reply = (await client.x.tweets.create({ account: "@username", text: "Here is the requested screenshot.", reply_to_tweet_id: "1893704267862470862", media: ["https://example.com/export-preview.png"], })) as TweetCreateResult; const replyHandoff = createTweetHandoff(reply, { account: "@username", reply_to_tweet_id: "1893704267862470862", media: ["https://example.com/export-preview.png"], }); process.stdout.write(`${JSON.stringify(replyHandoff)}\n`); ``` For DM attachments, upload the local file first. Then pass the returned `media.mediaId` as the only `media_ids` item. ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import fs from "node:fs"; const media = await client.x.media.upload({ account: "@username", file: fs.createReadStream("./handoff.png"), }); const dm = await client.x.dm.send("44196397", { account: "@username", text: "Here is the asset.", media_ids: [media.mediaId], }); const dmHandoff = { status: "sent", message_id: dm.messageId, media_id: media.mediaId, account: "@username", user_id: "44196397", }; process.stdout.write(`${JSON.stringify(dmHandoff)}\n`); ``` `client.x.tweets.create` returns `tweet.tweetId` for confirmed posts. While confirmation is still running, it returns the pending write fields above. `client.x.media.upload` returns `media.mediaId` for DM attachments. `client.x.dm.send` returns `dm.messageId` for support tickets, CRM records, queue jobs, or agent memory. Keep DM body text in private systems. Shared logs, public artifacts, queue status, and agent handoffs should omit full DM bodies. They should store `message_id`, optional `media_id`, `account`, `user_id`, and send status. Leave `reply_to_message_id` unset even if generated SDK types expose it. The REST endpoint rejects DM reply threading. `client.x.dm.deleteMessage` [deletes a DM](/api-reference/x-write/delete-dm). Text-only tweet and reply writes cost 30 credits. Tweet media adds 2 credits per started MB across attached files. Uploading media costs 10 credits. Sending the DM costs 10 credits. Do not pass uploaded `media.mediaId` values to `client.x.tweets.create`. That method uses `media` with public media URLs. These endpoints are useful next. * [Search Tweets](/api-reference/x/search-tweets) * [Create Extraction](/api-reference/extractions/create) * [Get Extraction](/api-reference/extractions/twitter-extraction-results) * [Export Extraction](/api-reference/extractions/export) * [Get User](/api-reference/x/twitter-profile-lookup) * [Create Tweet](/api-reference/x-write/create-tweet) * [Upload Media](/api-reference/x-write/upload-media) * [Send Direct Message](/api-reference/x-write/send-dm) * [Create Monitor](/api-reference/monitors/create) * [Create Webhook](/api-reference/webhooks/create) ### REST routes | Task | REST route | Reference | | - | - | - | | Post a media tweet or reply | `POST /x/tweets` | [Create tweet](/api-reference/x-write/create-tweet) | | Upload a local file | `POST /x/media` | [Upload media](/api-reference/x-write/upload-media) | | Send a DM attachment | `POST /x/dm/{userId}` | [Send DM](/api-reference/x-write/send-dm) | | Check a write action | `GET /x/write-actions/{id}` | [Write action status](/api-reference/x-write/get-write-action-status) | | Delete a DM | `DELETE /x/dm/{userId}/messages/{messageId}` | [Delete DM](/api-reference/x-write/delete-dm) | ## Next steps * [TypeScript SDK setup](/sdks/typescript) * [Tweet search](/sdks/typescript-tweet-search) * [Follower export](/sdks/typescript-follower-export) # X (Twitter) API TypeScript tweet search & CSV export Source: https://docs.xquik.com/sdks/typescript-tweet-search Search tweets with the Xquik TypeScript SDK, follow cursors, and save rows as JSON Lines, CSV, or XLSX for workers, queues, and analysts in your own apps. > For the complete documentation index, see [llms.txt](/llms.txt). This guide builds on the [TypeScript SDK setup](/sdks/typescript), which covers install and authentication. ## Tweet search workflow to JSON Lines, CSV, or XLSX This job is for Node.js, Bun, and queue workers that need searchable tweet data. They need it in a stable handoff format. The format is for queues, data lakes, analyst CSV files, or XLSX workbooks. It calls `GET /x/tweets/search` through `client.x.tweets.search` with the generated `TweetSearchParams` shape. It writes each returned tweet as one projected JSON object per line. ```ts theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import XTwitterScraper from "x-twitter-scraper"; const client = new XTwitterScraper(); const query = "from:username webhook OR SDK"; let cursor: string | undefined; let pageIndex = 0; while (true) { const pageCursor = cursor ?? null; const page = await client.x.tweets.search({ q: query, queryType: "Latest", cursor, }); for (const tweet of page.tweets) { const row = { source: "xquik.typescript.search", query, tweet_id: tweet.id, text: tweet.text, author_id: tweet.author?.id ?? null, author_username: tweet.author?.username ?? null, author_name: tweet.author?.name ?? null, created_at: tweet.createdAt ?? null, like_count: tweet.likeCount ?? 0, reply_count: tweet.replyCount ?? 0, retweet_count: tweet.retweetCount ?? 0, quote_count: tweet.quoteCount ?? 0, view_count: tweet.viewCount ?? 0, bookmark_count: tweet.bookmarkCount ?? 0, is_note_tweet: tweet.isNoteTweet ?? false, page_index: pageIndex, page_cursor: pageCursor, next_cursor: page.next_cursor || null, has_next_page: page.has_next_page, }; process.stdout.write(`${JSON.stringify(row)}\n`); } if (!page.has_next_page || !page.next_cursor) { break; } cursor = page.next_cursor; pageIndex += 1; } ``` The generated params map directly to the REST endpoint. > [card] q > > Maps to REST `q`. It holds the required X (Twitter) search query with keywords, handles, hashtags, or operators. > [card] limit > > Maps to REST `limit`. Use it as a 1 to 200 upper bound for a bounded pull. If `page.has_next_page` is true, keep the same `q`, filters, `queryType`, and `limit`. That applies when you continue with `page.next_cursor`. > [card] cursor > > Maps to REST `cursor`. Pass the opaque cursor from `page.next_cursor` to request the next page. > [card] sinceTime > > Maps to REST `sinceTime`. Use the inclusive ISO bound on every page. > [card] untilTime > > Maps to REST `untilTime`. Use the exclusive ISO bound on every page. > [card] queryType > > Maps to REST `queryType`. Use `Latest` for chronological results or `Top` for engagement-ranked results. ## Returned data & handoff `client.x.tweets.search` returns `PaginatedTweets`. > [card] page.tweets > > JSON field `tweets`. Contains tweet records with `id`, `text`, optional `author`, and `createdAt`. Records also carry `likeCount`, `replyCount`, `retweetCount`, `quoteCount`, `bookmarkCount`, `viewCount`, and `isNoteTweet` when available. > [card] page.has_next_page > > TypeScript field `page.has_next_page`. JSON field `has_next_page`. Tells your worker whether another page exists. > [card] page.next_cursor > > JSON field `next_cursor`. Store it only when `page.has_next_page` is true. For bounded pulls that return fewer tweets than `limit`, pass it back as `cursor`. Send the same query, filters, `queryType`, and `limit` with it. Project `page.tweets` into JSON Lines rows in `xquik-tweet-search.jsonl` for queues and data lakes. You can also transform the same projected records into CSV for analysts. When account teams need spreadsheets, produce XLSX from those rows. Store `tweet_id`, `author_username`, engagement counts, `page_index`, `page_cursor`, `next_cursor`, and `has_next_page`. With them, workers resume from the last saved cursor without replaying raw SDK objects. For explicit `limit` pulls, resume with the same query, filters, `queryType`, and `limit`. Only `cursor` changes. ## Next steps * [TypeScript SDK setup](/sdks/typescript) * [Follower export](/sdks/typescript-follower-export) * [Media tweets](/sdks/typescript-media-tweets) # Security reports for Xquik API, MCP & webhooks Source: https://docs.xquik.com/security Report vulnerabilities affecting Xquik docs, API keys, REST requests, MCP, OAuth, webhooks, SDKs, account connections, or exports through a private channel. Use [private vulnerability reporting](https://github.com/Xquik-dev/xquik-docs/security/advisories/new). Email [support@xquik.com](mailto:support@xquik.com) with the subject `Security report` if GitHub is unavailable. Do not open a public issue, discussion, or pull request for a vulnerability. ## What to include Describe the issue, impact, affected URL, and reproduction steps. Include safe request or response samples when useful. Remove every secret and personal field. Never send API keys, passwords, session cookies, or personal data. ## Response targets Xquik reviews private reports against these targets. * Acknowledgement within 3 business days * Initial triage within 14 days * A mitigation plan after triage * Progress updates at least every 14 days Critical issues receive immediate priority. ## Rewards Rewards can be monetary and depend on the bug's impact. Xquik decides each reward, and not every report earns one. The [bug bounty and vulnerability disclosure policy](https://xquik.com/en/vulnerability-disclosure) lists the scope and test rules. It also lists the reward rules. ## Scope Reports cover Xquik docs, the X (Twitter) REST API, MCP, OAuth, webhooks, and SDKs. Send product support questions to [support@xquik.com](mailto:support@xquik.com). ## Verify bot identity Xquik publishes Web Bot Auth keys at `https://xquik.com/.well-known/http-message-signatures-directory`. Require HTTPS and the documented origin. Check the `Content-Digest` header. Verify every RFC 9421 `bindingN` signature with its Ed25519 JWK. Reject expired keys or signatures. The JSON response never includes private key material. Follow `Cache-Control` when caching the directory. Key rotation keeps an overlap window so clients can refresh without losing valid signatures. ## Threat model Protected assets include contract integrity and release metadata. Tests detect public drift. Exact dependency pins and lockfile integrity protect documentation builds. ## Safe harbor Xquik supports good-faith security research that avoids privacy violations, data destruction, and service interruption. Allow reasonable time for remediation before public disclosure. Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp. # Xquik trust numbers for usage, speed & security Source: https://docs.xquik.com/trust See live Xquik numbers with sources. Package downloads, Apify users & ratings, daily uptime, read speed & OpenSSF results, rounded down & updated hourly. > For the complete documentation index, see [llms.txt](/llms.txt). [![Play Framer's video on YouTube. Framer builds a tweet ticker with Xquik.](https://img.youtube.com/vi/4UOSpoOoC3Y/maxresdefault.jpg)](https://youtu.be/4UOSpoOoC3Y?t=367) Watch Framer build a tweet ticker with Xquik, from 6:07. Framer posted it on June 16, 2026. Xquik publishes its X (Twitter) API usage, reviews, speed & security numbers on 1 page. Each number links to its source and shows the day Xquik read it. * [Benchmarks](https://xquik.com/en/benchmarks) shows every number with its source. * The same numbers come as a [JSON file](https://xquik.com/trust.json). ## What the page covers * Package downloads on npm, PyPI, RubyGems, NuGet, Packagist & the Terraform Registry * Apify Store users, runs, ratings & review counts * Skill installs on skills.sh & ClawHub * Registered Xquik accounts & GitHub stars * Measured read speed & published benchmarks * OpenSSF Best Practices results * Xquik's listings on GitHub, Apify, package registries & MCP directories * Daily uptime, API requests, accounts & read times for up to 90 days ## How Xquik keeps the numbers honest Xquik reads each number from its source every hour. Counts round down, so "10,000+" means at least 10,000. Read times round up, so they never look faster than measured. A number drops out when its source has not answered for 3 days. API requests & read times leave out Xquik's own traffic, such as its tests. ## Use the numbers in your own tools Agents & scripts can read `https://xquik.com/trust.json` without an API key. Each entry has the value, display text, unit, date, source & badge URL. Each trend lists 1 point per day with its unit & source. # X (Twitter) API alternatives compared by price Source: https://docs.xquik.com/twitter-api-alternatives Compare X (Twitter) API alternatives by price per result. Xquik bills USD 0.00015 per tweet. X lists USD 0.005 per post read. See scrapers and exporters. > For the complete documentation index, see [llms.txt](/llms.txt). Compare Twitter APIs and X (Twitter) API alternatives by what 1 result costs. Xquik bills USD 0.00015 per tweet, profile, or follower with pay-as-you-go credits. It charges only for delivered, unique, filter-matching results. X's pricing page lists USD 0.005 per post read. It also lists USD 0.010 per user read. See [Xquik pricing](https://xquik.com/en) for plans and credits. Compare Xquik with official X (Twitter) APIs, Twitter scraper APIs, and follower exporters. Also compare it with creator tools and social suites. Each guide tests a defined task, output, handoff, and cost. > [!NOTE] > > Verify current contracts and prices before choosing a service. Use the same > workload for every test. ## How to choose the best X (Twitter) scraper API The best X (Twitter) scraper API depends on the records and destination. Define the tweets, followers, replies, profiles, media, or monitors you need. Then compare pagination, exports, webhooks, SDKs, MCP, retries, and maintenance. Test the same query, profile, or export in each candidate. Compare fields, missing records, cursors, recovery, and total cost. ## X (Twitter) API alternative questions for 2026 ### What is the best API to scrape Twitter data in 2026? Replace the word data with the records your workflow needs. List tweets, replies, reposts, likes, profiles, followers, following, timelines, media, communities, or lists. Then test one real request against every candidate. Check returned Tweet IDs, user IDs, timestamps, engagement counts, media URLs, and cursor fields. Measure missing rows, duplicate rows, response time, and retry behavior. Price the same result count separately. Xquik supports direct cursor pages, saved extraction jobs, and file exports. It also supports monitors, signed webhooks, SDKs, and MCP. Use only the features the tested workflow needs. Recheck limits, prices, and contracts before choosing. ### What is the best X (Twitter) scraper API for developers in 2026? No single X (Twitter) API fits every export. Compare supported searches, tweet fields, author fields, rate limits, and cursor behavior. Then compare SDKs, costs, and file formats. Check for tweet text, replies, reposts, and likes. Also check media, profiles, and stable Tweet IDs. Xquik fits developers who need direct Twitter search and saved export jobs. The direct route returns cursor pages. Extraction jobs add estimates, receipts, status polling, and CSV, JSON, or XLSX files. Both paths use one API key. Use direct search for low-latency pages. Use extraction jobs for repeatable exports. Use account or keyword monitors for real-time alerts. Each option has its own request and response contract. Test the production integration before choosing. Include API-key storage, query operators, date ranges, and cursor checkpoints. Test rate limits, `429` recovery, temporary failures, and row deduplication. Validate every export. Compare Tweet IDs, author IDs, timestamps, text, engagement counts, media, and URLs. The test must verify those records and recovery steps. ### Best X (Twitter) API 2026 Choose the best X (Twitter) API for one defined production workflow. Tweet search needs query operators, stable Tweet IDs, author fields, and dates. It also needs engagement counts, media, and cursor pagination. A follower export needs stable user IDs, profile fields, page checkpoints, and file formats. A monitor needs event identity, webhook verification, retries, and replay. Run the same request, result cap, and time window through each shortlisted API. Record complete fields, omitted fields, duplicates, errors, latency, and credits consumed. Xquik fits integrations requiring REST, saved exports, monitors, or signed webhooks. It also provides SDKs, MCP, and Actors. Verify the current contract before selecting any 2026 provider. ### Which X (Twitter) API alternative is easiest to use? Start with one real task. Test tweet search, follower export, reply export, or a monitor webhook. The easiest API returns required fields with clear authentication, pagination, and errors. It also documents costs and SDK examples. Xquik packages tweet reads, profile reads, and follower or reply exports. It also provides account actions, monitors, signed webhooks, SDKs, MCP, and files. Teams still need the correct endpoint. They must store returned IDs and cursors. Time the first request and the production implementation. Include secret storage, cursor checkpoints, rate-limit recovery, and idempotent retries. Also include typed response handling and production alerts. The easiest X (Twitter) API alternative makes those operational steps explicit. It should help diagnose missing tweets, repeated followers, or rejected writes. It should also explain failed webhook delivery without browser scraping. ### Twitter data API comparison Make this comparison concrete by naming every required record. For tweets, compare text, author ID, creation time, replies, reposts, and likes. Also compare quotes, views, bookmarks, media, and permalinks. For profiles, compare stable user IDs, usernames, names, bios, and verification. Then compare locations, audience counts, and images. Next compare authentication, search operators, page sizes, cursors, rate limits, errors, and retries. Then compare exports, webhooks, SDKs, and MCP access. Run one fixed query and one fixed follower profile through each API. Store the returned IDs and costs. This produces a reproducible X (Twitter) API comparison instead of a generic feature table. Omit rows lacking current documentation or a controlled test. ### Top tweet scraping tools Evaluate top tweet scraping tools with a repeatable test set. Include a keyword query, hashtag, author filter, language, and date range. Add a media filter and minimum engagement threshold. Check for stable Tweet IDs, full text, author IDs, and timestamps. Then inspect replies, reposts, likes, quotes, media URLs, and the opaque cursor. Also test `429` handling, temporary failures, duplicate prevention, and saved checkpoints. Inspect CSV and JSON exports. Browser scrapers may suit a local experiment. Hosted APIs suit applications requiring documented responses and operational support. Xquik adds live search, extraction jobs, monitors, and webhooks. It also provides SDKs, MCP, and Actors. Compare the same result count and handoff before choosing. ### Best X (Twitter) scraper API Start with the destination. A spreadsheet workflow needs stable columns and CSV or XLSX output. A warehouse needs JSON rows, stable IDs, timestamps, and replayable checkpoints. A live application needs predictable cursor pages, rate-limit headers, retry instructions, and typed responses. For Xquik, use live Twitter search for current pages. Use an extraction job for an estimate, durable job ID, status, and downloadable files. Use a keyword or account monitor when matching tweets must create events. Test the chosen path with the real query and result cap. The best X (Twitter) scraper API matches the destination through a verified contract. It should not require manual cleanup. ### X (Twitter) API alternatives 2026 X (Twitter) API alternatives include official access, hosted scraper APIs, and open-source clients. Other options include browser automation, dataset platforms, and social suites. They solve different tasks. Compare tweet search, profile lookup, followers, following, replies, and timelines. Then compare media, communities, lists, writes, monitors, and webhooks. Create a dated scorecard. Record required authentication, returned fields, cursor behavior, rate limits, and file exports. Add SDK coverage, recovery steps, and one fixed workload cost. Test changes before migration. Xquik can combine REST, exports, account actions, monitors, and signed webhooks. It also offers SDKs, MCP, and Actors. That benefit matters only when workflows use those options. ### Is Xquik better than the official X (Twitter) API for scraping? That depends on the required contract. Choose direct platform access when its tier, authentication, fields, and limits fit. Choose Xquik for hosted extraction jobs, file exports, and credit estimates. It also provides replayable monitor events through one documented integration. Compare the same query and result count. Inspect tweet text, authors, profiles, media, replies, engagement fields, cursors, errors, and total cost. Do not base the decision on a feature-list total. Include operational differences. Record API-key or OAuth setup, supported search windows, page sizes, and `429` recovery. Add saved exports and production support. Direct access may fit teams aligned with official tiers and limits. Xquik may fit teams needing hosted jobs, files, monitors, or webhook replay. Keep the conclusion scoped to the test date and workload. ### Xquik vs Apify Twitter scraper Choose Apify when Actors, datasets, schedules, and the Apify ecosystem own the workflow. Xquik publishes tweet and follower Actors for those handoffs. Choose Xquik REST for direct pages, account actions, monitors, or signed webhooks. REST also supports SDKs and MCP. Test the relevant Actor and REST route with the same target before migrating. Compare Actor input, dataset schema, run status, schedules, retries, storage, and compute charges. Compare them against Xquik request fields, records, credits, and files. Check Tweet IDs, author IDs, engagement counts, media URLs, and pagination. Use Xquik on Apify when Actors and datasets are the desired handoff. Use REST for immediate pages, Xquik monitors, or webhooks. ### Xquik vs X (Twitter) API v2 Compare authentication, search coverage, returned fields, pagination, rate limits, exports, webhooks, and write requirements. Official API access offers a direct platform contract. Xquik provides its own documented response contracts and workflow tooling. Keep product claims scoped to the tested task. Review the dedicated [X API comparison](/alternatives/x-api) for the current migration checklist. Test one recent search, user lookup, and follower page where available. Compare stable IDs, tweet fields, profile fields, and time-window rules. Then inspect expansions, cursors, rate limits, and error bodies. Price the required monthly volume. Xquik adds extraction, export, monitor, webhook, SDK, MCP, and Actor contracts. It does not remove X terms or result validation. ### What makes a strong X (Twitter) API comparison? Use one test account, search query, time window, and result cap. Record returned Tweet IDs, author IDs, profile fields, cursors, retry behavior, and elapsed time. Price the same workload instead of comparing unrelated plan labels. Repeat the test after any material API or pricing change. A 2026 comparison must identify its test date and source links. Keep unsupported claims out of the buying brief. ## When Xquik fits Choose Xquik when an X workflow must move into code, exports, or signed webhooks. Choose it when the workflow must move into SDKs, MCP, or repeatable dashboard tools. > [card] Concrete outputs > > Test tweet results, followers, replies, media, monitor events, webhook > payloads, and export files. > [card] Integration handoff > > Start in the dashboard. Move the verified task to REST, an SDK, or MCP. Or > move it to an export or a signed webhook. > [card] Operational fit > > Check authentication, cursors, retries, idempotency, file formats, and > support before migrating. > [card] Cost control > > Price the tested workload with the current [billing guide](/guides/billing). > Include credits, plan fees, retries, storage, and platform charges. Open the guide for your current product or category. Compare one production task before comparing whole platforms. ## Sector decision matrix Some buying briefs start with a sector, workflow, or team, not a product name. Use this matrix for them. > [card] Developer API teams > > Start with [X API](/alternatives/x-api), [Twitter API Pro](/alternatives/twitter-api-pro), or [twscrape](/alternatives/twscrape). Choose Xquik when the team needs hosted tweet search, user lookup, and follower checks. Choose it when the team also needs retries, pagination, SDKs, MCP, and signed webhooks. Test JSON API responses, cursor pagination, webhook payloads, and SDK calls. > [card] Scraping and dataset teams > > Start with [Apify](/alternatives/apify), SocialCrawl, or TweetStream. Choose Xquik when the X job needs Xquik on Apify or follower exports. Choose it for tweet datasets or for connecting datasets, REST, webhooks, and MCP. Test Apify dataset rows, CSV, JSON, or XLSX exports, and REST response fields. > [card] Creator publishing teams > > Start with [Typefully](/alternatives/typefully), [Hypefury](/alternatives/hypefury), or [Tweet Hunter](/alternatives/tweet-hunter). Choose Xquik for media uploads, direct messages, follower exports, monitor events, and API handoff. Test draft text, media upload result, tweet creation response, and monitor event. > [card] Social listening and enterprise teams > > Start with Brandwatch, Meltwater, Talkwalker, [Hootsuite](/alternatives/hootsuite), [Sprout Social](/alternatives/sprout-social), or Sprinklr. Choose Xquik when a broad suite is too much. Test tweet search, profile records, follower exports, and account actions. Also test monitor events, webhook payloads, and export files. > [card] Workflow automation teams > > Start with [n8n](/guides/n8n), [Make](/guides/make), [Zapier](/guides/zapier), or [Pipedream](/guides/pipedream). Choose Xquik when the workflow builder should keep orchestration. Xquik then supplies exact X records, signed webhooks, SDKs, MCP, and exports. Test HTTP step response, signed webhook event, extraction export, and MCP tool result. > [card] AI agent teams > > Start with Antwork, Outstand, or TryPost. Choose Xquik when agents need tweet search, user profiles, or monitor events. Choose it too when agents need compose guidance or normalized MCP pagination. Test MCP tool result, tweet search records, user profile fields, and compose score. ## API & developer > [card] [Official X API vs Xquik](/alternatives/x-api) > > Use X API when you need direct platform access. It fits if you can build auth, pagination, storage, retries, exports, and alerts. Use Xquik when you want those pieces packaged. > [card] [X MCP servers compared](/alternatives/twitter-mcp-servers) > > Compare Xquik's hosted MCP server with xmcp & community servers by keys, tools & read price. > [card] [Twitter API Pro alternative](/alternatives/twitter-api-pro) > > Use higher-tier official X API access when you need direct platform control. Use Xquik when the task is tweet search, follower export, or monitoring. Use it for webhook delivery or account actions too. > [card] [Postproxy alternative](/alternatives/postproxy) > > Use Postproxy when one API must publish to many social networks. Use Xquik when the X part also needs search, follower exports, or monitors. Use it too when that part needs signed webhooks, SDKs, or MCP. > [card] [SocialCrawl alternative](/alternatives/socialcrawl) > > Use SocialCrawl for cross-network collection. Use Xquik when tweets, > profiles, followers, replies, or timelines must connect to these tools. The > tools are account actions, exports, 1-second monitors, signed webhooks, > SDKs, and MCP. > [card] [SocialData alternative](/alternatives/socialdata) > > Xquik costs 25% less per result than SocialData. It adds writes, 1-second monitors & exports. > [card] GetXAPI > > GetXAPI bills USD 0.001 per call, kept rows or not. Xquik bills only the rows you keep. > [card] [TwitterAPI.io alternative](/alternatives/twitterapi-io) > > TwitterAPI.io bills every call, even empty ones. Xquik bills only returned tweets & adds file exports. > [card] TwitterAPIs > > TwitterAPIs bills USD 0.0008 per call, even empty ones. Xquik bills only results & checks monitors every second. > [card] [Sorsa alternative](/alternatives/sorsa) > > Sorsa needs a plan from USD 49 a month & bills each call. Xquik bills only results, with writes & monitors. > [card] [Xpoz alternative](/alternatives/xpoz) > > Xpoz bills every search & page, whatever returns. Xquik bills only X results & adds writes & monitors. > [card] [ScrapeCreators alternative](/alternatives/scrapecreators) > > ScrapeCreators bills empty search pages. Xquik bills only results & searches X natively. > [card] Social Fetch > > Social Fetch bills misses & checks X every 5 minutes. Xquik bills reads only for results & checks monitors every second. > [card] TwexAPI > > TwexAPI bills empty requests & ships no monitors. Xquik bills only results & pushes 1-second monitor events. > [card] [ScrapeBadger alternative](/alternatives/scrapebadger) > > ScrapeBadger reads X among many other sites. Xquik bills only delivered rows & adds writes & exports. > [card] Data365 > > Data365 starts at EUR 300 a month with minutes of latency. Xquik bills per result & answers in seconds. > [card] [Bright Data alternative](/alternatives/bright-data) > > Xquik costs 90% less per X result than Bright Data. It adds keyword search, monitors & writes. > [card] [Apify alternative](/alternatives/apify) > > Tweet Scraper V2 cost USD 0.000623 per useful tweet in public benchmarks. Xquik cost USD 0.000155. > [card] [Xanguard alternative](/alternatives/xanguard) > > Use Xanguard for crypto alert streams. Use Xquik for tweet search, user lookups, follower exports, writes, webhooks, SDKs, and MCP. > [card] TweetStream > > Use TweetStream for a dedicated real-time tweet stream. Use Xquik for extractions, exports, account actions, monitors, signed webhooks, SDKs, and MCP together. > [card] [twscrape alternative](/alternatives/twscrape) > > Use twscrape when you want to own the code and maintenance. Use Xquik when you want hosted endpoints, billing, exports, monitors, webhooks, and support. > [card] [snscrape alternative](/alternatives/snscrape) > > snscrape Twitter scrapes have failed since June 2023. Use Xquik to run the same searches from Python with no X account. > [card] [Nitter alternative](/alternatives/nitter) > > nitter.net shows no posts and its repository is archived. Read X with no X account and follow accounts by alert. > [card] [Sotwe and TwStalker alternative](/alternatives/sotwe-twstalker) > > Both Twitter web viewers block scripts. View Twitter without an account through Xquik's viewer or API. > [card] [Syften alternative](/alternatives/syften) > > Syften bills USD 40 a month for 1,000 X posts, rejected ones too. Xquik bills only kept tweets & alerts every second. > [card] [Brand24 alternative](/alternatives/brand24) > > Brand24 plans start at USD 249 a month with mention caps. Xquik bills per tweet & returns full X text. > [card] [OpenTweet alternative](/alternatives/opentweet) > > OpenTweet sells plans with daily post caps. Xquik posts for USD 0.0045 a tweet & also reads & monitors X. > [card] [SnitchFeed alternative](/alternatives/snitchfeed) > > SnitchFeed bills each hourly X scan, posts found or not. Xquik bills only kept tweets & checks every second. > [card] [Tweepy alternative](/alternatives/tweepy) > > Tweepy calls the X API at USD 0.005 per post read. Xquik's Python SDK reads tweets for USD 0.00015. > [card] [Keyhole alternative](/alternatives/keyhole) > > Keyhole sells post-capped plans with pricing on request. Xquik bills per tweet & publishes every price. > [card] [Tweet Binder alternative](/alternatives/tweet-binder) > > Tweet Binder PRO opens by request on 1 annual plan. Xquik reports any hashtag for 1 credit per post. > [card] Pulsar > > Pulsar lists pricing on request. Xquik bills USD 0.00015 per X result & monitors every second. > [card] [TweetAPI alternative](/alternatives/tweetapi) > > TweetAPI bills every call, even empty pages & retries. Xquik bills only the tweets you keep. The TwitterAPIs alternative card compares Xquik with [TwitterAPIs, a pay-per-call X API](https://twitterapis.com). ## Publishing & creator > [card] [Typefully alternative](/alternatives/typefully) > > Use Typefully for drafting and scheduling threads. Use Xquik when publishing must connect to tweet search, follower exports, or media uploads. Use it too when publishing must connect to DMs, monitors, APIs, or MCP. > [card] [Hypefury alternative](/alternatives/hypefury) > > Use Hypefury for creator queues and repurposing. Use Xquik when the task also needs tweet, profile, follower, reply & timeline extraction. Use it too when the task needs account actions, signed webhooks, SDKs, or MCP. > [card] [Buffer alternative](/alternatives/buffer) > > Use Buffer for low-cost multi-channel scheduling. Use Xquik when the X task needs raw records, follower exports, or write actions. Use it too when the task needs monitors, webhooks, SDKs, or MCP. > [card] [Hootsuite alternative](/alternatives/hootsuite) > > Use Hootsuite for approvals, inboxes, and reporting across networks. Use Xquik for tweet, profile, follower, reply and account actions without a social-suite rollout. > [card] [Tweet Hunter alternative](/alternatives/tweet-hunter) > > Use Tweet Hunter for ideas, scheduling, and creator growth. Use Xquik when you also need data exports, monitors, or API keys. Use it too when you need signed webhooks, SDKs, or MCP. > [card] [Circleboom alternative](/alternatives/circleboom) > > Use Circleboom to schedule posts on plans sized by follower count. Use Xquik to delete tweets, track unfollowers and check fake followers by credit. > [card] Black Magic > > Use Black Magic for creator relationship context. Use Xquik when the task is extracting records or monitoring accounts. Use it too for sending webhooks or connecting X (Twitter) actions to code. > [card] Postwise > > Use Postwise for writing assistance and scheduling. Use Xquik when publishing must connect to exports, account actions, or monitors. Use it too when publishing must connect to signed webhooks, SDKs, or MCP. > [card] Post Bridge > > Use Post Bridge for cross-posting. Use Xquik when the X task needs more than scheduling. That means search, exports, writes, monitors, webhooks, SDKs, or MCP. > [card] [Late / Zernio alternative](/alternatives/late) > > Use Late or Zernio when one API must post across many networks. Use Xquik for lower-cost X reads, exports, monitors, signed webhooks, SDKs, and MCP. ## Agency & enterprise > [card] Brandwatch > > Use Brandwatch for social listening, consumer intelligence, and social media management. Use Xquik when the X job needs tweet search, follower exports, or monitor events. Use it too when the job needs webhooks, SDKs, or MCP. > [card] Meltwater > > Use Meltwater for media monitoring, social listening, and PR workflows. Use Xquik when the X job needs tweet search, follower exports, or monitor events. Use it too when the job needs webhooks, SDKs, or MCP. > [card] Talkwalker > > Use Talkwalker for consumer intelligence, social listening, sentiment, and trends. Use Xquik when the X job needs tweet search, follower exports, or monitor events. Use it too when the job needs webhooks, SDKs, or MCP. > [card] [Sprout Social alternative](/alternatives/sprout-social) > > Use Sprout Social for social care, analytics, and team reporting. Use Xquik > for tweet search, profile records, and follower exports. Also use it for > account actions, monitors, and signed webhook delivery. > [card] Sprinklr > > Use Sprinklr for enterprise CX, listening, and governance. Use Xquik without > a full CX platform. It covers focused tweet search, profile lookup, follower > exports, replies, account actions, and webhooks. > [card] Audiense > > Use Audiense for audience segmentation and intelligence. Use Xquik when you need to fetch, export, monitor, and automate X records directly. ## Workflow automation shortlist Use this shortlist when the alternative is an automation builder. Keep it when it owns approvals, schedules, app credentials, or team handoffs. Put Xquik behind it for tweet search, profile lookup, follower exports, or reply scraping. Do the same for account actions, monitor events, signed webhooks, SDKs, or MCP. > [card] [n8n](/guides/n8n) > > Use it for self-hosted or cloud workflows and AI agent steps. Use it for branching logic and app orchestration too. Put Xquik behind it when the workflow needs tweet search or user lookup. Do the same for extraction jobs, monitor events, or MCP calls. > [card] [Make](/guides/make) > > Use it for visual scenarios, routers, schedules, HTTP modules, and app-to-app operations. Put Xquik behind it when a scenario needs X records or follower exports. Do the same for media uploads, DMs, or signed monitor webhooks. > [card] [Pipedream](/guides/pipedream) > > Use it for code-backed workflows, HTTP triggers, reusable actions, sources, and developer handoffs. Put Xquik behind it when a workflow needs stable X API payloads. Do the same for extraction polling, webhook verification, or exported files. > [card] [Zapier](/guides/zapier) > > Use it for no-code Zaps, CRM updates, app routing, REST Hooks, and operator-owned automations. Put Xquik behind it when a Zap needs authenticated X API calls. Do the same for follower exports, monitor events, or approval-backed X (Twitter) actions. > [card] PhantomBuster > > Use it for no-code social automation, scheduled Phantoms, lead lists, and growth workflows. Put Xquik behind it when the X task needs REST, SDK, or MCP. Do the same for CSV, JSON, or XLSX exports, or 1-second monitor events. ## Agent & automation > [card] Antwork > > Use Antwork for broad agent-driven social publishing. Use Xquik for agents' tweet search, user lookups, extractions, posting, monitoring, and webhook events. > [card] Outstand > > Use Outstand for social management through MCP. An MCP tool may call tweet, profile, follower, reply & timeline endpoints. Use Xquik when it must also call write actions, monitors, exports, and signed webhooks. > [card] TryPost > > Use TryPost when you want an open-source scheduler. Use Xquik for hosted X reads, writes, extractions, monitors, webhooks, SDKs, and MCP. > [card] [TweetDeck alternative](/alternatives/tweetdeck) > > Use TweetDeck or X Pro for live columns. Use Xquik when the same work must become exports, API calls, or monitor events. Use it too when that work must become signed webhooks, SDKs, or MCP tools. > [card] Taplio > > Use Taplio for LinkedIn content and relationships. Use Xquik for X (Twitter) search, posting, follower exports, monitors, webhooks, SDKs, and MCP. # X (Twitter) webhook idempotency & retry dedupe Source: https://docs.xquik.com/webhooks/idempotency Handle repeated X (Twitter) webhook deliveries safely. Xquik resends the exact body on retry, so dedupe each event and keep your receiver idempotent every time. > For the complete documentation index, see [llms.txt](/llms.txt). This guide follows [webhook signature verification](/webhooks/verification). Verify each delivery first. ## Idempotency Xquik retries failed webhook deliveries. Your endpoint may receive the same event multiple times. Each retry sends the first attempt's exact body. Only the signature headers change. Production monitor deliveries include `deliveryId` and `streamEventId`. Use `deliveryId` as the webhook delivery idempotency key. Use `streamEventId` when your system should process one monitor event only once. It applies across webhook retries or endpoint changes. Do not hash the raw request body when `deliveryId` is available. `webhook.test` deliveries include `eventType`, `data`, and `timestamp`. They omit monitor idempotency fields. Use them to verify signatures and receiver reachability. Skip production event deduplication for the test request. ### Production store contract Use a persistent store before acknowledging production events. Scope nonce, delivery, and event keys by webhook ID. Retries for one endpoint then never block another endpoint. Duplicate `deliveryId` or `streamEventId` checks should return `2xx` after verification. The receiver has already accepted the work. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "webhook_receiver_store_contract", "webhook_id": "15", "nonce_key": "webhook:15:nonce_hash", "nonce_ttl_seconds": 300, "delivery_key": "webhook:15:delivery:502", "event_key": "event:9002", "duplicate_delivery_status": 200, "duplicate_event_status": 200, "event_join": "GET /api/v1/events/9002", "ack_after": "signature_verified_and_queue_row_written", "ack_status": 202, "slow_work": "async_worker", "delivery_log": "GET /api/v1/webhooks/15/deliveries", "shared_storage_excludes": [ "endpoint_signing_values", "raw_request_body", "raw_signature", "full_headers" ] } ``` Keep raw request bytes only for signature verification. Store the nonce cache marker, delivery key, event key, join route, and processing status. Keep them in the shared table or queue. Return `2xx` only after verification and a durable queue write. Move slow enrichment, exports, CRM sync, or alerting to an async worker. The receiver can then finish within the 10-second delivery timeout. ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const processedDeliveries = new Set(); const processedEvents = new Set(); app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => { const payload = req.body.toString(); if (!verifyWebhook(req, WEBHOOK_SECRET)) { return res.status(401).send("Invalid signature"); } const event = JSON.parse(payload); if (event.eventType === "webhook.test") { return res.status(200).send("Test accepted"); } if (typeof event.deliveryId !== "string" || typeof event.streamEventId !== "string") { return res.status(400).send("Missing idempotency fields"); } if (processedDeliveries.has(event.deliveryId)) { return res.status(200).send("Delivery already processed"); } processedDeliveries.add(event.deliveryId); if (processedEvents.has(event.streamEventId)) { return res.status(200).send("Event already processed"); } processedEvents.add(event.streamEventId); handleEvent(event); res.status(200).send("OK"); }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} processed_deliveries = set() processed_events = set() @app.route("/webhook", methods=["POST"]) def webhook(): payload = request.get_data() if not verify_webhook(request, WEBHOOK_SECRET): return "Invalid signature", 401 event = request.get_json() if event.get("eventType") == "webhook.test": return "Test accepted", 200 delivery_id = event.get("deliveryId") stream_event_id = event.get("streamEventId") if not isinstance(delivery_id, str) or not isinstance(stream_event_id, str): return "Missing idempotency fields", 400 if delivery_id in processed_deliveries: return "Delivery already processed", 200 processed_deliveries.add(delivery_id) if stream_event_id in processed_events: return "Event already processed", 200 processed_events.add(stream_event_id) handle_event(event) return "OK", 200 ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} type WebhookEvent struct { Data map[string]any `json:"data"` DeliveryID string `json:"deliveryId"` EventType string `json:"eventType"` StreamEventID string `json:"streamEventId"` } var ( processedDeliveries sync.Map processedEvents sync.Map ) func processSignedWebhook(w http.ResponseWriter, r *http.Request) { payload, err := io.ReadAll(r.Body) if err != nil { http.Error(w, "Bad request", http.StatusBadRequest) return } if !verifyWebhook(payload, r.Header, webhookSecret) { http.Error(w, "Invalid signature", http.StatusUnauthorized) return } var event WebhookEvent if err := json.Unmarshal(payload, &event); err != nil { http.Error(w, "Bad request", http.StatusBadRequest) return } if event.EventType == "webhook.test" { fmt.Fprint(w, "Test accepted") return } if event.DeliveryID == "" || event.StreamEventID == "" { http.Error(w, "Missing idempotency fields", http.StatusBadRequest) return } if _, replayed := processedDeliveries.LoadOrStore( event.DeliveryID, true, ); replayed { fmt.Fprint(w, "Delivery already processed") return } if _, seen := processedEvents.LoadOrStore( event.StreamEventID, true, ); seen { fmt.Fprint(w, "Event already processed") return } handleEvent(event) fmt.Fprint(w, "OK") } ``` > [!WARNING] > > The in-memory examples above work for single-process servers. In production, use a persistent store such as a database or Redis. The store tracks processed delivery IDs and event IDs across restarts and multiple instances. ## Next steps * [Signature verification](/webhooks/verification) * [Webhooks overview](/webhooks/overview) # X (Twitter) webhook API overview for monitor alerts Source: https://docs.xquik.com/webhooks/overview Deliver account, keyword & post monitor events to HTTPS endpoints with signed payloads, event filters, retry schedules & HMAC verification. See event fields. > For the complete documentation index, see [llms.txt](/llms.txt). Account and keyword monitors check every second. Webhooks deliver matched events to your server. Every delivery uses an HMAC-SHA256 signature. Use webhooks when events from tracked accounts must reach your app without polling. There are 10 tweet types. They are `tweet.new`, `tweet.reply`, `tweet.quote`, `tweet.retweet`, `tweet.media`, `tweet.link`, `tweet.poll`, `tweet.mention`, `tweet.hashtag`, and `tweet.longform`. There are 11 profile types. They are `profile.avatar.changed`, `profile.banner.changed`, `profile.name.changed`, `profile.username.changed`, `profile.bio.changed`, `profile.location.changed`, `profile.url.changed`, `profile.verified.changed`, `profile.protected.changed`, `profile.pinned_tweet.changed`, and `profile.unavailable.changed`. The 3 account activity types are `tweet.deleted`, `broadcast.started`, and `space.started`. The 2 following types are `following.added` and `following.removed`. The 2 follower types are `follower.added` and `follower.removed`. The 2 count types are `profile.followers.changed` and `profile.following.changed`. Keyword monitors support the 10 tweet types only. The setup returns a monitor ID, webhook ID, and one-time signing secret. It also returns signed JSON deliveries. Webhook operations are free. Active monitors cost 30 credits/hour and include stored events plus webhook delivery. An added type fires for a follow on top of the account's X list. A follow X (Twitter) lists again fires only after the monitor reported its removal. Its data then carries `followKind`. `refollow` means the account followed again. `return` means the follow never ended. [Post monitors](/api-reference/monitors/create-post) track 1 X post. Their 10 types are `post.reply.new`, `post.quote.new`, `post.likes.changed`, `post.retweets.changed`, `post.replies.changed`, `post.quotes.changed`, `post.bookmarks.changed`, `post.views.changed`, `post.edited` & `post.deleted`. Each post event carries `postId`, `postUrl`, `authorId` & `authorUsername`. Have no public endpoint? [Stream events](/api-reference/events/stream) over 1 open connection instead, and replay what you missed with `Last-Event-ID`. > [card] Account or keyword monitor > > It outputs a monitor ID, username or query, and selected event types. > It costs 30 credits/hour while active. > [card] Webhook endpoint > > It outputs a webhook ID, URL, event types, and one-time `secret`. > It is free. > [card] Signed delivery > > It outputs an HTTPS POST with JSON body and HMAC headers. > The active monitor includes it at no extra cost. ## Choose the webhook source > [card] Account activity > > Create `POST /monitors` when one X account should emit selected tweet and > profile event types. Store `monitorId`, `username`, `xUserId`, and > `eventTypes`. > [card] Keyword matches > > Create `POST /monitors/keywords` when a query should emit matching tweet > events. Store `keywordMonitorId`, `query`, and `eventTypes`. > [card] Post activity > > Create `POST /monitors/posts` when 1 post should emit replies, quotes, > edits, deletion & metric changes. Store `monitorId`, `postId` & > `eventTypes`. > [card] Receiver endpoint > > Create `POST /webhooks` after the monitor. Store the webhook `id`, URL, > selected `eventTypes`, and one-time `secret` before sending tests. > [card] Replay and audit > > Use `GET /events` for stored monitor events and > `GET /webhooks/{id}/deliveries` for delivery attempts. Join on > `streamEventId`. ## Send events to a Discord channel Paste a Discord channel webhook URL as the webhook URL. Xquik then sends each event as a Discord message. The message names the account and the event, such as "New post". It shows the post's text or the profile change. A link to the post comes with it. Mentions in a post ping no one in your server. Test deliveries reach Discord the same way. Discord can ask Xquik to slow down. The retry then waits as long as Discord asks. The [Discord guide](/guides/twitter-discord-bot) sets it up step by step. ## Send events to a Telegram chat Call [Connect Telegram](/api-reference/webhooks/telegram) for a t.me link. Open it and press Start in @XquikBot. Each new post then arrives in that chat as a message. Name `eventTypes` in the call to add replies, quotes or any other type. A burst arrives as 1 digest every few seconds. Only the first message rings. The chat shows in your webhook list as `telegram:`. Deliveries, retries, resume and test deliveries work as for any webhook. Send `/stop` in the chat to pause alerts, and `/status` to check them. The [Telegram guide](/guides/twitter-telegram-bot) sets it up step by step. ## Quick setup Set up webhooks in 3 steps. **1. Create a monitor** Choose an account monitor for one X account. Choose a keyword monitor for matching query results. ```bash Account monitor theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/monitors \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "username": "elonmusk", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq ``` ```bash Keyword monitor theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/monitors/keywords \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "query": "xquik launch", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq ``` Store the returned monitor `id`. Account events include `username`. Keyword events include `query`. **2. Register a webhook** Provide an HTTPS URL and select which event types to receive. Xquik generates a signing secret. Store it in a secret manager. The API returns it only once. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks \ -H "x-api-key: xq_YOUR_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-server.com/webhook", "eventTypes": ["tweet.new", "tweet.reply"] }' | jq ``` **Response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "15", "url": "https://your-server.com/webhook", "eventTypes": ["tweet.new", "tweet.reply"], "secret": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2", "createdAt": "2026-02-24T10:30:00.000Z" } ``` **3. Verify signatures** When events arrive, verify the `X-Xquik-Signature` header using your webhook secret to confirm authenticity. See [Signature Verification](/webhooks/verification) for implementation details. Send a test payload before connecting production logic. ```bash theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -X POST https://xquik.com/api/v1/webhooks/15/test \ -H "x-api-key: xq_YOUR_KEY_HERE" | jq ``` ## How it works ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} Account or keyword monitor event -> Xquik -> Your Webhook Endpoint ``` ## Delivery format Xquik sends webhook events as HTTPS POST requests. It sends each monitor event as its own payload. If one active monitor check finds multiple new matching tweets, expect multiple POST requests. You get one per matched tweet event instead of one batched payload. ### Headers > [card] Content-Type > > `application/json`. Payloads are always JSON. > [card] User-Agent > > `xquik-webhooks/1.0 (+https://xquik.com)`. Identifies Xquik traffic. > [card] X-Xquik-Timestamp > > Unix epoch milliseconds. Used in the signing string and for replay window enforcement. > [card] X-Xquik-Nonce > > 16 random bytes in hex. Reject duplicates within the replay window. > [card] X-Xquik-Signature > > `sha256=HMAC_HEX_DIGEST`. HMAC-SHA256 of `..`. ### Payload body ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "tweet.new", "schemaVersion": 1, "deliveryId": "502", "streamEventId": "9001", "occurredAt": "2026-02-24T14:22:00.000Z", "monitorId": "10", "monitorType": "account", "username": "elonmusk", "xUserId": "44196397", "data": { "id": "1893456789012345678", "text": "The future is now.", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk" }, "isRetweet": false, "isReply": false, "isQuote": false, "createdAt": "2026-02-24T14:22:00.000Z" } } ``` > [card] eventType > > Type `string`. Event type selected by the source monitor and webhook. > [card] schemaVersion > > Type `number`. Webhook payload schema version. Current value is `1`. > [card] deliveryId > > Type `string`. Webhook delivery ID. Every retry reuses it. Store it as the > delivery-level idempotency key and use it for delivery-log correlation. > [card] streamEventId > > Type `string`. Stored monitor event ID. You may need one monitor event > processed once across webhook retries or endpoint changes. If so, store this > ID as the event-level deduplication key. > [card] occurredAt > > Type `string`. ISO timestamp. X's time of the event when X gives one. A post, a live video & a Space have one. Else the time Xquik saw it. A deleted post, a profile change & a follow list change use that time. > [card] monitorId > > Type `string`. ID of the monitor that produced the event. Account, keyword & post monitors number separately, so read it together with `monitorType`. Use both to route events when many monitors share 1 webhook URL. > [card] monitorName > > Type `string`. Your monitor label when Xquik created the event. Present when the monitor had a `name` then. A rename leaves the event unchanged. > [card] monitorType > > Type `string`. `account`, `keyword` or `post`. Matches `monitorType` on the events API. > [card] username > > Type `string`. Current X (Twitter) username for account monitor events. It follows a username change. Omitted for keyword-only monitor events and `webhook.test`. > [card] xUserId > > Type `string`. Permanent X (Twitter) user ID of the monitored account, on account monitor events. It stays equal when the account changes its username. Use it to match events from before and after a change. > [card] query > > Type `string`. Keyword query that matched the event. Present for keyword monitor events. > [card] postId > > Type `string`. ID of the monitored post. Present for post monitor events. > [card] postUrl > > Type `string`. Link to the monitored post. Present for post monitor events. > [card] authorId > > Type `string`. Permanent X (Twitter) user ID of the monitored post's author. Present for post monitor events. > [card] authorUsername > > Type `string`. Username of the monitored post's author. Present for post monitor events. > [card] data > > Type `object`. Raw event object for the monitored tweet activity. > [!NOTE] > > Post fields match REST responses. Profiles use `username` and `verified` for the displayed badge. > Legacy `userName` remains available. `rawVerified` preserves the original X flag. > The `verified` field now includes blue verification. Card, reaction, quote & repost profiles use these fields. > Stored posts gain these fields when their source fields are available. Incomplete legacy posts remain readable. ### Receiver storage row After signature verification succeeds, store a compact receiver row. Then hand the event to workers. Use `deliveryId` for delivery-level retries and `streamEventId` for event-level processing. Never put endpoint signing values or the raw request body in shared incident rows. Leave out the raw signature and full headers too. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "webhook_receiver_event", "webhook_id": "15", "delivery_id": "502", "stream_event_id": "9001", "event_type": "tweet.new", "source": "account", "username": "elonmusk", "signature_verified": true, "nonce_cache_key": "webhook:15:nonce_hash", "occurred_at": "2026-02-24T14:22:00.000Z", "receiver_status": 202, "event_join": "GET /api/v1/events/9001", "delivery_log": "GET /api/v1/webhooks/15/deliveries" } ``` ## Tweet & profile event shapes Each event type includes `data`. Tweet events contain public post fields and retained legacy fields. The `webhook.test` event contains a test message and timestamp. The examples below show the most common fields. ### `tweet.new` A new original tweet posted by the monitored account. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "tweet.new", "username": "elonmusk", "data": { "id": "1893456789012345678", "text": "The future is now.", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk" }, "isRetweet": false, "isReply": false, "isQuote": false, "createdAt": "2026-02-24T14:22:00.000Z" } } ``` ### `tweet.quote` A quote tweet posted by the monitored account. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "tweet.quote", "username": "elonmusk", "data": { "id": "1893456789012345679", "text": "Interesting take on this.", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk" }, "isRetweet": false, "isReply": false, "isQuote": true, "quoted_tweet": { "id": "1893400000000000000", "text": "Our latest launch was a success.", "author": { "username": "SpaceX" } }, "createdAt": "2026-02-24T15:10:00.000Z" } } ``` ### `tweet.reply` A reply posted by the monitored account. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "tweet.reply", "username": "elonmusk", "data": { "id": "1893456789012345680", "text": "Great question. Working on it.", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk" }, "isRetweet": false, "isReply": true, "isQuote": false, "inReplyToId": "1893411111111111111", "createdAt": "2026-02-24T16:30:00.000Z" } } ``` ### `tweet.retweet` A retweet posted by the monitored account. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "tweet.retweet", "username": "elonmusk", "data": { "id": "1893456789012345681", "text": "RT @xai: Exciting news today.", "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk" }, "isRetweet": true, "isReply": false, "isQuote": false, "createdAt": "2026-02-24T17:00:00.000Z" } } ``` ### `webhook.test` A test payload that the [Test Webhook](/api-reference/webhooks/test) endpoint sends. It checks that your endpoint is reachable. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "webhook.test", "data": { "message": "Test delivery from Xquik" }, "timestamp": "2026-02-27T12:00:00.000Z" } ``` ## Post event shapes Post events carry `monitorType` `post` and the tracked post's fields. `post.reply.new` & `post.quote.new` carry the reply or quote as `data`, like `tweet.new`. ### `post.likes.changed` Each metric's changed event fires at most once a minute. It covers the whole change since the last one. The other 5 metric events use the same `data`. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "post.likes.changed", "monitorId": "31", "monitorType": "post", "postId": "2102882545427714266", "postUrl": "https://x.com/NASA/status/2102882545427714266", "authorId": "11348282", "authorUsername": "NASA", "data": { "metric": "likes", "previous": 17096, "current": 17200, "change": 104 } } ``` ### `post.edited` The author edited the post. `versionId` is the newest version's ID. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "post.edited", "monitorType": "post", "postId": "2102882545427714266", "data": { "previousText": "Today, Croatia joined the Artemis Accords.", "text": "Today, Croatia became the 74th nation that has committed to a peaceful and prosperous exploration of space.", "versionId": "2082577277246973001" } } ``` ### `post.deleted` The post was deleted. `text` is the last text the monitor saw. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "eventType": "post.deleted", "monitorType": "post", "postId": "2102882545427714266", "data": { "text": "Today, Croatia became the 74th nation that has committed to a peaceful and prosperous exploration of space." } } ``` ## Delivery order Deliveries can arrive in any order. Xquik sends up to 20 at once to 1 endpoint. Retries can come after newer events. Order events by `occurredAt`, then `streamEventId`. A `429`, `503` or timeout limits Xquik to 8 at once. The limit holds until 1 minute passes without one. ## Retry policy Return `2xx` within 10 seconds for every delivery, even one you skip. Any other status, a redirect, a timeout, or a network error is a failure. `410 Gone` is a normal failure. Xquik retries a failed delivery until your endpoint returns `2xx`. Each delivery gets 30 days from the time Xquik queues it. A delivery still failing after 30 days ends as `exhausted`. Xquik never pauses or turns off your webhook. > [card] Failing endpoint > > After a failed delivery, Xquik treats your endpoint as failing. It retries 1 > waiting delivery at a time to check the endpoint. This is a real delivery, > not a `webhook.test`. Checks start 2 seconds apart and slow to 1 every 15 > minutes. New deliveries wait as `pending` until a check succeeds. > [card] Recovery > > When a check succeeds, Xquik starts sending `pending` deliveries at once. > A delivery your endpoint rejected can wait until its 30 days end. > [Resume Webhook](/api-reference/webhooks/resume) sends it at once. > [card] 1 rejected delivery > > A new event may not arrive within 2 seconds of a failure. In that case, > Xquik retries the rejected delivery at the next check. New events wait for > that check, up to 15 minutes. See the table below. > [card] Quiet endpoint > > A rejected delivery keeps failing checks while no new events arrive. After > about 2 quiet days, the webhook shows `needs_attention`. Delivery continues. > [!WARNING] > > While a rejected delivery fails, new events can arrive up to 15 minutes late. A new event may arrive within 2 seconds of each failure. In that case, a rejected delivery waits longer. | Failed attempts | Next retry after | | - | - | | 1 | 1 second | | 2 | 2 seconds | | 3 | 4 seconds | | 10 | About 9 minutes | | 15 | About 4.5 hours | | 19 | About 3 days | No retry comes later than 30 days after Xquik queued the delivery. Retries can arrive a little later than listed. ### Pause or delete a webhook Pause the webhook with [Update Webhook](/api-reference/webhooks/update), or delete it. Xquik holds the deliveries that were waiting. Each one shows `exhausted` once its 30 days end. A paused monitor holds its deliveries the same way. Events expire 30 days after Xquik creates them. An event whose delivery ended as `exhausted` stays 30 days after that delivery ended. [Resume Webhook](/api-reference/webhooks/resume) sends a signed test first. Then it starts sending held deliveries at once. A paused webhook gets no new deliveries. Use stored event pages to catch up. Deleting a monitor removes its waiting deliveries. ### Check delivery status [List Deliveries](/api-reference/webhooks/deliveries) shows each delivery's `status`, which is `pending`, `delivered`, `failed`, or `exhausted`. `exhausted` means 30 days passed without a `2xx`, and `lastError` says why. `attempts` counts the tries so far. A retry reuses the same `deliveryId`, so store it and skip repeats. [List Webhooks](/api-reference/webhooks/list) shows `deliveryStatus` and `consecutiveFailures`. `needs_attention` means 200 failed checks in a row. That takes about 2 days. Xquik keeps retrying. ### When deliveries fail 1. Fix your endpoint so it returns `2xx` within 10 seconds. 2. Call [Resume Webhook](/api-reference/webhooks/resume). It sends a signed test first. 3. When the test passes, Xquik starts sending waiting and rejected deliveries at once. Without Resume, a rejected delivery can wait until its 30 days end. ## Backfill after a receiver outage Xquik resends failed deliveries after your receiver recovers. Use this handoff when your systems lost work or the webhook was paused. Fix the receiver first. Then use delivery rows and stored event pages to rebuild downstream work. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "webhook_receiver_backfill", "webhook_id": "15", "delivery_log": "GET /api/v1/webhooks/15/deliveries", "resume_endpoint": "POST /api/v1/webhooks/15/resume", "event_backfill_endpoint": "GET /api/v1/events?limit=100&cursor={nextCursor}", "source_filter": "monitorId for account monitors, keywordMonitorId for keyword monitors", "join_key": "delivery.streamEventId == event.id", "resume_fields": [ "deliveryId", "streamEventId", "status", "attempts", "lastStatusCode", "lastError", "deliveryStatus", "consecutiveFailures", "failureHardCap", "nextCursor" ], "stop_when": "hasMore is false", "handoff_state": "receiver_fixed_page_events_join_deliveries" } ``` Store `nextCursor` after every event page. Reprocess only events your receiver never stored. Skip repeats by `streamEventId`, since Xquik also resends failed deliveries. Events from a pause may never reach the webhook, so page them here. Scope event pages when the source is known. Use `monitorId` for account monitors or `keywordMonitorId` for keyword monitors. Omit both only for all-monitor replay. ## Troubleshoot a delivery Use this handoff when a receiver fails a signed test or keeps failing deliveries. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "record_type": "webhook_delivery_troubleshooting", "webhook_id": "15", "signed_test": "POST /api/v1/webhooks/15/test", "resume_endpoint": "POST /api/v1/webhooks/15/resume", "delivery_log": "GET /api/v1/webhooks/15/deliveries", "event_join": "GET /api/v1/events/{id}", "event_id_source": "streamEventId", "route_on": [ "deliveryStatus", "consecutiveFailures", "failureHardCap", "status", "attempts", "lastStatusCode", "lastError", "createdAt", "deliveredAt" ], "test_payload_has_ids": false, "production_payload_ids": ["deliveryId", "streamEventId"], "handoff_state": "verify_signature_resume_if_needed_check_delivery_join_event" } ``` > [card] Signed receiver test > > Run [Test Webhook](/api-reference/webhooks/test) after changing endpoint > code, secrets, firewall rules, or queue routing. Treat `success: true` > with a `2xx` `statusCode` as receiver proof. > [card] Signature and IDs > > Verify `X-Xquik-Signature`, `X-Xquik-Timestamp`, and `X-Xquik-Nonce` on > the raw request body. `webhook.test` omits `deliveryId` and `streamEventId`, > while production deliveries include both IDs. > [card] Delivery triage > > Check [List Deliveries](/api-reference/webhooks/deliveries) for `status`, > `attempts`, `lastStatusCode`, `lastError`, `createdAt`, and > `deliveredAt`. Act on `failed`, wait on `pending`, and ignore > `delivered`. `exhausted` means 30 days passed without a `2xx`. > [card] Needs attention > > `needs_attention` does not stop delivery. Fix the receiver, then call > [Resume Webhook](/api-reference/webhooks/resume). It starts sending waiting > deliveries at once. > [card] Event context > > Join `streamEventId` to [Get Event](/api-reference/events/get) when the > receiver owner needs what triggered the delivery. That means the original > monitor event, tweet fields, username, or keyword query. ## Requirements * The endpoint must use HTTPS * The endpoint must not resolve to a private or internal IP address. That rules out localhost, 10.x.x.x, 172.16-31.x.x, 192.168.x.x and 169.254.x.x * Endpoints must return `2xx` within 10 seconds ## Where to go next > [card] [Webhook API reference](/api-reference/webhooks/create) > > Create, list, update, deactivate, test, resume, and inspect webhook deliveries. > [card] [Signature verification](/webhooks/verification) > > Verify HMAC-SHA256 signatures and implement idempotency. > [card] [Testing webhooks](/guides/twitter-webhook-testing) > > Test webhook delivery locally with tunnels and mock payloads. > [card] [MCP equivalent](/mcp/tools) > > Use `xquik.request('/api/v1/webhooks', ...)` for create, list, update, delete, and test. > [card] [Monitor setup](/api-reference/monitors/create) > > Create account monitors that emit events for webhook delivery. > [card] [Keyword monitor setup](/api-reference/monitors/create-keyword) > > Create keyword monitors that emit matching tweet events for webhook delivery. # Twitter monitor webhook signature verification Source: https://docs.xquik.com/webhooks/verification Verify HMAC-SHA256 signatures before processing account, keyword or post monitor webhooks. Keep raw request bodies and compare signatures in constant time. > For the complete documentation index, see [llms.txt](/llms.txt). Xquik signs every X (Twitter) webhook delivery with HMAC-SHA256. It signs a string built from a timestamp, nonce, and the raw body. Verify the signature and reject stale or replayed requests before processing events. | Verification checkpoint | Exact source | Reject when | | - | - | - | | Signature | `X-Xquik-Signature` | HMAC-SHA256 differs in a timing-safe comparison. | | Timestamp | `X-Xquik-Timestamp` | The delivery falls outside the 5-minute tolerance. | | Nonce | `X-Xquik-Nonce` | The webhook already used this nonce within 5 minutes. | | Raw body | Unparsed request bytes | Middleware parsed or re-serialized JSON before verification. | | Delivery | `deliveryId` | The receiver already queued this delivery. | | Monitor event | `streamEventId` | The receiver already processed this monitor event. | ## Headers sent with every delivery Read these headers from each webhook `POST` before parsing the JSON body. Trust only the signature. Use `Content-Type` and `User-Agent` only for handler routing and logs. > [card] Timestamp > > `X-Xquik-Timestamp` is Unix epoch milliseconds. Reject requests outside the > 5-minute tolerance window. > [card] Nonce > > `X-Xquik-Nonce` is 16 random bytes in hex. Store recent values for 5 > minutes and reject repeats. > [card] Signature > > `X-Xquik-Signature` is `sha256=` over > `..` keyed with the endpoint secret. > [card] Raw JSON body > > `Content-Type` is always `application/json`. Verify the raw body bytes > before parsing or re-serializing JSON. > [card] Sender logs > > `User-Agent` is `xquik-webhooks/1.0 (+https://xquik.com)`. Log it for > diagnostics. Never trust it instead of the signature. ## How it works 1. Xquik computes the signing string `..`. 2. Xquik computes `sha256=` + HMAC-SHA256(webhook secret, signing string). 3. Your server recomputes the signature with the same secret over the raw body. 4. Reject the request if the signature does not match in constant time. 5. Reject the request if the timestamp is older than 5 minutes (clock-skew tolerant). 6. Reject the request if the nonce was already seen in the last 5 minutes. This check is replay protection. ## Receiver hardening handoff Use this handoff when you promote a webhook receiver. This handoff covers the step from a signed test request to production monitor events. It keeps signing, replay protection, idempotency, and incident routing visible in one review record. ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "workflow": "webhook_receiver_hardening", "signature": { "raw_body": true, "signing_string": "..", "headers": ["X-Xquik-Signature", "X-Xquik-Timestamp", "X-Xquik-Nonce"], "replay_window_ms": 300000, "secret_logging": "never" }, "nonce_store": { "key": "webhook_id:nonce", "ttl_seconds": 300, "on_duplicate": "reject" }, "production_idempotency": { "delivery_id": "502", "stream_event_id": "9002", "test_payload_omits_ids": true }, "incident_row": { "source": "GET /api/v1/webhooks/15/deliveries", "fields": ["status", "attempts", "lastStatusCode", "lastError", "createdAt", "deliveredAt"] }, "handoff_state": "verify_raw_body_store_nonce_then_dedupe_delivery" } ``` > [card] Raw body first > > Keep raw request bytes available until signature verification succeeds. > Parse JSON only after the HMAC check passes. > [card] Nonce store > > Store each nonce with the webhook ID for 5 minutes. Reject duplicates before > queueing or acknowledging the event. > [card] Secret hygiene > > Store the webhook secret once. Use it only for HMAC checks. Never write > it to logs, queues, traces, or incident rows. > [card] Incident fields > > Send `status`, `attempts`, `lastStatusCode`, `lastError`, `createdAt`, and > `deliveredAt` from the deliveries API. Send them to your alerting or support > queue. ## Implementation ```bash cURL (test) theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} # Generate a test signature to verify your implementation TS=$(date +%s)000 NONCE=$(openssl rand -hex 16) BODY='{"test":"payload"}' SIG=$(printf "%s.%s.%s" "$TS" "$NONCE" "$BODY" | openssl dgst -sha256 -hmac "your_webhook_secret" | sed 's/.*= /sha256=/') echo "X-Xquik-Timestamp: $TS" echo "X-Xquik-Nonce: $NONCE" echo "X-Xquik-Signature: $SIG" ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import { createHmac, timingSafeEqual } from "node:crypto"; const FIVE_MINUTES_MS = 5 * 60 * 1000; const seenNonces = new Map(); // nonce -> expiresAt function verifyWebhook(req, secret) { const timestamp = req.headers["x-xquik-timestamp"]; const nonce = req.headers["x-xquik-nonce"]; const signature = req.headers["x-xquik-signature"]; const rawBody = req.body.toString(); if (!timestamp || !nonce || !signature) return false; // Reject stale requests (clock-skew tolerant). const ts = Number(timestamp); if (!Number.isFinite(ts) || Math.abs(Date.now() - ts) > FIVE_MINUTES_MS) { return false; } const signingString = `${timestamp}.${nonce}.${rawBody}`; const expected = "sha256=" + createHmac("sha256", secret).update(signingString).digest("hex"); const expectedBuffer = Buffer.from(expected); const signatureBuffer = Buffer.from(signature); if (expectedBuffer.length !== signatureBuffer.length) return false; if (!timingSafeEqual(expectedBuffer, signatureBuffer)) return false; // Claim the nonce only after authentication succeeds. const now = Date.now(); for (const [n, exp] of seenNonces) if (exp <= now) seenNonces.delete(n); if (seenNonces.has(nonce)) return false; seenNonces.set(nonce, now + FIVE_MINUTES_MS); return true; } // Express example app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => { if (!verifyWebhook(req, WEBHOOK_SECRET)) { return res.status(401).send("Invalid signature"); } const event = JSON.parse(req.body.toString()); // Process event... res.status(200).send("OK"); }); ``` The same check is ready in [Python webhook verification](/webhooks/verification-python) and [Go webhook verification](/webhooks/verification-go). ## Security checklist > [accordion] Always verify before processing > > Never process webhook payloads without verifying the signature first. An unverified payload could be a spoofed request. > [accordion] Use constant-time comparison > > Use `timingSafeEqual` (Node.js), `hmac.compare_digest` (Python), or `hmac.Equal` (Go). String equality (`===`) is vulnerable to timing attacks. > [accordion] Use the raw request body > > Compute the HMAC over the raw request body bytes, not a re-serialized JSON object. Re-serialization can alter whitespace or key ordering. > [accordion] Respond quickly > > Respond within 10 seconds. Process events asynchronously if your handler is slow. ## Idempotency Xquik retries failed webhook deliveries. Your endpoint may receive the same event more than once. See [webhook idempotency](/webhooks/idempotency) for the dedupe patterns. # Verify X (Twitter) webhook signatures in Go Source: https://docs.xquik.com/webhooks/verification-go Verify Xquik webhook signatures in Go with crypto/hmac and a constant-time compare. Reject bad deliveries before your handler trusts any X (Twitter) event. > For the complete documentation index, see [llms.txt](/llms.txt). This handler verifies each delivery before it trusts the body. See [signature verification](/webhooks/verification) for the headers and each check. ## Go implementation ```go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "crypto/hmac" "crypto/sha256" "encoding/hex" "fmt" "io" "net/http" "strconv" "sync" "time" ) const fiveMinutesMs = int64(5 * 60 * 1000) var ( seenNonces = sync.Map{} ) func verifyWebhook(payload []byte, headers http.Header, secret string) bool { timestamp := headers.Get("X-Xquik-Timestamp") nonce := headers.Get("X-Xquik-Nonce") signature := headers.Get("X-Xquik-Signature") if timestamp == "" || nonce == "" || signature == "" { return false } ts, err := strconv.ParseInt(timestamp, 10, 64) if err != nil { return false } nowMs := time.Now().UnixMilli() diff := nowMs - ts if diff < 0 { diff = -diff } if diff > fiveMinutesMs { return false } signingString := fmt.Sprintf("%s.%s.%s", timestamp, nonce, string(payload)) mac := hmac.New(sha256.New, []byte(secret)) mac.Write([]byte(signingString)) expected := "sha256=" + hex.EncodeToString(mac.Sum(nil)) if !hmac.Equal([]byte(expected), []byte(signature)) { return false } seenNonces.Range(func(key, value any) bool { expiresAt, ok := value.(int64) if ok && expiresAt <= nowMs { seenNonces.Delete(key) } return true }) _, replayed := seenNonces.LoadOrStore(nonce, nowMs+fiveMinutesMs) return !replayed } func webhookHandler(w http.ResponseWriter, r *http.Request) { payload, err := io.ReadAll(r.Body) if err != nil { http.Error(w, "Bad request", http.StatusBadRequest) return } if !verifyWebhook(payload, r.Header, webhookSecret) { http.Error(w, "Invalid signature", http.StatusUnauthorized) return } // Process event... fmt.Fprint(w, "OK") } ``` ## Next steps * [Signature verification](/webhooks/verification) * [Webhook idempotency](/webhooks/idempotency) # Verify X (Twitter) webhook signatures in Python Source: https://docs.xquik.com/webhooks/verification-python Verify Xquik webhook signatures in Python with hmac and hashlib. Reject bad deliveries before your receiver trusts the body of any X (Twitter) monitor event. > For the complete documentation index, see [llms.txt](/llms.txt). This handler verifies each delivery before it trusts the body. See [signature verification](/webhooks/verification) for the headers and each check. ## Python implementation ```python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import hmac import hashlib import time from flask import Flask, request app = Flask(__name__) FIVE_MINUTES_MS = 5 * 60 * 1000 _seen_nonces: dict[str, int] = {} def verify_webhook(req, secret: str) -> bool: timestamp = req.headers.get("X-Xquik-Timestamp", "") nonce = req.headers.get("X-Xquik-Nonce", "") signature = req.headers.get("X-Xquik-Signature", "") raw_body = req.get_data() if not (timestamp and nonce and signature): return False try: ts = int(timestamp) except ValueError: return False now_ms = int(time.time() * 1000) if abs(now_ms - ts) > FIVE_MINUTES_MS: return False signing_string = f"{timestamp}.{nonce}.".encode() + raw_body expected = "sha256=" + hmac.new( secret.encode(), signing_string, hashlib.sha256 ).hexdigest() if not hmac.compare_digest(expected, signature): return False expired = [n for n, exp in _seen_nonces.items() if exp <= now_ms] for n in expired: _seen_nonces.pop(n, None) if nonce in _seen_nonces: return False _seen_nonces[nonce] = now_ms + FIVE_MINUTES_MS return True @app.route("/webhook", methods=["POST"]) def webhook(): if not verify_webhook(request, WEBHOOK_SECRET): return "Invalid signature", 401 event = request.get_json() # Process event... return "OK", 200 ``` ## Next steps * [Signature verification](/webhooks/verification) * [Webhook idempotency](/webhooks/idempotency) # Twitter API quickstart with an API key & webhooks Source: https://docs.xquik.com/x-api-quickstart Build an X (Twitter) API integration with Xquik. Create an API key, authenticate a REST request, monitor tweets every 1 second, and send secure signed webhooks. > For the complete documentation index, see [llms.txt](/llms.txt). [![Play Framer's video on YouTube. Framer builds a tweet ticker with Xquik.](https://img.youtube.com/vi/4UOSpoOoC3Y/maxresdefault.jpg)](https://youtu.be/4UOSpoOoC3Y?t=367) Watch Framer build a tweet ticker with Xquik, from 6:07. Framer posted it on June 16, 2026. Use this X (Twitter) API quickstart to build an integration with Xquik. First, follow the REST API key authentication example. Then call `GET /account`, monitor tweets every 1 second, and register a Twitter webhook. For accountless reads, use a [guest wallet](/guides/guest-wallets) across its eligible routes. You can also use [direct MPP](/mpp/quickstart) on its fixed-price operations. | Integration step | Exact API call | Save for the next step | | - | - | - | | Check access and credits | `GET /account` | `plan`, `creditInfo.balance`, and monitor billing | | Monitor tweets and replies | `POST /monitors` | Monitor `id`, `username`, `eventTypes`, and `isActive` | | Register the receiver | `POST /webhooks` | Webhook `id`, `url`, `eventTypes`, and one-time `secret` | | Test delivery | `POST /webhooks/{id}/test` | HTTP status and receiver log timestamp | | Verify live delivery | HMAC-SHA256 verification | `deliveryId` and `streamEventId` idempotency keys | ## How the integration works Your first API request checks credentials, credits, and monitor billing. Send the `x-api-key` request header for API key authentication. Each write sends `Content-Type: application/json` with a JSON request body. The monitor watches one X account for selected tweet events. The X (Twitter) API webhook step stores your HTTPS endpoint and chosen webhook events. Signed webhooks then deliver new tweets and replies to that endpoint. Verify every delivery with the saved secret before processing its payload. This flow checks access, creates a monitor, and registers a webhook. The monitor detects tweets. The webhook forwards each matching event. Keep the returned monitor and webhook IDs for later updates, tests, or deletion. ## Before you start * Create an Xquik account with enough credits for the monitor. * Prepare a secret manager for the API key and webhook secret. * Expose an HTTPS endpoint that can receive webhook events. * Choose the X (Twitter) username and exact tweet event types to monitor. * Use an HTTP client that can send JSON requests and headers. Keep the 2 credentials separate. The API key grants Xquik API access. The webhook secret verifies deliveries sent to your server. Never send the Xquik key to the webhook endpoint. Treat the webhook secret as a separate secret key. > [card] First API call > > Call `GET /account` to confirm authentication, plan status, available credits, and monitor billing. > [card] First monitor > > Create an account monitor that checks every 1 second. Active monitors cost 30 credits per hour while enabled. > [card] First webhook > > Register an HTTPS endpoint and save the one-time secret for HMAC signature verification. > [card] [Accountless reads](/guides/guest-wallets) > > Prepay the eligible GET routes with a USD 10 to 250 hosted checkout. You need no account. **1. Create an account** Sign up at [xquik.com](https://xquik.com/en) with your email. You'll receive a magic link. You need no password. **2. Fund your account** > [!WARNING] > > Metered account operations require enough available credits. You need no active plan while enough credits remain. Subscribe for monthly credits or use your remaining account balance. Starter is USD 20/month and includes 140,000 monthly credits. Manage funding from the [dashboard billing page](https://dashboard.xquik.com/en/account?tab=subscription). Guest wallets cover the prepaid paid-read routes without an account. Direct MPP covers fixed-price operations. **3. Generate an API key** Open [API Keys](https://dashboard.xquik.com/en/api-keys) in the dashboard and create a new key. Copy the full key right away. The dashboard shows it once. ```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} xq_your_api_key_here ``` > [!WARNING] > > Store your API key in a secret manager. You cannot retrieve it after creation. Revoke and replace a leaked key. **4. Make your first request** Verify your setup by fetching your account info. In JavaScript or TypeScript, install the typed SDK with `npm install x-twitter-scraper`. The TypeScript SDK tabs use it. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s https://xquik.com/api/v1/account \ -H "x-api-key: xq_your_api_key_here" | jq ``` ```typescript TypeScript SDK theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import XTwitterScraper from "x-twitter-scraper"; const client = new XTwitterScraper({ apiKey: "xq_your_api_key_here" }); const account = await client.account.retrieve(); process.stdout.write(`${JSON.stringify(account, null, 2)}\n`); ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/account", { headers: { "x-api-key": "xq_your_api_key_here" }, }); const account = await response.json(); process.stdout.write(`${JSON.stringify(account, null, 2)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.get( "https://xquik.com/api/v1/account", headers={"x-api-key": "xq_your_api_key_here"}, ) print(response.json()) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "fmt" "io" "net/http" ) func main() { req, _ := http.NewRequest("GET", "https://xquik.com/api/v1/account", nil) req.Header.Set("x-api-key", "xq_your_api_key_here") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) } ``` **Response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "plan": "active", "monitorsAllowed": 9007199254740991, "monitorsUsed": 0, "monitorBilling": { "activeDailyEstimate": "0", "activeHourlyBurn": "0", "creditsPerActiveMonitorDay": "720", "creditsPerActiveMonitorHour": "30", "eventsIncluded": true, "instantCheckIntervalSeconds": 1, "unlimitedSlots": true }, "creditInfo": { "balance": "50000", "lifetimePurchased": "140000", "lifetimeUsed": "90000", "autoTopupEnabled": false, "autoTopupAmountDollars": 10, "autoTopupThreshold": "50000" } } ``` **5. Create a monitor** Start tracking an X account. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s -X POST https://xquik.com/api/v1/monitors \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"username": "elonmusk", "eventTypes": ["tweet.new", "tweet.reply"]}' | jq ``` ```typescript TypeScript SDK theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import XTwitterScraper from "x-twitter-scraper"; const client = new XTwitterScraper({ apiKey: "xq_your_api_key_here" }); const monitor = await client.monitors.create({ username: "elonmusk", eventTypes: ["tweet.new", "tweet.reply"], }); process.stdout.write(`${JSON.stringify(monitor, null, 2)}\n`); ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/monitors", { method: "POST", headers: { "x-api-key": "xq_your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ username: "elonmusk", eventTypes: ["tweet.new", "tweet.reply"], }), }); const monitor = await response.json(); process.stdout.write(`${JSON.stringify(monitor, null, 2)}\n`); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/monitors", headers={"x-api-key": "xq_your_api_key_here"}, json={ "username": "elonmusk", "eventTypes": ["tweet.new", "tweet.reply"], }, ) print(response.json()) ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "username": "elonmusk", "eventTypes": []string{"tweet.new", "tweet.reply"}, }) req, _ := http.NewRequest("POST", "https://xquik.com/api/v1/monitors", bytes.NewReader(body)) req.Header.Set("x-api-key", "xq_your_api_key_here") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() respBody, _ := io.ReadAll(resp.Body) fmt.Println(string(respBody)) } ``` **Response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "7", "username": "elonmusk", "xUserId": "44196397", "eventTypes": ["tweet.new", "tweet.reply"], "isActive": true, "createdAt": "2026-02-24T10:30:00.000Z", "nextBillingAt": "2026-02-24T10:30:00.000Z" } ``` To receive events on your own server, continue with the [webhook quickstart](/x-api-quickstart-webhooks). ## Verify each result Confirm every step before continuing. The account API endpoint should return `200`. Its response shows the plan, credit balance, and monitor billing values. A `401` means the API key is missing, invalid, or revoked. Next, inspect the monitor response. Confirm its `id`, `username`, `eventTypes`, and `isActive` values. The username must match the account you intend to watch. The event types must match the tweets or replies you need. Finally, inspect the webhook response. Confirm its `id`, `url`, and `eventTypes`. Store the returned `secret` immediately. Xquik returns that secret only during creation. Use the test endpoint before relying on live webhook events. Verify the HMAC signature before parsing a delivery. Return `2xx` after accepting the event. Inspect failed HTTP requests using their status and response body. Never log secret-bearing HTTP headers. Use the troubleshooting steps below for authentication, payment, webhook, or rate-limit failures. ## Next steps > [card] [API reference](/api-reference/overview) > > Browse tweet, profile, follower, timeline, monitor, and webhook endpoints. > [card] [Export tweets & followers](/api-reference/extractions/create) > > Export tweets, replies, followers, following, likes, lists, and media. > [card] [Run a draw](/api-reference/draws/create) > > Run a giveaway draw on a tweet. > [card] [Webhook verification](/webhooks/verification) > > Verify HMAC signatures on incoming webhooks. > [card] [MCP server](/mcp/overview) > > Connect API MCP through Streamable HTTP. Use Code Mode by default, or add `?codemode=false` for OpenAPI-native tools. > [card] [Run in Postman](/api-reference/overview#run-in-postman) > > Fork the Xquik collection & send any request with your API key. > [card] [Error handling](/guides/error-handling) > > Handle errors, rate limits, and retries. > [card] [Billing & usage](/guides/billing) > > Track credits, monitor costs, subscriptions, and rate-limit quotas. ## Troubleshooting > [accordion] Magic link email not received > > Keep using your Xquik account email. Wait 60 seconds and request a new link. Open the newest email within 15 minutes. Check your spam or junk folder. If no email arrives, contact [support@xquik.com](mailto:support@xquik.com) with the exact request time. > [accordion] API key not working (401) > > Verify the header name is `x-api-key` (lowercase). Check that the key starts with `xq_` and hasn't been revoked. Regenerate from the [API Keys dashboard](https://dashboard.xquik.com/en/api-keys). > [accordion] Getting 401 or 402 > > Neither status creates checkout. Anonymous non-MPP paid reads return `401` with a Bearer challenge and guest wallet action. The direct MPP reads return `402` with a Payment challenge and the same action. A `402` response lists choices for account or guest credit failures. Ask the user to choose and confirm before creating checkout. See [Billing](/guides/billing). > [accordion] Webhook not receiving events > > Verify the URL uses HTTPS. Check that the webhook is active via [List Webhooks](/api-reference/webhooks/list). Test delivery with the [Test Webhook](/api-reference/webhooks/test) endpoint. > [accordion] Rate limited (429) > > The fixed windows allow 500 reads per 1 second. They allow 6,000 changes and 120 X (Twitter) actions per 60 seconds. Respect `Retry-After`. See [Rate Limits](/guides/rate-limits). # X API quickstart for Twitter webhook delivery Source: https://docs.xquik.com/x-api-quickstart-webhooks Add a webhook to your X API quickstart. Create the endpoint, keep the signing secret, and receive signed X (Twitter) monitor events on your server in minutes. > For the complete documentation index, see [llms.txt](/llms.txt). This step follows the [X API quickstart](/x-api-quickstart). You need an API key and a monitor from that guide. ## Set up a webhook Receive signed monitor events at your endpoint. ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} curl -s -X POST https://xquik.com/api/v1/webhooks \ -H "x-api-key: xq_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"url": "https://your-server.com/webhook", "eventTypes": ["tweet.new"]}' | jq ``` ```typescript TypeScript SDK theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import XTwitterScraper from "x-twitter-scraper"; const client = new XTwitterScraper({ apiKey: "xq_your_api_key_here" }); const webhook = await client.webhooks.create({ url: "https://your-server.com/webhook", eventTypes: ["tweet.new"], }); const webhookSecret = webhook.secret; process.stdout.write(`Webhook ${webhook.id} ready\n`); // Store webhookSecret in your secret manager. Do not print it. ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} const response = await fetch("https://xquik.com/api/v1/webhooks", { method: "POST", headers: { "x-api-key": "xq_your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ url: "https://your-server.com/webhook", eventTypes: ["tweet.new"], }), }); const webhook = await response.json(); const webhookSecret = webhook.secret; if (!webhookSecret) throw new Error("missing webhook secret"); process.stdout.write(`Webhook ${webhook.id} ready\n`); // Store webhookSecret in your secret manager; do not print it. ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} import requests response = requests.post( "https://xquik.com/api/v1/webhooks", headers={"x-api-key": "xq_your_api_key_here"}, json={ "url": "https://your-server.com/webhook", "eventTypes": ["tweet.new"], }, ) webhook = response.json() webhook_secret = webhook["secret"] if not webhook_secret: raise RuntimeError("missing webhook secret") print(f"Webhook {webhook['id']} ready") # Store webhook_secret in your secret manager; do not print it. ``` ```go Go theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]interface{}{ "url": "https://your-server.com/webhook", "eventTypes": []string{"tweet.new"}, }) req, _ := http.NewRequest("POST", "https://xquik.com/api/v1/webhooks", bytes.NewReader(body)) req.Header.Set("x-api-key", "xq_your_api_key_here") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var webhook struct { ID string `json:"id"` Secret string `json:"secret"` } if err := json.NewDecoder(resp.Body).Decode(&webhook); err != nil { panic(err) } webhookSecret := webhook.Secret if webhookSecret == "" { panic("missing webhook secret") } fmt.Printf("Webhook %s ready\n", webhook.ID) // Store webhookSecret in your secret manager; do not print it. } ``` **Response.** ```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/bash.json","/languages/csharp.json","/languages/go.json","/languages/java.json","/languages/javascript.json","/languages/kotlin.json","/languages/php.json","/languages/python.json","/languages/ruby.json","/languages/typescript.json"]}} { "id": "15", "url": "https://your-server.com/webhook", "eventTypes": ["tweet.new"], "secret": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2", "createdAt": "2026-02-24T10:30:00.000Z" } ``` Save the `secret` from the response in a secret manager. Xquik returns it once. Use it to [verify webhook signatures](/webhooks/verification). Do not print it in shared logs. ## Next steps * [X API quickstart](/x-api-quickstart) * [Webhooks overview](/webhooks/overview) * [Signature verification](/webhooks/verification)