Skip to main content

jquants-api-client

PyPI version

個人投資家向けデータAPI配信サービス「 J-Quants API 」のPythonクライアントライブラリです。 J-QuantsやAPI仕様についての詳細を知りたい方は 公式ウェブサイト をご参照ください。 現在、J-Quants APIはベータ版サービスとして提供されています。

使用方法

pip経由でインストールします。

pip install jquants-api-client

J-Quants API のリフレッシュトークン取得

J-Quants APIを利用するためには J-Quants API の Web サイト から取得できる リフレッシュトークンが必要になります。

サンプルコード

from datetime import datetime
from dateutil import tz
import jquantsapi

my_refresh_token:str = "*****"
cli = jquantsapi.Client(refresh_token=my_refresh_token)
df = cli.get_price_range(
    start_dt=datetime(2022, 7, 25, tzinfo=tz.gettz("Asia/Tokyo")),
    end_dt=datetime(2022, 7, 26, tzinfo=tz.gettz("Asia/Tokyo")),
)
print(df)

APIレスポンスがDataframeの形式で取得できます。

       Code       Date  ...  AdjustmentClose  AdjustmentVolume
0     13010 2022-07-25  ...           3630.0            8100.0
1     13050 2022-07-25  ...           2023.0           54410.0
2     13060 2022-07-25  ...           2001.0          943830.0
3     13080 2022-07-25  ...           1977.5          121300.0
4     13090 2022-07-25  ...          43300.0             391.0
...     ...        ...  ...              ...               ...
4189  99930 2022-07-26  ...           1426.0            5600.0
4190  99940 2022-07-26  ...           2605.0            7300.0
4191  99950 2022-07-26  ...            404.0           13000.0
4192  99960 2022-07-26  ...           1255.0            4000.0
4193  99970 2022-07-26  ...            825.0          133600.0

[8388 rows x 14 columns]

対応API

ラッパー群 

J-Quants API の各APIエンドポイントに対応しています。

  • get_id_token
  • get_listed_info
  • get_listed_sections
  • get_market_segments
  • get_prices_daily_quotes
  • get_fins_statements
  • get_fins_announcement

ユーティリティ群

日付範囲を指定して一括でデータ取得して、取得したデータを結合して返すようなユーティリティが用意されています。

  • get_list
  • get_price_range
  • get_statements_range

動作確認

Python 3.10で動作確認を行っています。 J-Quants APIは現在β版のため、本ライブラリも今後仕様が変更となる可能性があります。

開発

J-Quants API Clientの開発に是非ご協力ください。 Github上でIssueやPull Requestをお待ちしております。

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jquants-api-client-0.1.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jquants_api_client-0.1.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file jquants-api-client-0.1.1.tar.gz.

File metadata

  • Download URL: jquants-api-client-0.1.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.5 Linux/5.15.0-1014-azure

File hashes

Hashes for jquants-api-client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 452d8ea4c0f7623a0df8101212279f441945b43b6797ace315b4c43a7a9b8097
MD5 c4b089957da7851fab32be2db87ebd80
BLAKE2b-256 c2a7b5947c86923d54107741882884bcc2cc3d970e5cfaf462e4a29c6dd9558c

See more details on using hashes here.

File details

Details for the file jquants_api_client-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: jquants_api_client-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.5 Linux/5.15.0-1014-azure

File hashes

Hashes for jquants_api_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 911af4133e175505b1d4d139bc83447dc7957f6716ac92da182b0f2dbad6bc7d
MD5 2739f2ae23d31109295136f785bf4a9c
BLAKE2b-256 86f7c44369ba9354c281ac65c19053c800da749d88765239fbeb357dce381e08

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page