Serper.dev authentication issues

Describe the problem/error/question

Unable to connect to Serper.dev with Custom Auth or Header Auth. Even created a new account, same issue. Any tips? Going a little crazy here. :rofl:

In Custom Auth I have JSON:
{
“X-API-KEY”: “the actual API key”
}

and in Header Auth I have the name of the Key: Default and the Value: the actual API key

What is the error message (if any)?

403 - "{\"message\":\"Unauthorized. Sign up for a free account.\",\"statusCode\":403}"

Please share your workflow

Share the output returned by the last node

{
“errorMessage”: “Forbidden - perhaps check your credentials?”,
“errorDescription”: “Unauthorized. Sign up for a free account.”,
“errorDetails”: {
“rawErrorMessage”: [
“403 - "{\"message\":\"Unauthorized. Sign up for a free account.\",\"statusCode\":403}"”
],
“httpCode”: “403”
},
“n8nDetails”: {
“nodeName”: “Get Mobile SERPs”,
“nodeType”: “n8n-nodes-base.httpRequest”,
“nodeVersion”: 4.2,
“itemIndex”: 0,
“time”: “7/26/2025, 8:26:46 AM”,
“n8nVersion”: “1.84.3 (Cloud)”,
“binaryDataMode”: “filesystem”,
“stackTrace”: [
“NodeApiError: Forbidden - perhaps check your credentials?”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:525:33)“,
" at processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:681:27)“,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:913:51”,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1246:20"
]
}
}

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @teknovision, it’s because you’re using GET method for that, and if you’re using GET method, the serper.dev needs you to pass the auth not in header, but in query.

If you want still to use Header, you must use POST method.
I give you two examples of the correct method and apiKey passing in this workflow:

Thank you very much that helped!!

The trick was to add Send Headers using JSON as per below:

{
“X-API-KEY”: “the actual API key”
}

You’re welcome!
By the way, you don’t need to send headers anymore if you’re using Post method.