New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cryptoapis.io

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cryptoapis.io

Cryptoapis SDK

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
63
decreased by-10%
Maintainers
1
Weekly downloads
 
Created
Source

Cryptoapis.io

CryptoAPIs SDK for all Exchanges endpoints. You can get API key here.

Table of Contents

Install

$ npm install cryptoapis.io

How to use

const CryptoApis = require('cryptoapis.io');

const apiKey = 'your API key';

var caClient = new CryptoApis(apiKey);

caClient.getAllExchanges().then(function(result) {

    console.log(result);
}, function(error) {
    console.log(error);
});

Check out CryptoAPIs documentation for more information.

Functions

constructor

Parameters

getAllExchanges

Get a detailed list of all supported exchanges provided by CryptoAPIs.

Parameters
  • skip (optional) (Number Offset results. Default value is 0
  • limit (optional) (Number Limit results. Default limit is 100
Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var skip = 0;
var limit = 20;
var caClient = new CryptoApis(apiKey);
caClient.getAllExchanges(skip, limit).then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

getAllAssets

Get detailed list of all associated assets.

Parameters
  • skip (optional) (Number Offset results. Default value is 0
  • limit (optional) (Number Limit results. Default limit is 100
Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var skip = 0;
var limit = 5;
var caClient = new CryptoApis(apiKey);
caClient.getAllAssets(skip, limit).then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

getAllSymbols

Get a detailed list of all symbol mappings.

Parameters
  • skip (optional) (Number Offset results. Default value is 0
  • limit (optional) (Number Limit results. Default limit is 100
Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var skip = 0;
var limit = 10;
var caClient = new CryptoApis(apiKey);
caClient.getAllSymbols(skip, limit).then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

getSpecificRate

Get exchange rates between pair of requested assets.

Parameters
  • baseAsset String Base asset identifier
  • quoteAsset String Quote asset identifier
Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getSpecificRate('BTC', 'USD').then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

getAllCurrentRates

Get the current exchange rate between requested asset and all other assets.

Parameters
  • baseAsset String Base asset identifier
Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getAllCurrentRates('BTC').then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

getOHLCVPeriods

Get full list of time periods available for requesting OHLCV data.

Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getOHLCVPeriods().then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

getOHLCVLatestData

Get OHLCV latest time-series data for requested symbol and period, returned in time descending order.

Parameters
  • symbol String Symbol identifier used to filter response.
  • period String Period
  • limit (optional) (Number Limit results. Default limit is 100
Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getOHLCVLatestData('5bfc329f9c40a100014dc5a7', '1day', 10).then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

getOHLCVHistoricalData

Get OHLCV time-series data for requested symbol and period, returned in time ascending order.

Parameters
  • symbol String Symbol identifier used to filter response.
  • period String Period
  • timePeriodStart (Number | String) Time period start
  • timePeriodEnd (Number | String) Time period end
  • limit (optional) (Number Limit results. Default limit is 100
Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.getOHLCVHistoricalData('5bfc329f9c40a100014dc5a7', '1day', 1542955177, 1556355177, 2).then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

tradesGetLatestData

Get latest trades from all symbols up to 1 hour ago

Parameters
  • skip (optional) (Number Offset results. Default value is 0
  • limit (optional) (Number Limit results. Default limit is 100
Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.tradesGetLatestData(0, 10).then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

tradesGetLatestDataBySymbol

Get latest trades from a specific symbol without time limitation

Parameters
  • symbol String Symbol identifier used to filter response.
Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.tradesGetLatestDataBySymbol('5bfc329f9c40a100014dc5a7').then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

tradesGetHistoricalData

Get history transactions from specific symbol, returned in time ascending order. If no start & end time is defined, your data results will be provided 24 hours back, by default.

Parameters
  • symbol_id String Symbol identifier used to filter response.
  • timeStart (Number | String) Time start
  • timeEnd (Number | String) Time end
  • skip (optional) (Number Offset results. Default value is 0
  • limit (optional) (Number Limit results. Default limit is 100
Example
const CryptoApis = require('cryptoapis.io');
const apiKey = 'your API key';
var caClient = new CryptoApis(apiKey);
caClient.tradesGetHistoricalData('5bfc329f9c40a100014dc5a7', 1542955177, 1556355177, 0, 10).then(function(result) {
    console.log(result);
}, function(error) {
    console.log(error);
});

License

MIT

Keywords

FAQs

Package last updated on 03 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc