{
  "meta": {
    "instanceId": "60c025075753afcab9f803964b4caaca9402f435deb4efafbb8e3b93b54d8752",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "55979fca-6abb-43f2-af9a-59f2cacaeb51",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        0,
        0
      ],
      "webhookId": "259a4fed-36fb-457c-8813-f84cf10d8c36",
      "parameters": {
        "options": {},
        "formTitle": "Competitor Analysis ",
        "formFields": {
          "values": [
            {
              "fieldLabel": "website",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Competitor Analysis "
      },
      "typeVersion": 2.2
    },
    {
      "id": "00963262-4328-4998-a996-b12d98f1badb",
      "name": "Re format output",
      "type": "n8n-nodes-base.code",
      "position": [
        560,
        0
      ],
      "parameters": {
        "jsCode": "return $input.first().json.data.semrushAPI.domainOverview"
      },
      "typeVersion": 2
    },
    {
      "id": "493ee398-972d-4a0b-b4ee-407ce2eeffc0",
      "name": "Reformat",
      "type": "n8n-nodes-base.code",
      "position": [
        720,
        420
      ],
      "parameters": {
        "jsCode": "return $input.first().json.data.semrushAPI.organicCompetitors;"
      },
      "typeVersion": 2
    },
    {
      "id": "2ec4b6b3-d8e0-4afd-8230-05604e85a258",
      "name": "Competitor Analysis ",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        300,
        0
      ],
      "parameters": {
        "url": "https://competitor-analysis-semrush.p.rapidapi.com/competitor.php",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "website",
              "value": "={{ $json.website }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "competitor-analysis-semrush.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "your key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "47be20f6-5340-4d42-af21-bff7faf046ec",
      "name": "Domain overview",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        800,
        0
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "database",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "database",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organicKeywords",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "organicKeywords",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organicTraffic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "organicTraffic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1271965358,
          "cachedResultUrl": "",
          "cachedResultName": "domainOverview"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": "Seo n8n"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "credential-id",
          "name": "googleApi Credential"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "2273488d-2ac3-404a-8708-cc032fe3be62",
      "name": "Organic Competitor",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1160,
        320
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "adwordsKeywords",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "adwordsKeywords",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "commonKeywords",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "commonKeywords",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitorRelevance",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competitorRelevance",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "domain",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organicCost",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "organicCost",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organicKeywords",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "organicKeywords",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organicTraffic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "organicTraffic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1979882207,
          "cachedResultUrl": "",
          "cachedResultName": "organicCompetitors"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": "Seo n8n"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "credential-id",
          "name": "googleApi Credential"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "955fce75-4e3e-4360-b82e-d9ab6c1e2c2b",
      "name": "Reformat 2",
      "type": "n8n-nodes-base.code",
      "position": [
        380,
        700
      ],
      "parameters": {
        "jsCode": "return $input.first().json.data.semrushAPI.organicPages;"
      },
      "typeVersion": 2
    },
    {
      "id": "3e7e7efb-ea5f-4254-8efc-8ac886bb371c",
      "name": "Organic Pages",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1020,
        700
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "trafficPercent",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "trafficPercent",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "traffic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "traffic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "numberOfKeywords",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "numberOfKeywords",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1802882998,
          "cachedResultUrl": "",
          "cachedResultName": "organicPages"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": "Seo n8n"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "credential-id",
          "name": "googleApi Credential"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "00f9c804-fa53-4549-afff-d21f7d61ed06",
      "name": "Reformat2",
      "type": "n8n-nodes-base.code",
      "position": [
        640,
        960
      ],
      "parameters": {
        "jsCode": "return $input.first().json.data.semrushAPI.domainOrganicSearchKeywords;"
      },
      "typeVersion": 2
    },
    {
      "id": "b8327558-3253-4175-b354-247f861cc4b8",
      "name": "organic keywords",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        920,
        1000
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "competition",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "competition",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "cpc",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "cpc",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "keyword",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "keyword",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "numberOfResults",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "numberOfResults",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "position",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "position",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "positionDifference",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "positionDifference",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "previousPosition",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "previousPosition",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "searchVolume",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "searchVolume",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "trafficPercent",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "trafficPercent",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "trafficCostPercent",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "trafficCostPercent",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "trends",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "trends",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "keywordDifficulty",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "keywordDifficulty",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 185010398,
          "cachedResultUrl": "",
          "cachedResultName": "domainOrganicSearchKeywords"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": "Seo n8n"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "credential-id",
          "name": "googleApi Credential"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "d2e9d70f-e407-4d2d-89bc-599307a1127e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1100,
        40
      ],
      "parameters": {
        "width": 900,
        "height": 1120,
        "content": "# Title:\n**Competitor Analysis & SEO Data Logging Workflow Using Semrush API and Google Sheets**\n\n# Description:\nThis workflow automates competitor analysis by leveraging the **Semrush API** and the **Top Backlink Checker API** to analyze backlinks, organic keywords, and traffic, then logs the results directly into **Google Sheets** for easy SEO reporting and tracking.\n\n## Node-by-Node Explanation:\n\n### 1. **On form submission**  \nCaptures the website URL from a user submission, triggering the analysis workflow.\n\n### 2. **Reformat output**  \nProcesses and reformats the domain overview data retrieved from the **Semrush API** for further analysis.\n\n### 3. **Reformat**  \nReformats the list of organic competitors from the **Semrush API** for storing in Google Sheets.\n\n### 4. **Competitor Analysis**  \nFetches backlink data from the **Top Backlink Checker API** and other competitor analysis information via a POST request.\n\n### 5. **Domain overview**  \nAppends the domain overview data, such as organic traffic and keywords, into the Google Sheets document for analysis.\n\n### 6. **Organic Competitor**  \nLogs competitor information such as keywords, relevance, and organic traffic into the appropriate Google Sheets.\n\n### 7. **Reformat 2**  \nReformats organic pages' data retrieved from **Semrush API** for detailed analysis.\n\n### 8. **Organic Pages**  \nStores the re-formatted organic pages data, including traffic percentage and keyword counts, into Google Sheets.\n\n### 9. **Reformat2**  \nPrepares organic keyword data for the next stage of processing.\n\n### 10. **organic keywords**  \nLogs the organic keywords data, including competition, CPC, and search volume, into the Google Sheets document.\n\n---\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "392030b3-6fad-4413-806c-d681cc0a77f9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -160
      ],
      "parameters": {
        "height": 400,
        "content": " **On form submission**  \nCaptures the website URL from a user submission, triggering the analysis workflow.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "6b374b63-4273-4884-ac5d-ea06dfa2917f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -160
      ],
      "parameters": {
        "height": 400,
        "content": "**Competitor Analysis**  \nFetches backlink data from the **Top Backlink Checker API** and other competitor analysis information via a POST request.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e5b7a624-e183-4083-a29b-7df9d9a5352e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        -160
      ],
      "parameters": {
        "height": 400,
        "content": "**Reformat output**  \nProcesses and reformats the domain overview data retrieved from the **Semrush API** for further analysis.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "088dfba6-8113-456b-821c-8097e9b052ec",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        300
      ],
      "parameters": {
        "height": 280,
        "content": "**Reformat**  \nReformats the list of organic competitors from the **Semrush API** for storing in Google Sheets.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "096424cc-ae1d-4ef1-a6f4-ac6d453f5c9d",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        -160
      ],
      "parameters": {
        "height": 400,
        "content": "**Domain overview**  \nAppends the domain overview data, such as organic traffic and keywords, into the Google Sheets document for analysis.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d3a217ec-3b03-4558-bbc7-65a033886a71",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1080,
        120
      ],
      "parameters": {
        "height": 400,
        "content": "**Organic Competitor**  \nLogs competitor information such as keywords, relevance, and organic traffic into the appropriate Google Sheets.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5be1e49a-cee1-4b24-950d-2e031f8d4ff4",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        560
      ],
      "parameters": {
        "height": 280,
        "content": "**Reformat 2**  \nReformats organic pages' data retrieved from **Semrush API** for detailed analysis.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3d0146eb-b7db-416c-955e-250c2ec8edb1",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        580
      ],
      "parameters": {
        "height": 260,
        "content": "**Organic Pages**  \nStores the re-formatted organic pages data, including traffic percentage and keyword counts, into Google Sheets.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f6548868-48ac-4d87-ac98-fa18edf20c5f",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        840
      ],
      "parameters": {
        "height": 280,
        "content": " **Reformat2**  \nPrepares organic keyword data for the next stage of processing.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1afa168f-b854-41a8-a150-6782ab94e259",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        860
      ],
      "parameters": {
        "height": 260,
        "content": "**organic keywords**  \nLogs the organic keywords data, including competition, CPC, and search volume, into the Google Sheets document.\n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Reformat": {
      "main": [
        [
          {
            "node": "Organic Competitor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reformat2": {
      "main": [
        [
          {
            "node": "organic keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reformat 2": {
      "main": [
        [
          {
            "node": "Organic Pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Re format output": {
      "main": [
        [
          {
            "node": "Domain overview",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Competitor Analysis ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Competitor Analysis ": {
      "main": [
        [
          {
            "node": "Re format output",
            "type": "main",
            "index": 0
          },
          {
            "node": "Reformat",
            "type": "main",
            "index": 0
          },
          {
            "node": "Reformat 2",
            "type": "main",
            "index": 0
          },
          {
            "node": "Reformat2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}