npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

metaapi.cloud-sdk

v29.0.0

Published

SDK for MetaApi, a professional cloud forex API which includes MetaTrader REST API and MetaTrader websocket API. Supports both MetaTrader 5 (MT5) and MetaTrader 4 (MT4). CopyFactory copy trading API included. (https://metaapi.cloud)

Downloads

9,992

Readme

metaapi.cloud SDK for node.js and browser javascript

MetaApi is a powerful, fast, cost-efficient, easy to use and standards-driven cloud forex trading API for MetaTrader 4 and MetaTrader 5 platform designed for traders, investors and forex application developers to boost forex application development process. MetaApi can be used with any broker and does not require you to be a brokerage.

CopyFactory is a simple yet powerful copy-trading API which is a part of MetaApi. See below for CopyFactory readme section.

MetaApi is a paid service, however we offer a free tier for testing and personal use.

The MetaApi pricing was developed with the intent to make your charges less or equal to what you would have to pay for hosting your own infrastructure. This is possible because over time we managed to heavily optimize our MetaTrader infrastructure. And with MetaApi you can save significantly on application development and maintenance costs and time thanks to high-quality API, open-source SDKs and convenience of a cloud service.

Official REST and websocket API documentation: https://metaapi.cloud/docs/client/

Please note that this SDK provides an abstraction over REST and websocket API to simplify your application logic.

For more information about SDK APIs please check esdoc documentation in source codes located inside lib folder of this npm package.

Working code examples

Please check this short video to see how you can download samples via our web application.

You can also find code examples at examples folder of our github repo or in the examples folder of the npm package.

We have composed a short guide explaining how to use the example code

Installation

npm install --save metaapi.cloud-sdk

Installing SDK in browser SPA applications

npm install --save metaapi.cloud-sdk

Examples of integration with :

  1. Angular
  2. React
  3. Vue

Installing SDK in browser HTML applications

<script src="unpkg.com/metaapi.cloud-sdk"></script>
<script>
  const token = '...';
  const api = new MetaApi.default(token);
</script>

Details of integration into HTML.

Using SDK within native Node ECMAScript modules

import MetaApi from 'metaapi.cloud-sdk/esm-node';

const token = '...';
const api = new MetaApi(token);

Connecting to MetaApi

Please use one of these ways:

  1. https://app.metaapi.cloud/api-access/generate-token web UI to obtain your API token.
  2. An account access token which grants access to a single account. See section below on instructions on how to retrieve account access token.

Supply token to the MetaApi class constructor.

import MetaApi from 'metaapi.cloud-sdk';

const token = '...';
const api = new MetaApi(token);

Retrieving account access token

Account access token grants access to a single account. You can retrieve account access token via token management API:

const accountId = '...';
const validityInHours = 24;
const accountAccessToken = await api.tokenManagementApi.narrowDownToken(
  {
    applications: ['trading-account-management-api', 'copyfactory-api', 'metaapi-rest-api', 'metaapi-rpc-api', 'metaapi-real-time-streaming-api', 'metastats-api', 'risk-management-api'],
    roles: ['reader'],
    resources: [{entity: 'account', id: accountId}]
  }, 
  validityInHours
);
console.log(accountAccessToken);

Alternatively, you can retrieve account access token via web UI. For that go to https://app.metaapi.cloud/accounts page and choose "Account access token" option in the trading account card actions menu.

Table of contents

  1. MT account management

  2. MetaApi RPC API

  3. MetaApi real-time streaming API (websocket API)

  4. Risk management API

  5. CopyFactory copy trading API

  6. MetaStats trading statistics API

  7. MetaApi MT manager API

  8. Tracking latencies

  9. Enable log4js logging

  10. Rate limits & quotas

  11. Token Management API

  12. Intergration for Web UI