# IG API GET /session/encryptionKey

Independent and unofficial. Not affiliated with or endorsed by any broker or platform named here. Educational only: nothing here is advice, and nothing here recommends a broker or a trade.

This is the markdown version of https://openbrokerapi.com/brokers/ig/endpoints/session-encryption-key, written from the same records as that page.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Fetch the key and timestamp used to send a password in encrypted form when logging in. Only some logins need it.

- Request: `GET /session/encryptionKey`
- Version: 1
- Group: Session
- Status: verified. Source: [labs.ig.com](https://labs.ig.com/reference/session-encryption-key.html), checked 2026-10-12.
- Official reference: https://labs.ig.com/reference/session-encryption-key.html

Note: The method, path, version and response fields were read on IG's own reference page on 12 Oct 2026. The page lists no request headers and does not say whether session tokens are needed, so only the API key and version headers from IG's REST trading API guide are recorded. The page's own description repeats the login wording.

## Parameters

- `VERSION` (in header, type string, required): Endpoint version. Send 1.

### Authentication headers

- `X-IG-API-KEY` (type string, required): Your API key, from your IG account settings. Placeholder only here.

## Request

Written from the method, path and parameters recorded on this page, against the demo host. Not executed against a live or demo account. Credentials are read from environment variables on your own machine and are never entered on this site. The request builder at https://openbrokerapi.com/tools/request-builder writes these same snippets, from the same record.

### Python

```python
# Set IG_API_KEY as an environment variable first. Never paste real values into code.
import os
import requests

BASE_URL = "https://demo-api.ig.com/gateway/deal"  # the demo host
headers = {
    "X-IG-API-KEY": os.environ["IG_API_KEY"],
    "VERSION": "1",
}
resp = requests.get(BASE_URL + "/session/encryptionKey", headers=headers, timeout=10)
resp.raise_for_status()
print(resp.json())
```

### JavaScript

```javascript
// Set IG_API_KEY as an environment variable first. Never paste real values into code.
// Run as a module, for example a .mjs file, on a Node version that has fetch built in.
const BASE_URL = "https://demo-api.ig.com/gateway/deal"; // the demo host
const res = await fetch(BASE_URL + "/session/encryptionKey", {
  method: "GET",
  headers: {
    "X-IG-API-KEY": process.env.IG_API_KEY,
    "VERSION": "1",
  },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
```

### curl

```bash
# Set IG_API_KEY as an environment variable first. Never paste real values into code.
curl -X GET "https://demo-api.ig.com/gateway/deal/session/encryptionKey" \
  -H "X-IG-API-KEY: $IG_API_KEY" \
  -H "VERSION: 1"
```

## Response

A mock response. The values are invented, so check field names against the [official reference](https://labs.ig.com/reference/session-encryption-key.html).

```json
{
  "_mock": true,
  "encryptionKey": "MOCK-BASE64-KEY",
  "timeStamp": 1789718400000
}
```

## Limits that apply at IG

- Historical price data points a week: 10,000 data points per week
  - Scope: Per account, price history endpoints only
  - Status: verified. Source: [labs.ig.com](https://labs.ig.com/faq.html), checked 2026-10-12.
- Non trading requests a minute: 30 requests per minute
  - Scope: Per account, non trading calls only
  - Status: verified. Source: [labs.ig.com](https://labs.ig.com/faq.html), checked 2026-10-12.
- Non trading requests a minute: 60 requests per minute
  - Scope: Per application, that is per API key, non trading calls only
  - Status: verified. Source: [labs.ig.com](https://labs.ig.com/faq.html), checked 2026-10-12.
- Concurrent streaming subscriptions: 40 subscriptions
  - Scope: Per streaming connection
  - Status: verified. Source: [labs.ig.com](https://labs.ig.com/faq.html), checked 2026-10-12.
  - Corroborated by [labs.ig.com/streaming-api-guide.html](https://labs.ig.com/streaming-api-guide.html)
- Trading requests a minute: 100 requests per minute
  - Scope: Per account, trading calls only
  - Sources conflict: [ig.com](https://www.ig.com/en/trading-platforms/trading-apis/how-to-use-ig-api) states around 40 trade requests per minute, checked 2026-10-05. IG's own pages disagree. The conflict is labelled, not resolved. Pace against 40.
  - Status: conflicting. Source: [labs.ig.com](https://labs.ig.com/faq.html), checked 2026-10-12.

## More on the IG API

- [All IG API endpoints](https://openbrokerapi.com/brokers/ig/endpoints): 49 documented, grouped by what they do.
- [IG API quickstart](https://openbrokerapi.com/brokers/ig/quickstart)
- [All IG API error codes](https://openbrokerapi.com/errors/ig)
- [IG API page](https://openbrokerapi.com/brokers/ig): The full record: access, authentication, limits and the source for each.
- [IG API as an OpenAPI file](https://openbrokerapi.com/specs/ig.json): Generated from these endpoint records. Independent and unofficial.

## Licence and how to cite

The records behind this page are all rights reserved. This file is the page itself, at its own address, in another format. It is not part of the CC BY 4.0 downloads listed at https://openbrokerapi.com/data. Quote from it with a link to the page.

Cite as: IG API GET /session/encryptionKey. Broker API Hub, https://openbrokerapi.com/brokers/ig/endpoints/session-encryption-key, newest check 2026-10-12.

Where you rely on a single figure, cite the source and the checked date printed beside it as well. Where this page and a broker's own documentation differ, the documentation wins.
