# ig-rest-api

> IG REST API Wrapper

Latest version **1.1.0** (published 2021-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install ig-rest-api
pnpm add ig-rest-api
yarn add ig-rest-api
bun add ig-rest-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-11-07 |
| First published | 2021-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Forntoh Thomas |
| Maintainers | forntoh |
| Keywords | ig, api, trading, broker |

## Links

- npm: https://www.npmjs.com/package/ig-rest-api
- Repository: https://github.com/forntoh/ig-rest-api
- Issues: https://github.com/forntoh/ig-rest-api/issues
- npm.io page: https://npm.io/package/ig-rest-api

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.24.0
- [rambda](https://npm.io/package/rambda.md) ^6.9.0

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-11-07
- 1.0.9 — 2021-11-07
- 1.0.8 — 2021-11-07
- 1.0.7 — 2021-11-07
- 1.0.6 — 2021-11-07
- 1.0.5 — 2021-11-06
- 1.0.4 — 2021-11-06
- 1.0.3 — 2021-11-06
- 1.0.2 — 2021-11-06
- 1.0.1 — 2021-11-06
- 1.0.0 — 2021-11-06

## README

# IG REST API JS Wrapper

## Installation

```bash
yarn install ig-rest-api
```

## Usage

### 1. Import library

```js
// ES6
import IG from "ig-rest-api";
// Common
const IG = require("ig-rest-api");
```

### 2. Create a new instance

```js
const ig = new IG(yourApiKey, isDemo);
```

### 3. Use

Using Promise

```js
ig.login(username, password)
  .then((res) => {
    console.log(res);
    //
    ig.get("positions").then((positions) => {
      console.log("positions:", positions);
    });
  })
  .catch(console.error);
```

Using Async

```js
try {
  await ig.login(username, password);
  const positions = await ig.get("positions");
  console.log("positions:", positions);
} catch (error) {
  console.error(error);
}
```

---
_Source: https://npm.io/package/ig-rest-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
