AutomationFlowsData & Sheets › Extract Google Ads Creatives by Domain with Serpapi and Export to CSV

Extract Google Ads Creatives by Domain with Serpapi and Export to CSV

ByNikan Noorafkan @nikkannoora on n8n.io

This n8n workflow pulls ad creatives from Google's Ads Transparency Center using SerpApi, filtered by a specific domain and region. It extracts, filters, categorizes, and exports ads into neatly formatted CSV files for easy analysis.

Event trigger★★★★☆ complexity16 nodesHTTP RequestSpreadsheet File
Data & Sheets Trigger: Event Nodes: 16 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #4616 — we link there as the canonical source.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "nodes": [
    {
      "id": "65aafe70-bcfb-4c28-96dd-17d9dd2f4203",
      "name": "Get Ads Page 1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -380,
        580
      ],
      "parameters": {
        "url": "https://serpapi.com/search.json",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParametersUi": {
          "parameter": [
            {
              "name": "engine",
              "value": "google_ads_transparency_center"
            },
            {
              "name": "text",
              "value": "={{$json[\"domain\"]}}"
            },
            {
              "name": "region",
              "value": "={{$json[\"region\"]}}"
            },
            {
              "name": "api_key",
              "value": "your_serpapi_key"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "6158066c-e944-42cf-9a40-5c2c309a8567",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1260,
        580
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "15dea6e9-0a6a-4ba1-ae36-7234f5f3ff13",
      "name": "Set Domain & Region",
      "type": "n8n-nodes-base.set",
      "position": [
        -820,
        580
      ],
      "parameters": {
        "values": {
          "string": [
            {
              "name": "domain",
              "value": "example.com"
            },
            {
              "name": "region",
              "value": "example_region_code"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "8b768e62-6697-491e-89d6-6fa40aa36619",
      "name": "Extract Ad Creatives",
      "type": "n8n-nodes-base.function",
      "position": [
        60,
        580
      ],
      "parameters": {
        "functionCode": "const targetDomain = items[0].json.search_parameters.text.toLowerCase();\n\nreturn items[0].json.ad_creatives\n  .filter(ad => (ad.target_domain || '').toLowerCase() === targetDomain)\n  .map(ad => ({ json: ad }));\n"
      },
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "50bcee68-570e-4b2f-bc14-3e5148f63ed6",
      "name": "Split by Format1",
      "type": "n8n-nodes-base.switch",
      "rules": {
        "rules": [
          {
            "value1": "text",
            "operation": "equal"
          },
          {
            "value1": "image",
            "operation": "equal"
          },
          {
            "value1": "video",
            "operation": "equal"
          }
        ]
      },
      "position": [
        500,
        560
      ],
      "parameters": {
        "rules": {
          "rules": [
            {
              "value2": "text"
            },
            {
              "output": 1,
              "value2": "image"
            },
            {
              "output": 2,
              "value2": "video"
            }
          ]
        },
        "value1": "={{$json[\"format\"]}}",
        "dataType": "string"
      },
      "typeVersion": 1
    },
    {
      "id": "5a385bb4-a7eb-4327-8719-311ba61fe82a",
      "name": "Convert Text Ads to CSV",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        900,
        220
      ],
      "parameters": {
        "options": {
          "fileName": "=/files/text_{{ $json.target_domain }}_ads.csv"
        },
        "operation": "toFile"
      },
      "typeVersion": 1
    },
    {
      "id": "2860d7c8-8c45-4d13-964d-40d6565e7a18",
      "name": "Convert Image Ads to CSV",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        900,
        680
      ],
      "parameters": {
        "options": {
          "fileName": "=/files/image_{{ $json.target_domain }}_ads.csv"
        },
        "operation": "toFile",
        "fileFormat": "csv"
      },
      "typeVersion": 1
    },
    {
      "id": "2240db0a-0cb3-4449-a187-6daa52bca0fd",
      "name": "Convert Video Ads to CSV1",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        900,
        1120
      ],
      "parameters": {
        "options": {
          "fileName": "=/files/video_{{ $json.target_domain }}_ads.csv"
        },
        "operation": "toFile",
        "fileFormat": "csv"
      },
      "typeVersion": 1
    },
    {
      "id": "bc86000d-ed7b-4690-a19e-3b9819024c8b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1380,
        120
      ],
      "parameters": {
        "color": 7,
        "width": 360,
        "height": 420,
        "content": "# Node Annotations\n\n\u2705 When clicking 'Test workflow'\nTrigger the workflow manually during testing or development.\n\n\ud83d\udccc Note:\nUsed for debugging or one-time executions. No configuration needed."
      },
      "typeVersion": 1
    },
    {
      "id": "431fdfd5-9550-4eca-8489-26fb126e828e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -940,
        120
      ],
      "parameters": {
        "width": 360,
        "height": 420,
        "content": "# \u270f\ufe0f Set Domain & Region\n\nDefine which domain and region you want to extract ads for.\n\n\ud83d\udccc Note:\n\nSet the domain (e.g., example.com)\n\nSet the region using the numeric SerpApi region code\n\n\ud83d\udd17 https://serpapi.com/google-ads-transparency-center-regions"
      },
      "typeVersion": 1
    },
    {
      "id": "245857fd-4405-4f75-95d1-41d7374b770a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        120
      ],
      "parameters": {
        "width": 360,
        "height": 420,
        "content": "# \ud83c\udf10 Get Ads Page 1\n\nCalls SerpApi to fetch Google Ads Transparency data based on the domain and region.\n\n\ud83d\udccc Note:\n\nUses the SerpApi google_ads_transparency_center engine\n\nRequires a SerpApi API Key\n\nMake sure the region code is supported\n\nYou can paginate using next_page_token in future improvements\n\n\ud83d\udd17 https://serpapi.com/google-ads-transparency-center-api"
      },
      "typeVersion": 1
    },
    {
      "id": "59c2eab0-ce67-463b-aaea-bf5c69fcb15e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        120
      ],
      "parameters": {
        "width": 360,
        "height": 420,
        "content": "# \ud83e\udde0 Extract Ad Creatives\n\nFilters only the ad creatives where target_domain exactly matches your input.\n\n\ud83d\udccc Note:\n\nThis avoids pulling unrelated advertiser ads\n\nMakes sure only relevant ads for your domain are processed further"
      },
      "typeVersion": 1
    },
    {
      "id": "e87811c5-2f2a-4bd4-828b-ec4333393839",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        120
      ],
      "parameters": {
        "width": 360,
        "height": 420,
        "content": "# \ud83d\udd00 Split by Format\n\nSorts the ads by their format into separate branches: text, image, or video.\n\n\ud83d\udccc Note:\n\nBased on format field of each ad\n\nEnsures clean CSV outputs for each type"
      },
      "typeVersion": 1
    },
    {
      "id": "f18950f7-9c67-4ffb-8c89-b2b70287db05",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1140,
        120
      ],
      "parameters": {
        "color": 4,
        "width": 500,
        "height": 300,
        "content": "# \ud83d\udcc4 Convert Text Ads to CSV\n\nSaves text ads in a CSV file named: text_{domain}_ads.csv\n\n\ud83d\udccc Note:\n\nUse this for text-only creatives\n\nFile will be saved in your /files/ directory"
      },
      "typeVersion": 1
    },
    {
      "id": "25d6d14b-e4c7-40e4-97be-b422871cc756",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1140,
        580
      ],
      "parameters": {
        "color": 4,
        "width": 500,
        "height": 300,
        "content": "# \ud83d\uddbc\ufe0f Convert Image Ads to CSV\nSaves image-based ads to: image_{domain}_ads.csv\n\n\ud83d\udccc Note:\n\nContains ad dimensions and image URLs\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7d05ce27-42ee-4799-807a-eeb204b05553",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1140,
        1040
      ],
      "parameters": {
        "color": 4,
        "width": 500,
        "height": 300,
        "content": "# \ud83c\udf9e\ufe0f Convert Video Ads to CSV\nExports video ads into: video_{domain}_ads.csv\n\n\ud83d\udccc Note:\n\nContains video links (HTML preview links or embedded content)"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Get Ads Page 1": {
      "main": [
        [
          {
            "node": "Extract Ad Creatives",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split by Format1": {
      "main": [
        [
          {
            "node": "Convert Text Ads to CSV",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Convert Image Ads to CSV",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Convert Video Ads to CSV1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Domain & Region": {
      "main": [
        [
          {
            "node": "Get Ads Page 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Ad Creatives": {
      "main": [
        [
          {
            "node": "Split by Format1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Set Domain & Region",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This n8n workflow pulls ad creatives from Google's Ads Transparency Center using SerpApi, filtered by a specific domain and region. It extracts, filters, categorizes, and exports ads into neatly formatted CSV files for easy analysis.

Source: https://n8n.io/workflows/4616/ — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

Working With Excel Spreadsheet Files Xls Xlsx. Uses stickyNote, readBinaryFile, manualTrigger, writeBinaryFile. Event-driven trigger; 24 nodes.

Read Binary File, Write Binary File, Google Drive +4
Data & Sheets

This workflow will help guide you through obtaining a spreadsheet file, reading it, making a change then saving it to local or cloud storage.

Read Binary File, Write Binary File, Google Drive +4
Data & Sheets

Download invoices from Poland's KSeF (Krajowy System e-Faktur) and export them as an XLSX spreadsheet. Handles the full v2 authentication flow automatically.

HTTP Request, Spreadsheet File
Data & Sheets

Monitor Azure subscription resources with cost and usage tracking

HTTP Request, Spreadsheet File
Data & Sheets

Upload Bulk Records From Csv Airtable Interfaces. Uses airtable, httpRequest, stickyNote, spreadsheetFile. Event-driven trigger; 17 nodes.

Airtable, HTTP Request, Spreadsheet File +1