{
  "name": "Template for TikTok, RapidAPI, and Google Sheets services",
  "nodes": [
    {
      "id": "863dc7cd-d022-4d64-b729-236c13c76498",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        260,
        0
      ]
    },
    {
      "id": "7dc09659-1a38-4be4-baf8-e07312379205",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        500,
        0
      ]
    },
    {
      "id": "3dd8c2aa-5dd9-4677-9ad7-a9cfa27c5da6",
      "name": "Profile Stats",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1040,
        20
      ]
    },
    {
      "id": "e8fc9e5c-5eb4-49fd-a60f-03ab3677f1c5",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "ca95ec8a-8dba-4821-a3d6-9fc96bd39fdc",
      "name": "Fetch Profile",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        800,
        20
      ]
    },
    {
      "id": "3cceba32-d50e-46a6-8f66-ea36ee42bdb9",
      "name": "Fetch Videos",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        660,
        440
      ]
    },
    {
      "id": "97890005-4e87-4204-8779-e9404fd3a75f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        -180
      ],
      "parameters": {
        "width": 600,
        "height": 1280,
        "content": "# 📊 TikTok Analytics Automation \n\n## 📝 Description\nThis workflow in n8n automates the process of retrieving TikTok user data using the RapidAPI service, processes the data in batches, and writes analy"
      }
    },
    {
      "id": "26c5211b-bbf7-4cfa-998e-f2bdb0a94fa2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -200
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "**Schedule Trigger**  \n  Triggers the entire workflow based on a predefined schedule (e.g., daily or hourly).  \n  It ensures the process runs automatically without manual input."
      }
    },
    {
      "id": "66fe6fa5-7266-441d-a469-077715887da3",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        -200
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "**Google Sheets**  \n  Reads a list of TikTok usernames from a master Google Spreadsheet.  \n  These usernames are used as input for the TikTok API calls."
      }
    },
    {
      "id": "83162a57-ffb5-4d24-ab62-288ff2e07d4e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -200
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "**Loop Over Items**  \n  Iterates over each row (username) retrieved from the sheet.  \n  Allows individual API requests for each username in sequence."
      }
    },
    {
      "id": "f7a65bc9-e008-4e75-afe1-d477cd16d246",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -200
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "- **Fetch Profile**  \n  Calls the `user_profile.php` endpoint on RapidAPI for the current username.  \n  Retrieves user details like profile name, followers, etc. (if needed)."
      }
    },
    {
      "id": "ec2d2a17-ce62-434c-9f2c-727cb7a9967f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        280
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": "- **Fetch Videos**  \n  Sends a POST request to `view_count.php` on RapidAPI using the current username.  \n  Returns total video stats such as views, posts count, and more."
      }
    },
    {
      "id": "5fbbbff4-97b3-4aa5-92ca-b6f903660a6a",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        260
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "- **Videos stats**  \n  Appends all the collected data (username, views, posts, date, etc.) to a result sheet.  \n  Acts as the final output log or dashboard for TikTok data tracking."
      }
    },
    {
      "id": "2b69a5a1-2e3f-4646-a495-05b2f6c63f90",
      "name": "Videos Stats",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1300,
        440
      ]
    },
    {
      "id": "15d42bde-0278-47c7-9cb5-46d41056cac5",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        -200
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "- **Profile Stats**  \n  Appends all the collected data  to a result sheet.  \n  Acts as the final output log or dashboard for TikTok data tracking."
      }
    }
  ],
  "connections": {
    "Fetch Videos": {
      "main": [
        [
          {
            "node": "Videos Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Videos Stats": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Profile": {
      "main": [
        [
          {
            "node": "Profile Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Profile Stats": {
      "main": [
        [
          {
            "node": "Fetch Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Fetch Profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}