{"id":21447155,"url":"https://github.com/metaapi/metaapi-metastats-javascript-sdk","last_synced_at":"2025-06-11T01:06:00.797Z","repository":{"id":206157689,"uuid":"715972872","full_name":"metaapi/metaapi-metastats-javascript-sdk","owner":"metaapi","description":"Javascript SDK for MetaStats forex trading statistics API. Supports MetaTrader 5 (MT5) and MetaTrader 4 (MT4)","archived":false,"fork":false,"pushed_at":"2025-03-16T06:03:35.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-11T21:18:00.175Z","etag":null,"topics":["api","cloud","forex","javascript","metaapi","metaapi-cloud","metastats","metatrader","metatrader4","metatrader5","metrics","mt4","mt4-api","mt5","mt5-api","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.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-08T08:00:50.000Z","updated_at":"2025-05-01T11:31:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"1e752adc-5214-42c9-a88d-27706371d3d8","html_url":"https://github.com/metaapi/metaapi-metastats-javascript-sdk","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"c2ced622c132f80497ecf461b98dd363e62d6498"},"previous_names":["metaapi/metaapi-metastats-javascript-sdk"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaapi%2Fmetaapi-metastats-javascript-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaapi%2Fmetaapi-metastats-javascript-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaapi%2Fmetaapi-metastats-javascript-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaapi%2Fmetaapi-metastats-javascript-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metaapi","download_url":"https://codeload.github.com/metaapi/metaapi-metastats-javascript-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaapi%2Fmetaapi-metastats-javascript-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259178484,"owners_count":22817385,"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","javascript","metaapi","metaapi-cloud","metastats","metatrader","metatrader4","metatrader5","metrics","mt4","mt4-api","mt5","mt5-api","rest","trading"],"created_at":"2024-11-23T03:09:03.075Z","updated_at":"2025-06-11T01:06:00.782Z","avatar_url":"https://github.com/metaapi.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# MetaStats forex metrics API\nMetaStats 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.\n\nUsing 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.\n\nMetaStats API is a member of MetaApi project ([https://metaapi.cloud](https://metaapi.cloud)), a powerful cloud forex trading API which supports both MetaTrader 4 and MetaTrader 5 platforms.\n\n## MetaStats API features\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 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 which can be easily consumed from any programming language.\n\nThe primary intended use of MetaStats API is creating trade monitoring applications.\n\n## Pricing\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 [https://metaapi.cloud/#pricing](https://metaapi.cloud/#pricing) for more details. In some cases a free tier access can be available.\n\n## Frequently asked questions (FAQ)\nFAQ is located here: [http://metaapi.cloud/docs/metastats/faq/](http://metaapi.cloud/docs/metastats/faq/)\n\n## REST API documentation\nMetaStats SDK is built on top of MetaStats REST API.\n\nMetaStats REST API docs are available at [https://metaapi.cloud/docs/metastats/](https://metaapi.cloud/docs/metastats/)\n\n## Code examples\nWe published some code examples in our github repository, namely:\n\n- Javascript: [https://github.com/metaapi/metaapi-javascript-sdk/tree/master/examples/node/metastats](https://github.com/metaapi/metaapi-javascript-sdk/tree/master/examples/node/metastats)\n\n## Installation\n```bash\nnpm install --save metaapi.cloud-sdk\n```\n\n## Installing SDK in browser SPA applications\n```bash\nnpm install --save metaapi.cloud-sdk\n```\n\n## Installing SDK in browser HTML applications\n```html\n\u003cscript src=\"unpkg.com/metaapi.cloud-sdk\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    const token = '...';\n    const metaStats = new MetaStats(token);\n\u003c/script\u003e\n```\n## Retrieving API token\nPlease visit [https://app.metaapi.cloud/token](https://app.metaapi.cloud/token) web UI to obtain your API token.\n\n## Configuring trading statistics\n```javascript\nimport {MetaStats} from 'metaapi.cloud-sdk';\n\nconst token = '...';\nconst metaStats = new MetaStats(token);\n```\nSee esdoc in-code documentation for full definition of possible configuration options.\n\n## Retrieving trading statistics\n```javascript\nlet accountId = '...'; // MetaApi account id\n\n// retrieve MetaApi MetaTrader account statistics\nconsole.log(await metaStats.getMetrics(accountId));\n\n// retrieve MetaApi MetaTrader account statistics including open positions\nconsole.log(await metaStats.getMetrics(accountId, true));\n\n// retrieve MetaApi MetaTrader account trades\nconsole.log(await metaStats.getAccountTrades(accountId, '2020-01-01 00:00:00.000', '2021-01-01 00:00:00.000'));\n\n// retrieve MetaApi MetaTrader account open trades\nconsole.log(await metaStats.getAccountOpenTrades(accountId));\n\n// reset MetaApi MetaTrader account metrics\nconsole.log(await metaStats.resetMetrics(accountId));\n```\n\n## Quotas and rate limits\nAPI calls you make are subject to rate limits. See [https://metaapi.cloud/docs/metastats/rateLimiting/](https://metaapi.cloud/docs/metastats/rateLimiting/) for more details.\n\n## Related projects:\nSee our website for the full list of APIs and features supported [https://metaapi.cloud/#features](https://metaapi.cloud/#features)\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/](https://metaapi.cloud/docs/client/)\n2. CopyFactory copy trading API [https://metaapi.cloud/docs/copyfactory/](https://metaapi.cloud/docs/copyfactory/)\n3. MetaTrader account management API [https://metaapi.cloud/docs/provisioning/](https://metaapi.cloud/docs/provisioning/)\n4. MetaApi MT manager API [https://metaapi.cloud/docs/manager/](https://metaapi.cloud/docs/manager/)\n5. MetaApi risk management API [https://metaapi.cloud/docs/risk-management/](https://metaapi.cloud/docs/risk-management/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaapi%2Fmetaapi-metastats-javascript-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetaapi%2Fmetaapi-metastats-javascript-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaapi%2Fmetaapi-metastats-javascript-sdk/lists"}