{"id":21447151,"url":"https://github.com/metaapi/metaapi-metastats-python-sdk","last_synced_at":"2025-07-14T19:31:45.849Z","repository":{"id":206157690,"uuid":"715978298","full_name":"metaapi/metaapi-metastats-python-sdk","owner":"metaapi","description":"Python SDK for MetaStats forex trading statistics API. Supports MetaTrader 5 (MT5) and MetaTrader 4 (MT4)","archived":false,"fork":false,"pushed_at":"2024-11-21T00:27:22.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-21T00:35:34.264Z","etag":null,"topics":["api","cloud","forex","metaapi","metaapi-cloud","metastats","metatrader","metatrader4","metatrader5","metrics","mt4","mt4-api","mt5","mt5-api","python","rest","trading"],"latest_commit_sha":null,"homepage":"https://metaapi.cloud","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metaapi.png","metadata":{"files":{"readme":"README.rst","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-11-08T08:16:07.000Z","updated_at":"2024-11-21T00:26:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ede8b09-ab4e-4f12-bb7a-9431a24c6558","html_url":"https://github.com/metaapi/metaapi-metastats-python-sdk","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"24378c726c945789d3680419d27fc13dd6fb4bf6"},"previous_names":["metaapi/metaapi-metastats-python-sdk"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaapi%2Fmetaapi-metastats-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaapi%2Fmetaapi-metastats-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaapi%2Fmetaapi-metastats-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaapi%2Fmetaapi-metastats-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metaapi","download_url":"https://codeload.github.com/metaapi/metaapi-metastats-python-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225994848,"owners_count":17556830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cloud","forex","metaapi","metaapi-cloud","metastats","metatrader","metatrader4","metatrader5","metrics","mt4","mt4-api","mt5","mt5-api","python","rest","trading"],"created_at":"2024-11-23T03:09:00.815Z","updated_at":"2025-07-14T19:31:45.816Z","avatar_url":"https://github.com/metaapi.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"MetaStats forex metrics API\n###########################\nMetaStats is a fast, cost-efficient, easy to use and standards-driven cloud forex trading statistics API supporting\nboth MetaTrader 4 and MetaTrader 5 platforms designed to boost forex application development process.\n\nUsing MetaStats API you can develop applications similar to Myfxbook or MetriX extremely fast, saving time you\notherwise spend for coding, optimizing and testing your own trading metrics calculation engine, since we already\ndid it for you.\n\nMetaStats API is a member of MetaApi project (`https://metaapi.cloud \u003chttps://metaapi.cloud\u003e`_), a powerful cloud forex\ntrading API which supports both MetaTrader 4 and MetaTrader 5 platforms.\n\nThis SDK requires a 3.8+ version of Python to run.\n\nMetaStats API features\n======================\nFeatures supported:\n\n- support for MetaTrader 4 and MetaTrader 5 platforms\n- metrics calculation for MetaTrader accounts added to MetaApi\n- optionally include open positions in metrics calculation\n- get historical trades for MetaApi account. The historical trades data is updated when you invoke metrics calculation\n  endpoint or when set query parameter updateHistory to true\n- get open trades for MetaApi account\n\nThe features described above are available for use via a professional, fast, easy to use, standards-driven REST API\nwhich can be easily consumed from any programming language.\n\nThe primary intended use of MetaStats API is creating trade monitoring applications.\n\nPricing\n=======\nMetaStats is available to all MetaApi users without extra charges at this point.\n\nYou pay a fee executing MetaTrader terminal on MetaApi cloud. See\n`https://metaapi.cloud/#pricing \u003chttps://metaapi.cloud/#pricing\u003e`_ for more details.\nIn some cases a free tier access can be available.\n\nFrequently asked questions (FAQ)\n================================\nFAQ is located here: `http://metaapi.cloud/docs/metastats/faq/ \u003chttp://metaapi.cloud/docs/metastats/faq/\u003e`_\n\nREST API documentation\n======================\nMetaStats SDK is built on top of MetaStats REST API.\n\nMetaStats REST API docs are available at\n`https://metaapi.cloud/docs/metastats/ \u003chttps://metaapi.cloud/docs/metastats/\u003e`_\n\nCode examples\n=============\nWe published some code examples in our github repository, namely:\n\n- Python: `https://github.com/metaapi/metaapi-metastats-python-sdk/tree/master/examples \u003chttps://github.com/metaapi/metaapi-metastats-python-sdk/tree/master/\u003e`_\n\nInstallation\n============\n.. code-block:: bash\n\n    pip install metaapi-cloud-sdk\n\nRetrieving API token\n====================\nPlease visit `https://app.metaapi.cloud/token \u003chttps://app.metaapi.cloud/token\u003e`_ web UI to obtain your API token.\n\nConfiguring trading statistics\n==============================\n.. code-block:: python\n\n    from metaapi_cloud_sdk import MetaStats\n\n    token = '...'\n    api = MetaStats(token=token)\n\nSee in-code documentation for full definition of possible configuration options.\n\nRetrieving trading statistics\n=============================\n.. code-block:: python\n\n    account_id = '...'  #  MetaApi account id\n\n    # retrieve MetaApi MetaTrader account statistics\n    print(await metaStats.get_metrics(account_id=account_id))\n\n    # retrieve MetaApi MetaTrader account statistics including open positions\n    print(await metaStats.get_metrics(account_id=account_id, include_open_positions=True))\n\n    # retrieve MetaApi MetaTrader account trades\n    print(await metaStats.get_account_trades(account_id=account_id, start_time='2020-01-01 00:00:00.000',\n                                             end_time='2021-01-01 00:00:00.000'))\n\n    # retrieve MetaApi MetaTrader account open trades\n    print(await metaStats.get_account_open_trades(account_id=account_id))\n\n    # reset MetaApi MetaTrader account metrics\n    print(await metaStats.reset_metrics(account_id=account_id))\n\nQuotas and rate limits\n======================\nAPI calls you make are subject to rate limits. See `https://metaapi.cloud/docs/metastats/rateLimiting/ \u003chttps://metaapi.cloud/docs/metastats/rateLimiting/\u003e`_ for more details.\n\nRelated projects:\n=================\nSee our website for the full list of APIs and features supported `https://metaapi.cloud/#features \u003chttps://metaapi.cloud/#features\u003e`_\n\nSome of the APIs you might decide to use together with this module:\n\n1. MetaApi cloud forex trading API `https://metaapi.cloud/docs/client/ \u003chttps://metaapi.cloud/docs/client/\u003e`_\n2. CopyFactory copy trading  API `https://metaapi.cloud/docs/copyfactory/ \u003chttps://metaapi.cloud/docs/copyfactory/\u003e`_\n3. MetaTrader account management API `https://metaapi.cloud/docs/provisioning/ \u003chttps://metaapi.cloud/docs/provisioning/\u003e`_\n4. MetaApi MT manager API `https://metaapi.cloud/docs/manager/ \u003chttps://metaapi.cloud/docs/manager/\u003e`_\n5. MetaApi risk management API `https://metaapi.cloud/docs/risk-management/ \u003chttps://metaapi.cloud/docs/risk-management/\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaapi%2Fmetaapi-metastats-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetaapi%2Fmetaapi-metastats-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaapi%2Fmetaapi-metastats-python-sdk/lists"}