metaapi.cloud SDK for Python
############################
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 <https://metaapi.cloud/#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/
This SDK requires a 3.8+ version of Python to run.
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 docstring documentation in source codes located inside lib folder of this package.
Working code examples
=====================
Please check `this short video <https://youtu.be/LIqFOOOLP-g>`_ to see how you can download samples via our web application.
You can find code examples at `examples folder of our github repo <https://github.com/metaapi/metaapi-python-sdk/tree/master/examples>`_ or in the examples folder of the pip package.
We have composed a `short guide explaining how to use the example code <https://metaapi.cloud/docs/client/usingCodeExamples/>`_
Installation
============
.. code-block:: bash
pip install metaapi-cloud-sdk
Connecting to MetaApi
=====================
Please use one of these ways:
1. https://app.metaapi.cloud/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.
.. code-block:: python
from metaapi_cloud_sdk import MetaApi
token = '...'
api = MetaApi(token=token)
Retrieving account access token
===============================
Account access token grants access to a single account. You can retrieve account access token via API:
.. code-block:: python
account_id = '...'
validity_in_hours = 24
account_access_token = await api.token_management_api.narrow_down_token(
{
'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': account_id}]
},
validity_in_hours
)
print(account_access_token)
Alternatively, you can retrieve account access token via web UI on https://app.metaapi.cloud/accounts page (see `this video <https://youtu.be/PKYiDns6_xI>`_).
Table of contents
=================
1. `MT account management <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/metaApi/managingAccounts.rst>`_
2. `MetaApi RPC API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/metaApi/rpcApi.rst>`_
3. `MetaApi real-time streaming API (websocket API) <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/metaApi/streamingApi.rst>`_
4. `Risk management API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/riskManagement.rst>`_
5. `CopyFactory copy trading API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/copyTrading.rst>`_
6. `MetaStats trading statistics API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/metaStats.rst>`_
7. `MetaApi MT manager API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/managerApi.rst>`_
8. `Tracking latencies <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/trackingLatencies.rst>`_
9. `Enable log4js logging <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/logging.rst>`_
10. `Rate limits & quotas <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/rateLimits.rst>`_
11. `Token management API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/tokenManagementApi.rst>`_
Raw data
{
"_id": null,
"home_page": null,
"name": "metaapi-cloud-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "metaapi.cloud, MetaTrader, MetaTrader 5, MetaTrader 4, MetaTrader5, MetaTrader4, MT, MT4, MT5, forex, trading, API, REST, websocket, client, sdk, cloud, free, copy trading, copytrade, copy trade, trade copying",
"author": null,
"author_email": "MetaApi <support@metaapi.cloud>",
"download_url": "https://files.pythonhosted.org/packages/04/3e/f8a73c9d5e6c957944a233521eab2b92f2ba29bbce0f6051e5497c05c774/metaapi_cloud_sdk-28.0.1.tar.gz",
"platform": null,
"description": "metaapi.cloud SDK for Python\n############################\n\nMetaApi 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.\n\nCopyFactory is a simple yet powerful copy-trading API which is a part of MetaApi. See below for CopyFactory readme section.\n\nMetaApi is a paid service, however we offer a free tier for testing and personal use.\n\nThe `MetaApi pricing <https://metaapi.cloud/#pricing>`_ was developed with the intent to make your charges less or equal to what you would have to pay\nfor hosting your own infrastructure. This is possible because over time we managed to heavily optimize\nour MetaTrader infrastructure. And with MetaApi you can save significantly on application development and\nmaintenance costs and time thanks to high-quality API, open-source SDKs and convenience of a cloud service.\n\nOfficial REST and websocket API documentation: https://metaapi.cloud/docs/client/\n\nThis SDK requires a 3.8+ version of Python to run.\n\nPlease note that this SDK provides an abstraction over REST and websocket API to simplify your application logic.\n\nFor more information about SDK APIs please check docstring documentation in source codes located inside lib folder of this package.\n\nWorking code examples\n=====================\nPlease check `this short video <https://youtu.be/LIqFOOOLP-g>`_ to see how you can download samples via our web application.\n\nYou can find code examples at `examples folder of our github repo <https://github.com/metaapi/metaapi-python-sdk/tree/master/examples>`_ or in the examples folder of the pip package.\n\nWe have composed a `short guide explaining how to use the example code <https://metaapi.cloud/docs/client/usingCodeExamples/>`_\n\nInstallation\n============\n.. code-block:: bash\n\n pip install metaapi-cloud-sdk\n\nConnecting to MetaApi\n=====================\nPlease use one of these ways:\n\n1. https://app.metaapi.cloud/token web UI to obtain your API token.\n2. An account access token which grants access to a single account. See section below on instructions on how to retrieve account access token.\n\nSupply token to the MetaApi class constructor.\n\n.. code-block:: python\n\n from metaapi_cloud_sdk import MetaApi\n\n token = '...'\n api = MetaApi(token=token)\n\nRetrieving account access token\n===============================\nAccount access token grants access to a single account. You can retrieve account access token via API:\n\n.. code-block:: python\n\n account_id = '...'\n validity_in_hours = 24\n account_access_token = await api.token_management_api.narrow_down_token(\n {\n 'applications': ['trading-account-management-api', 'copyfactory-api', 'metaapi-rest-api', 'metaapi-rpc-api', 'metaapi-real-time-streaming-api', 'metastats-api', 'risk-management-api'],\n 'roles': ['reader'],\n 'resources': [{'entity': 'account', 'id': account_id}]\n\n },\n validity_in_hours\n )\n print(account_access_token)\n\nAlternatively, you can retrieve account access token via web UI on https://app.metaapi.cloud/accounts page (see `this video <https://youtu.be/PKYiDns6_xI>`_).\n\nTable of contents\n=================\n\n1. `MT account management <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/metaApi/managingAccounts.rst>`_\n\n2. `MetaApi RPC API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/metaApi/rpcApi.rst>`_\n\n3. `MetaApi real-time streaming API (websocket API) <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/metaApi/streamingApi.rst>`_\n\n4. `Risk management API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/riskManagement.rst>`_\n\n5. `CopyFactory copy trading API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/copyTrading.rst>`_\n\n6. `MetaStats trading statistics API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/metaStats.rst>`_\n\n7. `MetaApi MT manager API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/managerApi.rst>`_\n\n8. `Tracking latencies <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/trackingLatencies.rst>`_\n\n9. `Enable log4js logging <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/logging.rst>`_\n\n10. `Rate limits & quotas <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/rateLimits.rst>`_\n\n11. `Token management API <https://github.com/metaapi/metaapi-python-sdk/blob/master/docs/tokenManagementApi.rst>`_\n",
"bugtrack_url": null,
"license": "(c) Copyright 2020-2023 MetaApi DMCC. All rights reserved See https://metaapi.cloud/terms for the license. The client library is provided as an open-source project to all metaapi.cloud users or developers free of charge provided you use it in order to implement applications which use metaapi.cloud API service. Provided the above condition is met and if needed by your project you can create derivative works from this code. However we strongly recommend you to create issues in our github repository instead, so that we can integrate the features you need into this project. The use of this code in competing projects or for implementing products which are not using metaapi.cloud API service is permitted only if you have a written approval from the MetaApi project owners. ",
"summary": "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)",
"version": "28.0.1",
"project_urls": {
"Homepage": "https://github.com/metaapi/metaapi-python-sdk"
},
"split_keywords": [
"metaapi.cloud",
" metatrader",
" metatrader 5",
" metatrader 4",
" metatrader5",
" metatrader4",
" mt",
" mt4",
" mt5",
" forex",
" trading",
" api",
" rest",
" websocket",
" client",
" sdk",
" cloud",
" free",
" copy trading",
" copytrade",
" copy trade",
" trade copying"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "99a79cbf0e7af2b2fb8276cd108f7121d6667664de325a553e1ab7bba68ad6fe",
"md5": "4c777242f18d23a0a6dbeca65eb5bd92",
"sha256": "9dfdc13bcac6c03a08913efb47cc871572bdaf97ab467d9f7ce206166cadd24e"
},
"downloads": -1,
"filename": "metaapi_cloud_sdk-28.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4c777242f18d23a0a6dbeca65eb5bd92",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 324408,
"upload_time": "2024-12-22T06:43:52",
"upload_time_iso_8601": "2024-12-22T06:43:52.966711Z",
"url": "https://files.pythonhosted.org/packages/99/a7/9cbf0e7af2b2fb8276cd108f7121d6667664de325a553e1ab7bba68ad6fe/metaapi_cloud_sdk-28.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "043ef8a73c9d5e6c957944a233521eab2b92f2ba29bbce0f6051e5497c05c774",
"md5": "0770ffa1adeae261090ffef23d0077fa",
"sha256": "a054e2f93bc158a862fe4825bf5b5f6ab5e15ca7649e270fa7a95417bce4e481"
},
"downloads": -1,
"filename": "metaapi_cloud_sdk-28.0.1.tar.gz",
"has_sig": false,
"md5_digest": "0770ffa1adeae261090ffef23d0077fa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 285017,
"upload_time": "2024-12-22T06:43:54",
"upload_time_iso_8601": "2024-12-22T06:43:54.808972Z",
"url": "https://files.pythonhosted.org/packages/04/3e/f8a73c9d5e6c957944a233521eab2b92f2ba29bbce0f6051e5497c05c774/metaapi_cloud_sdk-28.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-22 06:43:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "metaapi",
"github_project": "metaapi-python-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "metaapi-cloud-sdk"
}