x-developer 2.6.5 → 2.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +4 -4
- package/.claude-plugin/plugin.json +3 -3
- package/.codex-plugin/plugin.json +5 -5
- package/CHANGELOG.md +16 -3
- package/README.md +111 -70
- package/commands/post.md +5 -5
- package/commands/search.md +5 -8
- package/commands/trending.md +3 -5
- package/commands/user.md +4 -10
- package/context7.json +9 -9
- package/openclaw.plugin.json +4 -4
- package/package.json +10 -2
- package/scripts/check-versions.mjs +1 -1
- package/scripts/release-guard/content-policy.mjs +17 -17
- package/scripts/release-guard/policy.mjs +2 -2
- package/server.json +1 -1
- package/skills/x-twitter-scraper/SKILL.md +96 -90
- package/skills/x-twitter-scraper/metadata.json +2 -2
- package/skills/x-twitter-scraper/references/api-endpoints-api-keys.md +5 -5
- package/skills/x-twitter-scraper/references/api-endpoints-compose.md +16 -16
- package/skills/x-twitter-scraper/references/api-endpoints-credits.md +3 -3
- package/skills/x-twitter-scraper/references/api-endpoints-drafts.md +21 -21
- package/skills/x-twitter-scraper/references/api-endpoints-draws.md +15 -15
- package/skills/x-twitter-scraper/references/api-endpoints-error-codes.md +4 -4
- package/skills/x-twitter-scraper/references/api-endpoints-events.md +8 -8
- package/skills/x-twitter-scraper/references/api-endpoints-extractions.md +24 -23
- package/skills/x-twitter-scraper/references/api-endpoints-monitors.md +21 -21
- package/skills/x-twitter-scraper/references/api-endpoints-radar.md +13 -13
- package/skills/x-twitter-scraper/references/api-endpoints-support.md +6 -6
- package/skills/x-twitter-scraper/references/api-endpoints-trends.md +20 -5
- package/skills/x-twitter-scraper/references/api-endpoints-tweet-style-cache.md +39 -39
- package/skills/x-twitter-scraper/references/api-endpoints-webhooks.md +24 -24
- package/skills/x-twitter-scraper/references/api-endpoints-x-accounts.md +13 -13
- package/skills/x-twitter-scraper/references/api-endpoints-x-api.md +41 -41
- package/skills/x-twitter-scraper/references/api-endpoints-x-media.md +9 -9
- package/skills/x-twitter-scraper/references/api-endpoints-x-write.md +73 -73
- package/skills/x-twitter-scraper/references/api-endpoints.md +11 -11
- package/skills/x-twitter-scraper/references/automate-twitter-giveaways.md +13 -13
- package/skills/x-twitter-scraper/references/best-x-api-alternative.md +38 -38
- package/skills/x-twitter-scraper/references/compare-twitter-apis.md +23 -24
- package/skills/x-twitter-scraper/references/draws.md +14 -14
- package/skills/x-twitter-scraper/references/export-twitter-followers.md +12 -12
- package/skills/x-twitter-scraper/references/extract-x-community-data.md +10 -10
- package/skills/x-twitter-scraper/references/extractions.md +54 -48
- package/skills/x-twitter-scraper/references/mcp-setup.md +30 -36
- package/skills/x-twitter-scraper/references/mcp-tools.md +59 -69
- package/skills/x-twitter-scraper/references/monitor-twitter-webhooks.md +17 -18
- package/skills/x-twitter-scraper/references/python-examples.md +18 -26
- package/skills/x-twitter-scraper/references/reliable-twitter-data-api-2026.md +58 -60
- package/skills/x-twitter-scraper/references/scrape-export-twitter-data.md +25 -27
- package/skills/x-twitter-scraper/references/security.md +9 -22
- package/skills/x-twitter-scraper/references/track-twitter-keywords-mentions.md +18 -18
- package/skills/x-twitter-scraper/references/twitter-api-alternative-faq.md +17 -17
- package/skills/x-twitter-scraper/references/twitter-api-without-x-account.md +10 -11
- package/skills/x-twitter-scraper/references/twitter-data-pipeline.md +23 -23
- package/skills/x-twitter-scraper/references/twitter-scraper-api-guide.md +50 -50
- package/skills/x-twitter-scraper/references/types-account-identity.md +1 -1
- package/skills/x-twitter-scraper/references/types-account.md +1 -1
- package/skills/x-twitter-scraper/references/types-api-keys.md +1 -1
- package/skills/x-twitter-scraper/references/types-bookmarks-and-timeline.md +1 -1
- package/skills/x-twitter-scraper/references/types-credits.md +1 -1
- package/skills/x-twitter-scraper/references/types-download-media.md +4 -4
- package/skills/x-twitter-scraper/references/types-draws.md +1 -1
- package/skills/x-twitter-scraper/references/types-error.md +1 -1
- package/skills/x-twitter-scraper/references/types-events.md +1 -1
- package/skills/x-twitter-scraper/references/types-extractions.md +79 -96
- package/skills/x-twitter-scraper/references/types-mcp-output-schemas.md +1 -1
- package/skills/x-twitter-scraper/references/types-monitors.md +1 -1
- package/skills/x-twitter-scraper/references/types-radar.md +1 -1
- package/skills/x-twitter-scraper/references/types-request-bodies.md +1 -1
- package/skills/x-twitter-scraper/references/types-rest-api-vs-mcp-field-naming.md +1 -1
- package/skills/x-twitter-scraper/references/types-support.md +1 -1
- package/skills/x-twitter-scraper/references/types-trends.md +1 -1
- package/skills/x-twitter-scraper/references/types-tweet-drafts.md +1 -1
- package/skills/x-twitter-scraper/references/types-tweet-style-cache.md +1 -1
- package/skills/x-twitter-scraper/references/types-user-activity.md +1 -1
- package/skills/x-twitter-scraper/references/types-webhooks.md +1 -1
- package/skills/x-twitter-scraper/references/types-x-accounts.md +3 -3
- package/skills/x-twitter-scraper/references/types-x-api.md +25 -31
- package/skills/x-twitter-scraper/references/types-x-articles.md +1 -1
- package/skills/x-twitter-scraper/references/types-x-write.md +3 -3
- package/skills/x-twitter-scraper/references/types.md +15 -15
- package/skills/x-twitter-scraper/references/usage.md +6 -6
- package/skills/x-twitter-scraper/references/webhooks.md +27 -37
- package/skills/x-twitter-scraper/references/workflows.md +54 -63
- package/skills/x-twitter-scraper/skill-card.md +35 -27
- package/skills/x-twitter-scraper/skillspector-report.md +2 -2
- package/skills/xquik-social-research/SKILL.md +19 -16
- package/skills.sh.json +8 -8
- package/stub-server.mjs +42 -42
- package/task-guides/check-mutuals.md +9 -9
- package/task-guides/clean-followers.md +15 -15
- package/task-guides/export-tweets-csv.md +12 -12
- package/task-guides/extract-followers.md +16 -16
- package/task-guides/find-bangers.md +14 -14
- package/task-guides/find-influencers.md +10 -10
- package/task-guides/find-viral-tweets.md +15 -15
- package/task-guides/follow-unfollow.md +16 -15
- package/task-guides/for-you-feed.md +10 -10
- package/task-guides/going-viral.md +19 -18
- package/task-guides/grow-followers.md +13 -13
- package/task-guides/monitor-accounts.md +16 -16
- package/task-guides/optimize-tweets.md +16 -15
- package/task-guides/post-tweets.md +19 -18
- package/task-guides/run-giveaway.md +15 -15
- package/task-guides/search-tweets.md +13 -13
- package/task-guides/send-dms.md +13 -13
- package/task-guides/top-replies.md +10 -10
- package/task-guides/track-competitors.md +16 -16
- package/task-guides/track-hashtags.md +10 -10
- package/task-guides/track-mentions.md +12 -12
- package/task-guides/trending-news.md +11 -11
- package/task-guides/tweet-analytics.md +16 -16
- package/task-guides/tweet-ideas.md +10 -10
- package/task-guides/tweet-replies.md +15 -15
- package/task-guides/tweet-style.md +10 -10
- package/task-guides/tweet-webhooks.md +12 -12
- package/task-guides/update-x-profile.md +15 -15
- package/task-guides/user-tweets.md +21 -21
- package/task-guides/who-liked.md +10 -10
- package/task-guides/who-quoted.md +10 -10
- package/task-guides/who-retweeted.md +10 -10
- package/task-guides/write-threads.md +13 -13
- package/task-guides/write-tweets.md +15 -15
- package/task-guides/x-articles.md +9 -9
- package/task-guides/x-bookmarks.md +10 -10
- package/task-guides/x-communities.md +10 -10
- package/task-guides/x-lists.md +8 -8
- package/task-guides/x-spaces.md +9 -9
- package/task-guides/x-trends.md +11 -11
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
# Xquik MCP
|
|
1
|
+
# Xquik MCP tools reference
|
|
2
2
|
|
|
3
|
-
The MCP server at `https://xquik.com/mcp` provides 2
|
|
3
|
+
The MCP server at `https://xquik.com/mcp` provides 2 API tools. The client sends requests through the server, which authenticates calls to `xquik.com/api/v1`.
|
|
4
4
|
|
|
5
5
|
Hosted MCP v2.6.0 supports `2026-07-28` through `server/discover`.
|
|
6
6
|
Current MCP SDKs add request metadata and headers automatically.
|
|
7
7
|
Modern calls need no initialization session.
|
|
8
8
|
|
|
9
|
-
## Contents
|
|
10
|
-
|
|
11
|
-
- [Tools](#tools)
|
|
12
|
-
- [Safety Gates](#safety-gates)
|
|
13
|
-
- [Tool Selection Rules](#tool-selection-rules)
|
|
14
|
-
- [Workflow Patterns](#workflow-patterns)
|
|
15
|
-
- [Common Mistakes](#common-mistakes)
|
|
16
|
-
- [Unsupported Operations](#unsupported-operations)
|
|
17
|
-
- [Usage Reference](#usage-reference)
|
|
18
|
-
|
|
19
9
|
## Tools
|
|
20
10
|
|
|
21
11
|
| Tool | Description | Usage |
|
|
@@ -23,9 +13,9 @@ Modern calls need no initialization session.
|
|
|
23
13
|
| `explore` | Search the API endpoint catalog (read-only, no network calls) | Included |
|
|
24
14
|
| `xquik` | Send confirmed Xquik API requests | Varies by endpoint |
|
|
25
15
|
|
|
26
|
-
###
|
|
16
|
+
### Search the API spec with `explore`
|
|
27
17
|
|
|
28
|
-
The tool provides an in-memory `spec.endpoints` array.
|
|
18
|
+
The tool provides an in-memory `spec.endpoints` array. Search or filter it before calling an endpoint.
|
|
29
19
|
|
|
30
20
|
```typescript
|
|
31
21
|
interface EndpointInfo {
|
|
@@ -42,20 +32,20 @@ interface EndpointInfo {
|
|
|
42
32
|
declare const spec: { endpoints: EndpointInfo[] };
|
|
43
33
|
```
|
|
44
34
|
|
|
45
|
-
|
|
35
|
+
For example:
|
|
46
36
|
|
|
47
37
|
```javascript
|
|
48
|
-
// Find all included-usage endpoints
|
|
38
|
+
// Find all included-usage endpoints.
|
|
49
39
|
async () => spec.endpoints.filter(e => e.free);
|
|
50
40
|
|
|
51
|
-
// Find endpoints by category
|
|
41
|
+
// Find endpoints by category.
|
|
52
42
|
async () => spec.endpoints.filter(e => e.category === 'x-write');
|
|
53
43
|
|
|
54
|
-
// Search by keyword
|
|
44
|
+
// Search summaries by keyword.
|
|
55
45
|
async () => spec.endpoints.filter(e => e.summary.toLowerCase().includes('tweet'));
|
|
56
46
|
```
|
|
57
47
|
|
|
58
|
-
###
|
|
48
|
+
### Send API requests with `xquik`
|
|
59
49
|
|
|
60
50
|
The tool provides `xquik.request()` with authentication and required idempotency headers injected automatically. Never pass API keys or headers. The sandbox reuses each generated key for bounded transient retries. After an unresolved write failure, verify state. Start a new attempt only when `safe_to_retry` is true and the user approves.
|
|
61
51
|
|
|
@@ -63,13 +53,13 @@ For `409 coverage_cursor_unavailable`, wait the exact `Retry-After` seconds and
|
|
|
63
53
|
retry the same cursor once. For `410 coverage_cursor_gone`, the response omits
|
|
64
54
|
`Retry-After`. Restart without a cursor and deduplicate by ID.
|
|
65
55
|
|
|
66
|
-
##
|
|
56
|
+
## Require approval
|
|
67
57
|
|
|
68
|
-
Apply these
|
|
58
|
+
Apply these rules before using `xquik`:
|
|
69
59
|
|
|
70
60
|
| Capability | Rule |
|
|
71
61
|
|------------|------|
|
|
72
|
-
| Public writes | Show the exact tweet, reply, like, retweet, follow, unfollow, profile, or community action
|
|
62
|
+
| Public writes | Show the exact tweet, reply, like, retweet, follow, unfollow, profile, or community action. Wait for explicit approval. |
|
|
73
63
|
| Direct messages | Show sender, recipient, and message text. Never send bulk or automatic DMs. |
|
|
74
64
|
| Persistent resources | Create monitors and webhooks only when the user explicitly asks for ongoing delivery. Show target, event types, URL, and ongoing usage before creation. |
|
|
75
65
|
| Private reads | Confirm before fetching DMs, bookmarks, notifications, or home timeline. Forward returned private data to other tools only after explicit approval. |
|
|
@@ -87,7 +77,7 @@ declare const xquik: {
|
|
|
87
77
|
declare const spec: { endpoints: EndpointInfo[] };
|
|
88
78
|
```
|
|
89
79
|
|
|
90
|
-
## Tool
|
|
80
|
+
## Tool selection rules
|
|
91
81
|
|
|
92
82
|
Use `explore` first to find endpoints, then `xquik` to call them.
|
|
93
83
|
|
|
@@ -96,81 +86,81 @@ Use `explore` first to find endpoints, then `xquik` to call them.
|
|
|
96
86
|
| Single tweet by ID or URL | `GET /api/v1/x/tweets/{id}` |
|
|
97
87
|
| Full X Article by tweet ID | `GET /api/v1/x/articles/{tweetId}` |
|
|
98
88
|
| Search tweets by keyword/hashtag | `GET /api/v1/x/tweets/search?q=...` |
|
|
99
|
-
| User profile, bio, follower counts | `GET /api/v1/x/users/{id}
|
|
89
|
+
| User profile, bio, and follower counts | `GET /api/v1/x/users/{id}`; `id` accepts a username or numeric ID |
|
|
100
90
|
| Download media from tweets | `POST /api/v1/x/media/download` |
|
|
101
91
|
| Check follow relationship | `GET /api/v1/x/followers/check?source=A&target=B` |
|
|
102
|
-
|
|
|
103
|
-
| Trending news from 7 sources | `GET /api/v1/radar`
|
|
92
|
+
| X trending topics by region | `GET /api/v1/trends?woeid=1` |
|
|
93
|
+
| Trending news from 7 sources | `GET /api/v1/radar` through `xquik` |
|
|
104
94
|
| Activity from monitored accounts | `GET /api/v1/events` |
|
|
105
95
|
| Credit balance | `GET /api/v1/credits` |
|
|
106
|
-
| Monitor an X account | `POST /api/v1/monitors
|
|
107
|
-
| Set up webhook notifications | `POST /api/v1/webhooks
|
|
96
|
+
| Monitor an X account | `POST /api/v1/monitors`; persistent and requires approval |
|
|
97
|
+
| Set up webhook notifications | `POST /api/v1/webhooks`; persistent and requires approval |
|
|
108
98
|
| Run a giveaway draw | `POST /api/v1/draws` |
|
|
109
|
-
| Compose
|
|
99
|
+
| Compose or draft a tweet | `POST /api/v1/compose`; run compose, refine, then score |
|
|
110
100
|
| Link your X username | Use the Xquik dashboard account settings |
|
|
111
101
|
| Analyze tweet style | `POST /api/v1/styles` |
|
|
112
102
|
| Get cached style | `GET /api/v1/styles/{id}` |
|
|
113
103
|
| Compare two styles | `GET /api/v1/styles/compare` |
|
|
114
|
-
| Post a tweet | `POST /api/v1/x/tweets
|
|
115
|
-
| Like
|
|
116
|
-
| Retweet | `POST /api/v1/x/tweets/{id}/retweet
|
|
117
|
-
| Unretweet | delete request to `/api/v1/x/tweets/{id}/retweet
|
|
118
|
-
| Follow
|
|
119
|
-
| Send a DM | `POST /api/v1/x/dm/{userId}
|
|
120
|
-
| Upload media | `POST /api/v1/x/media
|
|
104
|
+
| Post a tweet | `POST /api/v1/x/tweets`; requires approval |
|
|
105
|
+
| Like or unlike a tweet | `POST /api/v1/x/tweets/{id}/like` likes it. A delete request to the same route unlikes it. Both require approval. |
|
|
106
|
+
| Retweet | `POST /api/v1/x/tweets/{id}/retweet`; requires approval |
|
|
107
|
+
| Unretweet | Send a delete request to `/api/v1/x/tweets/{id}/retweet`; requires approval |
|
|
108
|
+
| Follow or unfollow | `POST /api/v1/x/users/{id}/follow` follows. A delete request to the same route unfollows. Both require approval. |
|
|
109
|
+
| Send a DM | `POST /api/v1/x/dm/{userId}`; requires approval |
|
|
110
|
+
| Upload media | `POST /api/v1/x/media`; approve its use in a post or profile change |
|
|
121
111
|
| Open support ticket | `POST /api/v1/support/tickets` |
|
|
122
112
|
| List support tickets | `GET /api/v1/support/tickets` |
|
|
123
113
|
| Get user's recent tweets | `GET /api/v1/x/users/{id}/tweets` |
|
|
124
114
|
| Get user's liked tweets | `GET /api/v1/x/users/{id}/likes` |
|
|
125
115
|
| Get user's media tweets | `GET /api/v1/x/users/{id}/media` |
|
|
126
|
-
| Get
|
|
116
|
+
| Get accounts that liked a tweet | `GET /api/v1/x/tweets/{id}/favoriters` |
|
|
127
117
|
| Get mutual followers | `GET /api/v1/x/users/{id}/followers-you-know` |
|
|
128
|
-
| Get followers
|
|
129
|
-
| Get tweet quotes
|
|
118
|
+
| Get followers or following | `GET /api/v1/x/users/{id}/followers` or `GET /api/v1/x/users/{id}/following` |
|
|
119
|
+
| Get tweet quotes, replies, retweeters, or thread | `GET /api/v1/x/tweets/{id}/quotes`, `/replies`, `/retweeters`, or `/thread` |
|
|
130
120
|
| Read X Lists | `GET /api/v1/x/lists/{id}/members`, `/followers`, `/tweets` |
|
|
131
121
|
| Read X Communities | `GET /api/v1/x/communities/search`, `/tweets`, `/{id}/info`, `/{id}/members`, `/{id}/moderators`, `/{id}/tweets` |
|
|
132
|
-
| Get bookmarks | `GET /api/v1/x/bookmarks
|
|
122
|
+
| Get bookmarks | `GET /api/v1/x/bookmarks`; private and requires approval |
|
|
133
123
|
| Get bookmark folders | `GET /api/v1/x/bookmarks/folders` |
|
|
134
|
-
| Get notifications | `GET /api/v1/x/notifications
|
|
135
|
-
| Get home timeline | `GET /api/v1/x/timeline
|
|
136
|
-
| Get DM history | `GET /api/v1/x/dm/{userId}/history?account={username}
|
|
124
|
+
| Get notifications | `GET /api/v1/x/notifications`; private and requires approval |
|
|
125
|
+
| Get home timeline | `GET /api/v1/x/timeline`; private and requires approval |
|
|
126
|
+
| Get DM history | `GET /api/v1/x/dm/{userId}/history?account={username}`; private and requires exact-account approval |
|
|
137
127
|
| Check credit balance | `GET /api/v1/credits` |
|
|
138
128
|
|
|
139
|
-
Use `POST /api/v1/extractions`
|
|
129
|
+
Use `POST /api/v1/extractions` only for bulk data that simpler endpoints cannot provide. Examples include complete follower lists, replies, and community members. Always call `POST /api/v1/extractions/estimate` first.
|
|
140
130
|
|
|
141
131
|
Fresh cursorless Tweet Search with `queryType=Latest` is newest-first across
|
|
142
132
|
pages. Existing cursors retain their ordering. Thread reads accept 32 effective
|
|
143
133
|
result filters. They exclude `nativeRetweets`, `sinceTime`, and `untilTime`.
|
|
144
134
|
See [direct lookups](api-endpoints-x-api.md) for the exact names.
|
|
145
135
|
|
|
146
|
-
## Workflow
|
|
136
|
+
## Workflow patterns
|
|
147
137
|
|
|
148
138
|
| Workflow | Steps |
|
|
149
139
|
|----------|-------|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
160
|
-
## Common
|
|
140
|
+
| Set up ongoing alerts | Confirm target, event types, destination, and usage estimate -> `POST /monitors` -> `POST /webhooks` -> `POST /webhooks/{id}/test` |
|
|
141
|
+
| Run a giveaway | Confirm tweet URL and rules -> `POST /draws` |
|
|
142
|
+
| Bulk extraction | `POST /extractions/estimate` -> `POST /extractions` -> `GET /extractions/{id}` |
|
|
143
|
+
| Compose and score a tweet | `POST /compose` with `step=compose` -> `refine` -> `score` |
|
|
144
|
+
| Analyze tweet style | `POST /styles` -> `GET /styles/{id}` -> `POST /compose` with `styleUsername` |
|
|
145
|
+
| Post a tweet | `GET /x/accounts` -> approve -> `POST /x/tweets` with `account` and `text` -> hosted MCP adds a unique `Idempotency-Key` -> poll `statusUrl` |
|
|
146
|
+
| Get trending news | `GET /radar` through `xquik` -> `POST /compose` with the selected topic |
|
|
147
|
+
| Open a support ticket | `POST /support/tickets` -> `GET /support/tickets/{id}` |
|
|
148
|
+
| Collect complete reply coverage | `GET /x/tweets/{id}/replies?mode=complete&limit=<1-25000>` -> filter direct rows by `inReplyToId` -> keep `nested_replies` separate -> inspect `diagnostic` |
|
|
149
|
+
|
|
150
|
+
## Common mistakes
|
|
161
151
|
|
|
162
152
|
| Mistake | Fix |
|
|
163
153
|
|---------|-----|
|
|
164
|
-
| Combining
|
|
165
|
-
| Using `compose` when user wants to send a tweet | `POST /compose`
|
|
166
|
-
| Using `POST /x/tweets` when user wants help
|
|
167
|
-
| Falling back to web search
|
|
168
|
-
|
|
|
169
|
-
| Passing API keys in code |
|
|
170
|
-
| Using `explore` for API calls | `explore`
|
|
171
|
-
| Looking up follow
|
|
172
|
-
| Treating nested replies as direct replies | Match `inReplyToId` to the root ID. Keep `nested_replies` separate |
|
|
173
|
-
| Treating 424 as an empty failure | Keep safe partial rows. Follow `diagnostic.recommendedFallback` and disclose coverage |
|
|
154
|
+
| Combining included and metered calls in `Promise.all` | Call included endpoints first, then metered ones. A 402 in `Promise.all` cancels all results. |
|
|
155
|
+
| Using `compose` when the user wants to send a tweet | `POST /compose` creates drafts. Use `POST /x/tweets` to send. |
|
|
156
|
+
| Using `POST /x/tweets` when the user wants writing help | Use compose, refine, and score instead. |
|
|
157
|
+
| Falling back to web search after an API error | Keep data already fetched from Xquik. |
|
|
158
|
+
| Skipping account checks before metered calls | Attempt the requested call. On 402, explain the account state and direct the user to the dashboard. |
|
|
159
|
+
| Passing API keys in code | The server adds authentication. Do not include keys. |
|
|
160
|
+
| Using `explore` for API calls | `explore` searches the API spec. Use `xquik` for API calls. |
|
|
161
|
+
| Looking up follow or DM targets by username | These routes need a numeric user ID. Resolve it through `GET /x/users/{id}` first. |
|
|
162
|
+
| Treating nested replies as direct replies | Match `inReplyToId` to the root ID. Keep `nested_replies` separate. |
|
|
163
|
+
| Treating 424 as an empty failure | Keep safe partial rows. Follow `diagnostic.recommendedFallback` and disclose coverage. |
|
|
174
164
|
|
|
175
165
|
## REST-only operations
|
|
176
166
|
|
|
@@ -187,7 +177,7 @@ These 8 credential, checkout, or guest-wallet operations remain outside MCP:
|
|
|
187
177
|
- Guest wallet status polling
|
|
188
178
|
- Guest wallet top-ups
|
|
189
179
|
|
|
190
|
-
## Usage
|
|
180
|
+
## Usage reference
|
|
191
181
|
|
|
192
|
-
-
|
|
193
|
-
- Metered or account-gated
|
|
182
|
+
- Included operations cover account info, compose steps, cached styles, drafts, Radar, support tickets, credit balance, and webhook management.
|
|
183
|
+
- Metered or account-gated operations cover tweet search, lookups, media, extractions, draws, monitors, analysis, trends, and approved writes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Twitter
|
|
1
|
+
# Twitter account monitor API: HMAC webhook alerts
|
|
2
2
|
|
|
3
3
|
Xquik account monitors can detect new tweets, replies, quotes, and reposts.
|
|
4
4
|
Keyword monitors detect new matches for a persistent query. Poll events or push
|
|
@@ -7,27 +7,27 @@ them to an HTTPS endpoint through HMAC-signed webhooks.
|
|
|
7
7
|
> Xquik is an independent third-party service. Not affiliated with X Corp.
|
|
8
8
|
> "Twitter" and "X" are trademarks of X Corp.
|
|
9
9
|
|
|
10
|
-
## Twitter
|
|
10
|
+
## Twitter monitor event and delivery data
|
|
11
11
|
|
|
12
|
-
| Object | Fields to
|
|
12
|
+
| Object | Fields to preserve |
|
|
13
13
|
| --- | --- |
|
|
14
14
|
| Account monitor | Monitor ID, username, event types, active state |
|
|
15
15
|
| Keyword monitor | Monitor ID, query, event types, active state |
|
|
16
16
|
| Event | Event ID, monitor ID and type, event type, occurrence time, data |
|
|
17
17
|
| Delivery | Delivery ID, stream event ID, attempts, status, delivery time |
|
|
18
18
|
|
|
19
|
-
## Twitter
|
|
19
|
+
## Twitter monitor polling versus webhook delivery
|
|
20
20
|
|
|
21
|
-
| Requirement | Poll
|
|
21
|
+
| Requirement | Poll events | Webhook delivery |
|
|
22
22
|
| --- | --- | --- |
|
|
23
|
-
| Simple scheduled batch |
|
|
24
|
-
| Low detection delay |
|
|
23
|
+
| Simple scheduled batch | Use polling | Optional |
|
|
24
|
+
| Low detection delay | Poll more often | Use webhooks |
|
|
25
25
|
| Recover after downtime | Resume with the stored cursor | Inspect delivery status, then repoll events |
|
|
26
26
|
| Public HTTPS endpoint | Not required | Required |
|
|
27
27
|
| Signature verification | Not applicable | Required |
|
|
28
28
|
| Backpressure control | Caller controls fetch rate | Receiver must queue work |
|
|
29
29
|
|
|
30
|
-
Both models need idempotency. Persist the event before
|
|
30
|
+
Both models need idempotency. Persist the event before processing it.
|
|
31
31
|
Mark completion only after every required side effect succeeds.
|
|
32
32
|
|
|
33
33
|
### What is the best way to monitor a Twitter account programmatically?
|
|
@@ -57,7 +57,7 @@ shown only once and should enter a secret store immediately.
|
|
|
57
57
|
|
|
58
58
|
Verify `<timestamp>.<nonce>.<raw body>` with `X-Xquik-Timestamp`,
|
|
59
59
|
`X-Xquik-Nonce`, and `X-Xquik-Signature`. Reject timestamps outside 5 minutes
|
|
60
|
-
and reused nonces. Reject invalid signatures before parsing
|
|
60
|
+
and reused nonces. Reject invalid signatures before parsing event data.
|
|
61
61
|
|
|
62
62
|
### What is a Twitter account monitor API?
|
|
63
63
|
|
|
@@ -72,13 +72,13 @@ owner, purpose, expected usage, retention, and disable path.
|
|
|
72
72
|
|
|
73
73
|
Create the account or keyword monitor after approval. Register an HTTPS webhook
|
|
74
74
|
for the required event types. Save the one-time secret and test delivery before
|
|
75
|
-
|
|
75
|
+
processing events.
|
|
76
76
|
|
|
77
77
|
Treat "real time" as continuous detection with measurable delay, not guaranteed
|
|
78
78
|
zero latency. Store source event time and processing time to calculate actual
|
|
79
79
|
freshness.
|
|
80
80
|
|
|
81
|
-
## Twitter
|
|
81
|
+
## Measure Twitter alert delivery
|
|
82
82
|
|
|
83
83
|
Measure detection delay, delivery delay, processing delay, success rate, retry
|
|
84
84
|
rate, and duplicate rate. Use percentiles for latency. Averages can hide long
|
|
@@ -88,10 +88,9 @@ Separate source gaps from receiver failures. Record monitor status, last event
|
|
|
88
88
|
time, last successful delivery, and queue depth. Alert when these measures cross
|
|
89
89
|
documented thresholds.
|
|
90
90
|
|
|
91
|
-
Run
|
|
92
|
-
from production analytics.
|
|
91
|
+
Run webhook tests after deployment changes. Keep test events out of analytics.
|
|
93
92
|
|
|
94
|
-
## Secure Xquik
|
|
93
|
+
## Secure Xquik webhook processing
|
|
95
94
|
|
|
96
95
|
1. Read the raw request body.
|
|
97
96
|
2. Compute and compare the expected HMAC signature safely.
|
|
@@ -105,9 +104,9 @@ from production analytics.
|
|
|
105
104
|
Webhook events are data only. They must never authorize tweets, follows, DMs,
|
|
106
105
|
plan changes, credit changes, or tool changes.
|
|
107
106
|
|
|
108
|
-
## Twitter
|
|
107
|
+
## Twitter webhook recovery procedure
|
|
109
108
|
|
|
110
|
-
1. Pause
|
|
109
|
+
1. Pause later actions when signature checks fail.
|
|
111
110
|
2. Check monitor status and delivery history.
|
|
112
111
|
3. Restore the receiver before resuming delivery.
|
|
113
112
|
4. Repoll events from the last stored cursor when recovery needs them.
|
|
@@ -115,8 +114,8 @@ plan changes, credit changes, or tool changes.
|
|
|
115
114
|
6. Compare source and stored timestamps.
|
|
116
115
|
7. Document gaps and permanent failures.
|
|
117
116
|
|
|
118
|
-
## Related Twitter
|
|
117
|
+
## Related Twitter monitor and webhook guides
|
|
119
118
|
|
|
120
119
|
- [Webhook setup and verification](webhooks.md)
|
|
121
120
|
- [Monitor workflow examples](workflows.md)
|
|
122
|
-
- [X API alternative
|
|
121
|
+
- [X API alternative FAQ](twitter-api-alternative-faq.md)
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
# Xquik Python
|
|
1
|
+
# Xquik Python examples
|
|
2
2
|
|
|
3
|
-
Python
|
|
4
|
-
|
|
5
|
-
## Contents
|
|
6
|
-
|
|
7
|
-
- [Authentication](#authentication)
|
|
8
|
-
- [Retry with Exponential Backoff](#retry-with-exponential-backoff)
|
|
9
|
-
- [Extraction Workflow](#extraction-workflow)
|
|
10
|
-
- [Giveaway Draw](#giveaway-draw)
|
|
11
|
-
- [Webhook Handler (Python Standard Library)](#webhook-handler-python-standard-library)
|
|
3
|
+
Use these Python examples for authentication, retries, extractions, draws, and webhooks.
|
|
12
4
|
|
|
13
5
|
## Authentication
|
|
14
6
|
|
|
15
|
-
>
|
|
7
|
+
> These examples send credentials, parameters, and
|
|
16
8
|
> returned data to and from `xquik.com`. Keep the key in a secret store. Get
|
|
17
9
|
> explicit approval before private reads, writes, exports, persistent resources,
|
|
18
10
|
> webhooks, or metered jobs. Never forward private results without separate
|
|
@@ -24,7 +16,7 @@ import urllib.error
|
|
|
24
16
|
import urllib.request
|
|
25
17
|
|
|
26
18
|
def load_secret(name: str) -> str:
|
|
27
|
-
"""Read from
|
|
19
|
+
"""Read from the runtime secret store."""
|
|
28
20
|
raise RuntimeError(f"Configure {name} in your secret store.")
|
|
29
21
|
|
|
30
22
|
API_KEY = load_secret("XQUIK_API_KEY")
|
|
@@ -32,7 +24,7 @@ BASE = "https://xquik.com/api/v1"
|
|
|
32
24
|
HEADERS = {"x-api-key": API_KEY, "Content-Type": "application/json"}
|
|
33
25
|
```
|
|
34
26
|
|
|
35
|
-
## Retry with
|
|
27
|
+
## Retry with exponential backoff
|
|
36
28
|
|
|
37
29
|
```python
|
|
38
30
|
import time, random
|
|
@@ -65,7 +57,7 @@ def xquik_fetch(path, method="GET", json_body=None, max_retries=3):
|
|
|
65
57
|
time.sleep(delay)
|
|
66
58
|
```
|
|
67
59
|
|
|
68
|
-
## Extraction
|
|
60
|
+
## Extraction workflow
|
|
69
61
|
|
|
70
62
|
```python
|
|
71
63
|
RESULTS_LIMIT = 1000
|
|
@@ -75,7 +67,7 @@ def require_explicit_approval(scope: str) -> None:
|
|
|
75
67
|
f"Approval required for {scope}. Implement the approval gate first."
|
|
76
68
|
)
|
|
77
69
|
|
|
78
|
-
#
|
|
70
|
+
# Estimate the extraction.
|
|
79
71
|
estimate = xquik_fetch("/extractions/estimate", method="POST", json_body={
|
|
80
72
|
"toolType": "reply_extractor",
|
|
81
73
|
"targetTweetId": "1893704267862470862",
|
|
@@ -83,10 +75,10 @@ estimate = xquik_fetch("/extractions/estimate", method="POST", json_body={
|
|
|
83
75
|
})
|
|
84
76
|
|
|
85
77
|
if not estimate["allowed"]:
|
|
86
|
-
print(f"
|
|
78
|
+
print(f"Extraction estimate: {estimate['creditsRequired']} credits. Balance: {estimate['creditsAvailable']}.")
|
|
87
79
|
exit()
|
|
88
80
|
|
|
89
|
-
#
|
|
81
|
+
# Create the bounded job only after approval.
|
|
90
82
|
require_explicit_approval(
|
|
91
83
|
"the bounded extraction job, usage, recipients, and retention"
|
|
92
84
|
)
|
|
@@ -96,12 +88,12 @@ job = xquik_fetch("/extractions", method="POST", json_body={
|
|
|
96
88
|
"resultsLimit": RESULTS_LIMIT,
|
|
97
89
|
})
|
|
98
90
|
|
|
99
|
-
#
|
|
91
|
+
# Poll until the job finishes. Large jobs may remain in "running" state.
|
|
100
92
|
while job["status"] in ("pending", "running"):
|
|
101
93
|
time.sleep(2)
|
|
102
94
|
job = xquik_fetch(f"/extractions/{job['id']}")
|
|
103
95
|
|
|
104
|
-
#
|
|
96
|
+
# Get every approved result page.
|
|
105
97
|
cursor = None
|
|
106
98
|
results = []
|
|
107
99
|
|
|
@@ -119,10 +111,10 @@ while True:
|
|
|
119
111
|
print(f"Extracted {len(results)} results")
|
|
120
112
|
```
|
|
121
113
|
|
|
122
|
-
## Giveaway
|
|
114
|
+
## Giveaway draw
|
|
123
115
|
|
|
124
116
|
```python
|
|
125
|
-
# Create draw with
|
|
117
|
+
# Create a draw with explicit filters.
|
|
126
118
|
draw = xquik_fetch("/draws", method="POST", json_body={
|
|
127
119
|
"tweetUrl": "https://x.com/burakbayir/status/1893456789012345678",
|
|
128
120
|
"winnerCount": 3,
|
|
@@ -135,14 +127,14 @@ draw = xquik_fetch("/draws", method="POST", json_body={
|
|
|
135
127
|
"requiredKeywords": ["giveaway"],
|
|
136
128
|
})
|
|
137
129
|
|
|
138
|
-
# Get winners
|
|
130
|
+
# Get the winners.
|
|
139
131
|
details = xquik_fetch(f"/draws/{draw['id']}")
|
|
140
132
|
for winner in details["winners"]:
|
|
141
|
-
role = "
|
|
133
|
+
role = "Backup" if winner["isBackup"] else "Winner"
|
|
142
134
|
print(f"{role} #{winner['position']}: @{winner['authorUsername']}")
|
|
143
135
|
```
|
|
144
136
|
|
|
145
|
-
##
|
|
137
|
+
## Python standard library webhook handler
|
|
146
138
|
|
|
147
139
|
```python
|
|
148
140
|
import hashlib
|
|
@@ -156,9 +148,9 @@ def load_secret(name: str) -> str:
|
|
|
156
148
|
"""Read from your runtime secret store."""
|
|
157
149
|
raise RuntimeError(f"Configure {name} in your secret store.")
|
|
158
150
|
|
|
159
|
-
#
|
|
151
|
+
# Use the per-webhook secret from POST /webhooks, not an Xquik account credential.
|
|
160
152
|
WEBHOOK_SECRET = load_secret("XQUIK_WEBHOOK_SECRET")
|
|
161
|
-
processed_delivery_ids = set() # Use durable storage in
|
|
153
|
+
processed_delivery_ids = set() # Use durable storage in deployed services.
|
|
162
154
|
|
|
163
155
|
def verify_signature(payload: bytes, signature: str, timestamp: str, nonce: str, secret: str) -> bool:
|
|
164
156
|
if not timestamp.isdigit() or not re.fullmatch(r"[0-9a-f]{32}", nonce):
|