{
  "name": "Find influencers and their emails with hiCreator API → Google Sheets",
  "nodes": [
    {
      "parameters": {},
      "id": "9616794e-a394-487e-9cf2-df1a8cd752e9",
      "name": "Run workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "efa70b0a-1377-42a1-82e9-30b613e4d47c",
              "name": "platform",
              "value": "instagram",
              "type": "string"
            },
            {
              "id": "93208faf-2b21-4e70-ab89-27ccfbc73e15",
              "name": "query",
              "value": "Home cooking creators sharing simple, healthy recipes",
              "type": "string"
            },
            {
              "id": "bb52ab2f-fb7c-4a04-913b-bafea3b2e086",
              "name": "limit",
              "value": 20,
              "type": "number"
            },
            {
              "id": "7807ea6a-aaee-442b-9076-dfa1aed9034e",
              "name": "regions",
              "value": "=[\"US\"]",
              "type": "array"
            },
            {
              "id": "e6494b8c-a5a7-4713-9899-a1501e024bd4",
              "name": "minFollowers",
              "value": 10000,
              "type": "number"
            },
            {
              "id": "be12470c-c8b8-462c-a281-4fd3818fd765",
              "name": "maxFollowers",
              "value": 200000,
              "type": "number"
            }
          ]
        },
        "options": {}
      },
      "id": "c74cbf99-0478-4a33-a699-d2a4657a9028",
      "name": "Search settings",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [220, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://app.hicreator.ai/api/openapi/v1/creators/ai-search",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ platform: $json.platform, query: $json.query, limit: $json.limit, filters: { regions: $json.regions, minFollowers: $json.minFollowers, maxFollowers: $json.maxFollowers, workspaceDeduplicationEnabled: true } }) }}",
        "options": {}
      },
      "id": "874b7dbf-6bde-4c00-9cd4-9c398f4848b4",
      "name": "hiCreator: AI search",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [440, 300],
      "credentials": {
        "httpHeaderAuth": {
          "id": "",
          "name": "hiCreator API key"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "data.items",
        "options": {}
      },
      "id": "8d753849-1eb9-4ed3-bd6f-84f0b073e49f",
      "name": "One row per creator",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [660, 300]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "edf699ce-3634-4fcf-9651-0a0004d0508f",
              "leftValue": "={{ $json.email }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "id": "8bdc823b-e06d-4ee2-bd42-f26e5c3c82a5",
      "name": "Email already in results?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [880, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://app.hicreator.ai/api/openapi/v1/creators/email",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ profile_url: $json.profileUrl }) }}",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 5,
              "batchInterval": 1000
            }
          }
        }
      },
      "id": "92be46ad-b769-462a-828c-a5d3d02ec40b",
      "name": "hiCreator: find email",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [1100, 420],
      "credentials": {
        "httpHeaderAuth": {
          "id": "",
          "name": "hiCreator API key"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8d66976e-2d90-4b74-ae1b-9598adf0c97c",
              "name": "email",
              "value": "={{ $json.data?.email?.value ?? '' }}",
              "type": "string"
            },
            {
              "id": "2c05b6d9-c268-45e8-8361-1ef5eff8bfbe",
              "name": "email_status",
              "value": "={{ $json.data?.email?.status ?? 'lookup_failed' }}",
              "type": "string"
            },
            {
              "id": "7dec7fc1-3032-4267-a48b-609e1b75410d",
              "name": "lookup_error",
              "value": "={{ (() => { const e = $json.error; if (!e) return ''; const s = typeof e === 'string' ? e : (e.message || '') + ' ' + (e.description || '') + ' ' + JSON.stringify(e); const code = (s.match(/code[\\\\\"]*\\s*:\\s*[\\\\\"]*(\\d{5})/) || [])[1]; const rid = (s.match(/requestId[\\\\\"]*\\s*:\\s*[\\\\\"]*([0-9a-zA-Z-]{6,})/) || [])[1]; const http = (s.match(/^(\\d{3})\\b/) || [])[1]; return ['http ' + (http || '?'), 'code ' + (code || '?'), rid ? 'requestId ' + rid : '', s.slice(0, 200)].filter(Boolean).join(' | '); })() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "ff8e2935-3eb6-47c6-81c1-af7d6e012760",
      "name": "Keep looked-up email",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [1320, 420]
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "options": {}
      },
      "id": "5aa889b6-287b-4679-81db-df8cfc4996fd",
      "name": "Attach email to creator",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3,
      "position": [1540, 500]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "5e1d0993-36bb-44ef-88f9-872bdbc3b6f4",
              "name": "username",
              "value": "={{ String($json.username ?? '').replace(/^([=+\\-@])/, \"'$1\") }}",
              "type": "string"
            },
            {
              "id": "21db178e-17e4-4710-b596-701e2967cea9",
              "name": "platform",
              "value": "={{ $json.platform }}",
              "type": "string"
            },
            {
              "id": "00a049e2-b622-475d-8d7a-d7dfca6dbfe6",
              "name": "profile_url",
              "value": "={{ $json.profileUrl }}",
              "type": "string"
            },
            {
              "id": "fe94c796-396b-4952-b4fb-a5f7d31a2d41",
              "name": "followers",
              "value": "={{ $json.followerCount }}",
              "type": "number"
            },
            {
              "id": "dc575cbe-c985-4ed1-b2d8-cb5da9845bdf",
              "name": "median_engagement_rate",
              "value": "={{ $json.medianEngagementRate }}",
              "type": "number"
            },
            {
              "id": "922a4052-d60b-4547-9d7f-9fdebbff769f",
              "name": "region",
              "value": "={{ String($json.region ?? '').replace(/^([=+\\-@])/, \"'$1\") }}",
              "type": "string"
            },
            {
              "id": "da3e6e37-8351-41cd-ad3d-e0df00346cf0",
              "name": "email",
              "value": "={{ String($json.email ?? '').replace(/^([=+\\-@])/, \"'$1\") }}",
              "type": "string"
            },
            {
              "id": "ee2782cb-015b-4678-beed-d73cd716bb6d",
              "name": "email_status",
              "value": "={{ $json.email_status || 'in_search_results' }}",
              "type": "string"
            },
            {
              "id": "82dc987b-210c-4cf7-8f88-54cb6b5badb5",
              "name": "lookup_error",
              "value": "={{ String($json.lookup_error || '').replace(/^([=+\\-@])/, \"'$1\") }}",
              "type": "string"
            },
            {
              "id": "e1c5c673-1a99-4385-8612-86ac46fc5ed0",
              "name": "ai_summary",
              "value": "={{ String($json.aiDescription ?? '').replace(/^([=+\\-@])/, \"'$1\") }}",
              "type": "string"
            },
            {
              "id": "7f010e52-450e-470e-b462-02a85b92a064",
              "name": "search_query",
              "value": "={{ String($('Search settings').first().json.query ?? '').replace(/^([=+\\-@])/, \"'$1\") }}",
              "type": "string"
            },
            {
              "id": "2e65a709-bef7-4f67-8dba-1dd15eaa0b34",
              "name": "found_on",
              "value": "={{ $now.toISODate() }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "a3f9b3b0-b0c3-416a-818c-891e28518526",
      "name": "Sheet columns",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [1760, 300]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "",
          "mode": "list"
        },
        "sheetName": {
          "__rl": true,
          "value": "",
          "mode": "list"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [],
          "schema": []
        },
        "options": {}
      },
      "id": "9e16a11c-2448-484c-829c-dde652a2a29b",
      "name": "Append to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [1980, 300],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "content": "## Find creators and their emails with hiCreator\n\n### How it works\nThis workflow helps influencer marketing teams build an outreach list. It sends a plain-language search (for example \"US skincare creators with 10K to 300K followers\") to the hiCreator AI search API, splits the results into one row per creator, and checks whether each creator already has an email in the search result. Creators without one go to the hiCreator email lookup. Every creator is appended to Google Sheets with an email_status: in_search_results, found, missing, or lookup_failed. Failed lookups keep the error message in lookup_error.\n\n### Setup\n1. Create an API key in your hiCreator Workspace settings (a paid Workspace is required).\n2. Add an **HTTP Header Auth** credential: Name `Authorization`, Value `Bearer YOUR_API_KEY`. Select it in both hiCreator nodes.\n3. Connect Google Sheets and pick a sheet with this header row: username, platform, profile_url, followers, median_engagement_rate, region, email, email_status, lookup_error, ai_summary, search_query, found_on. After picking the sheet, set Mapping Column Mode back to **Map Automatically** (n8n switches it to manual when you pick a sheet).\n4. Edit **Search settings**, then run the workflow.\n\n### Customization\nChange the query, platform and limit in **Search settings**. Search costs 0.5 credits per returned creator (2 on X). Each email lookup costs 0.5 credits, charged even when no email is found. The lookup node handles up to 5 creators per batch, one second apart; lower the batch size in the node's batching options if you hit rate limits.",
        "height": 760,
        "width": 480
      },
      "id": "76bd9442-b468-495b-8d4b-a2396ce275fc",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-560, 0]
    },
    {
      "parameters": {
        "content": "## 1. Search creators\nSet the query once. Each returned creator becomes one item.",
        "height": 300,
        "width": 800,
        "color": 7
      },
      "id": "869a807f-573d-471c-b13f-c3ff6b850c7a",
      "name": "Section: search",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-40, 160]
    },
    {
      "parameters": {
        "content": "## 2. Look up missing emails\nOnly creators without an email in the search result are looked up. Failed lookups continue with lookup_failed instead of stopping the run.",
        "height": 500,
        "width": 820,
        "color": 7
      },
      "id": "3824209e-c37e-4ee9-8f3e-2d7086225b76",
      "name": "Section: email lookup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [840, 160]
    },
    {
      "parameters": {
        "content": "## 3. Write to Google Sheets\nOne row per creator. Columns must match the header row in Setup.",
        "height": 300,
        "width": 420,
        "color": 7
      },
      "id": "045bd550-5c19-4246-8501-e90db60fd010",
      "name": "Section: sheet",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [1720, 160]
    }
  ],
  "connections": {
    "Run workflow": {
      "main": [
        [
          {
            "node": "Search settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search settings": {
      "main": [
        [
          {
            "node": "hiCreator: AI search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "hiCreator: AI search": {
      "main": [
        [
          {
            "node": "One row per creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "One row per creator": {
      "main": [
        [
          {
            "node": "Email already in results?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email already in results?": {
      "main": [
        [
          {
            "node": "Sheet columns",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "hiCreator: find email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Attach email to creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "hiCreator: find email": {
      "main": [
        [
          {
            "node": "Keep looked-up email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep looked-up email": {
      "main": [
        [
          {
            "node": "Attach email to creator",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Attach email to creator": {
      "main": [
        [
          {
            "node": "Sheet columns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sheet columns": {
      "main": [
        [
          {
            "node": "Append to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  }
}
