curl -X GET "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/prices/line?startDate=2024-02-01T00:00:00Z&endDate=2024-02-14T00:00:00Z&resolution=1D"
// Fetch 30 days of daily price data
const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7';
const endDate = new Date();
const startDate = new Date();
startDate.setDate(startDate.getDate() - 30);
const params = new URLSearchParams({
startDate: startDate.toISOString(),
endDate: endDate.toISOString(),
resolution: '1D'
});
const response = await fetch(
`https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/prices/line?${params}`
);
const data = await response.json();
// Calculate price statistics
const prices = data.map(d => d.value);
const avgPrice = prices.reduce((a, b) => a + b) / prices.length;
const maxPrice = Math.max(...prices);
const minPrice = Math.min(...prices);
console.log(`30-day stats: Avg: $${avgPrice}, High: $${maxPrice}, Low: $${minPrice}`);
import requests
from datetime import datetime, timedelta
import pandas as pd
token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'
end_date = datetime.now()
start_date = end_date - timedelta(days=30)
params = {
'startDate': start_date.isoformat() + 'Z',
'endDate': end_date.isoformat() + 'Z',
'resolution': '1D'
}
response = requests.get(
f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/prices/line',
params=params
)
data = response.json()
# Convert to DataFrame for analysis
df = pd.DataFrame(data)
df['date'] = pd.to_datetime(df['date'])
df.set_index('date', inplace=True)
# Calculate moving averages
df['MA7'] = df['value'].rolling(window=7).mean()
df['MA30'] = df['value'].rolling(window=30).mean()
[
{
"date": "2024-02-01T00:00:00Z",
"value": 2320.50
},
{
"date": "2024-02-02T00:00:00Z",
"value": 2345.75
},
{
"date": "2024-02-03T00:00:00Z",
"value": 2380.20
},
{
"date": "2024-02-04T00:00:00Z",
"value": 2365.90
},
{
"date": "2024-02-05T00:00:00Z",
"value": 2410.30
},
{
"date": "2024-02-06T00:00:00Z",
"value": 2435.50
}
]
Markets
Get Price Feed
Retrieve historical price data for charting and analysis
GET
/
v3
/
tokens
/
{tokenAddress}
/
prices
/
line
curl -X GET "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/prices/line?startDate=2024-02-01T00:00:00Z&endDate=2024-02-14T00:00:00Z&resolution=1D"
// Fetch 30 days of daily price data
const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7';
const endDate = new Date();
const startDate = new Date();
startDate.setDate(startDate.getDate() - 30);
const params = new URLSearchParams({
startDate: startDate.toISOString(),
endDate: endDate.toISOString(),
resolution: '1D'
});
const response = await fetch(
`https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/prices/line?${params}`
);
const data = await response.json();
// Calculate price statistics
const prices = data.map(d => d.value);
const avgPrice = prices.reduce((a, b) => a + b) / prices.length;
const maxPrice = Math.max(...prices);
const minPrice = Math.min(...prices);
console.log(`30-day stats: Avg: $${avgPrice}, High: $${maxPrice}, Low: $${minPrice}`);
import requests
from datetime import datetime, timedelta
import pandas as pd
token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'
end_date = datetime.now()
start_date = end_date - timedelta(days=30)
params = {
'startDate': start_date.isoformat() + 'Z',
'endDate': end_date.isoformat() + 'Z',
'resolution': '1D'
}
response = requests.get(
f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/prices/line',
params=params
)
data = response.json()
# Convert to DataFrame for analysis
df = pd.DataFrame(data)
df['date'] = pd.to_datetime(df['date'])
df.set_index('date', inplace=True)
# Calculate moving averages
df['MA7'] = df['value'].rolling(window=7).mean()
df['MA30'] = df['value'].rolling(window=30).mean()
[
{
"date": "2024-02-01T00:00:00Z",
"value": 2320.50
},
{
"date": "2024-02-02T00:00:00Z",
"value": 2345.75
},
{
"date": "2024-02-03T00:00:00Z",
"value": 2380.20
},
{
"date": "2024-02-04T00:00:00Z",
"value": 2365.90
},
{
"date": "2024-02-05T00:00:00Z",
"value": 2410.30
},
{
"date": "2024-02-06T00:00:00Z",
"value": 2435.50
}
]
Overview
Fetch historical price data for any token with customizable time ranges and resolutions. Perfect for building price charts, analyzing trends, and backtesting strategies.Request
string
required
Token contract address
string
required
ISO 8601 start date (e.g., “2024-01-01T00:00:00Z”)
string
required
ISO 8601 end date (e.g., “2024-02-01T00:00:00Z”)
string
default:"1H"
Data point frequency:
1- 1 minute5- 5 minutes15- 15 minutes1H- 1 hour4H- 4 hours1D- 1 day1W- 1 week
string
Quote currency token address (defaults to USD)
Response
string
required
ISO 8601 date-time for this data point
number
required
Price at this date
curl -X GET "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/prices/line?startDate=2024-02-01T00:00:00Z&endDate=2024-02-14T00:00:00Z&resolution=1D"
// Fetch 30 days of daily price data
const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7';
const endDate = new Date();
const startDate = new Date();
startDate.setDate(startDate.getDate() - 30);
const params = new URLSearchParams({
startDate: startDate.toISOString(),
endDate: endDate.toISOString(),
resolution: '1D'
});
const response = await fetch(
`https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/prices/line?${params}`
);
const data = await response.json();
// Calculate price statistics
const prices = data.map(d => d.value);
const avgPrice = prices.reduce((a, b) => a + b) / prices.length;
const maxPrice = Math.max(...prices);
const minPrice = Math.min(...prices);
console.log(`30-day stats: Avg: $${avgPrice}, High: $${maxPrice}, Low: $${minPrice}`);
import requests
from datetime import datetime, timedelta
import pandas as pd
token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'
end_date = datetime.now()
start_date = end_date - timedelta(days=30)
params = {
'startDate': start_date.isoformat() + 'Z',
'endDate': end_date.isoformat() + 'Z',
'resolution': '1D'
}
response = requests.get(
f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/prices/line',
params=params
)
data = response.json()
# Convert to DataFrame for analysis
df = pd.DataFrame(data)
df['date'] = pd.to_datetime(df['date'])
df.set_index('date', inplace=True)
# Calculate moving averages
df['MA7'] = df['value'].rolling(window=7).mean()
df['MA30'] = df['value'].rolling(window=30).mean()
[
{
"date": "2024-02-01T00:00:00Z",
"value": 2320.50
},
{
"date": "2024-02-02T00:00:00Z",
"value": 2345.75
},
{
"date": "2024-02-03T00:00:00Z",
"value": 2380.20
},
{
"date": "2024-02-04T00:00:00Z",
"value": 2365.90
},
{
"date": "2024-02-05T00:00:00Z",
"value": 2410.30
},
{
"date": "2024-02-06T00:00:00Z",
"value": 2435.50
}
]
Resolution Guidelines
Recommended resolutions by time range:
- < 1 day: 1 or 5 minute resolution
- 1-7 days: 15 minute or 1 hour resolution
- 1-4 weeks: 1 or 4 hour resolution
- 1-3 months: Daily resolution
- 3+ months: Weekly resolution
Was this page helpful?
⌘I