{
  "nodes": [
    {
      "id": "04e0377a-a1b5-4e97-9db0-57097891b7cc",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        980,
        360
      ],
      "parameters": {
        "options": {},
        "formTitle": "Keyword Research ",
        "formFields": {
          "values": [
            {
              "fieldLabel": "keyword",
              "requiredField": true
            },
            {
              "fieldLabel": "country",
              "placeholder": "in",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Keyword Research "
      },
      "typeVersion": 2.2
    },
    {
      "id": "4b50741c-b9bc-4a70-ba9c-3a7b80c7f338",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 780,
        "height": 960,
        "content": "# \ud83d\udd0d n8n Workflow: Keyword Research to Google Sheets\n\nThis workflow automates keyword research by capturing user input via a form, querying a keyword research API, and storing the results in Google Sheets.\n\n---\n\n## \ud83d\udccc Node-by-Node Explanation\n\n### 1. \ud83d\udfe2 On form submission\n- **Type:** `formTrigger`  \n- **Purpose:** Collects keyword and country inputs from the user to initiate the research process.\n\n---\n\n### 2. \ud83c\udf10Keyword Research \n- **Type:** `httpRequest`  \n- **Purpose:** Sends the keyword and country to an external keyword research API to fetch search data and suggestions.\n\n---\n\n### 3. \ud83d\udcc4 Append Data to Google Sheet\n- **Type:** `googleSheets`  \n- **Purpose:** Appends the keyword research results into a specified Google Sheets document for easy access and further analysis.\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c6bc5303-ee49-45c1-9562-88eadee018f2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        900,
        180
      ],
      "parameters": {
        "height": 320,
        "content": "**On form submission**\n- **Node Type:** `formTrigger`\n- **Function:** Displays a form to collect `keyword` and `country` inputs from the user.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ff10e636-c3e0-433e-ac73-da4307e74810",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1160,
        180
      ],
      "parameters": {
        "height": 320,
        "content": " **Keyword Research**\n- **Node Type:** `httpRequest`\n- **Function:** Sends a POST request with the user\u2019s keyword and country to the external keyword research API to retrieve related keyword data.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "24a448ee-44b2-4269-90b8-a39caa89516c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1420,
        180
      ],
      "parameters": {
        "height": 320,
        "content": " **Append Data to Google Sheet**\n- **Node Type:** `googleSheets`\n- **Function:** Appends the received keyword data and extensions into a connected Google Sheets file for record-keeping and analysis.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3482420b-9003-4567-87f5-7903f07c8197",
      "name": "Keyword Research",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1200,
        360
      ],
      "parameters": {
        "url": "https://semrush-keyword-research-tool.p.rapidapi.com/keyword-tool.php",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "keyword",
              "value": "={{ $json.keyword }}"
            },
            {
              "name": "country",
              "value": "={{ $json.country }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "semrush-keyword-research-tool.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "your key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "14c8ccca-f475-415e-a0fd-8bfa47760994",
      "name": "Append Data to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1440,
        360
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "data",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "data",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "extensions",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "extensions",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    }
  ],
  "connections": {
    "Keyword Research": {
      "main": [
        [
          {
            "node": "Append Data to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Keyword Research",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}