{"id":24496853,"url":"https://github.com/10mohi6/bitflyer-api-python-client","last_synced_at":"2025-04-14T04:14:21.035Z","repository":{"id":53473322,"uuid":"132346942","full_name":"10mohi6/bitflyer-api-python-client","owner":"10mohi6","description":"bitflyer-client is a python client (sync/async) library for bitflyer api","archived":false,"fork":false,"pushed_at":"2022-12-08T04:49:57.000Z","size":11,"stargazers_count":2,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T04:14:15.234Z","etag":null,"topics":["api","async","bitflyer","client","python","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/10mohi6.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-06T14:36:39.000Z","updated_at":"2019-04-22T18:36:02.000Z","dependencies_parsed_at":"2023-01-24T16:00:11.236Z","dependency_job_id":null,"html_url":"https://github.com/10mohi6/bitflyer-api-python-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10mohi6%2Fbitflyer-api-python-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10mohi6%2Fbitflyer-api-python-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10mohi6%2Fbitflyer-api-python-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10mohi6%2Fbitflyer-api-python-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/10mohi6","download_url":"https://codeload.github.com/10mohi6/bitflyer-api-python-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819408,"owners_count":21166477,"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","async","bitflyer","client","python","wrapper"],"created_at":"2025-01-21T21:19:07.196Z","updated_at":"2025-04-14T04:14:20.987Z","avatar_url":"https://github.com/10mohi6.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bitflyer-client\n\n[![PyPI version](https://badge.fury.io/py/bitflyer-client.svg)](https://badge.fury.io/py/bitflyer-client) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nbitflyer-client is a python client (sync/async) library for bitflyer api\n\n## Installation\n\n    $ pip install bitflyer-client\n\n## Usage\n\n```python\n#\n# sync\n#\nfrom bitflyer_client.sync import Client\n\nclient = Client(public_key='your api key', private_key='your api secret')\nresponse = client.markets()\nprint(response.status_code, response.json())\n\n#\n# async\n#\nimport grequests\nfrom bitflyer_client.async import Async\n\nclient = Async(public_key='your api key', private_key='your api secret')\nreqs = [client.markets(), client.board(), client.ticker(), ...]\nresponse = grequests.map(reqs)\nfor r in response:\n\tprint(r.status_code, r.json())\n\n#\n# /v1/markets\n#\nclient.markets()\n# [{ \"product_code\": \"BTC_JPY\" },{ \"product_code\": \"FX_BTC_JPY\" },{ \"product_code\": \"ETH_BTC\" },{\"product_code\": \"BTCJPY28APR2017\",\"alias\": \"BTCJPY_MAT1WK\"},{\"product_code\": \"BTCJPY05MAY2017\",\"alias\": \"BTCJPY_MAT2WK\"}]\n\n#\n# /v1/board\n#\nclient.board()\n# {\"mid_price\": 33320,\"bids\": [{\"price\": 30000,\"size\": 0.1},{\"price\": 25570,\"size\": 3}],\"asks\": [{\"price\": 36640,\"size\": 5},{\"price\": 36700,\"size\": 1.2}]}\n\n#\n# /v1/ticker\n#\nclient.ticker()\n# {\"mid_price\": 33320,\"bids\": [{\"price\": 30000,\"size\": 0.1},{\"price\": 25570,\"size\": 3}],\"asks\": [{\"price\": 36640,\"size\": 5},{\"price\": 36700,\"size\": 1.2}]}\n\n#\n# /v1/executions\n#\nclient.executions()\n# [{\"id\": 39287,\"side\": \"BUY\",\"price\": 31690,\"size\": 27.04,\"exec_date\": \"2015-07-08T02:43:34.823\",\"buy_child_order_acceptance_id\": \"JRF20150707-200203-452209\",\"sell_child_order_acceptance_id\": \"JRF20150708-024334-060234\"},{\"id\": 39286,\"side\": \"SELL\",\"price\": 33170,\"size\": 0.36,\"exec_date\": \"2015-07-08T02:43:34.72\",\"buy_child_order_acceptance_id\": \"JRF20150708-010230-400876\",\"sell_child_order_acceptance_id\": \"JRF20150708-024334-197755\"}]\n\n#\n# /v1/getboardstate\n#\nclient.getboardstate()\n# {\"health\": \"NORMAL\",\"state\": \"RUNNING\",}{\"health\": \"NORMAL\",\"state\": \"MATURED\",\"data\": {\"special_quotation\": 410897}}\n\n#\n# /v1/gethealth\n#\nclient.gethealth()\n# {\"status\": \"NORMAL\"}\n\n#\n# /v1/getchats\n#\nclient.getchats()\n# [{\"nickname\": \"User1234567\",\"message\": \"Hello world!\",\"date\": \"2016-02-16T10:58:08.833\"},{\"nickname\": \"ビット太郎\",\"message\": \"サンプルメッセージ\",\"date\": \"2016-02-15T10:18:06.67\"}]\n\n#\n# /v1/me/getpermissions\n#\nclient.getpermissions()\n# [\"/v1/me/getpermissions\",\"/v1/me/getbalance\",\"/v1/me/getcollateral\",\"/v1/me/getchildorders\",\"/v1/me/getparentorders\",\"/v1/me/getparentorder\",\"/v1/me/getexecutions\",\"/v1/me/getpositions\"]\n\n#\n# /v1/me/getbalance\n#\nclient.getbalance()\n# [{\"currency_code\": \"JPY\",\"amount\": 1024078,\"available\": 508000},{\"currency_code\": \"BTC\",\"amount\": 10.24,\"available\": 4.12},{\"currency_code\": \"ETH\",\"amount\": 20.48,\"available\": 16.38}]\n\n#\n# /v1/me/getcollateral\n#\nclient.getcollateral()\n# {\"collateral\": 100000,\"open_position_pnl\": -715,\"require_collateral\": 19857,\"keep_rate\": 5.000}\n\n#\n# /v1/me/getcollateralaccounts\n#\nclient.getcollateralaccounts()\n# [{\"currency_code\": \"JPY\",\"amount\": 10000},{\"currency_code\": \"BTC\",\"amount\": 1.23}]\n\n#\n# /v1/me/getaddresses\n#\nclient.getaddresses()\n# [{\"type\": \"NORMAL\",\"currency_code\": \"BTC\",\"address\": \"3AYrDq8zhF82NJ2ZaLwBMPmaNziaKPaxa7\"},{\"type\": \"NORMAL\",\"currency_code\": \"ETH\",\"address\": \"0x7fbB2CC24a3C0cd3789a44e9073381Ca6470853f\"}]\n\n#\n# /v1/me/getcoinins\n#\nclient.getcoinins()\n# [{\"id\": 100,\"order_id\": \"CDP20151227-024141-055555\",\"currency_code\": \"BTC\",\"amount\": 0.00002,\"address\": \"1WriteySQufKZ2pVuM1oMhPrTtTVFq35j\",\"tx_hash\": \"9f92ee65a176bb9545f7becb8706c50d07d4cee5ffca34d8be3ef11d411405ae\",\"status\": \"COMPLETED\",\"event_date\": \"2015-11-27T08:59:20.301\"}]\n\n#\n# /v1/me/getcoinouts\n#\nclient.getcoinouts()\n# [{\"id\": 500,\"order_id\": \"CWD20151224-014040-077777\",\"currency_code\": \"BTC\",\"amount\": 0.1234,\"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\"tx_hash\": \"724c07dfd4044abcb390b0412c3e707dd5c4f373f0a52b3bd295ce32b478c60a\",\"fee\": 0.0005,\"additional_fee\": 0.0001,\"status\": \"COMPLETED\",\"event_date\": \"2015-12-24T01:40:40.397\"}]\n\n#\n# /v1/me/getbankaccounts\n#\nclient.getbankaccounts()\n# [{\"id\": 3402,\"is_verified\": true,\"bank_name\": \"三井住友銀行\",\"branch_name\": \"アオイ支店\",\"account_type\": \"普通\",\"account_number\": \"1111111\",\"account_name\": \"ビットフライヤータロウ\"}]\n\n#\n# /v1/me/getdeposits\n#\nclient.getdeposits()\n# [{\"id\": 300,\"order_id\": \"MDP20151014-101010-033333\",\"currency_code\": \"JPY\",\"amount\": 10000,\"status\": \"COMPLETED\",\"event_date\": \"2015-10-14T10:10:10.001\"}]\n\n#\n# /v1/me/withdraw\n#\nclient.withdraw(bank_account_id=1234, amount=12000, code=012345)\n# {\"message_id\": \"69476620-5056-4003-bcbe-42658a2b041b\"}\n\n#\n# /v1/me/getwithdrawals\n#\nclient.getwithdrawals()\n# [{\"id\": 700,\"order_id\": \"MWD20151020-090909-011111\",\"currency_code\": \"JPY\",\"amount\": 12000,\"status\": \"COMPLETED\",\"event_date\": \"2015-10-20T09:09:09.416\"}]\n\n#\n# /v1/me/sendchildorder\n#\nclient.sendchildorder(price=30000, size=0.1)\n# 200 OK\n\n#\n# /v1/me/cancelchildorder\n#\nclient.cancelchildorder(child_order_id='JOR20150707-055555-022222')\n# 200 OK\n\n#\n# /v1/me/sendparentorder\n#\nclient.sendparentorder()\n# 200 OK\n\n#\n# /v1/me/cancelparentorder\n#\nclient.cancelparentorder()\n# 200 OK\n\n#\n# /v1/me/cancelallchildorders\n#\nclient.cancelallchildorders()\n# 200 OK\n\n#\n# /v1/me/getchildorders\n#\ndata = client.getchildorders()\nprint(data)\n# [{\"id\": 138398,\"child_order_id\": \"JOR20150707-084555-022523\",\"product_code\": \"BTC_JPY\",\"side\": \"BUY\",\"child_order_type\": \"LIMIT\",\"price\": 30000,\"average_price\": 30000,\"size\": 0.1,\"child_order_state\": \"COMPLETED\",\"expire_date\": \"2015-07-14T07:25:52\",\"child_order_date\": \"2015-07-07T08:45:53\",\"child_order_acceptance_id\": \"JRF20150707-084552-031927\",\"outstanding_size\": 0,\"cancel_size\": 0,\"executed_size\": 0.1,\"total_commission\": 0},{\"id\": 138397,\"child_order_id\": \"JOR20150707-084549-022519\",\"product_code\": \"BTC_JPY\",\"side\": \"SELL\",\"child_order_type\": \"LIMIT\",\"price\": 30000,\"average_price\": 0,\"size\": 0.1,\"child_order_state\": \"CANCELED\",\"expire_date\": \"2015-07-14T07:25:47\",\"child_order_date\": \"2015-07-07T08:45:47\",\"child_order_acceptance_id\": \"JRF20150707-084547-396699\",\"outstanding_size\": 0,\"cancel_size\": 0.1,\"executed_size\": 0,\"total_commission\": 0}]\n\n#\n# /v1/me/getparentorders\n#\nclient.getparentorders()\n# [{\"id\": 138398,\"parent_order_id\": \"JCO20150707-084555-022523\",\"product_code\": \"BTC_JPY\",\"side\": \"BUY\",\"parent_order_type\": \"STOP\",\"price\": 30000,\"average_price\": 30000,\"size\": 0.1,\"parent_order_state\": \"COMPLETED\",\"expire_date\": \"2015-07-14T07:25:52\",\"parent_order_date\": \"2015-07-07T08:45:53\",\"parent_order_acceptance_id\": \"JRF20150707-084552-031927\",\"outstanding_size\": 0,\"cancel_size\": 0,\"executed_size\": 0.1,\"total_commission\": 0},{\"id\": 138397,\"parent_order_id\": \"JCO20150707-084549-022519\",\"product_code\": \"BTC_JPY\",\"side\": \"SELL\",\"parent_order_type\": \"IFD\",\"price\": 30000,\"average_price\": 0,\"size\": 0.1,\"parent_order_state\": \"CANCELED\",\"expire_date\": \"2015-07-14T07:25:47\",\"parent_order_date\": \"2015-07-07T08:45:47\",\"parent_order_acceptance_id\": \"JRF20150707-084547-396699\",\"outstanding_size\": 0,\"cancel_size\": 0.1,\"executed_size\": 0,\"total_commission\": 0}]\n\n#\n# /v1/me/getparentorder\n#\nclient.getparentorder(parent_order_id=4242)\n# {\"id\": 4242,\"parent_order_id\": \"JCO20150925-046876-036161\",\"order_method\": \"IFDOCO\",\"minute_to_expire\": 10000,\"parameters\": [{\"product_code\": \"BTC_JPY\",\"condition_type\": \"LIMIT\",\"side\": \"BUY\",\"price\": 30000,\"size\": 0.1,\"trigger_price\": 0,\"offset\": 0}, {\"product_code\": \"BTC_JPY\",\"condition_type\": \"LIMIT\",\"side\": \"SELL\",\"price\": 32000,\"size\": 0.1,\"trigger_price\": 0,\"offset\": 0}, {\"product_code\": \"BTC_JPY\",\"condition_type\": \"STOP_LIMIT\",\"side\": \"SELL\",\"price\": 28800,\"size\": 0.1,\"trigger_price\": 29000,\"offset\": 0}],\"parent_order_acceptance_id\": \"JRF20150925-060559-396699\"}\n\n#\n# /v1/me/getexecutions\n#\nclient.getexecutions()\n# [{\"id\": 37233,\"child_order_id\": \"JOR20150707-060559-021935\",\"side\": \"BUY\",\"price\": 33470,\"size\": 0.01,\"commission\": 0,\"exec_date\": \"2015-07-07T09:57:40.397\",\"child_order_acceptance_id\": \"JRF20150707-060559-396699\"},{\"id\": 37232,\"child_order_id\": \"JOR20150707-060426-021925\",\"side\": \"BUY\",\"price\": 33470,\"size\": 0.01,\"commission\": 0,\"exec_date\": \"2015-07-07T09:57:40.397\",\"child_order_acceptance_id\": \"JRF20150707-060559-396699\"}]\n\n#\n# /v1/me/getpositions\n#\nclient.getpositions()\n# [{\"product_code\": \"FX_BTC_JPY\",\"side\": \"BUY\",\"price\": 36000,\"size\": 10,\"commission\": 0,\"swap_point_accumulate\": -35,\"require_collateral\": 120000,\"open_date\": \"2015-11-03T10:04:45.011\",\"leverage\": 3,\"pnl\": 965,\"sfd\": -0.5}]\n\n#\n# /v1/me/getcollateralhistory\n#\nclient.getcollateralhistory()\n# [{\"id\": 4995,\"currency_code\": \"JPY\",\"change\": -6,\"amount\": -6,\"reason_code\": \"CLEARING_COLL\",\"date\": \"2017-05-18T02:37:41.327\"},{\"id\": 4994,\"currency_code\": \"JPY\",\"change\": 2083698,\"amount\": 0,\"reason_code\": \"EXCHANGE_COLL\",\"date\": \"2017-04-28T03:05:07.493\"},{\"id\": 4993,\"currency_code\": \"BTC\",\"change\": -14.69001618,\"amount\": 34.97163164,\"reason_code\": \"EXCHANGE_COLL\",\"date\": \"2017-04-28T03:05:07.493\"}]\n\n#\n# /v1/me/gettradingcommission\n#\nclient.gettradingcommission(product_code='BTC_JPY')\n# {\"commission_rate\": 0.001}\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10mohi6%2Fbitflyer-api-python-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F10mohi6%2Fbitflyer-api-python-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10mohi6%2Fbitflyer-api-python-client/lists"}