GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bennycode/ig-trading-api: IG Trading API for Node.js, written in TypeScript.

This repository was archived by the owner on Mar 23, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

627 Commits
627 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.env.defaults
.env.defaults
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
.prettierignore
.prettierignore
 
 
.prettierrc.json
.prettierrc.json
 
 
.yarnrc
.yarnrc
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
codecov.yml
codecov.yml
 
 
jasmine.json
jasmine.json
 
 
lefthook.yml
lefthook.yml
 
 
nyc.config.coverage.json
nyc.config.coverage.json
 
 
nyc.config.json
nyc.config.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
typedoc.json
typedoc.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

IG Trading API

Language Details Code Coverage License Package Version Dependency Updates

Unofficial IG Trading API for Node.js, written in TypeScript and covered by tests.

Features

  • Typed. Source code is 100% TypeScript. No need to install external typings.
  • Tested. Code coverage is 100%. No surprises when using ig-trading-api.
  • Maintained. Automated security updates. No threats from outdated dependencies.
  • Documented. Get started with the generated documentation.

Installation

npm

npm install ig-trading-api

Yarn

yarn add ig-trading-api

Usage

You can set the API gateway, when initializing the API client. Use APIClient.URL_DEMO (demo-api.ig.com) for demo accounts and APIClient.URL_LIVE (api.ig.com) for live account access.

Login

import {APIClient} from 'ig-trading-api';

const client = new APIClient(APIClient.URL_LIVE, {
  apiKey: 'your-api-key',
  username: 'your-username',
  password: 'your-password',
});

Search Trading Symbol

Make sure to use IG's Epic codes to find a trading symbol:

const query = 'BITCOIN';
const response = await client.rest.market.searchMarkets(query);
console.log(response.markets[0].epic);

Show available resolutions

Check the available intervals for retrieving data:

import {APIClient, Resolution} from 'ig-trading-api';
console.log(Resolution);

Retrieve historical data

const epic = 'UC.D.MSFT.CASH.IP';
const prices = await client.rest.market.price.getPrices(epic, Resolution.DAY, 5);

Subscribe to live data

Here is how you can subscribe to live candles and other updates from IG:

  • stream.ts

More Examples

More code examples can be found in the demo directory.

Resources

  • IG REST Trading API Reference
  • IG API Companion
  • IG Streaming Companion
  • IG REST Trading API Limits
  • Spreads, commissions and margins (in Germany)

IG Instrument Identifier (Epic)

Breakdown for "IX.D.DOW.DAILY.IP":

Symbol Description Example
IX Hours of trading "Index Out of Hours"
D Tradability "D" when tradeable
DOW Underlying market "Dow Jones"
DAILY Indicator for processing method "Daily" funded bet
IP Asset type "Intellectual Property"

Epics for testing:

Epic Name Environment Trading Time
ED.D.DHERGY.CASH.IP Delivery Hero SE Live / Demo Germany: 09:00 - 17:30
UC.D.MSFT.CASH.IP Microsoft Corp Live / Demo Germany: 10:00 - 03:00
UA.D.COINUS.CASH.IP Coinbase Global Inc Live Germany: 15:30 - 22:00

Development Setup

You can get up and running in just a few simple steps:

  1. Run yarn (to install or update third-party dependencies)
  2. Have a look at the .env.defaults file and make a copy (including your own credentials) with the name .env in the root directory of this repository (read more about dotenv files)
  3. Run yarn demo:login to test your credentials

Maintainers

Benny Neugebauer on Stack Exchange

Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

License

This project is MIT licensed.

⭐️ Show your support ⭐️

Please leave a star if you find this project useful.

About

IG Trading API for Node.js, written in TypeScript.

bennycode.com/ig-trading-api/

Topics

cfdderivativesfinancefintechhacktoberfestrest-clienttrading-api

Resources

Readme
MIT license
Activity

Stars

50 stars

Watchers

3 watching

Forks

20 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.