
Track Website Traffic & Backlinks with Ahref API and Google Sheets
Description
Categories
🤖 AI & Machine Learning
Nodes Used
n8n-nodes-base.ifn8n-nodes-base.setn8n-nodes-base.coden8n-nodes-base.coden8n-nodes-base.emailSendn8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNote
PriceFree
Views0
Last Updated11/28/2025
workflow.json
{
"meta": {
"instanceId": "60c025075753afcab9f803964b4caaca9402f435deb4efafbb8e3b93b54d8752",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "e35fb337-0724-4e36-9d0e-1d064df566f7",
"name": "On form submission",
"type": "n8n-nodes-base.formTrigger",
"position": [
0,
0
],
"webhookId": "6f2e148a-8220-4a88-8508-c3f6d6ea0192",
"parameters": {
"options": {},
"formTitle": "Website Traffic Checker",
"formFields": {
"values": [
{
"fieldLabel": "Domain",
"requiredField": true
}
]
}
},
"typeVersion": 2.2
},
{
"id": "20601b36-f688-4241-901f-92a606ff3a56",
"name": "Set Domain Value",
"type": "n8n-nodes-base.set",
"position": [
208,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "2119e477-af9d-4cb1-8729-2e62c8ffd23e",
"name": "Domain",
"type": "string",
"value": "={{ $json.Domain }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "d6b3586a-136f-436d-a0b4-d2a3eaeb7715",
"name": "Check Website Traffic API",
"type": "n8n-nodes-base.httpRequest",
"position": [
464,
0
],
"parameters": {
"url": "https://website-traffic-checker-ahref.p.rapidapi.com/check-traffic.php",
"method": "POST",
"options": {
"response": {
"response": {
"fullResponse": true
}
}
},
"sendBody": true,
"contentType": "multipart-form-data",
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "domain",
"value": "={{ $json.Domain }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "x-rapidapi-host",
"value": "website-traffic-checker-ahref.p.rapidapi.com"
},
{
"name": "x-rapidapi-key",
"value": "your key"
}
]
}
},
"typeVersion": 4.2,
"alwaysOutputData": true
},
{
"id": "59a6d92f-39b2-48b9-83db-96300ebe5cfc",
"name": "Check if API Call Succeeded",
"type": "n8n-nodes-base.if",
"position": [
784,
0
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d8ec3848-a4b9-47f1-bbf7-4097c45aa97e",
"operator": {
"type": "number",
"operation": "equals"
},
"leftValue": "={{ $json.statusCode }}",
"rightValue": 200
}
]
}
},
"typeVersion": 2.2
},
{
"id": "035c2cd8-5681-455a-9cb3-57e9b4328805",
"name": "Send Failure Email Alert",
"type": "n8n-nodes-base.emailSend",
"position": [
1088,
464
],
"webhookId": "fc7f3b45-0a59-4f07-ba2e-a150c69a8801",
"parameters": {
"html": "=Dear Team,\n\nThis is to inform you that the system failed to retrieve data for: {{ $('Set Domain Value').item.json.Domain }}.\n\nStatus Code: {{ $json.statusCode }}\n\nKindly take note of this issue and do the needful at the earliest.\n\nRegards, \nn8n Automation\n",
"options": {},
"subject": "=Failed to Retrieve Data for - {{ $('Set Domain Value').item.json.Domain }}",
"toEmail": "[email protected]",
"fromEmail": "[email protected]"
},
"credentials": {
"smtp": {
"id": "nPwKPPgVavimTJX4",
"name": "SMTP account"
}
},
"typeVersion": 2.1
},
{
"id": "55b516b2-065e-4f2b-bf45-f6d776d16392",
"name": "Extract Backlink Info",
"type": "n8n-nodes-base.code",
"position": [
1072,
-128
],
"parameters": {
"jsCode": "return $input.first().json.body.backlinks_info;"
},
"typeVersion": 2
},
{
"id": "abfddbea-a012-41e2-b52a-0a88771ea9c7",
"name": "Log Backlinks to Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
1440,
-128
],
"parameters": {
"columns": {
"value": {
"ascore": "={{ $json.data.ascore }}",
"website": "={{ $('Set Domain Value').item.json.Domain }}",
"total backlinks": "={{ $json.data.total }}",
"referring domain": "={{ $json.data.domains }}"
},
"schema": [
{
"id": "website",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "website",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ascore",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ascore",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "referring domain",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "referring domain",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "total backlinks",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "total backlinks",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "",
"cachedResultName": "Backlink Info"
},
"documentId": {
"__rl": true,
"mode": "url",
"value": ""
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "Rt0RWApx8PL9t0RF",
"name": "Google Docs account"
}
},
"typeVersion": 4.7
},
{
"id": "23991e01-055f-45ae-ae78-b3d1ea59b6f3",
"name": "Extract Traffic Info",
"type": "n8n-nodes-base.code",
"position": [
1344,
224
],
"parameters": {
"jsCode": "return $input.first().json.body.traffic_analysis;"
},
"typeVersion": 2
},
{
"id": "35bd8043-541c-43e9-a8ee-68b1e9ae7194",
"name": "Log Traffic to Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
1776,
368
],
"parameters": {
"columns": {
"value": {},
"schema": [
{
"id": "accuracy",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "accuracy",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "bounce_rate",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "bounce_rate",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "desktop_share",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "desktop_share",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "direct",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "direct",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "display_ad",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "display_ad",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "display_date",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "display_date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "mail",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "mail",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "mobile_share",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "mobile_share",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "pages_per_visit",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "pages_per_visit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "paid",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "paid",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_bounce_rate",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_bounce_rate",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_direct",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_direct",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_display_ad",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_display_ad",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_mail",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_mail",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_pages_per_visit",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_pages_per_visit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_referral",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_referral",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_search_organic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_search_organic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_search_paid",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_search_paid",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_social_organic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_social_organic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_social_paid",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_social_paid",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_time_on_site",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_time_on_site",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_users",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_users",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "prev_visits",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "prev_visits",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "rank",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "rank",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "referral",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "referral",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "search",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "search",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "search_organic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "search_organic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "search_paid",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "search_paid",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "social",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "social",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "social_organic",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "social_organic",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "social_paid",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "social_paid",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "target",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "target",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "time_on_site",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "time_on_site",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "unknown_channel",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "unknown_channel",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "users",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "users",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "visits",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "visits",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1530109257,
"cachedResultUrl": "",
"cachedResultName": "Traffic Data"
},
"documentId": {
"__rl": true,
"mode": "url",
"value": ""
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "Rt0RWApx8PL9t0RF",
"name": "Google Docs account"
}
},
"typeVersion": 4.7
},
{
"id": "6678ef4e-aedc-4a23-8444-f9ccc4272cfb",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
-160
],
"parameters": {
"height": 304,
"content": "Triggers the workflow when a user submits a form with a domain name.\nCaptures the input field Domain as required."
},
"typeVersion": 1
},
{
"id": "cd942b09-5757-4789-b5d0-289ad83628a6",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
160,
-160
],
"parameters": {
"height": 304,
"content": "Stores the submitted domain value into a variable Domain for reuse.\nEnsures consistent referencing throughout the workflow."
},
"typeVersion": 1
},
{
"id": "13ada3da-5313-4bdf-8625-2eabb8e09b44",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
416,
-160
],
"parameters": {
"height": 304,
"content": "Sends a POST request to the RapidAPI endpoint with the submitted domain.\nIncludes required headers and multipart form data for API compatibility."
},
"typeVersion": 1
},
{
"id": "b5a992d1-d024-40ce-a2a8-075e4b1ca3c9",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
672,
-160
],
"parameters": {
"height": 304,
"content": "Checks if the API response returned HTTP status code 200.\nBranches based on whether the call was successful or failed."
},
"typeVersion": 1
},
{
"id": "217c0e5a-b6be-4727-ab2d-473701b617be",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1008,
304
],
"parameters": {
"height": 320,
"content": "Sends an email alert if the API call fails.\nIncludes the failed domain and HTTP status code in the message."
},
"typeVersion": 1
},
{
"id": "61d200d6-be52-45b7-8bb6-dea56b990f71",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
992,
-272
],
"parameters": {
"height": 288,
"content": "Extracts the backlinks_info object from the API response body.\nThis data will be logged to the backlinks sheet."
},
"typeVersion": 1
},
{
"id": "5c01e269-2126-433e-83de-8c724cef80ee",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1376,
-288
],
"parameters": {
"height": 304,
"content": "Appends backlink-related data to the \"Backlink Info\" sheet.\nLogs values like ascore, referring domains, and total backlinks."
},
"typeVersion": 1
},
{
"id": "ef3260d7-50df-489f-80ed-680a4b7e79af",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
1296,
96
],
"parameters": {
"height": 256,
"content": "Extracts traffic_analysis data from the API response body.\nPrepares traffic metrics for logging."
},
"typeVersion": 1
},
{
"id": "674fdc56-0348-4fc4-8183-75d3baf238ef",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
1680,
272
],
"parameters": {
"height": 256,
"content": "Appends website traffic data to the \"Traffic Data\" sheet.\nAutomatically maps fields from the API response to sheet columns."
},
"typeVersion": 1
},
{
"id": "6d342474-b007-495c-801d-b59d28bb227b",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-880,
-320
],
"parameters": {
"width": 592,
"height": 784,
"content": "\n### 📈 **Automated Website Traffic & Backlink Tracker in Google Sheets**\n\n**Description:**\nThis n8n workflow automates the process of checking a website's traffic and backlink data using the RapidAPI \"Website Traffic Checker\" and logs the results into Google Sheets for ongoing monitoring and analysis.\n\n### 🔁 **Workflow Summary:**\n\n1. **User Input:**\n A user submits a domain name via a web form (`Form Trigger`).\n\n2. **API Call:**\n The domain is sent to the RapidAPI endpoint using a `POST` request.\n\n3. **Response Handling:**\n\n * ✅ If the response is successful (`Status Code: 200`):\n\n * Backlink data is extracted and saved to the **Backlink Info** sheet.\n * Traffic metrics are extracted and logged in the **Traffic Data** sheet.\n * ❌ If the API call fails:\n\n * An email alert is triggered, notifying the admin of the failed domain and status code.\n\n---\n\n### ✅ **Use Case:**\n\nPerfect for SEO professionals, digital marketers, or agencies who want an automated solution to track and log backlink and traffic data for multiple websites into Google Sheets.\n"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Set Domain Value": {
"main": [
[
{
"node": "Check Website Traffic API",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "Set Domain Value",
"type": "main",
"index": 0
}
]
]
},
"Extract Traffic Info": {
"main": [
[
{
"node": "Log Traffic to Sheet",
"type": "main",
"index": 0
}
]
]
},
"Extract Backlink Info": {
"main": [
[
{
"node": "Log Backlinks to Sheet",
"type": "main",
"index": 0
}
]
]
},
"Send Failure Email Alert": {
"main": [
[]
]
},
"Check Website Traffic API": {
"main": [
[
{
"node": "Check if API Call Succeeded",
"type": "main",
"index": 0
}
]
]
},
"Check if API Call Succeeded": {
"main": [
[
{
"node": "Extract Backlink Info",
"type": "main",
"index": 0
},
{
"node": "Extract Traffic Info",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Failure Email Alert",
"type": "main",
"index": 0
}
]
]
}
}
}