Getting started overview

Getting started with Finage involves a sequence of steps to establish API access and make an initial request. This guide outlines the process from account creation to executing your first API call, focusing on the essential actions required for integration. Finage provides access to various market data including real-time stock, forex, and cryptocurrency information through its API endpoints, as detailed in the Finage API documentation.

The core steps are:

  1. Account Creation: Register for a Finage account.
  2. API Key Generation: Obtain your unique API key from the Finage dashboard.
  3. First Request: Use the API key to make an authenticated call to a Finage endpoint.

Finage offers a Developer Plan that includes 500 requests per month, which can be used for initial testing and integration. The platform also provides SDKs for multiple programming languages, including Python and Node.js, to streamline the development process.

Quick Reference Guide

Step Action Location/Tool
1. Sign up Create a new Finage account. Finage Signup Page
2. Choose Plan Select a plan, typically the free Developer Plan for initial setup. Finage Pricing Page / Dashboard
3. Retrieve API Key Locate and copy your unique API key. Finage Dashboard > API Keys
4. Select Endpoint Identify the desired API endpoint (e.g., real-time stock data). Finage API Documentation
5. Make Request Construct and execute an HTTP request with your API key. Code editor, Postman, cURL
6. Process Response Parse the JSON response from the API. Code editor

Create an account and get keys

To begin using Finage APIs, you must first create an account and then retrieve your API key. This key authenticates your requests and grants access to the Finage data services.

1. Sign Up for a Finage Account

Navigate to the Finage signup page. Provide the requested information, which typically includes an email address and a password. After submitting the form, you may need to verify your email address to activate your account. Finage supports GDPR compliance, ensuring data privacy standards are met during registration.

2. Choose a Plan

Upon registration, you will usually be directed to a plan selection page or your dashboard. For initial testing and development, you can select the Developer Plan, which is free and includes up to 500 requests per month. This plan is sufficient for exploring the API capabilities and building prototypes. If your project requires higher request volumes or more advanced features, you can upgrade to a paid plan, such as the Startup Plan, which starts at $99 per month for 100,000 requests.

3. Retrieve Your API Key

Once your account is active and a plan is selected, log in to the Finage dashboard. Your API key will be displayed in a dedicated section, often labeled "API Keys" or "Dashboard Home." The API key is a unique string of characters that identifies your account and authorizes your API calls. It is critical to keep this key confidential to prevent unauthorized access to your Finage account and usage limits. Copy this key, as it will be required for every API request you make.

Your first request

After obtaining your API key, you can make your first API request. This example demonstrates how to fetch real-time stock data using a common programming language, Node.js, and also provides a cURL example for direct testing.

API Endpoint Structure

Finage API endpoints typically follow a structure that includes the base URL, the specific data type, and query parameters for filtering or specifying data. For example, to get real-time stock data, an endpoint might look like https://api.finage.co.uk/v1/stock/realtime?symbol=AAPL&apikey=YOUR_API_KEY.

Consult the Finage API documentation for a comprehensive list of available endpoints and their specific parameters.

Example: Real-time Stock Data (Node.js)

This Node.js example uses the node-fetch library to make an HTTP GET request to the Finage real-time stock API. First, install node-fetch if you haven't already:

npm install node-fetch

Then, create a JavaScript file (e.g., get-stock-data.js) with the following content:

import fetch from 'node-fetch';

const API_KEY = 'YOUR_FINAGE_API_KEY'; // Replace with your actual API key
const SYMBOL = 'AAPL'; // Example: Apple Inc.

async function getRealtimeStockData() {
  const url = `https://api.finage.co.uk/v1/stock/realtime?symbol=${SYMBOL}&apikey=${API_KEY}`;

  try {
    const response = await fetch(url);
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    const data = await response.json();
    console.log('Real-time Stock Data for', SYMBOL + ':', data);
  } catch (error) {
    console.error('Error fetching data:', error);
  }
}

getRealtimeStockData();

Execute the script from your terminal:

node get-stock-data.js

The output will be a JSON object containing the real-time stock data for Apple (AAPL).

Example: Real-time Stock Data (cURL)

For quick testing directly from the command line, you can use cURL:

curl -X GET "https://api.finage.co.uk/v1/stock/realtime?symbol=MSFT&apikey=YOUR_FINAGE_API_KEY"

Replace YOUR_FINAGE_API_KEY with your actual API key and MSFT with any desired stock symbol. This command will print the JSON response directly to your terminal.

Common next steps

After successfully making your first Finage API call, consider these next steps to further integrate and utilize the platform's capabilities:

  • Explore More Endpoints: Review the Finage API reference to discover other available data types, such as forex rates, cryptocurrency prices, historical data, and economic indicators. Each data type has specific endpoints and parameters.
  • Implement Error Handling: Incorporate robust error handling into your application to manage API rate limits, invalid requests, and other potential issues. This ensures your application remains stable even when encountering unexpected responses.
  • Utilize SDKs: If you are working in a supported language like Python, Node.js, Java, or C#, consider using the Finage SDKs. SDKs simplify API interaction by abstracting HTTP requests and providing language-specific methods for data retrieval. This can reduce boilerplate code and improve development speed.
  • Manage API Key Security: Never hardcode your API key directly into client-side code or publicly accessible repositories. Instead, use environment variables, secret management services, or secure server-side configurations to protect your API key. For example, AWS offers Secrets Manager for secure storage and retrieval.
  • Monitor Usage: Regularly check your API usage against your plan limits through the Finage dashboard. This helps prevent unexpected service interruptions due to exceeding your request quota.
  • Integrate Webhooks (if available and needed): For real-time event notifications, investigate if Finage offers webhook capabilities. Webhooks allow Finage to push data to your application when specific events occur, rather than requiring you to poll the API. This can be more efficient for certain use cases, as described in Mozilla's explanation of webhooks.

Troubleshooting the first call

Encountering issues during your first API call is common. Here's a guide to diagnose and resolve frequent problems:

  • Invalid API Key (HTTP 401 Unauthorized):
    • Issue: The API returns a 401 status code or an "unauthorized" message.
    • Resolution: Double-check that you have copied your API key correctly from the Finage dashboard. Ensure there are no leading or trailing spaces. Verify it's included in the request URL as the apikey query parameter.
  • Incorrect Endpoint or Parameters (HTTP 404 Not Found, HTTP 400 Bad Request):
    • Issue: The API returns 404 for a non-existent endpoint or 400 for malformed parameters.
    • Resolution: Refer to the Finage API documentation to confirm the exact endpoint path and required parameters. Check for typos in the endpoint URL, parameter names, or values. Ensure all mandatory parameters are included.
  • Rate Limit Exceeded (HTTP 429 Too Many Requests):
    • Issue: The API responds with a 429 status code.
    • Resolution: This indicates you've made too many requests within a given timeframe for your current plan. Wait for the rate limit window to reset, or consider upgrading your Finage plan if you consistently hit limits. Implement exponential backoff in your application for retries.
  • Network Connectivity Issues:
    • Issue: Your request times out or fails with a network error.
    • Resolution: Verify your internet connection. Check if there are any firewalls or proxy settings that might be blocking outbound HTTP requests from your environment.
  • JSON Parsing Errors:
    • Issue: Your application fails to parse the API response.
    • Resolution: Ensure the API is returning valid JSON. Use a tool like a JSON validator or print the raw response body to inspect its format. Sometimes, error messages from the API are not JSON and need to be handled separately before attempting to parse as JSON.