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

# Authentication

> Create a free Orbscan API key from your API Dashboard and authenticate requests with it as a Bearer token.

Authenticate to the Orbscan Open API with your **API key**, passed as a Bearer token in the Authorization header. Requests without a valid key are rejected with a `401` response.

## Getting an API key

API keys are self-serve. Create a free account and verify your email to get your first key. Create and manage more keys in your API Dashboard.

**1. Create an account**

Go to [orbscan.com/register](https://orbscan.com/register). Enter your email address and a password of at least 8 characters. Accept the Terms of Service and Privacy Policy, then click **Create Account**.

New accounts start on the free **Developer** plan. Each person can have one account.

**2. Verify your email and copy your key**

Follow the instructions in the verification email that Orbscan sends you. Verifying your email activates your account and creates your first API key.

Copy the full key and store it somewhere safe. Orbscan shows the full key only once. Keys start with `orb_live_`.

**3. Create more keys (optional)**

Sign in and open the [API Dashboard](https://orbscan.com/api-dashboard). You can also open it from the account menu by clicking **Dashboard**.

Click **Create API Key**, enter a **Key Name** such as `dev-local` or `production-app`, and click **Create API Key**. Copy the new key right away.

> [!TIP]
>
> If you didn't copy your first key, revoke it in the API Dashboard and create a new one.

> [!WARNING]
>
> Your API key is a secret. Keep it server-side, never commit it to a public repository, and never expose it in client-side code. If a key is exposed, revoke it in the API Dashboard and create a new one.

## Managing your keys

The **API Keys** tab of the [API Dashboard](https://orbscan.com/api-dashboard) lists every key on your account. Each row shows the key's name, a masked key value, when it was created, and when it was last used.

* Click **Rename** to change a key's name. The key value stays the same.
* Click **Revoke** to stop a key from authenticating immediately. The key's usage history remains available.
* Create a separate key for each app or environment. You can then revoke one key without affecting the others.

The number of active keys you can hold depends on your plan. All keys on your account share the same plan limits. See [Rate limits](https://docs.orbscan.com/api-reference/rate-limits.md) for details.

To see how many calls you've made, which keys and endpoints made them, and how close you are to your limits, open the **Usage** tab.

## Using your API key

Pass your key as a **Bearer token** in the `Authorization` header on every request:

```http theme={null}
Authorization: Bearer <your_api_key>
```

You can also pass the key as the `apikey` query parameter, such as `?apikey=<your_api_key>`. Use the header when you can. URLs, including query strings, are often recorded in server logs, browser history, and proxy logs.

### Example request

These examples read your key from the `ORBSCAN_API_KEY` environment variable:

```bash cURL theme={null}
curl "https://api.orbscan.com/v1/trader/0x6a72f61820b26b1fe4d956e17b6dc2a1ea3033ee/activity?limit=50" \
  -H "Authorization: Bearer $ORBSCAN_API_KEY"
```

```python Python theme={null}
import os
import requests

resp = requests.get(
    "https://api.orbscan.com/v1/trader/0x6a72f61820b26b1fe4d956e17b6dc2a1ea3033ee/activity",
    params={"limit": 50},
    headers={"Authorization": f"Bearer {os.environ['ORBSCAN_API_KEY']}"},
    timeout=30,
)
print(resp.json())
```

```javascript JavaScript theme={null}
const resp = await fetch(
  "https://api.orbscan.com/v1/trader/0x6a72f61820b26b1fe4d956e17b6dc2a1ea3033ee/activity?limit=50",
  { headers: { Authorization: `Bearer ${process.env.ORBSCAN_API_KEY}` } }
);
const body = await resp.json();
console.log(body);
```

> [!TIP]
>
> Store your API key in an environment variable such as `ORBSCAN_API_KEY` instead of hard-coding it in your source files. This keeps the key out of version control, and you can replace the key without changing your code.

## Verifying authentication

A successful, authenticated request returns `status_code: "1"`:

```json theme={null}
{
  "message": "OK",
  "status_code": "1",
  "data": { }
}
```

A missing or invalid key returns HTTP `401`:

```json theme={null}
{
  "message": "Missing or invalid API key",
  "status_code": "0",
  "data": null
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.