Overview
The Finscreener API uses a two-step authentication process:- API Key Exchange: Exchange your API key for JWT tokens
- 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:Step 2: Use Bearer Token
Include the access token in all API requests:Step 3: Refresh Access Token
When your access token expires, use the refresh token to get a new one:Error Handling
| Status Code | Error | Description |
|---|---|---|
| 400 | Bad Request | Invalid request body or missing API key |
| 401 | Unauthorized | Invalid or expired token |
| 403 | Forbidden | Token not authorized for developer API |
Best Practices
Secure Storage
Secure Storage
- Store API keys in environment variables, not in code
- Never commit API keys to version control
- Use secret management services in production
Token Management
Token Management
- Cache the access token and reuse until expiration
- Implement automatic token refresh before expiration
- Store refresh tokens securely (encrypted at rest)
Error Handling
Error Handling
- Handle 401 errors by refreshing the token
- Implement exponential backoff for rate limit errors (429)
- Log authentication failures for debugging