### GET /assets Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetch asset balances. ```APIDOC ## GET /assets ### Description Fetch asset balances. ### Method GET ### Endpoint /assets ### Response #### Success Response (200) - **data** (array) - List of asset balances including amount, available, conversionRate, and symbol. #### Response Example { "status": 0, "data": [ { "amount": "993982448", "available": "993982448", "conversionRate": "1", "symbol": "JPY" }, { "amount": "4.0002", "available": "4.0002", "conversionRate": "859614", "symbol": "BTC" } ], "responsetime": "2019-03-19T02:15:06.055Z" } ``` -------------------------------- ### GET /assets Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetches all asset balances for your account. Requires authentication. ```APIDOC ## GET /assets ### Description Fetch all asset balances for your account. Requires authentication. ### Method GET ### Endpoint /assets ### Response #### Success Response (200) - **data** (array) - An array of asset objects, each containing: - **symbol** (string) - The asset symbol (e.g., JPY, BTC). - **amount** (string) - The total amount of the asset. - **available** (string) - The available amount of the asset. - **conversionRate** (string) - The conversion rate of the asset to a base currency. ### Response Example ```json { "status": 0, "data": [ {"amount": "993982448", "available": "993982448", "conversionRate": "1", "symbol": "JPY"}, {"amount": "4.0002", "available": "4.0002", "conversionRate": "859614", "symbol": "BTC"} ] } ``` ``` -------------------------------- ### GET /margin Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetch margin summary information. ```APIDOC ## GET /margin ### Description Fetch margin summary. ### Method GET ### Endpoint /margin ### Response #### Success Response (200) - **data** (object) - Margin data including actualProfitLoss, availableAmount, margin, marginCallStatus, marginRatio, profitLoss, and transferableAmount. #### Response Example { "status": 0, "data": { "actualProfitLoss": "68286188", "availableAmount": "57262506", "margin": "1021682", "marginCallStatus": "NORMAL", "marginRatio": "6683.6", "profitLoss": "0", "transferableAmount": "57262506" }, "responsetime": "2019-03-19T02:15:06.051Z" } ``` -------------------------------- ### GET /margin Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetches margin/collateral summary for your account. Requires authentication. ```APIDOC ## GET /margin ### Description Fetch margin/collateral summary for your account. Requires authentication. ### Method GET ### Endpoint /margin ### Response #### Success Response (200) - **data** (object) - An object containing margin details: - **actualProfitLoss** (string) - The actual profit or loss. - **availableAmount** (string) - The available amount for trading. - **margin** (string) - The current margin amount. - **marginCallStatus** (string) - The status of margin call (NORMAL, MARGIN_CALL, LOSSCUT). - **marginRatio** (string) - The margin ratio percentage. - **profitLoss** (string) - Profit and loss value. ### Response Example ```json { "status": 0, "data": { "actualProfitLoss": "68286188", "availableAmount": "57262506", "margin": "1021682", "marginCallStatus": "NORMAL", "marginRatio": "6683.6", "profitLoss": "0" } } ``` ``` -------------------------------- ### GET /position-summary Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Retrieves a summary of current positions. ```APIDOC ## GET /position-summary ### Description Fetch position summary. ### Parameters #### Query Parameters - **symbol** (str) - Optional - Margin symbol filter. ### Response Example { "status": 0, "data": { "list": [ { "averagePositionRate": "715656", "positionLossGain": "250675", "side": "BUY", "symbol": "BTC_JPY" } ] }, "responsetime": "2019-03-19T02:15:06.102Z" } ``` -------------------------------- ### GET /tradingVolume Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetch trading volume information. ```APIDOC ## GET /tradingVolume ### Description Fetch trading volume information. ### Method GET ### Endpoint /tradingVolume ### Response #### Success Response (200) - **data** (object) - Trading volume data including jpyVolume, tierLevel, and limit details. #### Response Example { "status": 0, "data": { "jpyVolume": "9988888", "tierLevel": 1, "limit": [ { "symbol": "BTC/JPY", "todayLimitOpenSize": "10000", "takerFee": "0", "makerFee": "0" } ] }, "responsetime": "2019-03-19T02:15:06.055Z" } ``` -------------------------------- ### Initialize Client and Get Ticker Data Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/index.md Instantiate the client using environment variables and fetch ticker information for BTC_JPY. Ensure your API keys are set in the environment. ```python from gmocoin_client import Client client = Client.from_env() ticker = client.get_ticker(symbol="BTC_JPY") print(ticker.data) ``` -------------------------------- ### GET /open-positions Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetches a list of currently open margin trading positions. ```APIDOC ## GET /open-positions ### Description Fetch open positions. ### Parameters #### Query Parameters - **symbol** (str) - Required - Margin trading symbol (e.g., “BTC_JPY”). - **page** (int) - Optional - Page number. - **count** (int) - Optional - Page size. ### Response Example { "status": 0, "data": { "pagination": { "currentPage": 1, "count": 30 }, "list": [ { "positionId": 1234567, "symbol": "BTC_JPY", "side": "BUY", "size": "0.22", "price": "876045" } ] }, "responsetime": "2019-03-19T02:15:06.095Z" } ``` -------------------------------- ### Open Positions Response Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Example JSON response structure for fetching open positions. ```json { "status": 0, "data": [637000,637002], "responsetime": "2019-03-19T01:07:24.557Z" } ``` -------------------------------- ### GET /fiatDeposits Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetch fiat deposit history. ```APIDOC ## GET /fiatDeposits ### Description Fetch fiat deposit history. ### Method GET ### Endpoint /fiatDeposits ### Parameters #### Query Parameters - **from_timestamp** (str) - Required - Start time in UTC ISO8601 format with milliseconds. - **to_timestamp** (str) - Optional - End time in UTC ISO8601 format with milliseconds. ### Response #### Success Response (200) - **data** (array) - List of fiat deposit records. #### Response Example { "status": 0, "data": [ { "amount": "50000", "fee": "0", "status": "EXECUTED", "symbol": "JPY", "timestamp": "2021-01-01T13:47:12.791Z" } ], "responsetime": "2024-02-28T11:48:57.996Z" } ``` -------------------------------- ### GET /orders Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetch order information by order IDs. ```APIDOC ## GET /orders ### Description Fetch order information by order IDs. ### Parameters #### Query Parameters - **order_ids** (Iterable/str/int) - Required - Order ID or list of order IDs. ### Response #### Success Response (200) - **data** (object) - Order list data. #### Response Example { "status": 0, "data": { "list": [ { "orderId": 223456789, "symbol": "BTC_JPY", "status": "EXECUTED" } ] }, "responsetime": "2019-03-19T02:15:06.059Z" } ``` -------------------------------- ### GET /symbols Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetches trading rules and symbol information. ```APIDOC ## GET /symbols ### Description Fetches trading rules and symbol information. ### Method GET ### Endpoint /public/v1/symbols ### Parameters None. ### Response #### Success Response (200) - **status** (int) - API response status code. - **data** (array) - A list of symbol rule items. - **symbol** (string) - The trading symbol. - **name** (string) - The name of the symbol. - **openingTime** (string) - The opening time for trading the symbol. - **closingTime** (string) - The closing time for trading the symbol. - **minimumOrderQuantity** (string) - The minimum order quantity for the symbol. - **maximumOrderQuantity** (string) - The maximum order quantity for the symbol. - **minimumLotSize** (string) - The minimum lot size for the symbol. - **maximumLotSize** (string) - The maximum lot size for the symbol. - **tickSize** (string) - The minimum price change for the symbol. - **margin** (string) - The margin requirement for the symbol. - **makerFeeRate** (string) - The maker fee rate. - **takerFeeRate** (string) - The taker fee rate. - **takerBuyFeeRate** (string) - The taker buy fee rate. - **takerSellFeeRate** (string) - The taker sell fee rate. - **symbolTradeStatus** (string) - The trading status of the symbol. - **responsetime** (string) - Timestamp of the response. #### Response Example (Example response structure would be similar to other public endpoints, containing status, data, and responsetime. The 'data' field would be an array of symbol rule objects.) ``` -------------------------------- ### GET /get_position_summary Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch aggregated position summary. ```APIDOC ## GET /get_position_summary ### Description Fetch aggregated position summary. Requires authentication. ### Parameters #### Query Parameters - **symbol** (string) - Optional - The trading symbol ``` -------------------------------- ### Position Summary Response Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Example JSON response structure for retrieving a summary of current positions. ```json { "status": 0, "data": { "pagination": { "currentPage": 1, "count": 30 }, "list": [ { "positionId": 1234567, "symbol": "BTC_JPY", "side": "BUY", "size": "0.22", "orderdSize": "0", "price": "876045", "lossGain": "14", "leverage": "4", "losscutPrice": "766540", "timestamp": "2019-03-19T02:15:06.094Z" } ] }, "responsetime": "2019-03-19T02:15:06.095Z" } ``` -------------------------------- ### GET /v1/orderbooks Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch the order book snapshot for a specific symbol. ```APIDOC ## GET /v1/orderbooks ### Description Fetch the order book snapshot for a specific symbol. Returns the current asks and bids with price levels and sizes. ### Method GET ### Parameters #### Query Parameters - **symbol** (string) - Required - The trading symbol ### Response #### Success Response (200) - **status** (integer) - Status code - **data** (object) - Contains asks and bids arrays #### Response Example { "status": 0, "data": { "asks": [{"price": "455659", "size": "0.1"}], "bids": [{"price": "455600", "size": "0.2"}], "symbol": "BTC" } } ``` -------------------------------- ### GET /orderbooks Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetches the order book snapshot for a specified symbol. ```APIDOC ## GET /orderbooks ### Description Fetches the order book snapshot for a specified symbol. ### Method GET ### Endpoint /public/v1/orderbooks ### Parameters #### Query Parameters - **symbol** (string) - Required. The target symbol (e.g., "BTC"). ### Response #### Success Response (200) - **status** (int) - API response status code. - **data** (object) - Order book data. - **asks** (array) - List of ask orders. - **price** (string) - The price of the ask order. - **size** (string) - The size of the ask order. - **bids** (array) - List of bid orders. - **price** (string) - The price of the bid order. - **size** (string) - The size of the bid order. - **symbol** (string) - The trading symbol. - **responsetime** (string) - Timestamp of the response. #### Response Example ```json { "status": 0, "data": { "asks": [ { "price": "455659", "size": "0.1" } ], "bids": [ { "price": "455659", "size": "0.1" } ], "symbol": "BTC" }, "responsetime": "2019-03-19T02:15:06.026Z" } ``` ``` -------------------------------- ### GET /get_open_positions Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch open margin positions for a symbol. ```APIDOC ## GET /get_open_positions ### Description Fetch open margin positions for a symbol. Requires authentication. ### Parameters #### Query Parameters - **symbol** (string) - Required - The trading symbol (e.g., BTC_JPY) - **page** (integer) - Optional - Page number - **count** (integer) - Optional - Number of records to return ### Response #### Response Example {"status": 0, "data": {"list": [{"positionId": 1234567, "side": "BUY", "size": "0.22"}]}} ``` -------------------------------- ### GET /v1/status Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch the current service status of the GMO Coin exchange. ```APIDOC ## GET /v1/status ### Description Fetch the current service status of the GMO Coin exchange. Returns whether the exchange is open, in maintenance, or in pre-open state. ### Method GET ### Response #### Success Response (200) - **status** (integer) - Status code - **data** (object) - Contains the status string - **responsetime** (string) - ISO timestamp of the response #### Response Example { "status": 0, "data": {"status": "OPEN"}, "responsetime": "2019-03-19T02:15:06.001Z" } ``` -------------------------------- ### GET /status Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetches the current service status of the GMO Coin API. ```APIDOC ## GET /status ### Description Fetches the current service status of the GMO Coin API. ### Method GET ### Endpoint /public/v1/status ### Parameters None. ### Response #### Success Response (200) - **status** (int) - API response status code. - **data** (object) - Service status data. - **status** (string) - Current service status (e.g., "OPEN"). - **responsetime** (string) - Timestamp of the response. #### Response Example ```json { "status": 0, "data": { "status": "OPEN" }, "responsetime": "2019-03-19T02:15:06.001Z" } ``` ``` -------------------------------- ### GET /get_orders Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch order information by one or more order IDs. ```APIDOC ## GET /get_orders ### Description Fetch order information by order IDs. ### Parameters #### Query Parameters - **order_id** (integer/list) - Required - Single order ID or list of order IDs ### Response #### Success Response (200) - **data** (object) - Contains a list of order details including orderId, symbol, side, executionType, status, size, executedSize, and price. ``` -------------------------------- ### GET /depositHistory Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetch cryptocurrency deposit history for a specific asset. ```APIDOC ## GET /depositHistory ### Description Fetch cryptocurrency deposit history. ### Parameters #### Query Parameters - **symbol** (str) - Required - Asset symbol to filter (e.g., “BTC”). - **from_timestamp** (str) - Required - Start time in UTC ISO8601 format with milliseconds. - **to_timestamp** (str) - Optional - End time in UTC ISO8601 format with milliseconds. ### Response #### Success Response (200) - **data** (list) - List of deposit history records. #### Response Example { "status": 0, "data": [ { "address": "xxx", "amount": "0.9503", "status": "EXECUTED", "symbol": "BTC", "timestamp": "2021-10-05T06:04:46.241Z", "txHash": "yyy" } ], "responsetime": "2024-02-28T12:20:07.103Z" } ``` -------------------------------- ### GET /fiatWithdrawals Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetch fiat withdrawal history. ```APIDOC ## GET /fiatWithdrawals ### Description Fetch fiat withdrawal history. ### Method GET ### Endpoint /fiatWithdrawals ### Parameters #### Query Parameters - **from_timestamp** (str) - Required - Start time in UTC ISO8601 format with milliseconds. - **to_timestamp** (str) - Optional - End time in UTC ISO8601 format with milliseconds. ### Response #### Success Response (200) - **data** (array) - List of fiat withdrawal records. #### Response Example { "status": 0, "data": [ { "amount": "50000", "fee": "0", "status": "EXECUTED", "symbol": "JPY", "timestamp": "2021-01-01T13:47:12.791Z" } ], "responsetime": "2024-02-28T11:48:57.996Z" } ``` -------------------------------- ### Get Order Book Snapshot Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch the current order book for a given symbol. This provides a snapshot of current buy and sell orders at various price levels. ```python from gmocoin_client import Client client = Client() orderbook = client.get_orderbooks("BTC") print(f"Symbol: {orderbook.data.symbol}") print("Asks (sell orders):") for ask in orderbook.data.asks[:5]: print(f" Price: {ask.price}, Size: {ask.size}") print("Bids (buy orders):") for bid in orderbook.data.bids[:5]: print(f" Price: {bid.price}, Size: {bid.size}") ``` -------------------------------- ### Close Order Response Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Example JSON response structure for closing a position. ```json { "status": 0, "data": "637000", "responsetime": "2019-03-19T01:07:24.557Z" } ``` -------------------------------- ### GET /v1/klines Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch OHLCV (candlestick) data for a symbol. ```APIDOC ## GET /v1/klines ### Description Fetch OHLCV (candlestick) data for a symbol with a specific interval and date. ### Method GET ### Parameters #### Query Parameters - **symbol** (string) - Required - The trading symbol - **interval** (string) - Required - Time interval (e.g., 1min, 1hour) - **date** (string) - Required - Date in YYYYMMDD format ### Response #### Success Response (200) - **status** (integer) - Status code - **data** (array) - List of OHLCV objects #### Response Example { "status": 0, "data": [{ "openTime": "1618588800000", "open": "6418255", "high": "6518250", "low": "6318250", "close": "6418253", "volume": "0.0001" }] } ``` -------------------------------- ### GET /ticker Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetches the latest ticker rates for all symbols or a specific symbol. ```APIDOC ## GET /ticker ### Description Fetches the latest ticker rates. If no symbol is specified, it returns information for all symbols. ### Method GET ### Endpoint /public/v1/ticker ### Parameters #### Query Parameters - **symbol** (string) - Optional. The symbol to fetch ticker information for (e.g., "BTC"). If omitted, returns all symbols. ### Response #### Success Response (200) - **status** (int) - API response status code. - **data** (array) - A list of ticker items. - **ask** (string) - The highest buy order price. - **bid** (string) - The lowest sell order price. - **high** (string) - The highest price in the last 24 hours. - **last** (string) - The price of the last executed trade. - **low** (string) - The lowest price in the last 24 hours. - **symbol** (string) - The trading symbol. - **timestamp** (string) - The timestamp of the last trade. - **volume** (string) - The trading volume in the last 24 hours. - **responsetime** (string) - Timestamp of the response. #### Response Example ```json { "status": 0, "data": [ { "ask": "750760", "bid": "750600", "high": "762302", "last": "756662", "low": "704874", "symbol": "BTC", "timestamp": "2018-03-30T12:34:56.789Z", "volume": "194785.8484" } ], "responsetime": "2019-03-19T02:15:06.014Z" } ``` ``` -------------------------------- ### GET /trading-volume Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetches trading volume information and fee tier level. Requires authentication. ```APIDOC ## GET /trading-volume ### Description Fetch trading volume information and fee tier level. Requires authentication. ### Method GET ### Endpoint /trading-volume ### Response #### Success Response (200) - **data** (object) - An object containing trading volume details: - **jpyVolume** (string) - The trading volume in JPY. - **tierLevel** (integer) - The current fee tier level. - **limit** (array) - An array of fee limits per symbol: - **symbol** (string) - The trading symbol (e.g., BTC/JPY). - **takerFee** (string) - The taker fee rate. - **makerFee** (string) - The maker fee rate. ### Response Example ```json { "status": 0, "data": { "jpyVolume": "9988888", "tierLevel": 1, "limit": [ {"symbol": "BTC/JPY", "takerFee": "0", "makerFee": "0"} ] } } ``` ``` -------------------------------- ### GET /v1/ticker Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch the latest ticker rates for a specific symbol or all symbols. ```APIDOC ## GET /v1/ticker ### Description Fetch the latest ticker rates for a specific symbol or all symbols. Returns bid/ask prices, high/low, last price, and volume. ### Method GET ### Parameters #### Query Parameters - **symbol** (string) - Optional - The trading symbol to fetch ### Response #### Success Response (200) - **status** (integer) - Status code - **data** (array) - List of ticker objects #### Response Example { "status": 0, "data": [{ "ask": "750760", "bid": "750600", "high": "762302", "last": "756662", "low": "704874", "symbol": "BTC", "timestamp": "2018-03-30T12:34:56.789Z", "volume": "194785.8484" }] } ``` -------------------------------- ### GET /get_executions Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch execution (fill) details by order ID or execution IDs. ```APIDOC ## GET /get_executions ### Description Fetch execution (fill) details by order ID or execution IDs. ### Parameters #### Query Parameters - **order_id** (integer) - Optional - Filter by order ID - **execution_id** (list) - Optional - Filter by list of execution IDs ### Response #### Success Response (200) - **data** (object) - Contains a list of execution details including executionId, orderId, symbol, side, price, size, fee, and lossGain. ``` -------------------------------- ### GET /symbols Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetches trading rules and available symbols, including order size limits and fee rates. ```APIDOC ## GET /symbols ### Description Fetch trading rules and available symbols including order size limits and fee rates. ### Method GET ### Endpoint /symbols ### Response #### Success Response (200) - **data** (array) - An array of symbol objects, each containing: - **symbol** (string) - The trading symbol (e.g., BTC). - **minOrderSize** (string) - The minimum order size. - **maxOrderSize** (string) - The maximum order size. - **sizeStep** (string) - The step for order size. - **tickSize** (string) - The tick size for price. - **takerFee** (string) - The taker fee rate. - **makerFee** (string) - The maker fee rate. ### Response Example ```json { "status": 0, "data": [ { "symbol": "BTC", "minOrderSize": "0.0001", "maxOrderSize": "5", "sizeStep": "0.0001", "tickSize": "1", "takerFee": "0.0005", "makerFee": "-0.0001" } ] } ``` ``` -------------------------------- ### Position Summary Data Response Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Example JSON response structure for position summary data. ```json { "status": 0, "data": { "list": [ { "averagePositionRate": "715656", "positionLossGain": "250675", "side": "BUY", "sumOrderQuantity": "2", "sumPositionQuantity": "11.6999", "symbol": "BTC_JPY" } ] }, "responsetime": "2019-03-19T02:15:06.102Z" } ``` -------------------------------- ### GET /crypto-deposits Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetches cryptocurrency deposit history for a specific symbol. Requires authentication. ```APIDOC ## GET /crypto-deposits ### Description Fetch cryptocurrency deposit history for a specific symbol. Requires authentication. ### Method GET ### Endpoint /crypto-deposits ### Query Parameters - **symbol** (string) - Required - The cryptocurrency symbol (e.g., BTC). - **from_timestamp** (string) - Required - The start of the time range in ISO 8601 format. ### Response #### Success Response (200) - **data** (array) - An array of deposit objects, each containing: - **address** (string) - The deposit address. - **amount** (string) - The deposit amount. - **symbol** (string) - The cryptocurrency symbol. - **txHash** (string) - The transaction hash. - **status** (string) - The deposit status. ### Response Example ```json { "status": 0, "data": [ {"address": "xxx", "amount": "0.9503", "symbol": "BTC", "txHash": "yyy", "status": "COMPLETED"} ] } ``` ``` -------------------------------- ### GET /get_active_orders Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch currently active (open) orders for a specific symbol. ```APIDOC ## GET /get_active_orders ### Description Fetch currently active (open) orders for a symbol. ### Parameters #### Query Parameters - **symbol** (string) - Required - The trading pair - **page** (integer) - Optional - Page number - **count** (integer) - Optional - Number of items per page ### Response #### Success Response (200) - **data** (object) - Contains pagination info and a list of active orders. ``` -------------------------------- ### GET /klines Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetches OHLCV (Open, High, Low, Close, Volume) kline data for a specified symbol, interval, and date. ```APIDOC ## GET /klines ### Description Fetches OHLCV kline data for a specified symbol, interval, and date. ### Method GET ### Endpoint /public/v1/klines ### Parameters #### Query Parameters - **symbol** (string) - Required. Target symbol (e.g., “BTC”). - **interval** (string) - Required. Kline interval (e.g., “1min”). - **date** (string) - Required. Date filter in YYYYMMDD or YYYY format. ### Response #### Success Response (200) - **status** (int) - API response status code. - **data** (array) - A list of kline items. - **openTime** (string) - Timestamp for the opening of the kline. - **open** (string) - The opening price. - **high** (string) - The highest price during the kline interval. - **low** (string) - The lowest price during the kline interval. - **close** (string) - The closing price. - **volume** (string) - The trading volume during the kline interval. - **responsetime** (string) - Timestamp of the response. #### Response Example ```json { "status": 0, "data": [ { "openTime":"1618588800000", "open":"6418255", "high":"6518250", "low":"6318250", "close":"6418253", "volume":"0.0001" }, { "openTime":"1618588860000", "open":"6418251", "high":"6418252", "low":"6415250", "close":"6418245", "volume":"0.0001" } ], "responsetime": "2019-03-28T09:28:07.980Z" } ``` ``` -------------------------------- ### Fund Transfer Response Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Example JSON response structure for a fund transfer operation. ```json { "status": 0, "data": [ { "transferredAmount": "100000" } ], "responsetime": "2019-03-19T02:15:06.055Z" } ``` -------------------------------- ### Fetch Active Orders for a Symbol Source: https://context7.com/shion1305/gmocoin-client/llms.txt Get a list of currently open orders for a specific symbol. Pagination parameters can be used to control the number of results. ```python from gmocoin_client import Client with Client.from_env() as client: active = client.get_active_orders("BTC", page=1, count=30) print(f"Page: {active.data.pagination.currentPage}") for order in active.data.list: print(f"Order ID: {order.orderId}") print(f"Symbol: {order.symbol}, Side: {order.side}") print(f"Price: {order.price}, Size: {order.size}") print(f"Status: {order.status}") ``` -------------------------------- ### GET /trades Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetches recent trades for a specified symbol with optional pagination. ```APIDOC ## GET /trades ### Description Fetches recent trades for a specified symbol. Supports pagination. ### Method GET ### Endpoint /public/v1/trades ### Parameters #### Query Parameters - **symbol** (string) - Required. Target symbol (e.g., “BTC”). - **page** (integer) - Optional. Page number for pagination. - **count** (integer) - Optional. Number of items per page. ### Response #### Success Response (200) - **status** (int) - API response status code. - **data** (object) - Trades data. - **pagination** (object) - Pagination information. - **currentPage** (integer) - The current page number. - **count** (integer) - The number of items per page. - **list** (array) - A list of trade items. - **price** (string) - The price of the trade. - **side** (string) - The side of the trade (e.g., "BUY", "SELL"). - **size** (string) - The size of the trade. - **timestamp** (string) - The timestamp of the trade. - **responsetime** (string) - Timestamp of the response. #### Response Example ```json { "status": 0, "data": { "pagination": { "currentPage": 1, "count": 30 }, "list": [ { "price": "750760", "side": "BUY", "size": "0.1", "timestamp": "2018-03-30T12:34:56.789Z" } ] }, "responsetime": "2019-03-28T09:28:07.980Z" } ``` ``` -------------------------------- ### Fetch Crypto Deposit History Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Use this to retrieve a list of cryptocurrency deposit records. Requires a symbol and a start timestamp. ```json { "status": 0, "data": [ { "address": "xxx", "amount": "0.9503", "status": "EXECUTED", "symbol": "BTC", "timestamp": "2021-10-05T06:04:46.241Z", "txHash": "yyy" } ], "responsetime": "2024-02-28T12:20:07.103Z" } ``` -------------------------------- ### GET /fiat-deposits Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetches JPY deposit history within a specified time range. Requires authentication. ```APIDOC ## GET /fiat-deposits ### Description Fetch JPY deposit history within a specified time range. Requires authentication. ### Method GET ### Endpoint /fiat-deposits ### Query Parameters - **from_timestamp** (string) - Required - The start of the time range in ISO 8601 format. - **to_timestamp** (string) - Required - The end of the time range in ISO 8601 format. ### Response #### Success Response (200) - **data** (array) - An array of deposit objects, each containing: - **amount** (string) - The deposit amount. - **symbol** (string) - The currency symbol (e.g., JPY). - **fee** (string) - The transaction fee. - **status** (string) - The deposit status (e.g., EXECUTED). - **timestamp** (string) - The timestamp of the deposit in ISO 8601 format. ### Response Example ```json { "status": 0, "data": [ {"amount": "50000", "fee": "0", "status": "EXECUTED", "symbol": "JPY", "timestamp": "2024-01-15T10:30:00.000Z"} ] } ``` ``` -------------------------------- ### Bulk Order Cancellation Response Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Example JSON response structure for a bulk order cancellation request. ```json { "status": 0, "data": { "failed": [ { "message_code": "ERR-5122", "message_string": "The request is invalid due to the status of the specified order.", "orderId": 1 }, { "message_code": "ERR-5122", "message_string": "The request is invalid due to the status of the specified order.", "orderId": 2 } ], "success": [3,4] }, "responsetime": "2019-03-19T01:07:24.557Z" } ``` -------------------------------- ### Get GMO Coin Service Status Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch the current status of the GMO Coin exchange. Use this to check if the exchange is operational, in maintenance, or in a pre-open state. ```python from gmocoin_client import Client client = Client() response = client.get_status() print(f"Status: {response.data.status}") # "OPEN", "MAINTENANCE", or "PREOPEN" print(f"Response time: {response.responsetime}") ``` -------------------------------- ### Configure and Run Live Trading Tests Source: https://github.com/shion1305/gmocoin-client/blob/main/README.md Set required environment variables and execute tests using pytest with the live marker. ```bash export GMO_LIVE_TESTS=true export GMO_API_KEY="your_api_key" export GMO_SECRET_KEY="your_secret_key" export GMO_LIVE_SYMBOL="BTC" export GMO_LIVE_SIZE="0.0001" export GMO_LIVE_BUY_EXECUTION_TYPE="MARKET" export GMO_LIVE_SELL_EXECUTION_TYPE="MARKET" ``` ```bash pytest -m live ``` -------------------------------- ### Get OHLCV Candlestick Data Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch historical Open, High, Low, Close, and Volume (OHLCV) data for a symbol. Requires specifying the interval (e.g., '1hour') and the date. ```python from gmocoin_client import Client client = Client() # Intervals: 1min, 5min, 10min, 15min, 30min, 1hour, 4hour, 8hour, 12hour, 1day, 1week, 1month klines = client.get_klines(symbol="BTC", interval="1hour", date="20240101") for candle in klines.data: print(f"Time: {candle.openTime}") print(f"Open: {candle.open}, High: {candle.high}") print(f"Low: {candle.low}, Close: {candle.close}") print(f"Volume: {candle.volume}") ``` -------------------------------- ### GET /get_latest_executions Source: https://context7.com/shion1305/gmocoin-client/llms.txt Fetch the most recent executions for a symbol. ```APIDOC ## GET /get_latest_executions ### Description Fetch the most recent executions for a symbol. Requires authentication. ### Parameters #### Query Parameters - **symbol** (string) - Required - The trading symbol (e.g., BTC) - **page** (integer) - Optional - Page number - **count** (integer) - Optional - Number of records to return ``` -------------------------------- ### Initialize GMO Coin Client Source: https://context7.com/shion1305/gmocoin-client/llms.txt Instantiate the client for public or private API access. Private endpoints require API keys, which can be loaded from environment variables or provided directly. The client supports context management for automatic cleanup. ```python from gmocoin_client import Client # Public API only (no authentication needed) client = Client() # Private API with environment variables (GMO_API_KEY, GMO_SECRET_KEY) with Client.from_env() as client: assets = client.get_assets() print(assets.data) ``` ```python client = Client( api_key="your_api_key", api_secret="your_secret_key", timeout=30.0, raise_on_error=True ) ``` -------------------------------- ### Place a Trading Order Source: https://github.com/shion1305/gmocoin-client/blob/main/README.md Execute a limit order using the authenticated client context. ```python from gmocoin_client import Client with Client.from_env() as client: order = client.create_order( symbol="BTC_JPY", side="BUY", execution_type="LIMIT", time_in_force="FAS", price="430001", size="0.02", ) ``` -------------------------------- ### POST /create_order Source: https://context7.com/shion1305/gmocoin-client/llms.txt Creates a new spot or margin order. Requires authentication. ```APIDOC ## POST /create_order ### Description Create a new spot or margin order. ### Parameters #### Request Body - **symbol** (string) - Required - The trading pair (e.g., BTC_JPY) - **side** (string) - Required - BUY or SELL - **execution_type** (string) - Required - MARKET or LIMIT - **size** (string) - Required - Order quantity - **time_in_force** (string) - Optional - FAS, FAK, FOK, SOK (required for LIMIT) - **price** (string) - Optional - Price for limit orders - **losscut_price** (string) - Optional - Losscut price for margin orders ### Response #### Success Response (200) - **status** (integer) - 0 for success - **data** (string) - The created order ID - **responsetime** (string) - Timestamp of the response ``` -------------------------------- ### Fetch Margin Summary Source: https://context7.com/shion1305/gmocoin-client/llms.txt Retrieves account margin and collateral information. Requires authentication via environment variables. ```python from gmocoin_client import Client with Client.from_env() as client: margin = client.get_margin() print(f"Actual P&L: {margin.data.actualProfitLoss}") print(f"Available: {margin.data.availableAmount}") print(f"Margin: {margin.data.margin}") print(f"Margin Ratio: {margin.data.marginRatio}%") print(f"Status: {margin.data.marginCallStatus}") # NORMAL, MARGIN_CALL, LOSSCUT ``` -------------------------------- ### POST /ws_auth_create Source: https://context7.com/shion1305/gmocoin-client/llms.txt Create a WebSocket access token. ```APIDOC ## POST /ws_auth_create ### Description Create a WebSocket access token for private WebSocket subscriptions. Requires authentication. ``` -------------------------------- ### GET /activeOrders Source: https://github.com/shion1305/gmocoin-client/blob/main/docs/client.md Fetch active orders for a specific symbol. ```APIDOC ## GET /activeOrders ### Description Fetch active orders for a symbol. ### Parameters #### Query Parameters - **symbol** (str) - Required - Target symbol (e.g., “BTC”). - **page** (int) - Optional - Page number. - **count** (int) - Optional - Page size. ### Response #### Success Response (200) - **data** (object) - Active orders data including pagination. #### Response Example { "status": 0, "data": { "pagination": { "currentPage": 1, "count": 30 }, "list": [ { "orderId": 123456789, "symbol": "BTC", "status": "ORDERED" } ] }, "responsetime": "2019-03-19T01:07:24.217Z" } ``` -------------------------------- ### Fetch Asset Balances Source: https://context7.com/shion1305/gmocoin-client/llms.txt Retrieves all asset balances for the authenticated account. ```python from gmocoin_client import Client with Client.from_env() as client: assets = client.get_assets() for asset in assets.data: print(f"Symbol: {asset.symbol}") print(f"Amount: {asset.amount}") print(f"Available: {asset.available}") print(f"Conversion Rate: {asset.conversionRate}") ``` -------------------------------- ### Fetch Execution Details Source: https://context7.com/shion1305/gmocoin-client/llms.txt Retrieve detailed information about order executions (fills) by providing either an order ID or a list of execution IDs. The details include symbol, price, size, fees, and P&L. ```python from gmocoin_client import Client with Client.from_env() as client: # By order ID executions = client.get_executions(order_id=123456789) # By execution IDs executions = client.get_executions(execution_id=[72123911, 72123912]) for exec in executions.data.list: print(f"Execution ID: {exec.executionId}") print(f"Order ID: {exec.orderId}") print(f"Symbol: {exec.symbol}, Side: {exec.side}") print(f"Price: {exec.price}, Size: {exec.size}") print(f"Fee: {exec.fee}, P&L: {exec.lossGain}") ```