{"openapi":"3.0.3","info":{"title":"Bitcoin API","description":"Real-time Bitcoin price API.","version":"0.0.1"},"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key passed in the \"x-api-key\" custom header."},"BearerAuth":{"type":"http","scheme":"bearer","description":"API key passed as a Bearer token in the \"Authorization\" header."},"QueryAuth":{"type":"apiKey","in":"query","name":"apiKey","description":"API key passed as a query parameter (intended for WebSockets since WebSocket connections do not support custom headers)."}},"schemas":{}},"paths":{"/api/v1/prices/current":{"get":{"operationId":"getCurrentPrice","summary":"Get current price","tags":["prices","external"],"description":"Returns the latest price for a given trading pair from the configured exchange. For websocket use: wscat -c wss://bitcoin-api.net/api/v1/prices/current?symbol=btcusdt","parameters":[{"schema":{"type":"string","enum":["btcusdt"],"nullable":true},"in":"query","name":"symbol","required":false}],"x-default-rate-limit":40,"x-default-ws-connections-limit":2,"x-postman-run-link":"https://www.postman.com/bitcoin-api-net/bitcoin-api/http-request/6a1c1a7648162fb83611b016/bitcoin-api?action=share&creator=55378258","x-postman-ws-run-link":"https://www.postman.com/bitcoin-api-net/bitcoin-api/ws-raw-request/6a1c175077bc6c47bb790cd4/bitcoin-api?action=share&creator=55378258","responses":{"200":{"description":"Success Response","content":{"application/json":{"schema":{"type":"object","description":"Success Response","properties":{"price":{"type":"string","description":"Current price of the trading pair","example":"50000.00"},"time":{"type":"string","description":"ISO 8601 timestamp of the price recording","example":"2024-01-01T00:00:00.000Z"}},"required":["price","time"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","description":"Bad Request","properties":{"code":{"type":"string","description":"Error code","example":"VALIDATION_ERROR"},"message":{"type":"string","description":"Error message","example":"querystring/symbol must be equal to one of the allowed values"}},"required":["code","message"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","description":"Too Many Requests","properties":{"code":{"type":"string","description":"Error code","example":"RATE_LIMIT_EXCEEDED"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded, retry in 1 minute"}},"required":["code","message"]}}}}}}},"/api/v1/prices/klines":{"get":{"operationId":"getKlines","summary":"Get historical and current klines (candles)","tags":["prices","external"],"description":"Returns historical klines (candles) and the current open kline (candle) for a given trading pair and interval. For websocket use: wscat -c wss://bitcoin-api.net/api/v1/prices/klines?interval=1m","parameters":[{"schema":{"type":"string","enum":["btcusdt"],"nullable":true,"default":"btcusdt"},"in":"query","name":"symbol","required":false},{"schema":{"type":"string","enum":["1m","5m","15m","30m","1h","4h","6h","12h","1d"]},"in":"query","name":"interval","required":true},{"schema":{"type":"integer","minimum":1,"maximum":1000,"nullable":true},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"date-time","nullable":true},"in":"query","name":"from","required":false},{"schema":{"type":"string","format":"date-time","nullable":true},"in":"query","name":"to","required":false}],"x-default-rate-limit":40,"x-default-ws-connections-limit":2,"x-postman-run-link":"https://www.postman.com/bitcoin-api-net/bitcoin-api/http-request/6a1c1c21695855cdb8cf2ee6/bitcoin-api?action=share&creator=55378258","x-postman-ws-run-link":"https://www.postman.com/bitcoin-api-net/bitcoin-api/ws-raw-request/6a1c1c5b7347b5b6e507604c/bitcoin-api?action=share&creator=55378258","responses":{"200":{"description":"Success Response","content":{"application/json":{"schema":{"type":"object","description":"Success Response","properties":{"klines":{"type":"array","items":{"type":"object","properties":{"openTime":{"type":"string","description":"Opening time of the kline (candle) interval","example":"2024-05-23T12:00:00.000Z"},"closeTime":{"type":"string","description":"Closing time of the kline (candle) interval","example":"2024-05-23T12:01:00.000Z"},"open":{"type":"string","description":"Opening price","example":"65000.00"},"high":{"type":"string","description":"Highest price during the interval","example":"65100.00"},"low":{"type":"string","description":"Lowest price during the interval","example":"64900.00"},"close":{"type":"string","description":"Closing price","example":"65050.00"},"volume":{"type":"string","description":"Trading volume during the interval","example":"1.25"},"trades":{"type":"integer","description":"Number of trades","example":150},"isClosed":{"type":"boolean","description":"Whether the kline (candle) is fully closed","example":true}},"required":["openTime","closeTime","open","high","low","close","volume","trades","isClosed"]}}},"required":["klines"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","description":"Bad Request","properties":{"code":{"type":"string","description":"Error code","example":"VALIDATION_ERROR"},"message":{"type":"string","description":"Error message","example":"querystring/symbol must be equal to one of the allowed values"}},"required":["code","message"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","description":"Too Many Requests","properties":{"code":{"type":"string","description":"Error code","example":"RATE_LIMIT_EXCEEDED"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded, retry in 1 minute"}},"required":["code","message"]}}}}}}},"/api/v1/prices/klines/current":{"get":{"operationId":"getCurrentKline","summary":"Get current open kline (candle)","tags":["prices","external"],"description":"Returns the current open kline (candle) for a given trading pair and interval. For websocket use: wscat -c wss://bitcoin-api.net/api/v1/prices/current?interval=1m","parameters":[{"schema":{"type":"string","enum":["btcusdt"],"nullable":true,"default":"btcusdt"},"in":"query","name":"symbol","required":false},{"schema":{"type":"string","enum":["1m","5m","15m","30m","1h","4h","6h","12h","1d"]},"in":"query","name":"interval","required":true}],"x-default-rate-limit":40,"x-default-ws-connections-limit":2,"x-postman-run-link":"https://www.postman.com/bitcoin-api-net/bitcoin-api/http-request/6a1c1bb46b03892cbe868b37/bitcoin-api?action=share&creator=55378258","x-postman-ws-run-link":"https://www.postman.com/bitcoin-api-net/bitcoin-api/ws-raw-request/6a1c1bea7347b5b6e507604a/bitcoin-api?action=share&creator=55378258","responses":{"200":{"description":"Success Response","content":{"application/json":{"schema":{"type":"object","description":"Success Response","properties":{"openTime":{"type":"string","description":"Opening time of the kline (candle) interval","example":"2024-05-23T12:00:00.000Z"},"closeTime":{"type":"string","description":"Closing time of the kline (candle) interval","example":"2024-05-23T12:01:00.000Z"},"open":{"type":"string","description":"Opening price","example":"65000.00"},"high":{"type":"string","description":"Highest price during the interval","example":"65100.00"},"low":{"type":"string","description":"Lowest price during the interval","example":"64900.00"},"close":{"type":"string","description":"Closing price","example":"65050.00"},"volume":{"type":"string","description":"Trading volume during the interval","example":"1.25"},"trades":{"type":"integer","description":"Number of trades","example":150},"isClosed":{"type":"boolean","description":"Whether the kline (candle) is fully closed","example":false}},"required":["openTime","closeTime","open","high","low","close","volume","trades","isClosed"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","description":"Bad Request","properties":{"code":{"type":"string","description":"Error code","example":"VALIDATION_ERROR"},"message":{"type":"string","description":"Error message","example":"querystring/symbol must be equal to one of the allowed values"}},"required":["code","message"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","description":"Too Many Requests","properties":{"code":{"type":"string","description":"Error code","example":"RATE_LIMIT_EXCEEDED"},"message":{"type":"string","description":"Error message","example":"Rate limit exceeded, retry in 1 minute"}},"required":["code","message"]}}}}}}}},"security":[{"ApiKeyHeader":[]},{"BearerAuth":[]},{"QueryAuth":[]}],"tags":[{"name":"health","description":"Health checks"},{"name":"auth","description":"Authentication and account management"},{"name":"prices","description":"Cryptocurrency prices"},{"name":"docs","description":"Documentation search and AI assistant"},{"name":"api-keys","description":"Manage API keys"},{"name":"boosts","description":"Rate-limit boosts owned by the user"},{"name":"billing","description":"Subscriptions, checkout & webhooks"}]}