Skip to main content

Python SDK for MetaStats forex trading statistics API. Can calculate metrics for MetaTrader accounts added to MetaApi. Supports both MetaTrader 5 (MT5) and MetaTrader 4 (MT4). (

Project description

MetaStats is a fast, cost-efficient, easy to use and standards-driven cloud forex trading statistics API supporting both MetaTrader 4 and MetaTrader 5 platforms designed to boost forex application development process.

Using MetaStats API you can develop applications similar to Myfxbook or MetriX extremely fast, saving time you otherwise spend for coding, optimizing and testing your own trading metrics calculation engine, since we already did it for you.

MetaStats API is a member of MetaApi project (, a powerful cloud forex trading API which supports both MetaTrader 4 and MetaTrader 5 platforms.

MetaStats API features

Features supported:

  • support for MetaTrader 4 and MetaTrader 5 platforms

  • metrics calculation for MetaTrader accounts added to MetaApi

  • optionally include open positions in metrics calculation

The features described above are available for use via a professional, fast, easy to use, standards-driven REST API which can be easily consumed from any programming language.

The primary intended use of MetaStats API is creating trade monitoring applications.


MetaStats is available to all MetaApi users without extra charges at this point.

You pay only an affordable fee for MetaApi MetaTrader terminal hosting. See for more details.

MetaApi provides a free tier so that you can test our APIs without any charges.

Frequently asked questions (FAQ)

FAQ is located here:

REST API documentation

MetaStats SDK is built on top of MetaStats REST API.

MetaStats REST API docs are available at

Code examples

We published some code examples in our github repository, namely:


pip install metaapi-cloud-sdk

Retrieving API token

Please visit web UI to obtain your API token.

Configuring trading statistics

from metaapi_cloud_sdk import MetaStats

token = '...'
api = MetaStats(token=token)

See in-code documentation for full definition of possible configuration options.

Retrieving trading statistics

account_id = '...'  #  MetaApi account id

# retrieve MetaApi MetaTrader account statistics
print(await metaStats.get_metrics(account_id=account_id))

# retrieve MetaApi MetaTrader account statistics including open positions
print(await metaStats.get_metrics(account_id=account_id, include_open_positions=True))

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metaapi_cloud_metastats_sdk-1.0.0.tar.gz (14.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page