{"id":16320283,"url":"https://github.com/hellonico/jquants-api-jvm","last_synced_at":"2025-07-25T15:03:58.066Z","repository":{"id":60180546,"uuid":"536393024","full_name":"hellonico/jquants-api-jvm","owner":"hellonico","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-14T04:41:49.000Z","size":965,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-11T03:12:39.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hellonico.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}},"created_at":"2022-09-14T03:03:31.000Z","updated_at":"2022-09-29T04:36:53.000Z","dependencies_parsed_at":"2022-09-26T11:10:11.999Z","dependency_job_id":null,"html_url":"https://github.com/hellonico/jquants-api-jvm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hellonico/jquants-api-jvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellonico%2Fjquants-api-jvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellonico%2Fjquants-api-jvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellonico%2Fjquants-api-jvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellonico%2Fjquants-api-jvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellonico","download_url":"https://codeload.github.com/hellonico/jquants-api-jvm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellonico%2Fjquants-api-jvm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264786637,"owners_count":23663925,"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":[],"created_at":"2024-10-10T22:43:49.786Z","updated_at":"2025-07-25T15:03:58.027Z","avatar_url":"https://github.com/hellonico.png","language":"Clojure","readme":"# hellonico/jquants-api-jvm\n\n[![Clojars Project](https://img.shields.io/clojars/v/net.clojars.hellonico/jquants-api-jvm.svg?include_prereleases)](https://clojars.org/net.clojars.hellonico/jquants-api-jvm)\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/hellonico/jquants-api-jvm/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/hellonico/jquants-api-jvm/tree/master)\n\n\n# Goal\n\njquants-api is a Clojure/JVM Wrapper around the [jquants api](https://jpx-jquants.com/).\n\nThe http based [jquants-api](https://jpx.gitbook.io/j-quants-api-en/api-reference/) propose a diverse set of daily financial data, like: \n\n- [Listed Issue](https://jpx.gitbook.io/j-quants-api-en/api-reference/listed-api) Information\n- [Stock Price](https://jpx.gitbook.io/j-quants-api-en/api-reference/prices-api) Information\n- [Market](https://jpx.gitbook.io/j-quants-api-en/api-reference/markets-api) Information\n\nTo use the jquants api, You first need to [register and create an account](https://application.jpx-jquants.com/register). \n\n![](doc/register.png)\n\nOnce you are registered, to setup your credentials for API access, you either need to:\n\n- use the login function with your username and password, or\n- create a login file as shown below:\n\n```clojure\n; In $HOME/.config/digima/login.edn\n{:mailaddress \"youremail@address.com\" :password \"yourpassword\"}\n```\n\nNote that the login function simply outputs a file at the needed location.\n\n__The jquants-api specifies a refresh token and an id token to get and refresh but this wrapper will refresh those tokens as needed without the user having to do anything.__\n\n# Usage\n\nFor each function call, the returned data structure is according the jquants api, turned into Clojure data structures / maps with keywords as keys based on the json data.\n\n\n```clojure\n(daily {:code 86970 :date 20220118})\n\n;; {:daily_quotes [{:AdjustmentVolume 498800.0\n;;                  :TurnoverValue    1.2302805E9\n;;                  :AdjustmentOpen   2482.0\n;;                  :Low              2440.5\n;;                  :AdjustmentClose  2465.0\n;;                  :Volume           498800.0\n;;                  :High             2489.0\n;;                  :Date             \"20220118\"\n;;                  :AdjustmentHigh   2489.0\n;;                  :Code             \"86970\"\n;;                  :Close            2465.0\n;;                  :AdjustmentFactor 1.0\n;;                  :AdjustmentLow    2440.5\n;;                  :Open             2482.0}]}\n```\n\n```clojure\n(statements {:code 869701 :date 20220727})\n\n;; {:statements [{:ForecastDividendPerShareAnnual                                               \"52.0\"\n;;                :ForecastOperatingProfit                                                      \"65500000000\"\n;;                :ForecastDividendPerShare2ndQuarter                                           \"26.0\"\n;;                :ForecastOrdinaryProfit                                                       \"65500000000\"\n;;                :Profit                                                                       \"12089000000\"\n;;                :TypeOfDocument                                                               \"1QFinancialStatements_Consolidated_IFRS\"\n;;                :ResultDividendPerShareFiscalYearEnd                                          \"\"\n;;                :DisclosedUnixTime                                                            \"1658923200.0\"\n;;                :ChangesInAccountingEstimates                                                 \"false\"\n;;                :DisclosureNumber                                                             \"20220726504583\"\n;;                :ResultDividendPerShare3rdQuarter                                             \"\"\n;;                :MaterialChangesInSubsidiaries                                                \"false\"\n;;                :ApplyingOfSpecificAccountingOfTheQuarterlyFinancialStatements                \"\"\n;;                :NumberOfTreasuryStockAtTheEndOfFiscalYear                                    \"1938843\"\n;;                :EarningsPerShare                                                             \"22.93\"\n;;                :OperatingProfit                                                              \"17777000000\"\n;;                :NetSales                                                                     \"33576000000\"\n;;                :LocalCode                                                                    \"86970\"\n;;                :DisclosedDate                                                                \"2022-07-27\"\n;;                :ResultDividendPerShare1stQuarter                                             \"－\"\n;;                :Equity                                                                       \"310098000000\"\n;;                :BookValuePerShare                                                            \"\"\n;;                :CurrentPeriodEndDate                                                         \"2022-06-30\"\n;;                :DisclosedTime                                                                \"12:00:00\"\n;;                :ResultDividendPerShareAnnual                                                 \"\"\n;;                :ChangesOtherThanOnesBasedOnRevisionsOfAccountingStandard                     \"false\"\n;;                :OrdinaryProfit                                                               \"17790000000\"\n;;                :RetrospectiveRestatement                                                     \"\"\n;;                :ForecastProfit                                                               \"45000000000\"\n;;                :EquityToAssetRatio                                                           \"0.004\"\n;;                :AverageNumberOfShares                                                        \"527204054\"\n;;                :CurrentFiscalYearEndDate                                                     \"2023-03-31\"\n;;                :ForecastNetSales                                                             \"132500000000\"\n;;                :TotalAssets                                                                  \"76048180000000\"\n;;                :ResultDividendPerShare2ndQuarter                                             \"\"\n;;                :ChangesBasedOnRevisionsOfAccountingStandard                                  \"false\"\n;;                :CurrentFiscalYearStartDate                                                   \"2022-04-01\"\n;;                :ForecastDividendPerShare1stQuarter                                           \"\"\n;;                :ForecastEarningsPerShare                                                     \"85.42\"\n;;                :ForecastDividendPerShareFiscalYearEnd                                        \"26.0\"\n;;                :ForecastDividendPerShare3rdQuarter                                           \"－\"\n;;                :NumberOfIssuedAndOutstandingSharesAtTheEndOfFiscalYearIncludingTreasuryStock \"528578441\"\n;;                :TypeOfCurrentPeriod                                                          \"1Q\"}]}\n```\n\n```clojure\n(listed-info {:code 10000})\n\n;; {:info [{:Code               \"86970\"\n;;          :UpdateDate         \"20220927\"\n;;          :CompanyNameFull    \"（株）日本取引所グループ\"\n;;          :MarketCode         \"A\"\n;;          :CompanyName        \"ＪＰＸ\"\n;;          :CompanyNameEnglish \"Japan Exchange Group,Inc.\"\n;;          :SectorCode         \"7200\"}]}\n```\n\n\n# Extra Code for the Wrapper\n\nThe wrapper can also create a local cache to get daily quotes based on fuzzy search for the name of the entity to get the quotes from.\n\nMeaning, instead of :\n\n```clojure\n(daily {:Code 86970 :date 20220118})\n\n;; {:daily_quotes [{:AdjustmentVolume 498800.0\n;;                  :TurnoverValue    1.2302805E9\n;;                  :AdjustmentOpen   2482.0\n;;                  :Low              2440.5\n;;                  :AdjustmentClose  2465.0\n;;                  :Volume           498800.0\n;;                  :High             2489.0\n;;                  :Date             \"20220118\"\n;;                  :AdjustmentHigh   2489.0\n;;                  :Code             \"86970\"\n;;                  :Close            2465.0\n;;                  :AdjustmentFactor 1.0\n;;                  :AdjustmentLow    2440.5\n;;                  :Open             2482.0}]}\n```\n\nYou can do:\n```clojure\n(daily-fuzzy {:CompanyNameEnglish \"Japan Exchange\" :date 20220118})\n\n;; Same as above\n;; {:daily_quotes [{:AdjustmentVolume 498800.0\n;;                  :TurnoverValue    1.2302805E9\n;;                  :AdjustmentOpen   2482.0\n;;                  :Low              2440.5\n;;                  :AdjustmentClose  2465.0\n;;                  :Volume           498800.0\n;;                  :High             2489.0\n;;                  :Date             \"20220118\"\n;;                  :AdjustmentHigh   2489.0\n;;                  :Code             \"86970\"\n;;                  :Close            2465.0\n;;                  :AdjustmentFactor 1.0\n;;                  :AdjustmentLow    2440.5\n;;                  :Open             2482.0}]}\n```\n\n# Charting\n\nThere is a [charting example](examples/charting-with-oz/src/hellonico/charting.clj) based on the [Ox](https://github.com/metasoarous/oz)\n\nWhich would open a browser window and show the following graph:\n\n![](doc/preview.png)\n\n# Jupyter Notebook example\n\nThere is a notebook example for usage with Clojure within Jupyter and Charting jquants data with oz.\n\n![](./doc/jupyter.png)\n\n\n# Java Integration\n\nThis JQuants wrapper can also be called natively from Java code, with Maps as returned object from API calls.\nMaps in Java can be accessed using query using [JXPath](https://commons.apache.org/proper/commons-jxpath/), as shown in the [java example](./examples/JavaSample/src/main/java/info/hellonico/jquantsapi/JQuantsApiSample.java) below:\n\n```java\nMap\u003c?,?\u003e result = api.daily(\"24130\", \"20220301\");\nJXPathContext context = JXPathContext.newContext(result);\nDouble open = (Double) context.getValue(\"/daily_quotes[1]/Open\");\nSystem.out.printf(\"Quote for %s on day %s is %f\\n\", code, date, open);\n\n// Outputs:\n// Quote for 24130 on day 20220301 is 4315.000000\n```\n\nAnother example shows how to chart using [quickchart.io](https://quickchart.io/):\n\n```java\nString from = \"20220301\", to = \"20220505\";\nMap\u003c?,?\u003e result = api.daily(code, from, to);\nJXPathContext context = JXPathContext.newContext(result);\n\nQuickChart chart = new QuickChart();\nchart.setWidth(500);\nchart.setHeight(300);\nString config =\n        format(\"{type: 'line',data: {labels: %s , datasets: [{label: 'Open', data:%s ,fill: false}, {label: 'Close', data:%s ,fill: false}]}}\",\n                context.selectNodes(\"//Date\"),\n                context.selectNodes(\"//Open\"),\n                context.selectNodes(\"//Close\"));\nchart.setConfig(config);\n\nSystem.out.println(chart.getUrl());\n```\n\nWhich outputs the following graph:\n\n![](doc/javachart.webp)\n\n## License\n\nCopyright © 2022 hellonico\n\nDistributed under the Eclipse Public License version 1.0.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellonico%2Fjquants-api-jvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellonico%2Fjquants-api-jvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellonico%2Fjquants-api-jvm/lists"}