{
  "name": "Soke — Keyword Research",
  "nodes": [
    {
      "parameters": {},
      "id": "a1b2c3d4-0001-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/keywords",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"topic\": \"{{ $json.topic || 'productivity tips for developers' }}\",\n  \"platform\": \"youtube\",\n  \"maxResults\": 20\n}",
        "options": {
          "response": {
            "response": {
              "fullResponse": false
            }
          }
        }
      },
      "id": "a1b2c3d4-0001-4000-8000-000000000002",
      "name": "Research Keywords",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [480, 300],
      "credentials": {
        "httpHeaderAuth": {
          "id": "CREDENTIAL_ID",
          "name": "Soke API"
        }
      }
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "={\n  \"keywords\": {{ JSON.stringify($json.data.keywords.map(k => k.keyword)) }},\n  \"topKeyword\": \"{{ $json.data.keywords[0]?.keyword }}\",\n  \"keywordsWithScores\": {{ JSON.stringify($json.data.keywords.slice(0, 5).map(k => ({ keyword: k.keyword, competitionScore: k.competitionScore, trendDirection: k.trendDirection }))) }},\n  \"longTailPhrases\": {{ JSON.stringify($json.data.longTailPhrases) }}\n}",
        "options": {}
      },
      "id": "a1b2c3d4-0001-4000-8000-000000000003",
      "name": "Extract Top Keywords",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [720, 300]
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [{ "node": "Research Keywords", "type": "main", "index": 0 }]
      ]
    },
    "Research Keywords": {
      "main": [
        [{ "node": "Extract Top Keywords", "type": "main", "index": 0 }]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "soke-template"
  },
  "tags": [
    { "name": "Soke", "id": "soke-tag-1" }
  ]
}
