1.1.0 • Published 3 years ago

ig-rest-api v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

IG REST API JS Wrapper

Installation

yarn install ig-rest-api

Usage

1. Import library

// ES6
import IG from "ig-rest-api";
// Common
const IG = require("ig-rest-api");

2. Create a new instance

const ig = new IG(yourApiKey, isDemo);

3. Use

Using Promise

ig.login(username, password)
  .then((res) => {
    console.log(res);
    //
    ig.get("positions").then((positions) => {
      console.log("positions:", positions);
    });
  })
  .catch(console.error);

Using Async

try {
  await ig.login(username, password);
  const positions = await ig.get("positions");
  console.log("positions:", positions);
} catch (error) {
  console.error(error);
}
1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago