# Authentication (/docs/introduction/authentication)



The Connect API supports API-key authentication using the `x-api-key` header.

## Required Header [#required-header]

```http
x-api-key: YOUR_API_KEY
```

## cURL Example [#curl-example]

```json
{
  "query": "electric aviation"
}
```

```bash
curl -s "https://connect-api.trendtracker.ai/topics?query=electric%20aviation" \
  -H "x-api-key: $TT_API_KEY"
```

## JavaScript Example [#javascript-example]

```js
const response = await fetch(
  "https://connect-api.trendtracker.ai/topics?query=electric%20aviation&take=10",
  {
    headers: {
      "x-api-key": process.env.TT_API_KEY,
    },
  }
);

const data = await response.json();
console.log(data);
```

## Common Mistakes [#common-mistakes]

* Missing `x-api-key` header -> request is rejected.
* Typo in header name (`x_api_key`, `api-key`, etc.) -> request is rejected.
* Sending key in query params -> unsupported and insecure.

If you do not have an API key yet, contact sales to request access.
