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

# Autenticazione

> Autenticati all’API di ricerca, scraping e crawling di Olostep con le chiavi API.

Gli endpoint dell'API richiedono che tu ti autentichi utilizzando un token API.

## Genera un token

Il token può essere generato dalla dashboard di Olostep. Crea un account [qui](https://www.olostep.com/auth/).

## Usa il tuo token

Puoi autenticarti aggiungendo un'intestazione `Authorization` a tutte le tue chiamate HTTP. L'intestazione Authorization è formattata in questo modo: `Authorization: Bearer <API-TOKEN>` (sostituisci `<API-TOKEN>` con il tuo token. Se non hai un token, puoi generarne uno gratuitamente dalla [dashboard](https://www.olostep.com/dashboard) di Olostep).

Esempi:

<CodeGroup>
  ```python Python theme={null}
  # pip install requests

  import requests

  endpoint = 'https://api.olostep.com/v1/scrapes/<SCRAPE_ID>'
  headers = {
      'Authorization': 'Bearer <API-TOKEN>',
      'Accept': 'application/json'
  }

  response = requests.get(endpoint, headers=headers)
  print(response.status_code)
  print(response.json())
  ```

  ```js Node theme={null}
  // npm install node-fetch

  // ESM
  import fetch from 'node-fetch'

  const endpoint = 'https://api.olostep.com/v1/scrapes/<SCRAPE_ID>'
  const res = await fetch(endpoint, {
    headers: {
      'Authorization': 'Bearer <API-TOKEN>',
      'Accept': 'application/json'
    }
  })
  console.log(res.status)
  console.log(await res.json())
  ```

  ```bash cURL theme={null}
  curl -L -X GET 'https://api.olostep.com/v1/scrapes/<SCRAPE_ID>' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer <API-TOKEN>'
  ```
</CodeGroup>

## Utilizzo della CLI

Se stai usando la [CLI di Olostep](/sdks/cli), puoi evitare la gestione manuale delle chiavi e accedere dal terminale:

```bash theme={null}
npm install -g olostep-cli
olostep login
```

Si apre il browser, clicchi su **Authorize**, e la chiave viene salvata localmente. Per CI, imposta `OLOSTEP_API_KEY`.

## Utilizzo degli SDK

Gli SDK [Python](/sdks/python) e [Node.js](/sdks/node-js) leggono `OLOSTEP_API_KEY` dall'ambiente, o accettano la chiave direttamente quando costruisci il client.
