Gold, silver, CPI, GDP, lãi suất, tỷ giá — tất cả từ một endpoint.
Tích hợp trong vài phút với Python, JavaScript hoặc bất kỳ ngôn ngữ nào hỗ trợ HTTP.
Cài đặt API trong 4 bước
Làm theo thứ tự từ trên xuống — sau bước 4 bạn đã pull được dữ liệu thật vào code của mình.
Đăng ký tài khoản & lấy API key
API key là "chìa khoá" để gọi dữ liệu. Mỗi request đều cần key này.
Tôi muốn pull giá vàng SJC vào Python mỗi ngày
commodity
Lấy 30 ngày gần nhất, lọc theo SJC, lưu vào DataFrame:
import requests, pandas as pd
API_KEY = "YOUR_API_KEY"
BASE = "https://api.vietdataverse.online/api/v1"
r = requests.get(f"{BASE}/gold",
params={"type": "SJC", "period": "30d"},
headers={"X-API-Key": API_KEY})
df = pd.DataFrame(r.json()["data"])
df["period"] = pd.to_datetime(df["period"])
print(df[["period", "buy_price", "sell_price"]].tail(5))
Endpoint: GET /api/v1/gold · Params: type (SJC), period (30d | 90d | 1y)
Tôi muốn theo dõi tỷ giá USD/VND của VCB hàng ngày
rates
import requests
r = requests.get(
"https://api.vietdataverse.online/api/v1/sbv-rate",
params={"bank": "VCB", "currency": "USD", "period": "30d"},
headers={"X-API-Key": "YOUR_API_KEY"})
for row in r.json()["data"][-5:]:
print(f"{row['period']} mua={row['buy']:,} bán={row['sell']:,}")
Endpoint: GET /api/v1/sbv-rate · Params: bank (VCB | SBV), currency (USD | EUR | JPY…)
Tôi muốn so sánh lãi suất tiết kiệm ngân hàng theo kỳ hạn
rates
import requests
r = requests.get(
"https://api.vietdataverse.online/api/v1/termdepo",
params={"period": "90d"},
headers={"X-API-Key": "YOUR_API_KEY"})
data = r.json()["data"]
latest = data[-1] # row mới nhất
print(f"ACB — ngày {latest['period']}")
print(f" 1 tháng: {latest.get('term_1m', '-')}%")
print(f" 6 tháng: {latest.get('term_6m', '-')}%")
print(f" 12 tháng: {latest.get('term_12m', '-')}%")
Endpoint: GET /api/v1/termdepo
Tôi muốn lấy CPI Việt Nam cho AI agent
macro
import requests
def get_vn_cpi_context(api_key: str) -> str:
"""Trả về context string để inject vào system prompt của AI agent."""
r = requests.get(
"https://api.vietdataverse.online/api/v1/macro/cpi",
params={"period": "1y"},
headers={"X-API-Key": api_key})
rows = r.json()["data"][-6:] # 6 tháng gần nhất
lines = [f"- {d['period']}: CPI {d['value']}% YoY" for d in rows]
return "CPI Việt Nam 6 tháng gần nhất:\n" + "\n".join(lines)
print(get_vn_cpi_context("YOUR_API_KEY"))
Endpoint: GET /api/v1/macro/cpi
Tôi muốn dùng dữ liệu trong bảng tính — không cần code
google sheets
Copy file Google Sheets mẫu về Drive của bạn, dán API key vào một ô. Chín bộ dữ liệu tự đổ về và tự cập nhật.
Dùng hàm IMPORTDATA có sẵn của Google Sheets — không cài tiện ích, không có màn hình cấp quyền. Hướng dẫn đầy đủ →
Dùng dữ liệu trong Google Sheets
Không cần code — kéo giá vàng thẳng vào bảng tính bằng một công thức (các bộ dữ liệu khác đang được bổ sung).
Google Sheets có hàm IMPORTDATA() đọc trực tiếp dữ liệu CSV từ API.
Vì hàm này không gửi được header, Viet Dataverse cho phép truyền API key ngay trên đường link qua tham số api_key: