Prerequisites
- A Twexapi API key
- An MCP-capable agent or framework connected to
https://api.twexapi.io/mcp - A webhook URL from n8n, Zapier, Make, Pipedream, or your internal workflow runner
- A destination system such as Sheets, Airtable, Notion, Slack, a CRM, or a database
Recommended flow
Collect with an MCP-capable agent
Use Claude Code, Cursor, Codex CLI, LangChain, Pydantic AI, or another MCP client connected to
https://api.twexapi.io/mcp.Send to the no-code tool
Post the JSON to a webhook in n8n, Zapier, Make, Pipedream, or your internal workflow runner.
Copy-paste agent prompt
Workflow mapping
| JSON field | Common destination |
|---|---|
tweet_id | Database primary key, dedupe key, CRM note reference |
author_username | CRM account field, Slack message label |
created_at | Sort key and reporting timestamp |
next_cursor | Workflow state for the next scheduled run |
route_used | Audit log and debugging field |
Result handoff
Keep the workflow payload small and stable. Do not pass the full raw response to Slack messages, CRM notes, or spreadsheet rows unless you also archive it separately.| Row type | Required fields |
|---|---|
| Tweet search | tweet_id, text, author_username, created_at, public_url, route_used |
| Profile lookup | user_id, username, name, description, followers_count, verified |
| Trend rows | name, rank, query, requested country, requested topic |
| Pagination | has_more, next_cursor, original query or source ID |
| Write plan | action, endpoint, preview, requires_human_confirmation |
Recipe: Agent research to webhook
- Connect an AI agent to Twexapi MCP.
- Ask it for strict JSON using the prompt above.
- POST the JSON to your workflow webhook.
- Use the workflow tool’s iterator or loop step over
tweets. - Upsert rows by
tweet_id.
Recipe: Scheduled continuation
For daily jobs, keep the first run agent-assisted and make later runs deterministic:- Store
route_used, request parameters, andnext_cursor. - Run scheduled calls through Twexapi REST with
Authorization: Bearer YOUR_API_KEY. - Stop when
has_moreis false or the workflow reaches its row limit. - Send exceptions back to an agent only when the selected endpoint or query needs to change.
Testing checklist
- Confirm the webhook receives valid JSON, not Markdown.
- Confirm
tweet_idoruser_idis used for dedupe. - Confirm
next_cursoris persisted outside chat history. - Confirm write actions are represented as plans until a human approves them.
- Confirm API keys, cookies, and auth tokens are never sent to user-visible destinations.