Issues converting curl command into http request with JSON output

Hi I’m new here and migrating my workflows from make.com to N8N.

Describe the problem/error/question

Import CURL command is not working properly.

When I use the CURL import on N8N it didn’t import it correctly, so I tweaked it to get an output in return.

CURL command in the Bright Data API documentation:
curl -v --insecure --compressed --proxy brd.superproxy.io:22225 --proxy-user brd-customer-<ACCOUNT_ID>-zone-: “pizza - Google Suche

What is the error message (if any)?

http request returning (correct) html data, supposed to be already parsed in JSON.

By adding “&lum_json=1” at the end of the url, the output should return json load, which isn’t.
When I remove this part, the output is not changing.

When I make the request through a python script, it’s working as expected and returning the parsed html output.

Please share your workflow

I’m using N8N cloud, calling Bright Data Serp API which supposed to return JSON data in a basic workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

![Screenshot 2024-02-15 at 08.57.07|476x500]

{
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “a2435d996b378e3a6fdef0468d70285e3aa0fbd0004de817bfc80e80afee4e7b”
},
“nodes”: [
{
“parameters”: {
“url”: “pizza - Google Suche”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “Proxy-Authorization”,
“value”: “brd-customer-hl_<<<ID<>>-zone-serp:<<>>”
},
{
“name”: “Proxy”,
“value”: “http://brd.superproxy.io:XXXXX”
}
]
},
“options”: {
“allowUnauthorizedCerts”: true
}
},
“id”: “08c8d528-5926-4ca3-9e6c-a75e93335544”,
“name”: “HTTP Request”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.1,
“position”: [
1320,
640
],
“alwaysOutputData”: true
}
],
“connections”: {},
“pinData”: {}
}

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
    Version 1.27.2

  • Database (default: SQLite):
    None

  • n8n EXECUTIONS_PROCESS setting (default: own, main):

  • Running n8n via (Docker, npm, n8n cloud, desktop app):

Cloud

  • Operating system:

hello @Victor_DeCoster

Try to add Options >> Response >> Response Format > JSON

1 Like

Hi @barn4k

Thank you first of all for reading into my issue.

This approach returned me an error without a html output.

Well, I’ve checked with Curl and yes, the output is just HTTP. You can’t get results in JSON by fetching the google.com resource directly.

I suppose to get results in JSON you have to use the Google Search API

Ooh @barn4k , big thx!

Didn’t knew google was allowing this directly from one of their api’s.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.