Skip to main content
Glama
Xquik-dev

X Twitter Scraper

xquik

Destructive

Execute authenticated Twitter API calls to search tweets, look up users, post tweets, and manage accounts using a simple JavaScript function.

Instructions

Execute authenticated X (Twitter) API calls to read data, publish content, and manage accounts across 113 REST endpoints.

When to use

  • Use after calling 'explore' to discover the endpoint path and parameters.

  • Use for any live X/Twitter operation: search tweets, look up users, post tweets, like, retweet, follow, send DMs, run giveaway draws, monitor accounts, extract bulk data, compose tweets, and more.

When NOT to use

  • Do NOT use to discover endpoints - use 'explore' first.

  • Do NOT pass API keys or auth headers - authentication is injected automatically.

Behavior

  • Executes the provided async function in a sandboxed environment with xquik.request(path, options?) and spec.endpoints available.

  • Sandboxed via Node.js VM: no filesystem, no global network access - only xquik.request() is available. Console calls are silently ignored.

  • Execution timeout: 60 seconds per invocation, 60 seconds per individual API request.

  • Read operations (GET) return JSON objects with the requested data. Write operations (POST/DELETE) return { success: true } or { success: true, warning: '...' }.

  • Pagination: responses include has_next_page (boolean) and next_cursor (string). Pass cursor as a query param for the next page.

  • Can be destructive: write operations (POST/DELETE) modify data on X (tweets, follows, DMs, profile).

Error handling

  • 402: Subscription required or insufficient credits. Call POST /api/v1/subscribe to get a checkout URL.

  • 429: Rate limited. Retry after backoff.

  • 404: Resource not found (user, tweet, or monitor does not exist).

  • 200 with warning field: Probable success - do NOT retry.

Costs

  • Free: compose, styles, drafts, radar, subscribe, account, api-keys, support.

  • 1 credit/read ($0.00015): tweet search, timeline, bookmarks, favoriters.

  • 10 credits/write ($0.0015): tweet, like, retweet, follow, DM.

Input format

Write an async arrow function using xquik.request(path, { method?, body?, query? }). Auth is automatic.

Examples

Search tweets: async () => xquik.request('/api/v1/x/tweets/search', { query: { q: 'AI agents', limit: '50' } }) Get user: async () => xquik.request('/api/v1/x/users/elonmusk') Post tweet: async () => { const { accounts } = await xquik.request('/api/v1/x/accounts'); return xquik.request('/api/v1/x/tweets', { method: 'POST', body: { account: accounts[0].xUsername, text: 'Hello!' } }); }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesJavaScript async arrow function that calls xquik.request(path, options?) to execute X/Twitter API operations. Auth is injected automatically. Example: async () => xquik.request('/api/v1/x/tweets/search', { query: { q: 'AI', limit: '20' } })
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses sandboxed execution, timeout limits, return formats for read vs write operations, pagination indicators, and error handling. This adds significant context beyond the annotations, which already indicate destructive behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-organized with clear sections, bullet points, and code examples. It is front-loaded with the core purpose and every section adds value without unnecessary verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of the tool (multiple endpoints, pagination, error codes, cost breakdown), the description covers all essential aspects: input format, behavior, error handling, costs, and output types. No output schema exists, but return formats are explicitly described.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter 'code' is described in the schema as a JavaScript async arrow function. The description reinforces this with a detailed input format, multiple examples, and clarification that auth is injected automatically. Schema coverage is 100%, so baseline is 3; the extra examples and format clarification justify a 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes authenticated X/Twitter API calls to read, write, and manage accounts across 113 endpoints. It distinguishes itself from the sibling tool 'explore' by specifying that 'explore' is used for endpoint discovery.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description has explicit 'When to use' and 'When NOT to use' sections. It advises using 'explore' first to discover endpoints and warns against passing API keys or auth headers, providing clear guidance on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Xquik-dev/x-twitter-scraper'

If you have feedback or need assistance with the MCP directory API, please join our Discord server