{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "b72a5043-e59a-4669-ac5e-bacdd601fb90",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "options": {},
        "formTitle": "Keyword Difficulty Checker",
        "formFields": {
          "values": [
            {
              "fieldLabel": "keyword",
              "requiredField": true
            },
            {
              "fieldLabel": "country",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Keyword Difficulty Checker"
      },
      "typeVersion": 2.2
    },
    {
      "id": "2a1320b2-cc2a-42c9-9402-63f71aba61a4",
      "name": "Reformat 1",
      "type": "n8n-nodes-base.code",
      "position": [
        520,
        -140
      ],
      "parameters": {
        "jsCode": "return $input.first().json.data.semrushAPI.keywordDifficulty;"
      },
      "typeVersion": 2
    },
    {
      "id": "303d9dce-ae05-4f9b-9248-e03f5a6cfc39",
      "name": "Reformat 2",
      "type": "n8n-nodes-base.code",
      "position": [
        480,
        220
      ],
      "parameters": {
        "jsCode": "return $input.first().json.data.semrushAPI.serpResults;"
      },
      "typeVersion": 2
    },
    {
      "id": "305741d2-278c-41b1-9b42-fe3a9a00fcfc",
      "name": "Keyword Difficulty Checker",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        220,
        0
      ],
      "parameters": {
        "url": "https://keyword-difficulty-checker1.p.rapidapi.com/keywordDifficulty.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": "keyword-difficulty-checker1.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "your key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "91b005e6-8d01-4b32-9210-621f8b68638f",
      "name": "SERP Results ",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        800,
        220
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "backlinks"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1BL8gZNhmaiZVThuEIFFra0XNQnnNrkxTsgEKeRoRHFM",
          "cachedResultUrl": "",
          "cachedResultName": "backlinks"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "d9839383-542c-4365-b521-fa8950093197",
      "name": "Keyword Difficulty Checker1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        800,
        -140
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "keyword",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "keyword",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "keywordDifficultyIndex",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "keywordDifficultyIndex",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 4590546,
          "cachedResultUrl": "",
          "cachedResultName": "backlink overflow"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": "backlinks"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "25aa2e00-fb5f-484e-8fa8-c032d390969b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        -340
      ],
      "parameters": {
        "width": 1000,
        "height": 960,
        "content": "# \ud83d\udcca Keyword Difficulty Checker Workflow for SEO Analysis\n\n**Description:**  \nThis automated n8n workflow collects keyword difficulty and SERP data based on user input, fetches data from an external API, reformats it, and stores the results into Google Sheets for SEO analysis and reporting.\n\n---\n\n## \ud83d\udd17 Node-by-Node Summary\n\n### 1. \ud83d\udcdd On form submission\nCollects user-submitted data (`keyword` and `country`) via a form trigger.\n\n### 2. \ud83c\udf10 Keyword Difficulty Checker\nSends the submitted data to an external API (`keywordDifficulty.php`) using a POST request to retrieve keyword difficulty and SERP data.\n\n### 3. \ud83d\udce6 Reformat 1\nExtracts the `keywordDifficulty` value from the API response JSON.\n\n### 4. \ud83d\udcca Keyword Difficulty Checker1\nAppends the extracted `keyword` and `keywordDifficultyIndex` to the \"backlink overflow\" sheet in Google Sheets.\n\n### 5. \ud83d\udce6 Reformat 2\nExtracts the `serpResults` data array from the API response JSON.\n\n### 6. \ud83d\udcc4 SERP Results\nAppends the SERP results to the \"backlinks\" sheet in Google Sheets.\n\n---\n\n> \u2705 Use this setup to automate SEO keyword research and track difficulty scores and ranking pages for better content strategy.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d44aa91c-852e-40c4-9cab-40c7a507fffd",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -120
      ],
      "parameters": {
        "height": 320,
        "content": "\ud83d\udcdd On form submission\nCollects user-submitted data (`keyword` and `country`) via a form trigger."
      },
      "typeVersion": 1
    },
    {
      "id": "91e6c05b-eb6e-484f-b80b-8ae8d121ef45",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -120
      ],
      "parameters": {
        "height": 320,
        "content": " \ud83c\udf10 Keyword Difficulty Checker\nSends the submitted data to an external API (`keywordDifficulty.php`) using a POST request to retrieve keyword difficulty and SERP data.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f37486d8-5fe7-49b6-8093-d7aa7fedc468",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        -240
      ],
      "parameters": {
        "height": 280,
        "content": " \ud83d\udce6 Reformat 1\nExtracts the `keywordDifficulty` value from the API response JSON."
      },
      "typeVersion": 1
    },
    {
      "id": "9acfc662-2677-4b74-b5d9-5cd982be140f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -240
      ],
      "parameters": {
        "height": 280,
        "content": "\ud83d\udcca Keyword Difficulty Checker1\nAppends the extracted `keyword` and `keywordDifficultyIndex` to the \"backlink overflow\" sheet in Google Sheets.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c8e846c0-5127-4c52-b235-f354b748ddc3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        80
      ],
      "parameters": {
        "height": 300,
        "content": "\ud83d\udce6 Reformat 2\nExtracts the `serpResults` data array from the API response JSON."
      },
      "typeVersion": 1
    },
    {
      "id": "88c0a09f-829d-4c61-b143-26ffa2fdaf0e",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        80
      ],
      "parameters": {
        "height": 300,
        "content": "\ud83d\udcc4 SERP Results\nAppends the SERP results to the \"backlinks\" sheet in Google Sheets.\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Reformat 1": {
      "main": [
        [
          {
            "node": "Keyword Difficulty Checker1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reformat 2": {
      "main": [
        [
          {
            "node": "SERP Results ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Keyword Difficulty Checker",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keyword Difficulty Checker": {
      "main": [
        [
          {
            "node": "Reformat 1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Reformat 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}