{
  "name": "SocialCrawl: A creator's profile, recent posts and the comments on them",
  "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": "profile",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "parameters": {
        "method": "GET",
        "url": "https://www.socialcrawl.dev/v1/tiktok/profile?handle=charlidamelio",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 300000
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "SocialCrawl API key"
        }
      },
      "executeOnce": true,
      "retryOnFail": true,
      "maxTries": 4,
      "waitBetweenTries": 2000
    },
    {
      "id": "node-3",
      "position": [
        780,
        0
      ],
      "name": "videos",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "parameters": {
        "method": "GET",
        "url": "https://www.socialcrawl.dev/v1/tiktok/profile/videos?handle=charlidamelio",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 300000
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "SocialCrawl API key"
        }
      },
      "executeOnce": true,
      "retryOnFail": true,
      "maxTries": 4,
      "waitBetweenTries": 2000
    },
    {
      "id": "node-4",
      "position": [
        1040,
        0
      ],
      "name": "comments: rows of videos",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "parameters": {
        "jsCode": "// One item per row, up to ITEMS (5); the next node runs once per item.\nreturn $('videos').first().json.data.items.slice(0, 5).map((row) => ({ json: row }));"
      }
    },
    {
      "id": "node-5",
      "position": [
        1300,
        0
      ],
      "name": "comments",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "parameters": {
        "method": "GET",
        "url": "=https://www.socialcrawl.dev/v1/tiktok/post/comments?url={{ encodeURIComponent($json.post.url) }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 300000
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "SocialCrawl API key"
        }
      },
      "onError": "continueRegularOutput",
      "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": "## A creator's profile, recent posts and the comments on them\n\nPrice for profile, one page of videos, first comment page on five videos: 7 credits held up front (exact; the unused hold is refunded).\n\nMeasured on 25/10/2026: 7 credits in 7 calls for ITEMS=5 (the quote held 7). The TypeScript and Python programs both ran.\n\nITEMS caps the rows a step collects or loops over (default 5, profile, one page of videos, first comment page on five videos); 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  handle: The TikTok handle\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 5 rows (change the number in its rows node).\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": "profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "profile": {
      "main": [
        [
          {
            "node": "videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "videos": {
      "main": [
        [
          {
            "node": "comments: rows of videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "comments: rows of videos": {
      "main": [
        [
          {
            "node": "comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {}
}
