> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keywordinsights.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# N8N integration

<Warning>
  This guide uses **Bearer token** authentication, which is deprecated. For new N8N setups, you can skip the login step entirely by using an **API key** in the `X-API-Key` header instead. See [API Key Authentication](/api/api-key-authentication).
</Warning>

On this page, you'll find the guide on how to connect Keyword Insights API with N8N to run clustering.

### Step 1

#### Authentication

Use an HTTP Requst node, ensure the route is correct

\`[https://api.keywordinsights.ai//authentication/login/](https://api.keywordinsights.ai/authentication/login/)\`and the method is "POST".Finally, enable the body option, and enable JSON type, and pass the following by replacing the values of your account email/password.

```
{
  "email": "<email>",
  "password": "<password>"
}
```

<img src="https://mintcdn.com/snippetdigital/jBGkmInQA6GjnN58/images/image%20(28).png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=d0e8cd713d441f01b9d0ce08971afa4d" alt="" width="795" height="930" data-path="images/image (28).png" />

### Step 2

#### Creating a clustering order

Ensure the output of the Auth node shows in the second node.

<img src="https://mintcdn.com/snippetdigital/jBGkmInQA6GjnN58/images/image%20(29).png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=7f25c9cc2da09196bc31a287d08d4b58" alt="" width="1193" height="542" data-path="images/image (29).png" />

Update the following settings:

* Method -> POST
* URL -> [https://api.keywordinsights.ai/api/keywords-insights/order/](https://api.keywordinsights.ai/api/keywords-insights/order/)
* Send Headers -> Enabled
* Header Parameter Key -> Authorization
* Header Paramater Value -> Bearer `{'{ $json.result.access_token }'}`
* Send Body -> Enabled
* JSON, Using JSON

<img src="https://mintcdn.com/snippetdigital/jBGkmInQA6GjnN58/images/image%20(30).png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=657285ff3fa54b7a1da158e03fdeb7dd" alt="" width="2466" height="1241" data-path="images/image (30).png" />

Paste the following json into the body, make sure to update the keywords, volumes you want to cluster, and URL, you can also customize further based on the configuration you want. You can also pass `folder_id` if you want it placed in a specific folder in the platform.

```
{
  "clustering_method": "volume",
  "device": "desktop",
  "grouping_accuracy": 4,
  "hub_creation_method": "medium",
  "insights": [
    "cluster",
    "rank",
    "context"
  ],
  "language": "en",
  "location": "United States",
  "project_name": "A Clustering project",
  "keywords": [
    "keyword clustering",
    "keyword research",
    "topical authority",
    "clustering methods",
    "page authority"
  ],
  "search_volumes": [
    2300,
    3210,
    5500,
    2100,
    1200
  ],
  "url": "https://www.keywordinsights.ai/"
}
```

<img src="https://mintcdn.com/snippetdigital/jBGkmInQA6GjnN58/images/image%20(31).png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=7e25bdd45ad386b334cca38b273d010a" alt="" width="2468" height="1245" data-path="images/image (31).png" />

That's all!
