A bot that decides once a minute needs a candle that is finished and does not change afterwards. /v2/coins/{id}/ohlc?interval=1m returns only closed candles, up to 5,000 in a request, on every plan. The API gives you data. It does not place orders.
- Only closed candles are published, so the last row you read never changes.
- Minute candles are kept 30 days on Free and 90 days on Starter, Basic and Pro. Minute history begins 23 Nov 2026 and grows a day each day, up to those limits.
- 5-minute and 15-minute candles are rolled up from the same minutes, so every timeframe agrees.
Routes it uses
| Job | Route |
|---|---|
| Signal from closed candles | /v2/coins/{id}/ohlc?interval=1m&limit=... |
| Latest price between candles | /v2/simple/price |
| History for a test | /v2/coins/{id}/ohlc with from and to, in windows of up to 5,000 candles |
| Push instead of poll | The price stream |
Read the last hour
This script reads 60 closed candles and compares a 10-minute average of the close with a 30-minute one. It shows how to read the data, not a strategy. It needs requests and the key in COINPRICE_API_KEY.
import osimport requestsAPI = "https://api.coinprice.dev/v2"HEADERS = {"Authorization": f"Bearer {os.environ['COINPRICE_API_KEY']}"}def minute_candles(coin, limit): response = requests.get( f"{API}/coins/{coin}/ohlc", headers=HEADERS, params={"interval": "1m", "limit": limit}, timeout=10, ) response.raise_for_status() return response.json() # [[time_ms, open, high, low, close], ...] oldest firstdef average(closes): return sum(closes) / len(closes)candles = minute_candles("bitcoin", 60)closes = [c[4] for c in candles]fast, slow = average(closes[-10:]), average(closes[-30:])print(f"{len(candles)} candles, last closed minute starts at {candles[-1][0]}")print(f"10-minute average {fast:,.2f}, 30-minute average {slow:,.2f}")print("fast is above slow" if fast > slow else "fast is below slow")60 candles, last closed minute starts at 179549472000010-minute average 60,439.49, 30-minute average 60,372.76fast is above slowEach row is [time in ms, open, high, low, close]. The time is the start of the minute in UTC, and rows come oldest first. The candle for the minute that is still running is not in the list.
Why this data fits
- Each minute's price is the median of the latest prices from seven exchanges after outliers are dropped, so one venue's spike does not draw a false wick.
- The call budget is easy to plan. One candle request a minute is 43,200 calls a month, inside the Free plan. Starter has 300 calls a minute for a bot that watches many coins.
- Minute candles on every plan, with 5,000 candles to a request. How the candles are built.
Limits to plan for
- Minute candles are kept 30 days on Free and 90 days on paid plans, and minute history begins 23 Nov 2026, so a window older than the minutes held starts at the oldest minute held. Save the candles you need for longer. Hourly and daily candles start 1 Jan 2023, or when the coin began;
/v2/coverageshowshourly_fromanddaily_from. - A plan that reaches its monthly limit stops answering until the next month. On a 429
quota_exceededthe bot should stop and tell you: there is noRetry-After, and it resets on the 1st of the month UTC. Retry only a 429rate_limited, afterRetry-Afterseconds. - There are no orders, balances or exchange accounts here. Send your orders to your own exchange account.