0.13.7 • Published 7 months ago

ig-trading-api v0.13.7

Weekly downloads
97
License
MIT
Repository
github
Last release
7 months ago

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.

TypeScript

Recommended:

import {APIClient} from 'ig-trading-api';
const client = new APIClient(APIClient.URL_LIVE, 'your-api-key');
const session = await client.rest.login.createSession('your-username', 'your-password');
console.info(`Your client ID is "${session.clientId}".`);

Alternative:

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

Resources

IG Instrument Identifier (Epic)

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

SymbolDescriptionExample
IXHours of trading"Index Out of Hours"
DTradability"D" when tradeable
DOWUnderlying market"Dow Jones"
DAILYIndicator for processing method"Daily" funded bet
IPAsset type"Intellectual Property"

Epics for testing:

EpicNameEnvironmentTrading Time
ED.D.DHERGY.CASH.IPDelivery Hero SELive / DemoGermany: 09:00 - 17:30
UC.D.MSFT.CASH.IPMicrosoft CorpLive / DemoGermany: 10:00 - 03:00
UA.D.COINUS.CASH.IPCoinbase Global IncLiveGermany: 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.

0.13.6

8 months ago

0.13.7

7 months ago

0.13.5

9 months ago

0.13.4

2 years ago

0.13.3

2 years ago

0.13.2

3 years ago

0.13.1

3 years ago

0.11.0

3 years ago

0.12.0

3 years ago

0.11.1

3 years ago

0.13.0

3 years ago

0.10.1

3 years ago

0.10.0

3 years ago

0.9.0

3 years ago

0.9.1

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.3.0

3 years ago

0.4.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago