Skip to main content

gmo-fx-py

GMOが提供するFX用APIのSDKです。 GMOのAPIについてはこちらのリファレンスを参照してください。

インストール

pip install gmo-fx

使い方

各APIのエンドポイントの頭にgetをつけたメソッドを定義しています。 そのメソッドを実行することで、APIの呼び出しを行います。 ※例:「KLine情報の取得」APIの場合

from gmo_fx import KlinesApi, KlineInterval, Symbol
from datetime import datetime

response = KlinesApi()(
  symbol=Symbol.USD_JPY,
  price_type="BID",
  interval=KlineInterval.M1, # 1分足
  date=datetime.now(),
)
print(response.klines)

タイムアウト

各APIクラスのコンストラクタにtimeoutを指定すると、API呼び出しのタイムアウトを設定できます。 値はrequestsのtimeoutにそのまま渡されます。 秒数、または(接続タイムアウト, 読み取りタイムアウト)のタプルを指定してください。 未指定(None)の場合はタイムアウトせず、応答があるまで待ち続けます。

from gmo_fx.api.klines import KlinesApi
from gmo_fx.api.order import OrderApi

# Public API
klines_api = KlinesApi(timeout=10)

# Private API
order_api = OrderApi(api_key="API_KEY", secret_key="SECRET_KEY", timeout=(3.05, 10))

タイムアウトした場合はrequests.exceptions.Timeoutが送出されます。

from requests.exceptions import Timeout

try:
    response = klines_api(...)
except Timeout:
    # 再試行などを行う
    ...

Metadata

Release files for gmo-fx 0.16.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gmo-fx 0.16.0
File Size Uploaded Provenance Actions
gmo_fx-0.16.0.tar.gz 37.4 kB With provenance Details for gmo_fx-0.16.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gmo-fx 0.16.0
File Interpreter ABI Platform Actions
gmo_fx-0.16.0-py3-none-any.whl Python 3 none any Details for gmo_fx-0.16.0-py3-none-any.whl

Total release size: 114.3 kB

Release files / gmo_fx-0.16.0.tar.gz

Download URL gmo_fx-0.16.0.tar.gz
Size 37.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8f73151c5668c24c1a9f55dcb708d9c91ec3c3e7a34ad38113d14b3076c72658
BLAKE2b-256 checksum
How to use checksums
9fe806908e03fc81039f3c5c659058104d9ea9136ce8d6b4df4ec567b17e146c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / gmo_fx-0.16.0-py3-none-any.whl

Download URL gmo_fx-0.16.0-py3-none-any.whl
Size 76.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7b60786b7e502a184ce0f7d233b456af35ba3bc2ef2aa4fa37773a1cfd3a7c3
BLAKE2b-256 checksum
How to use checksums
ac2a9f366fdf030abc664e7a702fc5d1cf83e592b67c4ba420eab4080ee27312
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for gmo-fx 0.16.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gmo_fx-0.16.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page