WORKFLOW · N8N
Monitor X Search with Xquik
Prompts👁 5
WORKFLOW JSON
{
"name": "Monitor X Search with Xquik",
"tags": [
{
"name": "Xquik"
},
{
"name": "X"
},
{
"name": "Social Listening"
},
{
"name": "Marketing"
}
],
"nodes": [
{
"id": "manual-trigger",
"name": "Manual Trigger",
"type": "n8n-nodes-base.manualTrigger",
"position": [
240,
300
],
"parameters": {},
"typeVersion": 1
},
{
"id": "search-settings",
"name": "Search Settings",
"type": "n8n-nodes-base.set",
"position": [
460,
300
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "query",
"name": "query",
"type": "string",
"value": "n8n automation"
},
{
"id": "limit",
"name": "limit",
"type": "number",
"value": 10
}
]
}
},
"typeVersion": 3.4
},
{
"id": "api-key-note",
"name": "API Key Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
460,
140
],
"parameters": {
"color": 3,
"width": 300,
"height": 120,
"content": "Set XQUIK_API_KEY in n8n before running. This workflow reads it from $env and does not store the key."
},
"typeVersion": 1
},
{
"id": "search-x-with-xquik",
"name": "Search X with Xquik",
"type": "n8n-nodes-base.httpRequest",
"position": [
700,
300
],
"parameters": {
"url": "https://xquik.com/api/v1/x/tweets/search",
"options": {
"timeout": 120000
},
"sendQuery": true,
"sendHeaders": true,
"queryParameters": {
"parameters": [
{
"name": "q",
"value": "={{ $json.query }}"
},
{
"name": "limit",
"value": "={{ $json.limit }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "X-API-Key",
"value": "={{ $env.XQUIK_API_KEY }}"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "build-digest",
"name": "Build Digest",
"type": "n8n-nodes-base.code",
"position": [
940,
300
],
"parameters": {
"jsCode": "const body = $input.first().json;\nconst tweets = Array.isArray(body.tweets) ? body.tweets : [];\nconst normalized = tweets.map((tweet) => {\n const id = tweet.id ?? tweet.tweet_id ?? tweet.rest_id ?? '';\n const author = tweet.author ?? tweet.user ?? {};\n return {\n id,\n url: tweet.url ?? (id ? `https://x.com/i/web/status/${id}` : ''),\n text: tweet.text ?? tweet.full_text ?? tweet.content ?? '',\n author: author.username ?? author.screen_name ?? author.name ?? '',\n created_at: tweet.created_at ?? tweet.created ?? tweet.timestamp ?? '',\n metrics: tweet.metrics ?? {}\n };\n});\nconst digestLines = normalized.length === 0\n ? ['No matching X posts found for this query.']\n : normalized.map((tweet, index) => {\n const author = tweet.author ? ` by ${tweet.author}` : '';\n const link = tweet.url ? `\\n${tweet.url}` : '';\n return `${index + 1}. ${tweet.text}${author}${link}`;\n });\nreturn [{\n json: {\n query: $('Search Settings').first().json.query,\n results_count: normalized.length,\n has_more: Boolean(body.has_more),\n next_cursor: body.next_cursor ?? '',\n tweets: normalized,\n digest: digestLines.join('\\n\\n')\n }\n}];"
},
"typeVersion": 2
}
],
"settings": {
"executionOrder": "v1"
},
"connections": {
"Manual Trigger": {
"main": [
[
{
"node": "Search Settings",
"type": "main",
"index": 0
}
]
]
},
"Search Settings": {
"main": [
[
{
"node": "Search X with Xquik",
"type": "main",
"index": 0
}
]
]
},
"Search X with Xquik": {
"main": [
[
{
"node": "Build Digest",
"type": "main",
"index": 0
}
]
]
}
},
"description": "Searches X through Xquik, normalizes results, and builds an email-ready social listening digest."
}RELATED WORKFLOWS
COMMENTS
No comments yet — be the first.
