{"openapi":"3.1.0","info":{"title":"x402 Crypto Market Data","version":"1.0.0","description":"On-demand crypto market data. Discover available trading pairs for free, then retrieve live prices, market metadata, and historical candlesticks when you need them.","x-guidance":"Start with GET /symbols—it's free and returns every available trading pair. Use POST /symbol-info for one pair, GET /tickers for the complete live-price snapshot, or POST /symbol-infos for a batch of 2-10 pairs. For charting and backtesting, POST /historical-klines accepts a symbol, interval, and time range (times use 'YYYY-MM-DD HH:MM'); POST /historical-klines/recent returns the latest requested candles. Historical requests support up to 1000 candles. Payments are requested automatically via x402; the exact price is included in each endpoint's payment metadata.","contact":{"email":"nomail@for.me","AgMsg":{"username":"devops_note33","info":"https://api.agmsg.world/openapi.json"}}},"paths":{"/health":{"get":{"operationId":"health_check","summary":"Health check","tags":["Health"],"security":[],"responses":{"200":{"description":"Service is healthy.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}},"required":["status","message"]}}}}}}},"/symbols":{"get":{"operationId":"get_symbols","summary":"List all available trading symbols","tags":["Market Data"],"security":[],"responses":{"200":{"description":"All available trading symbols.","content":{"application/json":{"schema":{"properties":{"symbols":{"description":"All available trading symbols.","examples":[["BTCUSDT","ETHUSDT"]],"items":{"type":"string"},"type":"array"}},"required":["symbols"],"type":"object"}}}}}}},"/symbol-info":{"post":{"operationId":"get_symbol_info","summary":"Get trading info for a single symbol","tags":["Market Data"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.001500"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"symbol":{"description":"Trading symbol to look up, e.g. BTCUSDT.","examples":["BTCUSDT"],"pattern":"^[A-Z0-9]+$","type":"string"}},"required":["symbol"],"type":"object"}}}},"responses":{"200":{"description":"Trading info for the requested symbol.","content":{"application/json":{"schema":{"properties":{"symbol":{"description":"Trading symbol.","examples":["BTCUSDT"],"type":"string"},"status":{"description":"Current trading status of the symbol.","examples":["TRADING"],"type":"string"},"baseAsset":{"description":"Base asset of the trading pair.","examples":["BNB"],"type":"string"},"baseAssetPrecision":{"description":"Number of decimal places supported for the base asset.","examples":[8],"type":"integer"},"quoteAsset":{"description":"Quote asset of the trading pair.","examples":["BTC"],"type":"string"},"quotePrecision":{"description":"Number of decimal places supported for the quote asset.","examples":[8],"type":"integer"},"quoteAssetPrecision":{"description":"Number of decimal places supported for quote-asset amounts.","examples":[8],"type":"integer"}},"required":["symbol","status","baseAsset","baseAssetPrecision","quoteAsset","quotePrecision","quoteAssetPrecision"],"type":"object"}}}},"402":{"description":"Payment Required"}}}},"/symbol-infos":{"post":{"operationId":"get_symbol_infos","summary":"Get trading info for a list of symbols","tags":["Market Data"],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.002000","max":"0.010000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"symbols":{"description":"Trading symbols to look up, e.g. BTCUSDT.","examples":[["BTCUSDT","ETHUSDT"]],"items":{"type":"string"},"maxItems":10,"minItems":2,"type":"array"}},"required":["symbols"],"type":"object"}}}},"responses":{"200":{"description":"Trading info for each requested symbol.","content":{"application/json":{"schema":{"properties":{"infos":{"additionalProperties":{"properties":{"symbol":{"description":"Trading symbol.","examples":["BTCUSDT"],"type":"string"},"status":{"description":"Current trading status of the symbol.","examples":["TRADING"],"type":"string"},"baseAsset":{"description":"Base asset of the trading pair.","examples":["BNB"],"type":"string"},"baseAssetPrecision":{"description":"Number of decimal places supported for the base asset.","examples":[8],"type":"integer"},"quoteAsset":{"description":"Quote asset of the trading pair.","examples":["BTC"],"type":"string"},"quotePrecision":{"description":"Number of decimal places supported for the quote asset.","examples":[8],"type":"integer"},"quoteAssetPrecision":{"description":"Number of decimal places supported for quote-asset amounts.","examples":[8],"type":"integer"}},"required":["symbol","status","baseAsset","baseAssetPrecision","quoteAsset","quotePrecision","quoteAssetPrecision"],"type":"object"},"description":"Trading info for each requested symbol, keyed by symbol.","type":"object"}},"required":["infos"],"type":"object"}}}},"402":{"description":"Payment Required"}}}},"/historical-klines":{"post":{"operationId":"get_historical_klines","summary":"Get historical klines (candlesticks) for a time range","tags":["Market Data"],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.005000","max":"0.100000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"symbol":{"description":"Trading symbol, e.g. BTCUSDT.","examples":["BTCUSDT"],"pattern":"^[A-Z0-9]+$","type":"string"},"interval":{"description":"Candlestick interval","enum":["1m","3m","5m","15m","30m","1h","2h","4h","6h","8h","12h","1d","3d","1w","1M"],"type":"string","default":"1h"},"from_time":{"description":"Start of the time range, format: %Y-%m-%d %H:%M","examples":["2024-01-01 00:00"],"type":"string"},"to_time":{"description":"End of the time range, format: %Y-%m-%d %H:%M","examples":["2024-01-02 00:00"],"type":"string"}},"required":["symbol","from_time","to_time"],"type":"object"}}}},"responses":{"200":{"description":"Historical klines for the requested time range.","content":{"application/json":{"schema":{"properties":{"symbol":{"description":"Trading symbol the klines belong to.","examples":["BTCUSDT"],"type":"string"},"interval":{"description":"Candlestick interval of the returned klines.","enum":["1m","3m","5m","15m","30m","1h","2h","4h","6h","8h","12h","1d","3d","1w","1M"],"type":"string"},"klines":{"description":"List of candlesticks, ordered from oldest to newest.","items":{"properties":{"open_time":{"description":"Timestamp of the candle's opening.","format":"date-time","type":"string"},"open_price":{"description":"Price at the start of the candle.","type":"number"},"high_price":{"description":"Highest price reached during the candle.","type":"number"},"low_price":{"description":"Lowest price reached during the candle.","type":"number"},"close_price":{"description":"Price at the end of the candle.","type":"number"},"volume":{"description":"Traded volume, in base asset units, during the candle.","type":"number"},"close_time":{"description":"Timestamp of the candle's closing.","format":"date-time","type":"string"},"quote_asset_volume":{"description":"Traded volume, in quote asset units, during the candle.","type":"number"},"amount_trades":{"description":"Number of trades executed during the candle.","type":"integer"},"taker_buy_base_volume":{"description":"Base asset volume bought by takers during the candle.","type":"number"},"taker_buy_quote_volume":{"description":"Quote asset volume bought by takers during the candle.","type":"number"}},"required":["open_time","open_price","high_price","low_price","close_price","volume","close_time","quote_asset_volume","amount_trades","taker_buy_base_volume","taker_buy_quote_volume"],"type":"object"},"type":"array"}},"required":["symbol","interval","klines"],"type":"object"}}}},"402":{"description":"Payment Required"}}}},"/historical-klines/recent":{"post":{"operationId":"get_historical_klines_last_n","summary":"Get the most recent n klines (candlesticks)","tags":["Market Data"],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.005000","max":"0.100000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"symbol":{"description":"Trading symbol, e.g. BTCUSDT.","examples":["BTCUSDT"],"pattern":"^[A-Z0-9]+$","type":"string"},"interval":{"description":"Candlestick interval.","enum":["1m","3m","5m","15m","30m","1h","2h","4h","6h","8h","12h","1d","3d","1w","1M"],"type":"string","default":"1h"},"n":{"default":100,"description":"Number of most recent klines to fetch (max 1000).","exclusiveMinimum":0,"maximum":1000,"type":"integer"}},"required":["symbol"],"type":"object"}}}},"responses":{"200":{"description":"The most recent n klines.","content":{"application/json":{"schema":{"properties":{"symbol":{"description":"Trading symbol the klines belong to.","examples":["BTCUSDT"],"type":"string"},"interval":{"description":"Candlestick interval of the returned klines.","enum":["1m","3m","5m","15m","30m","1h","2h","4h","6h","8h","12h","1d","3d","1w","1M"],"type":"string"},"klines":{"description":"List of candlesticks, ordered from oldest to newest.","items":{"properties":{"open_time":{"description":"Timestamp of the candle's opening.","format":"date-time","type":"string"},"open_price":{"description":"Price at the start of the candle.","type":"number"},"high_price":{"description":"Highest price reached during the candle.","type":"number"},"low_price":{"description":"Lowest price reached during the candle.","type":"number"},"close_price":{"description":"Price at the end of the candle.","type":"number"},"volume":{"description":"Traded volume, in base asset units, during the candle.","type":"number"},"close_time":{"description":"Timestamp of the candle's closing.","format":"date-time","type":"string"},"quote_asset_volume":{"description":"Traded volume, in quote asset units, during the candle.","type":"number"},"amount_trades":{"description":"Number of trades executed during the candle.","type":"integer"},"taker_buy_base_volume":{"description":"Base asset volume bought by takers during the candle.","type":"number"},"taker_buy_quote_volume":{"description":"Quote asset volume bought by takers during the candle.","type":"number"}},"required":["open_time","open_price","high_price","low_price","close_price","volume","close_time","quote_asset_volume","amount_trades","taker_buy_base_volume","taker_buy_quote_volume"],"type":"object"},"type":"array"}},"required":["symbol","interval","klines"],"type":"object"}}}},"402":{"description":"Payment Required"}}}},"/tickers":{"get":{"operationId":"get_all_tickers","summary":"Get the latest price for all symbols","tags":["Market Data"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002000"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Latest price for every symbol.","content":{"application/json":{"schema":{"properties":{"tickers":{"additionalProperties":{"type":"number"},"description":"Latest price for every symbol, keyed by symbol.","type":"object"}},"required":["tickers"],"type":"object"}}}},"402":{"description":"Payment Required"}}}}}}