The data obtained through the API is inconsistent with the data on the web page. Why is there a slight deviation?

I obtained the currency transaction data in the last 3 days through the python program, and found that the data obtained by api is inconsistent with the data displayed on the web webpage. Why is there a slight deviation?
python code:
import ccxt
import pandas as pd
from datetime import datetime, timedelta

# 初始化币安交易所

exchange = ccxt.binance(({‘proxies’: {‘https’: ‘127.0.0.1:10809’}})) # 设置本地vpn代理,币安无法直接访问

# 获取当前时间和一年前的时间
end_time = datetime.now()
start_time = end_time - timedelta(days=365)

# 获取一年内上币的交易对的时间
new_listings =
for symbol in exchange.fetch_markets():
# 上币时间戳created字段里面,由于币安数据不完整,许多货币没有提供上币时间,只获取提供了时间的货币
if symbol[‘created’]:
timestamp = symbol[‘created’]
# 将时间戳转换成标准时间,提供的时间戳是毫秒级别的,需要先转成秒
listing_date = datetime.fromtimestamp(symbol[‘created’] / 1000)
# 筛选出最近1年上币的交易对
if start_time <= listing_date <= end_time:
new_listings.append(symbol[‘symbol’])
# print(symbol[‘symbol’] + ’ ’ + str(listing_date))

# 获取每个新上币的前3个交易日的涨跌幅
listing_data =
for symbol in new_listings:
try:
# 获取该交易对最近4天的数据
ohlcv = exchange.fetch_ohlcv(symbol, ‘1d’, limit=4)
for i in ohlcv:
print(symbol, datetime.fromtimestamp(i[0] / 1000), i)
if len(ohlcv) >= 4:
changes = [(ohlcv[i + 1][4] - ohlcv[i][4]) / ohlcv[i][4] * 100 for i in range(3)]
listing_data.append({‘Symbol’: symbol, ‘Day 1 Change (%)’: changes[0], ‘Day 2 Change (%)’: changes[1],
‘Day 3 Change (%)’: changes[2]})
except Exception as e:
print(f"Error fetching data for {symbol}: {e}")

# 转换为DataFrame并显示结果
df = pd.DataFrame(listing_data)
print(df)

Result:
ETH/BTC:BTC 2024-04-25 08:00:00 [1714003200000, 0.04885, 0.04943, 0.0485, 0.04894, 24627.79]
ETH/BTC:BTC 2024-04-26 08:00:00 [1714089600000, 0.04894, 0.04927, 0.0487, 0.0491, 12644.6]
ETH/BTC:BTC 2024-04-27 08:00:00 [1714176000000, 0.0491, 0.05179, 0.049, 0.05131, 35123.16]
ETH/BTC:BTC 2024-04-28 08:00:00 [1714262400000, 0.05132, 0.05212, 0.05116, 0.05194, 12292.52]

web地址:比特币交易所|加密货币交易所|币安