{
  "name": "ViralHunt morning radar",
  "nodes": [
    {
      "parameters": { "rule": { "interval": [ { "field": "cronExpression", "expression": "0 8 * * *" } ] } },
      "name": "Every morning at 8",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [0, 0]
    },
    {
      "parameters": {
        "url": "https://viralhunt.io/tool/api/v1/trending.php",
        "sendQuery": true,
        "queryParameters": { "parameters": [
          { "name": "source", "value": "tiktok" },
          { "name": "keyword", "value": "fitness" },
          { "name": "sort", "value": "rising" },
          { "name": "time_range", "value": "24h" },
          { "name": "per_page", "value": "10" }
        ] },
        "sendHeaders": true,
        "headerParameters": { "parameters": [ { "name": "Authorization", "value": "Bearer vhk_PASTE_YOUR_KEY" } ] },
        "options": {}
      },
      "name": "ViralHunt: rising posts",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [260, 0]
    },
    {
      "parameters": {
        "jsCode": "const posts = $input.first().json.data.posts || [];\nconst lines = posts.map((p, i) => `${i + 1}. ${p.title || p.text || ''} (${p.author || ''}) ${p.post_url}`);\nreturn [{ json: { text: 'Rising on TikTok this morning:\\n' + lines.join('\\n') } }];"
      },
      "name": "Format the list",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [520, 0]
    }
  ],
  "connections": {
    "Every morning at 8": { "main": [ [ { "node": "ViralHunt: rising posts", "type": "main", "index": 0 } ] ] },
    "ViralHunt: rising posts": { "main": [ [ { "node": "Format the list", "type": "main", "index": 0 } ] ] }
  },
  "settings": { "executionOrder": "v1" }
}
