{
  "name": "Soke — Content Research (Trending Videos)",
  "nodes": [
    {
      "parameters": {},
      "id": "b1b2c3d4-0002-4000-8000-000000000001",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [240, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.usesoke.ai/api/v1/research/content",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"keywords\": [\"{{ $json.keyword || 'productivity tips' }}\"],\n  \"platform\": \"youtube\",\n  \"maxResults\": 20,\n  \"recencyDays\": 365\n}",
        "options": {}
      },
      "id": "b1b2c3d4-0002-4000-8000-000000000002",
      "name": "Research Content",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [480, 300],
      "credentials": {
        "httpHeaderAuth": {
          "id": "CREDENTIAL_ID",
          "name": "Soke API"
        }
      }
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "={\n  \"totalResults\": {{ $json.data.totalResults }},\n  \"topVideos\": {{ JSON.stringify($json.data.videos.slice(0, 5).map(v => ({ title: v.title, channel: v.channelTitle, views: v.viewCount, velocity: v.viewVelocity, engagement: v.engagementRate }))) }}\n}",
        "options": {}
      },
      "id": "b1b2c3d4-0002-4000-8000-000000000003",
      "name": "Extract Top Videos",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [720, 300]
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [{ "node": "Research Content", "type": "main", "index": 0 }]
      ]
    },
    "Research Content": {
      "main": [
        [{ "node": "Extract Top Videos", "type": "main", "index": 0 }]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "soke-template"
  },
  "tags": [
    { "name": "Soke", "id": "soke-tag-1" }
  ]
}
