Skip to main content

Overview

The Finscreener API uses a two-step authentication process:
  1. API Key Exchange: Exchange your API key for JWT tokens
  2. Bearer Token: Use the JWT access token for all subsequent API calls
API keys start with fsk_ and can be obtained from your User Profile → Security settings.

Authentication Flow

Step 1: Login with API Key

Exchange your API key for JWT tokens:
Response:
The access_token expires after approximately 1 hour. Store the refresh_token securely to obtain new access tokens.

Step 2: Use Bearer Token

Include the access token in all API requests:
Your fsk_ API key is not a bearer token. It cannot be sent as Authorization: Bearer fsk_... — it must be exchanged at POST /api/auth/login first, and the token to send is the nested token.access_token (not a top-level access_token).Sending the raw key returns 401:

Step 3: Refresh Access Token

When your access token expires, use the refresh token to get a new one:

Error Handling

Best Practices

  • Store API keys in environment variables, not in code
  • Never commit API keys to version control
  • Use secret management services in production
  • Cache the access token and reuse until expiration
  • Implement automatic token refresh before expiration
  • Store refresh tokens securely (encrypted at rest)
  • Handle 401 errors by refreshing the token
  • Implement exponential backoff for rate limit errors (429)
  • Log authentication failures for debugging