{
  "name": "Keyword research to Google Sheets: search volume, CPC and keyword ideas",
  "nodes": [
    {
      "parameters": {
        "formTitle": "Keyword research",
        "formDescription": "Seed keywords in, Google Ads search volume, CPC and keyword ideas out, straight into your sheet.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Seed keywords (one per line)",
              "fieldType": "textarea",
              "requiredField": true
            },
            {
              "fieldLabel": "What do you need?",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Volume + new keyword ideas"
                  },
                  {
                    "option": "Volume for these exact keywords"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Country",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "United States"
                  },
                  {
                    "option": "United Kingdom"
                  },
                  {
                    "option": "Canada"
                  },
                  {
                    "option": "Australia"
                  },
                  {
                    "option": "Germany"
                  },
                  {
                    "option": "India"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Minimum monthly searches",
              "fieldType": "number"
            }
          ]
        },
        "options": {}
      },
      "id": "3d11f167-86e9-5d65-8c96-4e6be0d45f50",
      "name": "Keyword form",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        0,
        300
      ],
      "webhookId": "38a4f2e4-5048-5569-a17c-5c104ecab143"
    },
    {
      "parameters": {
        "jsCode": "// Turn the form answers into Actor input.\nconst raw = $json['Seed keywords (one per line)'] || '';\nconst keywords = [...new Set(raw.split(/[\\n,]+/).map(s => s.trim().toLowerCase()).filter(Boolean))].slice(0, 20);\nif (!keywords.length) throw new Error('Enter at least one seed keyword');\nreturn [{ json: {\n  keywords,\n  mode: $json['What do you need?'] === 'Volume for these exact keywords' ? 'search_volume' : 'both',\n  location: $json['Country'] || 'United States',\n  language: 'English',\n  maxIdeas: 200,\n  minSearchVolume: Number($json['Minimum monthly searches'] || 0),\n  includeMonthlySearches: false,\n}}];"
      },
      "id": "32739012-5354-5807-8d43-b9c0e8dc54c7",
      "name": "Build input",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "resource": "Actors",
        "operation": "Run actor and get dataset",
        "actorId": "wrenfield-data~keyword-search-volume",
        "customBody": "={{ JSON.stringify($json) }}",
        "timeout": 900,
        "memory": 1024,
        "maxTotalChargeUsd": 2,
        "authentication": "apifyApi"
      },
      "id": "3d590585-ac4a-5492-b7d3-e0a7dda145d0",
      "name": "Get search volume",
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 2,
      "position": [
        480,
        300
      ],
      "credentials": {
        "apifyApi": {
          "id": "",
          "name": "Apify account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Keep the columns people use; sort by volume.\nconst rows = $input.all().map(i => i.json).filter(r => r.found !== false);\nrows.sort((a, b) => (b.search_volume || 0) - (a.search_volume || 0));\nreturn rows.map(r => ({ json: {\n  keyword: r.keyword, type: r.type, seed_keyword: r.seed_keyword || '',\n  search_volume: r.search_volume, cpc_usd: r.cpc, competition: r.competition,\n  top_of_page_bid_low: r.low_top_of_page_bid, top_of_page_bid_high: r.high_top_of_page_bid,\n  location: r.location, pulled_at: new Date().toISOString().slice(0, 10),\n}}));"
      },
      "id": "333ad69c-0832-5ec2-8344-85add1cf447a",
      "name": "Clean and sort",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "",
          "mode": "url"
        },
        "sheetName": {
          "__rl": true,
          "value": "Keywords",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [],
          "schema": []
        },
        "options": {}
      },
      "id": "53155925-9967-581e-a744-04713b1c73bc",
      "name": "Append to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        960,
        300
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "content": "## Keyword research to Google Sheets\nSubmit seed keywords in a form and get Google Ads (Keyword Planner) search volume, CPC, competition and up to 200 keyword ideas in a Google Sheet. No Google Ads account needed.\n\n**Setup**\n1. Add your Apify API token as the *Apify account* credential.\n2. Pick your Google Sheet (tab `Keywords`).\n3. Activate and open the form URL.\n\n**Cost:** pay per keyword row plus a small per-request fee; 200 ideas cost well under $1. `maxTotalChargeUsd` caps each run at $2.",
        "height": 300,
        "width": 560,
        "color": 5
      },
      "id": "83a7f453-e154-5451-b7d3-df474391fffb",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -60
      ]
    }
  ],
  "connections": {
    "Keyword form": {
      "main": [
        [
          {
            "node": "Build input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build input": {
      "main": [
        [
          {
            "node": "Get search volume",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get search volume": {
      "main": [
        [
          {
            "node": "Clean and sort",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean and sort": {
      "main": [
        [
          {
            "node": "Append to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}