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

# Login

> Authenticate with API key and get access tokens

## Authentication

The Developer API uses **API key authentication only**. You must first generate an API key from your Finscreener dashboard.

<ParamField body="api_key" type="string" required>
  Developer API key (format: `fsk_xxx`). Generate one from your Finscreener dashboard under Settings → API Key.
</ParamField>

<Warning>
  Email/password login is **not supported** for the Developer API. You must use an API key.
</Warning>

## Response

<ResponseField name="token" type="object">
  <Expandable title="properties">
    <ResponseField name="access_token" type="string">
      JWT access token for API requests
    </ResponseField>

    <ResponseField name="refresh_token" type="string">
      Token for refreshing access token
    </ResponseField>

    <ResponseField name="token_type" type="string">
      Always "bearer"
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.finscreener.in/api/auth/login \
    -H "Content-Type: application/json" \
    -d '{"api_key": "fsk_your_api_key"}'
  ```

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

  response = requests.post(
      "https://api.finscreener.in/api/auth/login",
      json={"api_key": "fsk_your_api_key"}
  )
  token = response.json()["token"]["access_token"]
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.finscreener.in/api/auth/login', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ api_key: 'fsk_your_api_key' })
  });
  const { token } = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "token": {
      "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "token_type": "bearer"
    }
  }
  ```

  ```json Error (Invalid API Key) theme={null}
  {
    "detail": "Invalid API key"
  }
  ```
</ResponseExample>
