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

# Get Credentials

> How to get Ahrefs API credentials

## Get your Ahrefs API Key

<Steps>
  <Step title="Sign up or log in">
    Go to [Ahrefs](https://ahrefs.com) and sign in to your account.
  </Step>

  <Step title="Navigate to API Settings">
    1. Click on your profile in the top right
    2. Go to "API" settings
    3. Or directly visit: [https://ahrefs.com/api](https://ahrefs.com/api)
  </Step>

  <Step title="Generate API Token">
    1. Click "Generate new token" or use an existing token
    2. Copy the API token - you'll need this for authentication
    3. Store it securely (you won't be able to see it again)
  </Step>

  <Step title="Store in Corsair">
    Run the setup command:

    ```bash theme={null}
    pnpm corsair setup --plugin=ahrefs api_key=your-api-key
    ```

    When prompted, enter:

    * `api_key`: Your Ahrefs API token

    For multi-tenant setup:

    ```bash theme={null}
    pnpm corsair setup --plugin=ahrefs api_key=their-api-key --tenant=<tenantId>
    ```
  </Step>
</Steps>

## API Key Notes

Ahrefs API v3 uses the key in the `Authorization: Bearer <api_key>` header. Only workspace owners and admins can create API keys, and keys expire after 1 year.

## Rate Limits

Ahrefs API is limited to 60 requests per minute by default. Many endpoints also consume API units based on requested fields and returned rows, with a minimum request cost unless the endpoint is marked free in Ahrefs docs.

Corsair retries rate-limited responses with exponential backoff.

## Required Permissions

The API key needs access to:

* **Site Explorer API** - for domain metrics and backlinks data
* **Keywords Explorer API** - for keyword research and metrics

Check your Ahrefs subscription to ensure API access is enabled.
