Overview

IG is a financial data API providing access to spreadbetting and CFD (Contract for Difference) market data. You can retrieve live prices, historical data, and account information for trading instruments. It is aimed at developers building trading platforms or financial analysis tools.

Beginner Tip

You must register on the IG Labs portal to get API credentials; the demo environment is a safe place to test your integration before going live.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

stock price and symbol
open/close/high/low values
trading volume
market cap
historical price data

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "status": "success",
  "data": {
    "result": "Data from IG",
    "description": "Spreadbetting and CFD Market Data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

accounts List of trading accounts associated with your credentials.
accountId Unique identifier for a specific trading account.
balance Contains balance details including available funds and deposit amounts.
currency The currency code (e.g., USD, GBP) for the account balance.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.ig.com/gateway/deal/accounts";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

401 Unauthorized API key or credentials are invalid or not included in the request header
Include your API key in the X-IG-API-KEY header and ensure you have a valid session token.
400 Bad Request Malformed request body or missing required parameters
Check the IG API reference to confirm required fields and correct data types for your endpoint.
429 Too Many Requests Exceeded the API rate limit for your account tier
Reduce request frequency and implement exponential backoff when retrying requests.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Finance
Difficulty Intermediate
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →