Automate LinkedIn Profile Scraping with Apify and Google Sheets API

Efficiently scrape LinkedIn profiles using Apify and store data in Google Sheets for easy access and analysis. This automation solves the tedious task of manual data collection, allowing you to focus on actionable insights instead of data entry. With real-time data retrieval and seamless integration, you can gather comprehensive profiles without lifting a finger. Perfect for data analysts and recruiters who need to compile candidate information quickly. Requires 1 account: Google Sheets OAuth. Save up to 10 hours a week by automating data collection, enabling you to analyze 200+ profiles effortlessly.

Form Trigger
98 views11 nodesAug 2025Noah Campbell

APIs

ApifyGoogle Sheets API

Credentials

1 required

Quick Actions

Copy or download to import into your n8n instance

Workflow JSON
{
  "id": "4RA2eEP6J0LPqynD",
  "meta": {
    "instanceId": "a18da9fe05787064d0871c067b6baf1f5102992b14efc7335bca39a83ba97eb2"
  },
  "name": "Scrape LinkedIn Profiles Via Apify",
  "tags": [],
  "nodes": [
    {
      "id": "59c35b2d-9625-4255-ba16-2c04c02277fc",
      "name": "User Search Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1248,
        352
      ],
      "webhookId": "90183131-2984-4bb3-8100-b042c0d35aab",
      "parameters": {
        "options": {},
        "formTitle": "LinkedIn Profile Scraper",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Who are you looking for?",
              "requiredField": true
            },
            {
              "fieldLabel": "Location",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Get all the linkedIn Profile in minutes"
      },
      "typeVersion": 2.2
    },
    {
      "id": "1ca952c4-216e-4f18-9c07-6a42d5d6e160",
      "name": "Fetch Data from Apify API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -992,
        352
      ],
      "parameters": {
        "url": "=https://api.apify.com/v2/acts/apify~google-search-scraper/runs\n",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"focusOnPaidAds\": false,\n    \"forceExactMatch\": false,\n    \"includeIcons\": false,\n    \"includeUnfilteredResults\": false,\n    \"maxPagesPerQuery\": 1,\n    \"mobileResults\": false,\n    \"queries\": \"site:linkedIn.com + {{ $json['Who are you looking for?'] }} {{ $json.Location }}\",\n    \"resultsPerPage\": 100,\n    \"saveHtml\": false,\n    \"saveHtmlToKeyValueStore\": true\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "wuo9C8tD1CmNbIPD",
          "name": "Retell AI"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "71dc0457-d522-4034-84cd-48c6bd4a5bf3",
      "name": " Save Results to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -240,
        352
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $json.Name }}",
            "Followers": "={{ $json.Followers }}",
            "Description": "={{ $json.Description }}",
            "LinkedIn URL": "={{ $json.LinkedInURL }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "LinkedIn URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "LinkedIn URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Followers",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Followers",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "=YOUR_SPREADSHEET_ID\n"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1mVqTUcIcAxVt08PozPuLe5VrLx58CxBS2xfzYt-1InM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1mVqTUcIcAxVt08PozPuLe5VrLx58CxBS2xfzYt-1InM/edit?usp=drivesdk",
          "cachedResultName": " Scrapper Agent"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "c3aa300b-873e-4c98-a833-3930f318fbc9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        144
      ],
      "parameters": {
        "color": 4,
        "height": 384,
        "content": "## User Search Form\nThis node displays a form for entering the person or company name to search.\nYou don't need to change anything here unless you want to change the question or field label.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "4427efd9-9172-43c4-b7c9-1cc30c755ec9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        144
      ],
      "parameters": {
        "color": 3,
        "height": 384,
        "content": "Selects and renames fields from the API result to prepare for Google Sheets.\nUpdate the field names here if you want different data columns."
      },
      "typeVersion": 1
    },
    {
      "id": "e9e38cb2-b9f1-4f41-9e76-4aabdaa373b4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        144
      ],
      "parameters": {
        "height": 384,
        "content": "Custom code that reformats the response into rows.\nEdit only if you need to change the structure of the saved data.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b1c16cd2-faf1-49be-9340-dfd80d6a3bb3",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        144
      ],
      "parameters": {
        "color": 5,
        "height": 384,
        "content": "Appends or updates a row in your Google Sheet.\nReplace the placeholder Sheet ID with your own.\nMatch the column names to your sheet for correct data placement."
      },
      "typeVersion": 1
    },
    {
      "id": "66eedd0a-2a6a-4b61-94c0-24e68648d067",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 448,
        "height": 864,
        "content": "## Who's it for\nAnyone who needs to search for people or companies via the Apify API and automatically log the results into Google Sheets.\n\n## How it works\n1. User submits a name or keyword via an n8n form.\n2. Apify API fetches matching results.\n3. Data is cleaned and formatted.\n4. Results are saved into Google Sheets (new row or updated row).\n\n## Requirements\n- Apify API key (store in n8n Credentials or as {{$env.APIFY_API_KEY}})\n- Google Sheets account and target sheet\n\n## How to set up\n1. Open this workflow in n8n.\n2. Add your Apify API key in n8n credentials.\n3. Replace the placeholder Google Sheet ID with your own.\n4. Adjust column names in the Google Sheets node to match your sheet.\n5. Activate the workflow.\n\n## How to customize\n- Change the API endpoint in the HTTP Request node to use a different Apify actor.\n- Adjust fields in the \"Edit Fields\" node to format data differently.\n- Change the Google Sheets action to append only or overwrite.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e60eb90e-cf43-4492-8ed0-038584f53e66",
      "name": "Transform Data for Google Sheets",
      "type": "n8n-nodes-base.code",
      "position": [
        -512,
        352
      ],
      "parameters": {
        "jsCode": "/**\n * N8N Function node\n * Input: Google SERP JSON (like the sample you pasted) in items[].json\n * Output: One item per Linkedin profile with neat, type-safe fields\n */\n\nfunction parseFollowers(str = '') {\n    // Grab the numeric part + optional K / M suffix\n    const m = str.match(/([\\d.,]+)\\s*([kKmM]?)/);\n    if (!m) return null;\n\n    let num = parseFloat(m[1].replace(/,/g, ''));  // “22.7” → 22.7   /  “1,234” → 1234\n    if (isNaN(num)) return null;\n\n    const suffix = m[2]?.toLowerCase() || '';\n    if (suffix === 'k') num *= 1_000;\n    if (suffix === 'm') num *= 1_000_000;\n\n    return Math.round(num);\n}\n\nconst output = [];\n\nfor (const item of items) {\n    const results = item.json.organicResults || [];\n\n    for (const r of results) {\n        // Extract @username from the URL\n        let username = '';\n        if (r.url) {\n            const uMatch = r.url.match(/instagram\\.com\\/([^/?#]+)/i);\n            if (uMatch) username = uMatch[1];\n        }\n\n        output.push({\n            json: {\n                Name: r.title || '',\n                Username: username,\n                LinkedInURL: r.url || '',\n                Description: r.description || '',\n                Followers: parseFollowers(r.followersAmount),\n                RawFollowersText: r.followersAmount || '',\n                SearchTerm: item.json.searchQuery?.term || '',\n                SourcePageURL: item.json.url || ''\n            }\n        });\n    }\n}\n\nreturn output;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "f0c9f23a-becb-4dfd-85d1-7fe853b94e64",
      "name": "Format API Response",
      "type": "n8n-nodes-base.set",
      "position": [
        -752,
        352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "50221984-71ae-4133-bbd4-e5f3aa901d98",
              "name": "organicResults",
              "type": "array",
              "value": "={{ $json.organicResults }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c9b581a5-0c61-4938-b908-7f82d3bda182",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        144
      ],
      "parameters": {
        "color": 6,
        "height": 384,
        "content": "Makes a POST request to the Apify API to search for the input.\nReplace the placeholder API key with your stored Apify credentials or {{$env.APIFY_API_KEY}}.\nYou can change the endpoint or parameters to use a different Apify actor."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "acfea3d1-f367-4a1d-9cf1-57987969d3e8",
  "connections": {
    "User Search Form": {
      "main": [
        [
          {
            "node": "Fetch Data from Apify API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format API Response": {
      "main": [
        [
          {
            "node": "Transform Data for Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Data from Apify API": {
      "main": [
        [
          {
            "node": "Format API Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transform Data for Google Sheets": {
      "main": [
        [
          {
            "node": " Save Results to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Related Workflows

Automate Customer Queries with OpenAI GPT & Serp API Integration

Automate customer queries with an AI assistant powered by OpenAI GPT and Serp API. Use the chat Trigger and memory Buffer Window to provide instant and accurate responses to customer inquiries 24/7. Features include conversation memory for seamless interactions, real-time data processing for updated answers, and automatic filtering to prioritize urgent messages. Perfect for e-commerce businesses handling over 100 daily product inquiries, SaaS support teams, or any customer-facing role that requires fast, reliable answers. Requires 2 accounts: OpenAI API and Serp API. Save up to 5 hours daily by managing unlimited customer conversations with contextual, product-specific answers from your resources.

966,017 views
Personal ProductivityAI Chatbot

Automate WhatsApp Customer Inquiries with OpenAI and Vector Storage

Automate customer inquiries on WhatsApp using an AI assistant powered by OpenAI GPT. By integrating WhatsApp Business API, this workflow enables your AI to respond to customer questions 24/7, enhancing user experience and engagement. Features conversation memory for seamless interactions, vector storage for precise answers, and automatic message processing for real-time responses. Perfect for e-commerce stores with over 50 daily inquiries, SaaS customer success teams, or sales departments requiring instant product information. Requires 3 accounts: WhatsApp Trigger API, OpenAI API, and WhatsApp Business API. Handle unlimited inquiries efficiently, saving up to 5 hours daily with contextual, accurate responses from your product documentation.

378,452 views
Lead NurturingAI Chatbot

Automate Customer Inquiries with OpenAI Chat and HTTP Request

Automate customer inquiries using an AI assistant powered by OpenAI GPT and HTTP Request integration. This workflow enables real-time responses to customer questions, ensuring support is available 24/7. Features include conversation memory for engaging chats, automatic message processing for instant replies, and HTML for rich content rendering. Perfect for e-commerce businesses managing over 100 daily inquiries or SaaS platforms requiring real-time user support. Requires 1 account: OpenAI API. Save 5 hours weekly by handling unlimited customer inquiries with precise, context-aware answers from your product documentation.

330,215 views
Market ResearchAI Summarization

Automate Social Media Content Creation with Google Gemini & OpenAI

Streamline your social media content strategy with an automated workflow using Google Gemini and OpenAI GPT. This solution allows social media managers to generate, schedule, and publish posts across Facebook, Instagram, and LinkedIn seamlessly, saving hours of manual work each week. Features real-time content generation, intelligent scheduling, and integration with Facebook Graph API and Twitter API for effective outreach. Perfect for social media managers handling multiple accounts and needing consistent, engaging content for their audience. Requires 9 accounts: Google Palm API, OpenAI API, Facebook Graph API, and more. Experience up to 70% faster content creation and manage over 30 posts daily with AI-driven insights.

271,744 views
Social MediaMultimodal AI

How to Use This Workflow

1Import to n8n

  1. Copy the JSON using the button above
  2. Open your n8n instance
  3. Click “Import workflow” or press Ctrl+V
  4. Paste the JSON and click “Import”

2Before Running

Configure credentials and update service-specific settings before executing the workflow. Review required credentials in the Technical Details section above.

98