DataForSEO to Google Sheets, keyword history built
Keyword research gets messy fast. You run a report, paste results into a sheet, tweak columns, lose the date, then do it again next week and nothing lines up.
Content marketers feel it when planning goes slow. SEO specialists feel it when tracking becomes guesswork. And agency leads feel it when every client needs “one more export.” This DataForSEO Sheets automation turns that chaos into a clean, dated history you can actually use.
You’ll set up an n8n workflow that pulls keyword, SERP, and People Also Ask insights from DataForSEO and appends them into the right Google Sheet, every run. No column drift. No missing context.
How This Automation Works
Here’s the complete workflow you’ll be setting up:
n8n Workflow Template: DataForSEO to Google Sheets, keyword history built
flowchart LR
subgraph sg0["On form submission Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>On form submission"]
n1["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>related keyword"]
n2@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Switch", pos: "b", h: 48 }
n3@{ icon: "mdi:swap-vertical", form: "rounded", label: "Edit Fields", pos: "b", h: 48 }
n4@{ icon: "mdi:swap-vertical", form: "rounded", label: "Edit Fields1", pos: "b", h: 48 }
n5@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out", pos: "b", h: 48 }
n6@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out1", pos: "b", h: 48 }
n7@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out2", pos: "b", h: 48 }
n8@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out3", pos: "b", h: 48 }
n9@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out4", pos: "b", h: 48 }
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>keyword suggestion"]
n11@{ icon: "mdi:database", form: "rounded", label: "keyword suggestion sheet", pos: "b", h: 48 }
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>get autocomplete"]
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>get subtopics"]
n14["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>people also ask"]
n15@{ icon: "mdi:database", form: "rounded", label: "get autocomplete sheet", pos: "b", h: 48 }
n16@{ icon: "mdi:database", form: "rounded", label: "get subtopics sheet", pos: "b", h: 48 }
n17@{ icon: "mdi:database", form: "rounded", label: "people also ask sheet", pos: "b", h: 48 }
n18@{ icon: "mdi:swap-vertical", form: "rounded", label: "Edit Fields4", pos: "b", h: 48 }
n19@{ icon: "mdi:swap-vertical", form: "rounded", label: "Edit Fields6", pos: "b", h: 48 }
n20@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out6", pos: "b", h: 48 }
n21@{ icon: "mdi:swap-vertical", form: "rounded", label: "Edit Fields5", pos: "b", h: 48 }
n22@{ icon: "mdi:swap-vertical", form: "rounded", label: "Edit Fields2", pos: "b", h: 48 }
n23@{ icon: "mdi:database", form: "rounded", label: "Add operation to main sheet ..", pos: "b", h: 48 }
n24@{ icon: "mdi:database", form: "rounded", label: "related keyword sheet", pos: "b", h: 48 }
n25@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Filter people also ask", pos: "b", h: 48 }
n26@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check If fields not empty", pos: "b", h: 48 }
n27@{ icon: "mdi:database", form: "rounded", label: "Add to Sheet", pos: "b", h: 48 }
n28@{ icon: "mdi:database", form: "rounded", label: "Add to Sheet1", pos: "b", h: 48 }
n29@{ icon: "mdi:database", form: "rounded", label: "Add to Sheet2", pos: "b", h: 48 }
n30@{ icon: "mdi:database", form: "rounded", label: "Add to Sheet3", pos: "b", h: 48 }
n31@{ icon: "mdi:database", form: "rounded", label: "Add to Sheet4", pos: "b", h: 48 }
n2 --> n24
n2 --> n11
n2 --> n15
n2 --> n16
n2 --> n17
n5 --> n4
n6 --> n22
n7 --> n18
n8 --> n19
n9 --> n25
n20 --> n21
n3 --> n23
n4 --> n27
n22 --> n28
n18 --> n29
n21 --> n31
n19 --> n30
n13 --> n8
n14 --> n9
n1 --> n5
n12 --> n7
n0 --> n26
n10 --> n6
n16 --> n13
n17 --> n14
n24 --> n1
n25 --> n20
n15 --> n12
n11 --> n10
n26 --> n3
n23 --> n2
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n2,n25,n26 decision
class n11,n15,n16,n17,n23,n24,n27,n28,n29,n30,n31 database
class n1,n10,n12,n13,n14 api
classDef customIcon fill:none,stroke:none
class n0,n1,n10,n12,n13,n14 customIcon
Why This Matters: Keyword Research Without the Spreadsheet Spiral
SEO research isn’t hard because the data is unavailable. It’s hard because the workflow around the data is fragile. One teammate exports SERPs into a CSV, another pastes “People Also Ask” into a separate tab, and someone else renames columns to match their personal template. A week later you try to compare trends and realize the sheet is a patchwork. Worse, the date is missing, so you can’t tell if a ranking shift happened last Tuesday or three months ago. That’s how good content opportunities slip through the cracks.
The friction compounds. These are the spots where it usually breaks down.
- Exports don’t match your sheet structure, so every run starts with cleanup.
- SERP and PAA insights live in different places, which means planning happens without the full picture.
- When dates aren’t consistently logged, “trend tracking” becomes a hunch, not a process.
- Manual copy-paste invites small errors that quietly ruin comparisons and reporting.
What You’ll Build: DataForSEO Insights Logged to Sheets Automatically
This workflow gives you one repeatable pipeline for SEO research. It starts with a simple form submission inside n8n (or a scheduled run) where you choose what type of research you want, like related keywords, keyword suggestions, autocomplete ideas, subtopics, or People Also Ask questions. n8n then sends the right HTTP requests to DataForSEO, pulls back the raw JSON response, and normalizes it into clean rows. If the Google Sheet (or the specific tab for that operator) doesn’t exist yet, the workflow creates it for you. Finally, it appends the results with consistent columns and a date, so each run becomes part of a growing keyword history instead of a one-off export.
The workflow kicks off from the form trigger, validates your inputs, then routes the request through a switch that selects the right DataForSEO endpoint. After the data is expanded into individual items, n8n maps fields into a standard shape and appends rows into the matching Google Sheet tab.
What You’re Building
| What Gets Automated | What You’ll Achieve |
|---|---|
|
|
Expected Results
Say you research 20 keywords each week and you usually pull five datasets per keyword (related, suggestions, autocomplete, subtopics, and PAA). If you spend roughly 3 minutes exporting, formatting, and pasting each dataset, that’s about 300 minutes, or 5 hours a week. With this workflow, you submit the request once and let n8n append everything to the right Google Sheet tab; your “time spent” becomes closer to 10 minutes of setup and review. That’s a real afternoon back, every week.
Before You Start
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- DataForSEO account for keyword and SERP data access.
- Google Sheets to store and track keyword history.
- DataForSEO API credentials (get them from your DataForSEO dashboard).
Skill level: Beginner. You’ll connect accounts, paste credentials, and edit a few fields like location and language.
Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).
Step by Step
A form submission triggers the run. You enter the keyword (or keyword set) and pick the operation type, like Related Keywords, Suggestions, Autocomplete, Subtopics, or PAA.
Your inputs are validated and mapped. An If node checks required fields so you don’t waste API calls on blank keywords. Then a Set node standardizes what the rest of the workflow expects, which keeps the downstream mapping stable.
n8n routes to the correct DataForSEO endpoint. A switch chooses the right branch, then HTTP Request nodes fetch the dataset you selected. Split-out and batching steps expand the API response into row-shaped items so it’s easy to store.
Google Sheets tabs are created and filled. For each operator, the workflow creates the related sheet if needed, maps fields into consistent columns, then appends rows with a date so your history grows over time.
You can easily modify the operator options to add SERP analysis or competitor research based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Form Trigger
Set up the form that collects the keyword, location, language, and operation type from users.
- Add the Form Submission Trigger node as the workflow trigger.
- Set Form Title to
SEO Related Keyword Finder🚀and Form Description to✏️ Enter your target keyword\n📍 Choose the location\n🌐 Select the language. - Configure fields for keyword, location_name (dropdown), language_name (dropdown), and Operation (dropdown).
- Optional: Keep the options.customCss styling if you want the neon theme applied to the form.
Step 2: Validate and Map Incoming Data
Validate required inputs and normalize field names for downstream nodes.
- In Validate Input Fields, keep the four notEmpty checks for
{{$json.keyword}},{{$json.location_name}},{{$json.language_name}}, and{{$json.Operation}}. - In Map Request Fields, create assignments to map operation to
{{$json.Operation}}, keyword to{{$json.keyword}}, location_name to{{$json.location_name}}, and language_name to{{$json.language_name}}.
Step 3: Connect Google Sheets and Log the Summary
Write the incoming request to a summary sheet, then route the workflow based on the chosen operation.
- Open Append Summary Row and set Operation to
appendwith Authentication set toserviceAccount. - Map columns: Time to
{{$('Form Submission Trigger').item.json.submittedAt}}, keyword to{{$json.keyword}}, operation to{{$json.operation}}, language_name to{{$json.language_name}}, and location_name to{{$json.location_name}}. - Credential Required: Connect your googleApi credentials in Append Summary Row.
- In Route Operation Type, keep the rules that match
related keywords🔑,keyword suggestion💡,get autocomplete🧩,get subtopics📚, andpeople also ask🔍on{{$json.operation}}.
[YOUR_ID]) and creates new tabs per operation using {{$json.keyword}} [{{$json.operation}}] as the title.Step 4: Configure Related Keywords Path
This path creates a sheet tab and fetches related keywords from DataForSEO, then appends rows.
- In Create Related Sheet, set Operation to
createand Title to={{ $json.keyword }} [{{ $json.operation }}]. - Credential Required: Connect your googleApi credentials in Create Related Sheet.
- In Related Keywords API, keep URL as
https://api.dataforseo.com/v3/dataforseo_labs/google/related_keywords/liveand the JSON Body with{{$('Route Operation Type').item.json.keyword}},{{$('Route Operation Type').item.json.location_name}}, and{{$('Route Operation Type').item.json.language_name}}. - Credential Required: Connect your httpBasicAuth credentials in Related Keywords API.
- In Expand Related Items, set Field To Split Out to
tasks[0].result[0].items. - In Map Related Fields, map fields like related keyword to
{{ $json.keyword_data.keyword }}and SERP Analysis to{{$json.keyword_data.serp_info.serp_item_types.join(",")}}. - In Append Related Rows, set Operation to
appendand Sheet Name to={{ $('Create Related Sheet').item.json.sheetId }}. - Credential Required: Connect your googleApi credentials in Append Related Rows.
Step 5: Configure Suggestions and Autocomplete Paths
Set up the keyword suggestion and autocomplete branches that create sheets, call APIs, split results, map fields, and append rows.
- For the suggestions branch, configure Create Suggestion Sheet with Title
={{ $json.keyword }} [{{ $json.operation }}]and set Operation tocreate. - Credential Required: Connect your googleApi credentials in Create Suggestion Sheet and Append Suggestion Rows.
- In Keyword Suggestion API, keep the URL
https://api.dataforseo.com/v3/dataforseo_labs/google/keyword_suggestions/liveand JSON body with the same{{$('Route Operation Type').item.json.*}}expressions. - Credential Required: Connect your httpBasicAuth credentials in Keyword Suggestion API.
- For autocomplete, configure Create Autocomplete Sheet and keep Title as
={{ $json.keyword }} [{{ $json.operation }}]. - In Autocomplete API, keep URL
https://api.dataforseo.com/v3/serp/google/autocomplete/live/advancedand JSON body withclientset togws-wiz-serp. - Credential Required: Connect your httpBasicAuth credentials in Autocomplete API and your googleApi credentials in Append Autocomplete Rows.
tasks[0].result[0].items for split-out, so confirm the API responses include that array.Step 6: Configure Subtopics and People Also Ask Paths
Set up the subtopics and PAA branches that generate topical ideas and questions.
- In Create Subtopics Sheet and Create PAA Sheet, keep Title set to
={{ $json.keyword }} [{{ $json.operation }}]and Operation set tocreate. - Credential Required: Connect your googleApi credentials for Create Subtopics Sheet, Append Subtopic Rows, Create PAA Sheet, and Append PAA Rows.
- In Subtopics API, keep URL
https://api.dataforseo.com/v3/content_generation/generate_sub_topics/liveand the JSON body with{{ $('Route Operation Type').item.json.keyword }}. - Credential Required: Connect your httpBasicAuth credentials in Subtopics API and People Also Ask API.
- In People Also Ask API, update URL from
https://api.dataforseo.[CONFIGURE_YOUR_API_KEY]to your real endpoint before testing. - Keep Filter PAA Type set to filter on
{{$json.type}}equalspeople_also_ask, then split with Expand PAA Details usingitems.
[CONFIGURE_YOUR_API_KEY] in the URL, the request will fail. Replace it with your actual DataForSEO endpoint.Step 7: Test and Activate Your Workflow
Run a manual test to verify each branch writes to its respective sheet and then activate the workflow.
- Click Execute Workflow and submit the Form Submission Trigger form with a keyword, location, language, and one operation.
- Confirm Append Summary Row adds a new row in the
summarysheet and that the appropriate operation path runs. - Verify that the operation-specific sheet is created (e.g., by Create Related Sheet) and that rows are appended (e.g., by Append Related Rows).
- If a branch returns no data, inspect the Related Keywords API, Keyword Suggestion API, Autocomplete API, Subtopics API, or People Also Ask API responses for schema changes.
- When results look correct, toggle the workflow to Active to enable production use.
Troubleshooting Tips
- Google Sheets credentials can expire or need specific permissions. If things break, check the Google connection in n8n’s Credentials list first, then confirm the account can create and edit the target spreadsheet.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- OpenAI prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Quick Answers
About 30 minutes if your DataForSEO and Google accounts are ready.
No. You’ll mostly connect credentials and adjust a few mapped fields. The workflow already handles the API requests and formatting.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in DataForSEO API usage costs based on how many keywords and endpoints you hit per run.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and it’s the main reason this template is useful. You can add a SERP branch by extending the “Route Operation Type” switch and duplicating the pattern you already have (Create Sheet → HTTP Request → Split Out → Map Fields → Append Rows). Common customizations include changing the location_code and language_code, logging extra columns like CPC or competition, and adding an AI Agent step to summarize “what changed since last run.” If you want competitor research, you can route to a different DataForSEO endpoint and write to its own tab so your sheets stay readable.
Usually it’s an OAuth permission issue or an expired token. Reconnect your Google Sheets credential in n8n, then confirm the account can create new spreadsheets and edit existing ones. If the sheet lives in a shared drive, make sure that same Google account has access there too.
A few hundred keywords per run is typical, and you can scale up with batching.
Often, yes. This workflow relies on routing, item expansion, and consistent field mapping, and n8n handles that kind of multi-branch logic without turning it into a pricing problem. You also get self-hosting, which matters when you’re running lots of keyword pulls. Zapier or Make can still be fine for a simple “one endpoint to one sheet” job, but they get clunky when you’re splitting items and writing to multiple tabs. If you’re not sure, Talk to an automation expert and we’ll sanity-check your use case.
Once this is running, your SEO research stops being a pile of exports and starts acting like a system. Set it up, keep the history, and plan content from one sheet you actually trust.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.