{
  "name": "SocialCrawl: Collect thousands of tweets for a keyword",
  "nodes": [
    {
      "id": "node-1",
      "position": [
        260,
        0
      ],
      "name": "Run recipe",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "parameters": {}
    },
    {
      "id": "node-2",
      "position": [
        520,
        0
      ],
      "name": "tweets",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "parameters": {
        "method": "GET",
        "url": "https://www.socialcrawl.dev/v1/twitter/search/tweets?query=nvidia&sort=latest&max_items=1000",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 300000,
          "pagination": {
            "pagination": {
              "paginationMode": "updateAParameterInEachRequest",
              "parameters": {
                "parameters": [
                  {
                    "type": "qs",
                    "name": "cursor",
                    "value": "={{ $response.body.pagination.next_cursor }}"
                  }
                ]
              },
              "paginationCompleteWhen": "other",
              "completeExpression": "={{ !$response.body.pagination || !$response.body.pagination.has_more }}",
              "limitPagesFetched": true,
              "maxRequests": 500
            }
          }
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "SocialCrawl API key"
        }
      },
      "executeOnce": true,
      "retryOnFail": true,
      "maxTries": 4,
      "waitBetweenTries": 2000
    },
    {
      "id": "note",
      "name": "How this recipe works",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -460
      ],
      "parameters": {
        "content": "## Collect thousands of tweets for a keyword\n\nPrice for ten thousand tweets: 1 credit per page (page size not yet measured; quote the whole job with GET /v1/utility/estimate or scripts/estimate.py).\n\nMeasured on 25/10/2026: 17 credits in 1 call for ITEMS=25 (the quote held 1). The TypeScript and Python programs both ran.\n\nITEMS caps the rows a step collects or loops over (default 10000, ten thousand tweets); the price scales with it.\n\nFRESH=1 skips the cache and bills every call; a cache hit is free.\n\nInputs, set to a working example (change them to yours):\n\n  keyword: Keyword or phrase; X operators allowed\n\n**Key:** create a Header Auth credential named SocialCrawl API key, with Name x-api-key and your API key as Value, and pick it on every request node.\n\n**Rows:** a step that runs once per row takes the first 10000 rows (change the number in its rows node). A paging step reads up to 500 pages: raise Max Pages under Options, Pagination to fetch more.\n\n**Errors:** a request node stops the workflow on an API error. Read error.type in its output; retry only when error.retryable is true.",
        "width": 520,
        "height": 420
      }
    }
  ],
  "connections": {
    "Run recipe": {
      "main": [
        [
          {
            "node": "tweets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {}
}
