惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
人人都是产品经理
人人都是产品经理
C
Check Point Blog
宝玉的分享
宝玉的分享
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
量子位
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
J
Java Code Geeks
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
P
Proofpoint News Feed
美团技术团队
H
Help Net Security
B
Blog
博客园_首页

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How to Download Historical Exchange Rates as CSV with a F...
Jenpo Zhan · 2026-06-18 · via DEV Community

Jenpo Zhan

Developers and spreadsheet users often need historical exchange rates for reporting, bookkeeping, ecommerce reconciliation, or dashboards.

The usual workflow is awkward:

  • Search a currency converter.
  • Copy a single number.
  • Repeat for many dates.
  • Paste everything into a spreadsheet.

This tutorial shows a simpler workflow using FXpeek's free JSON and CSV endpoints.

1. Get The Latest Reference Rate

curl 'https://fxpeek.com/api/rates?from=CNY&to=TRY'

Example response:

{
  "from": "CNY",
  "to": "TRY",
  "rate": 6.789,
  "timestamp": 1780576363130
}

2. Get A Historical Series

curl 'https://fxpeek.com/api/history?from=CNY&to=TRY&days=365'

Use this when you want to build:

  • A chart
  • A dashboard
  • A report
  • A validation script
  • A lightweight finance tool

3. Download CSV For Excel Or Google Sheets

curl -L 'https://fxpeek.com/api/csv?from=CNY&to=TRY&days=365' \
  -o cny-try-history.csv

CSV output:

date,base,target,rate
2026-05-28,CNY,TRY,6.7699
2026-05-29,CNY,TRY,6.7811
2026-06-01,CNY,TRY,6.7839

4. Use It In JavaScript

async function getHistory(from, to, days = 365) {
  const url = new URL('https://fxpeek.com/api/history');
  url.searchParams.set('from', from);
  url.searchParams.set('to', to);
  url.searchParams.set('days', String(days));

  const res = await fetch(url);
  if (!res.ok) {
    throw new Error(`FX API error: ${res.status}`);
  }
  return res.json();
}

const history = await getHistory('CNY', 'TRY', 30);
console.log(history.rates);

5. Use It In Python

import requests
import pandas as pd

url = "https://fxpeek.com/api/history"
params = {"from": "CNY", "to": "TRY", "days": 365}

data = requests.get(url, params=params, timeout=20).json()
df = pd.DataFrame(data["rates"])
df.to_csv("cny-try-history.csv", index=False)

Notes

FXpeek provides reference rates for historical lookup, spreadsheets, reports, and lightweight apps. These are not transaction quotes.

API docs:

https://fxpeek.com/en/api?utm_source=devto&utm_medium=article&utm_campaign=fxpeek_wave1_api_csv&utm_content=csv_tutorial

Example pair page:

https://fxpeek.com/en/cny-to-try?utm_source=devto&utm_medium=article&utm_campaign=fxpeek_wave1_api_csv&utm_content=pair_page

Good Next Steps

  • Add a date picker.
  • Cache the API result.
  • Build a chart with Recharts or Chart.js.
  • Export monthly averages.
  • Combine rates with ecommerce order data.