{ "info": { "author": "Tom Gardiner", "author_email": "tom@teppen.io", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# questrade_api\nPython3 Questrade API Wrapper\n\n## Installation\n* Use `pip`/`pip3`:\n\n `pip3 install questrade-api`\n\n## Getting Started\n1. Familiarise yourself with the [Security documentation](https://www.questrade.com/api/documentation/security) for the Questrade API.\n2. [Generate](https://login.questrade.com/APIAccess/UserApps.aspx) a manual refresh token for your application.\n3. Init the API Wrapper with the refresh token:\n\n ```\n from questrade_api import Questrade\n q = Questrade(refresh_token='XYz1dBlop33lLLuys4Bd')\n ```\n **Important:**\n A token will be created at `~/.questrade.json` and used for future API calls\n * If the token is valid future initiations will not require a refresh token\n\n ```\n from questrade_api import Questrade\n q = Questrade()\n ```\n\n---\n\n## Using the API\n### [Time](https://www.questrade.com/api/documentation/rest-operations/account-calls/time)\n\n```\nq.time\n=> {'time': '2018-11-16T09:22:27.090000-05:00'}\n```\n\n### [Accounts](https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts)\n\n```\nq.accounts\n=> {'accounts': [{'type': 'Margin', 'number': '123456', 'status': 'Active' ...}]}\n```\n\n### [Account Positions](https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-positions)\n\nAccepts: ``\n\n```\nq.account_positions(123456)\n=> {'positions': [{'symbol': 'RY.TO', 'symbolId': 34658, 'openQuantity': ...}]}\n```\n\n### [Account Balances](https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-balances)\n\nAccepts: ``\n\n```\nq.account_balances(123456)\n=> {'perCurrencyBalances': [{'currency': 'CAD', 'cash': 1000, 'marketValue': 0, ...}]}\n```\n\n### [Account Executions](https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-executions)\n\nAccepts: ``, `startTime=`, `endTime=`\n\n```\nq.account_executions(123456)\n=> {'executions': []}\n```\n\n```\nq.account_executions(123456,startTime='2018-08-01T00:00:00-0')\n=> {'executions': [{'symbol': 'RY.TO', 'symbolId': 34658, 'quantity': 100, ...}]}\n```\n\n### [Account Orders](https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-orders)\n\nAccepts: ``, `startTime=`, `endTime=`, `stateFilter=`\n\n```\nq.account_orders(123456)\n=> {'orders': []}\n```\n\n```\nq.account_orders(123456, startTime='2018-08-01T00:00:00-0')\n=> {'orders': [{'id': 444444, 'symbol': 'RY.TO', 'symbolId': 34658, ...}]}\n```\n\n### [Account Order](https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-orders)\n\nAccepts: ``, ``\n\n```\nq.account_order(123456, 444444)\n=> {'orders': [{'id': 444444, 'symbol': 'RY.TO', 'symbolId': 34658, 'totalQuantity': 100, ...}]}\n```\n\n### [Account Activities](https://www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-activities)\n\nAccepts: ``, `startTime=`, `endTime=`\n\n```\nq.account_activities(123456)\n=> {'activities': []}\n```\n\n```\nq.account_activities(123456, startTime='2018-11-01T00:00:00-0')\n=> {'activities': []}\n```\n\n### [Symbol](https://www.questrade.com/api/documentation/rest-operations/market-calls/symbols-id)\n\nAccepts: ``\n\n```\nq.symbol(34659)\n=> {'symbols': [{'symbol': 'RY.TO 'symbolId': 34658, 'prevDayClosePrice': ...}]}\n```\n\n### [Symbols](https://www.questrade.com/api/documentation/rest-operations/market-calls/symbols-id)\n\nAccepts: `ids=','`, `names=','`\n\n```\nq.symbols(ids='34658,9339')\n=> {'symbols': [{'symbol': 'RY.TO', 'symbolId': 34658, 'prevDayClosePrice': ..}]}\n```\n\n```\nq.symbols(names='RY.TO,BNS.TO')\n=> {'symbols': [{'symbol': 'RY.TO', 'symbolId': 34658, 'prevDayClosePrice': ..}]}\n```\n\n### [Symbols Search](https://www.questrade.com/api/documentation/rest-operations/market-calls/symbols-search)\n\nAccepts: `prefix=''`, `offset=`\n\n```\nq.symbols_search(prefix='RY.TO')\n=> {'symbols': [{'symbol': 'RY.TO', 'symbolId': 34658, 'description': ...}]}\n```\n\n```\nq.symbols_search(prefix='RY', offset=5)\n{'symbols': [{'symbol': 'RY.PRE.TO', 'symbolId': 34700, 'description': ...}]}\n```\n\n### [Symbol Options](https://www.questrade.com/api/documentation/rest-operations/market-calls/symbols-id-options)\n\nAccepts: ``\n\n```\nq.symbol_options(34658)\n=> {'optionChain': [{'expiryDate': '2018-11-16T00:00:00.000000-05:00', 'description': ... }]}\n```\n\n### [Markets](https://www.questrade.com/api/documentation/rest-operations/market-calls/markets)\n\n```\nq.markets\n=> {'markets': [{'name': 'TSX', 'tradingVenues': ['TSX', 'ALPH', 'CXC', ... }]}\n```\n\n### [Markets Quote](https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-quotes-id)\n\nAccepts: ``\n\n```\nq.markets_quote(34658)\n=> {'quotes': [{'symbol': 'RY.TO', 'symbolId': 34658, 'tier': ... }]}\n```\n\n### [Markets Quotes](https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-quotes-id)\n\nAccepts: `ids=','`\n\n```\nq.markets_quotes(ids='34658,9339')\n=> {'quotes': [{'symbol': 'RY.TO', 'symbolId': 34658, 'tier': ... }]}\n```\n\n### [Markets Options](https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-quotes-options)\n\nAccepts: `optionIds=`, `filters=`\n\n```\nq.markets_options(optionIds=[\n 23615873,\n 23615874\n])\n=> {'optionQuotes': [{'underlying': 'RY.TO', 'underlyingId': 34658, 'symbol': 'RY30Nov18 ..}]}\n```\n\n```\nq.markets_options(filters=[\n {\n \"optionType\": \"Call\",\n \"underlyingId\": 34658,\n \"expiryDate\": \"2018-11-30T00:00:00.000000-05:00\",\n \"minstrikePrice\": 90,\n \"maxstrikePrice\": 100\n }\n])\n=> {'optionQuotes': [{'underlying': 'RY.TO', 'underlyingId': 34658, 'symbol': 'RY30Nov18 ..}]}\n```\n\n### [Markets Strategies](https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-quotes-strategies)\n\nAccepts: `variants=`\n\n```\nq.markets_strategies(variants=[\n {\n \"variantId\": 1,\n \"strategy\": \"Custom\",\n \"legs\": [\n {\n \"symbolId\": 23545340,\n \"ratio\": 10,\n \"action\": \"Buy\"\n },\n {\n \"symbolId\": 23008592,\n \"ratio\": 10,\n \"action\": \"Sell\"\n }\n ]\n }\n])\n=> {'strategyQuotes': [{'variantId': 1, 'bidPrice': None, 'askPrice': None, 'underlying': 'RY.TO' ...}]}\n```\n\n### [Markets Candles](https://www.questrade.com/api/documentation/rest-operations/market-calls/markets-candles-id)\n\nAccepts: ``, `startTime=`, `endTime=`, `interval=`\n\n```\nq.markets_candles(34658, interval='FiveMinutes')\n=> {'candles': [{'start': '2018-11-16T09:30:00.583000-05:00', 'end': '2018-11-16T ..}]}\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tgardiner/questrade_api", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "questrade-api", "package_url": "https://pypi.org/project/questrade-api/", "platform": "", "project_url": "https://pypi.org/project/questrade-api/", "project_urls": { "Homepage": "https://github.com/tgardiner/questrade_api" }, "release_url": "https://pypi.org/project/questrade-api/1.0.3/", "requires_dist": null, "requires_python": ">=3", "summary": "Python3 Questrade API Wrapper", "version": "1.0.3" }, "last_serial": 4787396, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "ef5f0004c1677db2e037ee11760c3166", "sha256": "e124423b0ce3322d9ab9fed1aefea7f6b6c4f751991536bb9d3293025a8ab2d4" }, "downloads": -1, "filename": "questrade_api-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ef5f0004c1677db2e037ee11760c3166", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7879, "upload_time": "2018-11-18T02:19:54", "url": "https://files.pythonhosted.org/packages/29/88/dd2aa88978a49aaa7edef5306c5bc63b86e5ef275ef5a4087ef68c65c952/questrade_api-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3f5b224e30a308a36876a23c4ce5c914", "sha256": "d3027479799e9e1ad1b54b3dfd776e9fd1b664991c64e2c35734fb23ff31e72a" }, "downloads": -1, "filename": "questrade-api-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3f5b224e30a308a36876a23c4ce5c914", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7169, "upload_time": "2018-11-18T02:19:56", "url": "https://files.pythonhosted.org/packages/f2/a9/9ad7f42108313f5097d0444b5fa87b4115484b2d16b32d3a1434d018a1aa/questrade-api-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "163badd196ea2a2eb47111414b50284e", "sha256": "6e5f6c4000d1c9d8d65c0e1e6689e1f1eb8c3f88a6362afdbb9ae5e0b04d8f58" }, "downloads": -1, "filename": "questrade_api-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "163badd196ea2a2eb47111414b50284e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7879, "upload_time": "2018-11-18T02:26:30", "url": "https://files.pythonhosted.org/packages/b9/1d/c0aa61e492f3d73a749dc894dd2af51640f2f45c54d60776003cf0640430/questrade_api-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "432364f27f8832cb6a949a78bf78b85d", "sha256": "a03761f01bd0910b90e4302a65fef4309a083115a4cca5a88328f10d4fbc4e31" }, "downloads": -1, "filename": "questrade-api-1.0.1.tar.gz", "has_sig": false, "md5_digest": "432364f27f8832cb6a949a78bf78b85d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7165, "upload_time": "2018-11-18T02:26:32", "url": "https://files.pythonhosted.org/packages/8d/dc/7f3867ec06c3af08d4d4ee90921c48185fa9db45ce95c0b9363c8c874c26/questrade-api-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "90fef736b9bac50c83b1478a18a53694", "sha256": "4ebee11fd0e45c34ab664d93dd881b3c459ac50bb5335ca4bc0a6206591cdda6" }, "downloads": -1, "filename": "questrade_api-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "90fef736b9bac50c83b1478a18a53694", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7894, "upload_time": "2019-01-01T05:16:41", "url": "https://files.pythonhosted.org/packages/79/8e/19223a398cf59a1a0e548786077c576b867f350ccbed2f4cfd2ca7e05ab9/questrade_api-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "07be02f83c5217acea6ade099751b94f", "sha256": "034e042a207a2285606e4e47c46c4e68dbf2fdc1ec3a256d4a7a906ed38564a5" }, "downloads": -1, "filename": "questrade-api-1.0.2.tar.gz", "has_sig": false, "md5_digest": "07be02f83c5217acea6ade099751b94f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 7210, "upload_time": "2019-01-01T05:16:45", "url": "https://files.pythonhosted.org/packages/8c/b9/52a9e65b9a358363becd2d4920a94d42ed8e236e585cfcc857b3c89ca25d/questrade-api-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "0046dc70021288de5aba5cccfb545541", "sha256": "aeca5c459c42b48923684bbd42c3738aad3023728d7b793a598de8890802b109" }, "downloads": -1, "filename": "questrade_api-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "0046dc70021288de5aba5cccfb545541", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7931, "upload_time": "2019-02-06T16:10:55", "url": "https://files.pythonhosted.org/packages/f1/ff/c37f985fa98d2e5c404b549c4f270dfc0a7b59768826d194f7eb0d11b1e7/questrade_api-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a9bd720d41b276a0df6ac93c30ed438", "sha256": "c73d3b0a12b50c61572a09fa2e1ab00d5d5a99fd94af3babd49e97da49913969" }, "downloads": -1, "filename": "questrade-api-1.0.3.tar.gz", "has_sig": false, "md5_digest": "0a9bd720d41b276a0df6ac93c30ed438", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 7274, "upload_time": "2019-02-06T16:10:58", "url": "https://files.pythonhosted.org/packages/43/62/e392c06de7cae04444cabe58a45f338ac1bd4349831af18deedcd62b1acc/questrade-api-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0046dc70021288de5aba5cccfb545541", "sha256": "aeca5c459c42b48923684bbd42c3738aad3023728d7b793a598de8890802b109" }, "downloads": -1, "filename": "questrade_api-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "0046dc70021288de5aba5cccfb545541", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7931, "upload_time": "2019-02-06T16:10:55", "url": "https://files.pythonhosted.org/packages/f1/ff/c37f985fa98d2e5c404b549c4f270dfc0a7b59768826d194f7eb0d11b1e7/questrade_api-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a9bd720d41b276a0df6ac93c30ed438", "sha256": "c73d3b0a12b50c61572a09fa2e1ab00d5d5a99fd94af3babd49e97da49913969" }, "downloads": -1, "filename": "questrade-api-1.0.3.tar.gz", "has_sig": false, "md5_digest": "0a9bd720d41b276a0df6ac93c30ed438", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 7274, "upload_time": "2019-02-06T16:10:58", "url": "https://files.pythonhosted.org/packages/43/62/e392c06de7cae04444cabe58a45f338ac1bd4349831af18deedcd62b1acc/questrade-api-1.0.3.tar.gz" } ] }