{"id":32480453,"url":"https://github.com/teramonagi/bitflyer","last_synced_at":"2026-07-08T12:31:18.849Z","repository":{"id":55096578,"uuid":"138744501","full_name":"teramonagi/bitflyer","owner":"teramonagi","description":"R wrapper for bitFlyer's REST API","archived":false,"fork":false,"pushed_at":"2021-01-11T02:28:19.000Z","size":69,"stargazers_count":2,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-09T04:16:10.294Z","etag":null,"topics":["bitflyer","bitflyer-api","r"],"latest_commit_sha":null,"homepage":null,"language":"R","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/teramonagi.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-26T13:47:31.000Z","updated_at":"2021-01-11T02:28:22.000Z","dependencies_parsed_at":"2022-08-14T11:50:34.963Z","dependency_job_id":null,"html_url":"https://github.com/teramonagi/bitflyer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/teramonagi/bitflyer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teramonagi%2Fbitflyer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teramonagi%2Fbitflyer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teramonagi%2Fbitflyer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teramonagi%2Fbitflyer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teramonagi","download_url":"https://codeload.github.com/teramonagi/bitflyer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teramonagi%2Fbitflyer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281202129,"owners_count":26460564,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bitflyer","bitflyer-api","r"],"created_at":"2025-10-27T01:58:54.508Z","updated_at":"2025-10-27T01:59:02.486Z","avatar_url":"https://github.com/teramonagi.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\n```\n\n# bitflyer \n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/teramonagi/bitflyer/workflows/R-CMD-check/badge.svg)](https://github.com/teramonagi/bitflyer/actions)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n\u003c!-- badges: end --\u003e\n\nR wrapper for [bitFlyer's API](https://lightning.bitflyer.com/docs/api?lang=en)\n\n## Installation\n\n```{r gh-installation, eval = FALSE}\n# Not yet on CRAN\n# install.packages(\"bitflyer\")\n\n# Install the development version from GitHub:\n# install.packages(\"devtools\")\ndevtools::install_github(\"teramonagi/bitflyer\")\n```\n\n## Preparation of API keys\nbitFlyer Private APIs require authentication using an API Key and API Secret. \n\nThey can be obtained by generating them on the [developer's page](https://lightning.bitflyer.com/developer).\n\nYou must set these keys in `.Renviron`\n\n```bash\n❯ cat ~/.Renviron \nBITFLYER_LIGHTNING_API_KEY=\u003cyour-api-key\u003e\nBITFLYER_LIGHTNING_API_SECRET=\u003cyour-api-secret\u003e\n```\nor as global variables in R\n\n```{r, eval=FALSE}\n\u003e BITFLYER_LIGHTNING_API_KEY \u003c- \"your-api-key\"\n\u003e BITFLYER_LIGHTNING_API_SECRET \u003c- \"your-api-secret\"\n```\n\n## Example\n\n### HTTP API\n#### [HTTP Public API](https://lightning.bitflyer.com/docs/api?lang=en#http-public-api)\n\n```{r public_api}\nlibrary(\"bitflyer\")\n# Get the list of market\nfromJSON(markets())\n\n# Get order book\nx \u003c- board(product_code = \"BTC_JPY\")\nx \u003c- fromJSON(x)\nstr(x)\n\n# Ticker \nticker(product_code = \"BTC_JPY\")\n\n# Execution History\nhead(fromJSON(executions()))\n\n# Get orderbook status\nfromJSON(get_board_state())\n\n# Get the current status of the exchange.\nget_health()\n```\n\n#### [HTTP Private API](https://lightning.bitflyer.com/docs/api?lang=en#http-private-api)\n\n\nThe results of this chunk are hidden because you really understand of my portfolio/positions ...\n\n```{r private_api, eval=FALSE}\n# Get a list of which HTTP Private APIs can be used with the specified API key\nfromJSON(get_permissions())\n\n# Get Margin Status\nfromJSON(get_collateral())\n\n#Send a New Order\nx \u003c- send_child_order(\n  product_code = \"BTC_JPY\", \n  child_order_type = \"LIMIT\", \n  side = \"BUY\", \n  price = 300*10^4, \n  size = 0.001\n)\nx\nchild_order_acceptance_id \u003c- fromJSON(x)$child_order_acceptance_id\n\n# List Orders\nfromJSON(get_child_orders(product_code = \"BTC_JPY\", child_order_acceptance_id=child_order_acceptance_id))\n# You can also get all active orders\n# fromJSON(get_child_orders(product_code = \"BTC_JPY\", child_order_state=\"ACTIVE\"))\n\n# Cancel the order\ncancel_child_order(product_code = \"BTC_JPY\", child_order_acceptance_id = child_order_acceptance_id)\n# You can also cancel all child orders\n# cancel_all_child_orders(product_code = \"BTC_JPY\")\n\n# No active orders (Check)\nfromJSON(get_child_orders(product_code = \"BTC_JPY\", child_order_state=\"ACTIVE\"))\n\n# Get balance\nfromJSON(get_balance())\n\n# Get Parent Order Details\nget_parent_orders(product_code = \"BTC_JPY\")\n\n# List Executions\nfromJSON(get_executions(product_code = \"BTC_JPY\"))\n\n# List Balance History\nfromJSON(get_balance_history())\n\n# Get Open Interest Summary\nget_positions()\n\n# Get Margin Change History\nfromJSON(get_collateral_history())\n\n# Get Trading Commission\nget_trading_commission(product_code = \"BTC_JPY\")\n```\n\nThe following APIs are not implemented yet.\n\n- [Deposits and Withdrawals](https://lightning.bitflyer.com/docs?lang=en#get-crypto-assets-deposit-addresses) APIs\n- [Submit New Parent Order (Special order)](https://lightning.bitflyer.com/docs?lang=en#submit-new-parent-order-special-order) API\n  - Endpoint: `/v1/me/sendparentorder`\n\n### Realtime API\n... Not implemented yet(under development) ...\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteramonagi%2Fbitflyer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteramonagi%2Fbitflyer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteramonagi%2Fbitflyer/lists"}