For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install equibles_cryptos --save
If the library is hosted at a git repository, e.g. https://github.com/equibles/cryptos-javascript then install it via:
npm install equibles/cryptos-javascript --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var EquiblesCryptos = require('equibles_cryptos');
var defaultClient = EquiblesCryptos.ApiClient.instance;
// Configure API key authorization: Query String
var Query String = defaultClient.authentications['Query String'];
Query String.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Query String.apiKeyPrefix['ApiKey'] = "Token"
var api = new EquiblesCryptos.CryptosApi()
var opts = {
'page': 1, // {Number} The number of the page to request.
'pageSize': 100 // {Number} The number of elements in each page. Max value: 100.
};
api.list(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
All URIs are relative to https://api.equibles.com
Class | Method | HTTP request | Description |
---|---|---|---|
EquiblesCryptos.CryptosApi | list | GET /cryptos/list | Get a list of all the available crytocurrencies. |
EquiblesCryptos.CryptosApi | profile | GET /cryptos/profile | The profile of this cryptocurrency. |
EquiblesCryptos.PricesApi | endOfDay | GET /cryptos/prices/endofday | Lists the end of day prices for a given cryptocurrency. |
EquiblesCryptos.PricesApi | intraday | GET /cryptos/prices/intraday | Lists the intraday prices for a given cryptocurrency with one minute precision. |
- EquiblesCryptos.AssetType
- EquiblesCryptos.CryptoCurrencyProfile
- EquiblesCryptos.CryptoCurrencyProfileResponse
- EquiblesCryptos.CryptoCurrencyProfilesResponse
- EquiblesCryptos.Exchange
- EquiblesCryptos.Image
- EquiblesCryptos.Price
- EquiblesCryptos.PricesResponse
- EquiblesCryptos.ResponseStatus
- Type: API key
- API key parameter name: ApiKey
- Location: URL query string