# Klines

## GET /v2/klines/token/{token-id}

> kline data points by token address (10 CU)

```json
{"openapi":"3.0.3","info":{"title":"Ave API (REST)","version":"2.1.0"},"servers":[{"url":"https://prod.ave-api.com"},{"url":"https://data.ave-api.xyz"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"ApiResponse":{"type":"object","properties":{"status":{"type":"integer"},"msg":{"type":"string"},"data_type":{"type":"integer"},"data":{"$ref":"#/components/schemas/KlineData"}}},"KlineData":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/KlinePoint"}},"total_count":{"type":"integer"},"limit":{"type":"integer"},"interval":{"type":"integer"},"to_time":{"type":"integer"}}},"KlinePoint":{"type":"object","properties":{"open":{"type":"string","description":"ppen price (string to preserve precision)"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"},"time":{"type":"integer","description":"unix epoch seconds"}},"required":["open","high","low","close","volume","time"]}}},"paths":{"/v2/klines/token/{token-id}":{"get":{"summary":"kline data points by token address (10 CU)","parameters":[{"name":"token-id","in":"path","required":true,"description":"token address and chain in format `<token_address>-<chain>` (e.g. `6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN-solana`)","schema":{"type":"string"}},{"name":"interval","in":"query","required":true,"description":"interval in minutes (allowed values: 1,5,15,30,60,120,240,1440,4320,10080,43200,525600,2628000)","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"number of data points to return (default: 300, max: 1000)","schema":{"type":"integer","default":300,"maximum":1000}},{"name":"from_time","in":"query","required":false,"description":"unix epoch seconds for start time (defaut: -1 means earliest available)","schema":{"type":"integer","default":-1}},{"name":"to_time","in":"query","required":false,"description":"unix epoch seconds for end time (default: current server time)","schema":{"type":"integer"}}],"responses":{"200":{"description":"successful response with kline points for token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"bad request"},"401":{"description":"unauthorized (missing or invalid API key)"},"403":{"description":"forbidden (API key expired)"},"500":{"description":"server error"}}}}}}
```

## GET /v2/klines/pair/{pair-id}

> kline data points by pair address (10 CU)

```json
{"openapi":"3.0.3","info":{"title":"Ave API (REST)","version":"2.1.0"},"servers":[{"url":"https://prod.ave-api.com"},{"url":"https://data.ave-api.xyz"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"ApiResponse":{"type":"object","properties":{"status":{"type":"integer"},"msg":{"type":"string"},"data_type":{"type":"integer"},"data":{"$ref":"#/components/schemas/KlineData"}}},"KlineData":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/KlinePoint"}},"total_count":{"type":"integer"},"limit":{"type":"integer"},"interval":{"type":"integer"},"to_time":{"type":"integer"}}},"KlinePoint":{"type":"object","properties":{"open":{"type":"string","description":"ppen price (string to preserve precision)"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"},"time":{"type":"integer","description":"unix epoch seconds"}},"required":["open","high","low","close","volume","time"]}}},"paths":{"/v2/klines/pair/{pair-id}":{"get":{"summary":"kline data points by pair address (10 CU)","parameters":[{"name":"pair-id","in":"path","required":true,"description":"pair address and chain in format `<pair_address>-<chain>` (e.g. `2prhzdRwWzas2f4g5AAjyRUBcQcdajxd8NAzKcqhv76P-solana`)","schema":{"type":"string"}},{"name":"interval","in":"query","required":true,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":1000}},{"name":"category","in":"query","required":false,"description":"category of target price: `u` (default) - target token USDT price; `r` - target token to base token relative price; `m` - target token to main token relative price","schema":{"type":"string","enum":["u","r","m"],"default":"u"}}],"responses":{"200":{"description":"successful response with kline points for pair","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"400":{"description":"bad request"},"401":{"description":"unauthorized (missing or invalid API key)"},"403":{"description":"forbidden (API key expired)"},"500":{"description":"server error"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ave-cloud.gitbook.io/data-api/rest/klines.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
