HTTP Requests with RapidApi

Describe the issue/error/question

Hi,

I’m struggling setup some APIs that I choose on RapidApi into n8n. The apis work properly into my python script but I would like to use them into n8n to create some workflow automations.

I’m using this one : Awesome Indeed API Documentation (fayeznazzal98) | RapidAPI

What is the error message (if any)?



I got those two errors (looks like the api key is not the good one but into my python script I’m using the same one and it works (so I think I’m missing something into the setup part)

Please share the workflow

This is the way I setup the node : 

{
  "nodes": [
    {
      "parameters": {
        "url": "https://awesome-indeed.p.rapidapi.com/indeed_jobs_detailed",
        "options": {},
        "headerParametersUi": {
          "parameter": [
            {
              "name": "headers",
              "value": "{'x-rapidapi-host': \"awesome-indeed.p.rapidapi.com\",'x-rapidapi-key':\"MY-RAPIDAPI-KEY\"}"
            }
          ]
        },
        "queryParametersUi": {
          "parameter": [
            {
              "name": "params",
              "value": "{\"search_query\":\"growth hacker\",\"page\":\"1\",\"country_code\":\"fr\",\"sort_by\":\"date\"}"
            }
          ]
        }
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        640,
        300
      ]
    }
  ],
  "connections": {}
}
(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)

Share the output returned by the last node

Could someone can tell me what did I do wrong ? Thanks :grinning_face_with_smiling_eyes:

Information on your n8n setup

  • n8n version: n8n cloud
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:

Hey @jeremy_FRANCOIS,

The workflow below shows 2 different ways you can get it working, The first breaks down the request so rather than using JSON you put in each option and value.

The second approach uses the json you have provided which a slight character change to swap the ' for " and checks the JSON/RAW Parameters option.

image

Example Workflow
{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://awesome-indeed.p.rapidapi.com/indeed_jobs_detailed",
        "options": {},
        "headerParametersUi": {
          "parameter": [
            {
              "name": "x-rapidapi-host",
              "value": "awesome-indeed.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "MY-RAPIDAPI-KEY"
            }
          ]
        },
        "queryParametersUi": {
          "parameter": [
            {
              "name": "search_query",
              "value": "growth hacker"
            },
            {
              "name": "page",
              "value": "1"
            },
            {
              "name": "country_code",
              "value": "fr"
            },
            {
              "name": "sort_by",
              "value": "date"
            }
          ]
        }
      },
      "name": "Broken Down",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        460,
        200
      ]
    },
    {
      "parameters": {
        "url": "https://awesome-indeed.p.rapidapi.com/indeed_jobs_detailed",
        "jsonParameters": true,
        "options": {},
        "headerParametersJson": "{\"x-rapidapi-host\": \"awesome-indeed.p.rapidapi.com\",\"x-rapidapi-key\":\"MY-RAPIDAPI-KEY\"}",
        "queryParametersJson": "{\"search_query\":\"growth hacker\",\"page\":\"1\",\"country_code\":\"fr\",\"sort_by\":\"date\"}"
      },
      "name": "Using JSON",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        460,
        380
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Broken Down",
            "type": "main",
            "index": 0
          },
          {
            "node": "Using JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Hopefully this helps :+1:

1 Like

Awesome ! thanks a lot @jon :raised_hands:

1 Like