Authentication overview

Finage secures access to its suite of financial market data APIs through a straightforward API key authentication process. This method requires developers to include a unique, secret key with each request, allowing the Finage API to verify the sender's identity and grant access based on their subscription plan. The API key acts as a form of credential, linking API calls to a specific user account and their authorized data entitlements. This system is designed for ease of integration while maintaining a necessary level of security for data access.

Authentication is a foundational step for any application interacting with the Finage platform, ensuring that only authorized users consume data and resources. Without a valid API key, requests to Finage endpoints will typically result in an authentication failure, preventing data retrieval. The entire process relies on the secure transmission of this key, typically over HTTPS, to protect it from interception.

Supported authentication methods

Finage primarily supports API key authentication. This method is common for web services requiring direct client-to-server communication without complex user interaction flows. The API key is a long, unique string generated by Finage and associated with a developer's account.

API Key Authentication

With API key authentication, the key is passed directly within the API request. For Finage, this is typically done as a query parameter in the URL. This method is suitable for server-side applications where keys can be securely stored and managed. Finage's official documentation on API usage specifies the exact parameter name, usually apikey or similar, for inclusion in all API calls.

Finage does not currently list support for more complex authentication flows like OAuth 2.0 or mutual TLS (mTLS) in its public documentation. For information on these advanced authentication methods, the OAuth 2.0 specification and TLS protocol details offer comprehensive resources. However, for Finage's current architecture, the API key remains the standard.

Authentication Methods Summary

Method When to Use Security Level
API Key (URL Parameter) Server-side applications, scripts, or where direct application authentication is sufficient. Moderate (relies on secure storage and HTTPS).

Getting your credentials

To obtain your Finage API key, follow these steps:

  1. Sign Up/Log In: Navigate to the Finage homepage and either sign up for a new account or log in to your existing one. Access to an API key requires an active Finage account, even if you are on the Developer Free Plan.
  2. Access Dashboard: Once logged in, you will be directed to your personal Finage user dashboard. This is the central hub for managing your account, subscriptions, and API keys.
  3. Locate API Key Section: Within the dashboard, look for a section explicitly labeled "API Keys," "My API Key," or similar. The exact location may vary slightly based on dashboard design updates, but it is typically prominent.
  4. Generate/Retrieve Key: If you haven't generated a key before, there will be an option to "Generate New API Key" or "Show API Key." If a key already exists, it will be displayed, often partially masked for security, with an option to reveal it or copy it to your clipboard.
  5. Securely Store Key: Once retrieved, immediately store your API key in a secure location. Avoid hardcoding it directly into your application's source code, especially for public repositories. Environment variables, secret management services, or secure configuration files are recommended.

Finage's documentation provides specific instructions and visual guides for key retrieval within the dashboard, which users should consult for the most up-to-date process. The API key is unique to your account and should be treated as sensitive information.

Authenticated request example

Finage API keys are typically included as a query parameter in the API request URL. The following examples demonstrate how to make an authenticated request using common programming languages. These examples assume you have replaced YOUR_API_KEY with your actual Finage API key and are querying a hypothetical stock data endpoint.

Python Example

Using the requests library:

import requests

api_key = "YOUR_API_KEY"
symbol = "AAPL"
url = f"https://api.finage.co.uk/v1/stock/realtime?stock={symbol}&apikey={api_key}"

response = requests.get(url)

if response.status_code == 200:
    data = response.json()
    print("Real-time stock data:", data)
else:
    print(f"Error: {response.status_code} - {response.text}")

Node.js Example

Using the built-in https module or node-fetch (after npm install node-fetch):

// Using node-fetch (recommended for simplicity)
// const fetch = require('node-fetch'); // For CommonJS
import fetch from 'node-fetch'; // For ES Modules

const apiKey = "YOUR_API_KEY";
const symbol = "GOOG";
const url = `https://api.finage.co.uk/v1/stock/realtime?stock=${symbol}&apikey=${apiKey}`;

async function getStockData() {
    try {
        const response = await fetch(url);
        if (response.ok) {
            const data = await response.json();
            console.log("Real-time stock data:", data);
        } else {
            console.error(`Error: ${response.status} - ${response.statusText}`);
        }
    } catch (error) {
        console.error("Fetch error:", error);
    }
}

getStockData();

For more detailed examples across various SDKs and specific endpoint usage, refer to the Finage API documentation.

Security best practices

Adhering to security best practices when handling Finage API keys is essential to prevent unauthorized access to your account and data. These practices align with general API security guidelines:

  • Never Expose API Keys in Client-Side Code: API keys should never be embedded directly into client-side code (e.g., JavaScript in a web browser, mobile application code that is not obfuscated). This makes them easily discoverable and exploitable. All API calls requiring authentication should originate from a secure backend server.

  • Use Environment Variables or Secret Management: Store API keys as environment variables in your deployment environment (e.g., FINAGE_API_KEY=your_key_here) rather than hardcoding them. For more complex setups, consider dedicated secret management services like AWS Secrets Manager, Google Secret Manager, or Azure Key Vault. This practice prevents keys from being committed to version control systems.

  • Restrict Access to API Keys: Limit who has access to your API keys. Only developers or systems that explicitly require access for operational purposes should be granted it. Implement principle of least privilege.

  • Regular Key Rotation: Periodically rotate your API keys. If a key is compromised, rotating it minimizes the window of exposure. Finage's dashboard typically offers functionality to generate new keys and revoke old ones. The frequency of rotation depends on your security policy and risk assessment.

  • Monitor API Usage: Regularly review your API usage logs (if provided by Finage) for any unusual activity. Spikes in requests, unexpected data access patterns, or requests from unfamiliar IP addresses could indicate a compromised key.

  • Utilize HTTPS/TLS: Always ensure all communications with the Finage API use HTTPS (Hypertext Transfer Protocol Secure). This encrypts the data transmitted, including your API key, preventing eavesdropping and tampering during transit. Finage APIs enforce HTTPS by default, but it's crucial for your client to also use it. Information on the importance of TLS encryption is available from trusted web security resources.

  • Implement Rate Limiting and Circuit Breakers: While Finage implements its own rate limits, incorporating client-side rate limiting and circuit breakers in your application can prevent accidental overuse of your API quota and add a layer of resilience against denial-of-service attempts, even with a valid key.

  • Error Handling for Authentication Failures: Implement robust error handling for authentication failures. Your application should gracefully handle 401 Unauthorized or similar HTTP status codes, alerting administrators rather than crashing or exposing sensitive information.