0.1.0 • Published 6 years ago

endotech-api-node v0.1.0

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

Endotech - NodeJS API

A Node API built on Endotech, a partner of Pareto Network, they supply AI/ML analysis for the crypto market.

This API provides a simple interface to connect to Endotech's data using your account that you have setup with them.

You can gain access to the data in 2 ways:

  • Become a Pareto token holder, and set up a free account with Endotech.
  • Pay for a annual subscription through Endotech.io

Installation

With Yarn:

$ yarn add endotech-api-node

With NPM:

$ npm install endotech-api-node --save

API

This API is simple, it provides an authorise method to log you into the system with your credentials.

After successful authorisation, a token is provided, with this you can query the range of endpoints that Endotech has to offer.

The potential of the API is huge, here are some ideas to wet your whistle.

  • Provide an up to date Crypto market Sentiment feed to any product, from telegram bots to React Native apps, using push notifications.
  • A daily vital feed for a Crypto trading bot, using the sentiment from the Vitals to optimise for a given strategy.
  • A method for personal and business community growth by providing the highlighted market commentary through a telegram or WhatsApp group chat.
  • A automatic buy/sell trigger trading notification to a user base for using the vitals intelligence in conjunction with continuously watching the current crypto prices.

Local build

If you wish to build the API client directly from the source prepare the project with yarn run build.

You'll need to reference the distribution folder in your testing JS file with:

var Endotech = require('./distribution')

Development

If expanding the functionality of the API client use yarn run watch:js to continuously watch your code and refresh the distribution build folder.

API Functions

Authorise

Upon successful authorisation the token may be fed into any data call to get any additional feeds.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const authorise = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (success) {
    console.log(data.token)
  }

  console.log(error)
}

authorise()

Success Response (Snippet)

{ success: true, data: { token: "xxx", refresh: "xxx" } }

Errors

No Password Provided

{ success: false, error: "no password provided" }

invalid password

{ success: false, error: "invalid password" }

Cabinet

Your data provided to Endotech.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const getCabinet = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (!success) {
    console.log(error)
  }

  const token = data.token
  const cabinet = await endotech.cabinet(token)

  console.log(cabinet)
}

getCabinet()

Success Response (Snippet)

{
  success: true,
  data: [
    {
      first_name: '',
      last_name: '',
      email: '',
      phone: '',
      country: '',
      wallet: '',
      plans: [] } }
  ]
}

Errors

Incorrect Token Provided

"Unauthorised"

Commentary

The current Endotech commentary and opinion based from their technical analysis.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const getCommentary = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (!success) {
    console.log(error)
  }

  const token = data.token
  const commentary = await endotech.commentary(token)

  console.log(commentary)
}

getCommentary()

Success Response (Snippet)

{ success: true,
  data: [
     { title: 'Trade Date 19-06-2018 Market Commentary',
       body: 'Monday;s action was positive for virtually all of the top 10 coins. BTC and ETH seemed to lead the way with no particular news driving things. All top 10 coins closed above daily LO MO levels showing some strength in the sector. None have been able to trade trade above the centerline on the daily charts yet. Volume was a bit better than average in BTC and ETH so for the longs that adds a little value to the move higher today. Holding above VRH tomorrow would add to the bullish view.' }
  ]
}

Errors

Incorrect Token Provided

"Unauthorised"

Vitals

The daily technical vitals of the top 10 coins that Endotech are providing.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const getVitals = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (!success) {
    console.log(error)
  }

  const token = data.token
  const vitals = await endotech.vitals(token)

  console.log(vitals)
}

getVitals()

Success Response (Snippet)

{
  success: true,
  data: [
    { date_for: '2018-06-19',
      exchange: 'COINBASE',
      asset_base: 'NEO',
      asset_quote: 'USD',
      pursuit: '39.64',
      pursuit_target_1st: '40.36',
      pursuit_target_2nd: '41.15',
      pursuit_target_3rd: '43.24',
      risk: '38.5',
      risk_target_1st: '37.79',
      risk_target_2nd: '36.99',
      risk_target_3rd: '34.9',
      ctr: '44.46',
      pivot: '39.07',
      lm: '38.07',
      lmc: '25.29',
      um: '50.84',
      umc: '63.62',
      vrh: '40.75',
      vrl: '38.51'
    }
  ]
}

Errors

Incorrect Token Provided

"Unauthorised"

Sentiment

The current up to date sentiment news feed for the crypto market.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const getSentiment = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (!success) {
    console.log(error)
  }

  const token = data.token
  const sentiment = await endotech.sentiment(token)

  console.log(sentiment)
}

getSentiment()

Success Response (Snippet)

{
  success: true,
  data: [
    {
      source: 'ccn.com',
       url: 'https://www.ccn.com/ico-analysis-pigzbe/',
       title: '(+) ICO Analysis: Pigzbe',
       rating: 'neutral',
       rate: '0',
       updated: 1529389802
     }
  ]
}

Errors

Incorrect Token Provided

"Unauthorised"

Majors

The market change of the top 10 coins from the last 24 hours.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const getMajors = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (!success) {
    console.log(error)
  }

  const token = data.token
  const majors = await endotech.majors(token)

  console.log(majors)
}

getMajors()

Success Response (Snippet)

{
  success: true,
  data: [
    { entries: [
        { position: 1,
          name: 'Bitcoin',
          symbol: 'BTC',
          percent: '40.12',
          percent_change_1h: '-0.26',
          percent_change_24h: '3.68',
          percent_change_7d: '-2.28'
        },
      ],
      updated: 1529391642 }
  ]
}

Errors

Incorrect Token Provided

"Unauthorised"

Marketcap

The current crypto marketcap with information on the total amount of active currencies and markets.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const getMarketcap = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (!success) {
    console.log(error)
  }

  const token = data.token
  const marketcap = await endotech.marketcap(token)

  console.log(marketcap)
}

getMarketcap()

Success Response (Snippet)

{
  success: true,
  data: [
    {
       total: 286109263016,
       total_24h: 12022394310,
       bitcoin_percentage: 40.13,
       active_currencies: 833,
       active_assets: 795,
       active_markets: 11388,
       updated: 1529392500
    }
  ]
}

Errors

Incorrect Token Provided

"Unauthorised"

Rankings

A list of the currencies that are leading and lagging with marketcap.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const getRankings = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (!success) {
    console.log(error)
  }

  const token = data.token
  const rankings = await endotech.rankings(token)

  console.log(rankings)
}

getRankings()

Success Response (Snippet)

{
  success: true,
  data: [
    {
       leading: [
         {
           name: 'Hexx',
           symbol: 'HXX',
           volume_24h: '$478,549',
           price: '$3.11',
           percent_7d: '913.65%'
         },
       ],
       lagging: [
         {
           name: 'Influxcoin',
           symbol: 'INFX',
           volume_24h: '$194,720',
           price: '$0.328004',
           percent_7d: '-63.25%'
         },
       ],
       updated: 1519162691,
    }
  ]
}

Errors

Incorrect Token Provided

"Unauthorised"

Insight

Get the current insight for the market performance, this indicates the current state of the market from bullish to bearish.

Current States, and the definitions:

1: Bullish Trend Continues

Definition:

Typically a bullish / rising market is one that is rallying and consistently making higher highs and higher lows for the trading periods used to view the markets activity. There will always be some periods that do not make a higher high or higher low but the general picture the market shows is rising prices.

2: Bullish Consolidation

Definition:

Typically a market that is trading sideways without making significant directional moves either up or down. This is when a market is basically digesting various market influences before making a move up or down.

3: Market is in a bullish breakout

Definition:

When market is trading sideways for a while and then attempts a bullish breakout.

4: Market is in a pull back

Definition:

Reversing – This is when a market changes its general direction. So reversing from a rallying phase to a falling phase or bullish to bearish action.

5: Market is Stagnating

Definition:

Typically a market that is trading sideways without making significant directional moves either up or down. This is when a market is basically digesting various market influences before making a move up or down.

6: Market is in Reversal

Definition:

This is when a market changes its general direction. So reversing from a rallying phase to a falling phase or bullish to bearish action.

7: Market is in a Bearish Breakout

Definition:

When market is trading sideways for a while and then attempts a bearish breakout.

8: Bearish consolidation

Definition:

A market that is recovering is similar to a consolidation phase however this would typically be a period of consolidation after a significant break.

9: Bearish Trend Continues

Definition:

Typically a bearish / falling market is one that is breaking and consistently making lower Lows and lower highs for the trading periods used to view the markets activity. There will always be some periods that do not make a lower Low and lower high but the general picture the market shows is falling prices.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const getInsight = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (!success) {
    console.log(error)
  }

  const token = data.token
  const insight = await endotech.insight(token)

  console.log(insight)
}

getInsight()

Success Response (Snippet)

{
  success: true,
  data: 1,
}

Errors

Incorrect Token Provided

"Unauthorised"

Coins

A list of the coins that Endotech provides metrics for along with up to date buy/sell signals.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const getCoins = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (!success) {
    console.log(error)
  }

  const token = data.token
  const coins = await endotech.coins(token)

  console.log(coins)
}

getCoins()

Success Response (Snippet)

{
  success: true,
  data: {
    count: '98',
    list: [
      {
        id: 1,
        name: 'Bitcoin',
        symbol: 'BTC',
        alt: 'XBT',
        sector: 'Cryptocurrency',
        base: 'USD',
        exchange: 'BITFINEX',
        cap: '105903638751',
        price: 6155.83,
        supply: '17203787',
        blocked: null,
        rank: 1,
        word: { alpha: 'Sell', beta: 'Flat' },
        subscr: { alpha: true, beta: true }
      },
    ]
  }
}

Errors

Incorrect Token Provided

"Unauthorised"

Portfolios

A list of the current portfolios that Endotech deliver metrics along with all history of the performance of a given portfolio.

const Endotech = require("endotech-api-node")

const credentials = {
  email: '**email**',
  password: '**password**'
}

const endotech = Endotech()

const getPortfolios = async () => {
  const { success, data, error } = await endotech.authorise(credentials)

  if (!success) {
    console.log(error)
  }

  const token = data.token
  const portfolios = await endotech.portfolios(token)

  console.log(portfolios)
}

getPortfolios()

Success Response (Snippet)

{
  success: true,
  data: [
    'b350c89b-64e8-480d-9e5a-c2409f4c9898': {
      graph: [
        [ '2017-01-01 03:00', 0, 10000 ],
        [ '2017-01-01 11:00', 0, 10000 ],
        [ '2017-01-01 19:00', 0, 10000 ],
      ],
      change24h: '4.8%',
      change7d: '12.05%'
    }
  ]
}

Errors

Incorrect Token Provided

"Unauthorised"