省略 base 时使用快照原始基准货币。rates 中的数值表示每单位 base 对应的目标货币数量。rateDate 为报价日期,updatedAt 为 D1 更新时刻。stale 表示报价日期距今超过两个 UTC 日。选择其他基准货币会重新折算源数据。 访问类别:匿名 API,可携带 Token 使用独立额度
请求参数
basequery- string · 格式:^[A-Z0-9]{2,12}$/i
_formatquery- 响应格式为 json 或 text;_format=svg 返回 JSON。plain 是 text 的别名。未识别的值继续按 Accept 协商。
- string · 可选:json、text
_colorquery- 控制 text 响应的 ANSI 颜色。0、false、off、no 关闭;省略或其他值保留。
- string · 可选:0、false、off、no
路径兼容入口
GET /fx/rates/{base}
将 base 的值进行 URL 编码后填入路径。
响应
application/json
{
"type": "object",
"properties": {
"base": {
"type": "string",
"pattern": "^[A-Z0-9]{2,12}$/i"
},
"source": {
"type": "string",
"enum": [
"fawaz-jsdelivr",
"fawaz-pages",
"ecb"
]
},
"rateDate": {
"type": "string",
"format": "date"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"rates": {
"type": "object",
"additionalProperties": {
"type": "number",
"exclusiveMinimum": 0,
"minimum": 1e-30,
"maximum": 1e+30
}
},
"stale": {
"type": "boolean"
}
},
"required": [
"base",
"source",
"rateDate",
"updatedAt",
"rates",
"stale"
]
}application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}响应示例
成功响应
curl -sS 'https://oit.sh/fx/rates/USD?_format=json'HTTP 200
content-type: application/json
content-encoding: gzip
cache-control: no-store
{
"base": "USD",
"source": "fawaz-jsdelivr",
"rateDate": "2026-11-15",
"updatedAt": "2026-11-16T03:23:16.950Z",
"rates": {
"1INCH": 14.96813866,
"AAVE": 0.0094667212,
"ADA": 6.6490087,
"AED": 3.6725,
"AFN": 65.5638136,
"AKT": 2.09045253,
"ALGO": 12.77773736,
"ALL": 82.28624216,
"AMD": 360.54046471,
"AMP": 1902.2784879,
"ANG": 1.79713303,
"AOA": 918.3149041,
"APE": 12.58023218,
"APT": 2.20154717,
"AR": 0.38229431,
"ARB": 7.53716454,
"ARS": 1544.79579929,
"ATOM": 0.77904593,
"ATS": 12.48433001,
"AUD": 1.47633138,
"AVAX": 0.13813627,
"AWG": 1.79,
"AXS": 1.47365166,
"AZM": 8506.26048109,
"AZN": 1.7012521,
"BAKE": 3981.45411486,
"BAM": 1.7744691,
"BAT": 10.64462752,
"BBD": 2,
"BCH": 0.0048523757,
"BDT": 125.05789682,
"BEF": 36.59924742,
"BGN": 1.7744691,
"BHD": 0.376,
"BIF": 3004.53243227,
"BMD": 1,
"BNB": 0.0016806991,
"BND": 1.28795143,
"BOB": 11.66600585,
"BRL": 5.66006867,
"BSD": 1,
"BSV": 0.069270101,
"BSW": 3330.65791428,
"BTC": 0.000015448161,
"BTG": 3.08943045,
"BTN": 94.25960039,
"BTT": 3221719.09603873,
"BUSD": 1.0004248,
"BWP": 13.97877104,
"BYN": 3.00443822,
"BYR": 19602.61923901,
"BZD": 2.01688521,
"CAD": 1.42708735,
"CAKE": 0.61561043,
"CDF": 2274.69086321,
"CELO": 16.66245307,
"CFX": 29.04193156,
"CHF": 0.83885978,
"CHZ": 102.29495033,
"CLP": 994.97986838,
"CNH": 6.67660067,
"CNY": 6.67169127,
"COMP": 0.055294092,
"COP": 3311.68819822,
"CRC": 447.68188485,
"CRO": 22.80044768,
"CRV": 4.82141779,
"CSPR": 596.59546353,
"CUC": 1.00013362,
"CUP": 24.06816842,
"CVE": 100.04484427,
"CVX": 0.69037803,
"CYP": 0.5310025,
"CZK": 22.13926703,
"DAI": 1.00029225,
"DASH": 0.026865172,
"DCR": 0.094951548,
"DEM": 1.7744691,
"DFI": 919.39469216,
"DJF": 177.78996794,
"DKK": 6.78282039,
"DOGE": 17.18086869,
"DOP": 60.636903,
"DOT": 1.39286997,
"DYDX": 12.68114167,
"DZD": 137.26527326,
"EEK": 14.19575281,
"EGLD": 0.38385012,
"EGP": 53.45214847,
"ENJ": 52.32135266,
"EOS": 15.30387634,
"ERN": 15,
"ESP": 150.95729989,
"ETB": 161.02002311,
"ETC": 0.16924488,
"ETH": 0.00055406973,
"EUR": 0.90727164,
"EURC": 0.90906336,
"FEI": 1.00130391,
"FIL": 1.62205672,
"FIM": 5.39439224,
"FJD": 2.25571282,
"FKP": 0.75684879,
"FLOW": 57.0724959,
"FLR": 205.73809215,
"FRAX": 1.00911545,
"FRF": 5.95131186,
"FTT": 4.88767754,
"GALA": 741.64124739,
"GBP": 0.75684879,
"GEL": 2.59293875,
"GGP": 0.75684879,
"GHC": 117198.19764451,
"GHS": 11.71981976,
"GIP": 0.75684879,
"GMD": 75.33992928,
"GMX": 0.1405469,
"GNF": 8860.14795131,
"GNO": 0.011085102,
"GRD": 309.15281296,
"GRT": 60.07083613,
"GT": 0.13184221,
"GTQ": 7.64313302,
"GUSD": 1.00226812,
"GYD": 209.11383515,
"HBAR": 17.4142236,
"HKD": 7.84560653,
"HNL": 26.96284977,
"HNT": 4.40995821,
"HOT": 2882.97994244,
"HRK": 6.83583821,
"HT": 24.92371659,
"HTG": 132.02479149,
"HUF": 330.96619277,
"ICP": 0.4564671,
"IDR": 18216.13138694,
"IEP": 0.71453449,
"ILS": 3.18208652,
"IMP": 0.75684879,
"IMX": 10.06861116,
"INJ": 0.14134273,
"INR": 94.25960039,
"IQD":
… 已截断,完整响应 8261 字符错误示例
curl -sS 'https://oit.sh/fx/rates?base=invalid+value&_format=json'HTTP 400
content-type: application/json
content-encoding: gzip
cache-control: no-store
{
"error": {
"code": "INVALID_INPUT",
"message": "参数无效",
"issues": [
{
"location": "query",
"field": "base",
"code": "invalid_format",
"message": "格式要求:/^[A-Z0-9]{2,12}$/i"
}
]
}
}curl 访问示例
curl、wget、HTTPie 默认得到 text/plain。示例展示纯文本输出。
命令与输出
curl -sS 'https://oit.sh/fx/rates/USD?_color=0'HTTP 200 content-type: text/plain; charset=utf-8 content-encoding: gzip cache-control: no-store base: USD source: fawaz-jsdelivr rateDate: 2026-11-15 updatedAt: 2026-11-16T03:23:16.950Z rates: 1INCH: 14.96813866 AAVE: 0.0094667212 ADA: 6.6490087 AED: 3.6725 AFN: 65.5638136 AKT: 2.09045253 ALGO: 12.77773736 ALL: 82.28624216 AMD: 360.54046471 AMP: 1902.2784879 ANG: 1.79713303 AOA: 918.3149041 APE: 12.58023218 APT: 2.20154717 AR: 0.38229431 ARB: 7.53716454 ARS: 1544.79579929 ATOM: 0.77904593 ATS: 12.48433001 AUD: 1.47633138 AVAX: 0.13813627 AWG: 1.79 AXS: 1.47365166 AZM: 8506.26048109 AZN: 1.7012521 BAKE: 3981.45411486 BAM: 1.7744691 BAT: 10.64462752 BBD: 2 BCH: 0.0048523757 BDT: 125.05789682 BEF: 36.59924742 BGN: 1.7744691 BHD: 0.376 BIF: 3004.53243227 BMD: 1 BNB: 0.0016806991 BND: 1.28795143 BOB: 11.66600585 BRL: 5.66006867 BSD: 1 BSV: 0.069270101 BSW: 3330.65791428 BTC: 0.000015448161 BTG: 3.08943045 BTN: 94.25960039 BTT: 3221719.09603873 BUSD: 1.0004248 BWP: 13.97877104 BYN: 3.00443822 BYR: 19602.61923901 BZD: 2.01688521 CAD: 1.42708735 CAKE: 0.61561043 CDF: 2274.69086321 CELO: 16.66245307 CFX: 29.04193156 CHF: 0.83885978 CHZ: 102.29495033 CLP: 994.97986838 CNH: 6.67660067 CNY: 6.67169127 COMP: 0.055294092 COP: 3311.68819822 CRC: 447.68188485 CRO: 22.80044768 CRV: 4.82141779 CSPR: 596.59546353 CUC: 1.00013362 CUP: 24.06816842 CVE: 100.04484427 CVX: 0.69037803 CYP: 0.5310025 CZK: 22.13926703 DAI: 1.00029225 DASH: 0.026865172 DCR: 0.094951548 DEM: 1.7744691 DFI: 919.39469216 DJF: 177.78996794 DKK: 6.78282039 DOGE: 17.18086869 DOP: 60.636903 DOT: 1.39286997 DYDX: 12.68114167 DZD: 137.26527326 EEK: 14.19575281 EGLD: 0.38385012 EGP: 53.45214847 ENJ: 52.32135266 EOS: 15.30387634 ERN: 15 ESP: 150.95729989 ETB: 161.02002311 ETC: 0.16924488 ETH: 0.00055406973 EUR: 0.90727164 EURC: 0.90906336 FEI: 1.00130391 FIL: 1.62205672 FIM: 5.39439224 FJD: 2.25571282 FKP: 0.75684879 FLOW: 57.0724959 FLR: 205.73809215 FRAX: 1.00911545 FRF: 5.95131186 FTT: 4.88767754 GALA: 741.64124739 GBP: 0.75684879 GEL: 2.59293875 GGP: 0.75684879 GHC: 117198.19764451 GHS: 11.71981976 GIP: 0.75684879 GMD: 75.33992928 GMX: 0.1405469 GNF: 8860.14795131 GNO: 0.011085102 GRD: 309.15281296 GRT: 60.07083613 GT: 0.13184221 GTQ: 7.64313302 GUSD: 1.00226812 GYD: 209.11383515 HBAR: 17.4142236 HKD: 7.84560653 HNL: 26.96284977 HNT: 4.40995821 HOT: 2882.97994244 HRK: 6.83583821 HT: 24.92371659 HTG: 132.02479149 HUF: 330.96619277 ICP: 0.4564671 IDR: 18216.13138694 IEP: 0.71453449 ILS: 3.18208652 IMP: 0.75684879 IMX: 10.06861116 INJ: 0.14134273 INR: 94.25960039 IQD: 1512.1913153 IRR: 1913993.24546896 ISK: 123.91582001 ITL: 1756.72286766 JEP: 0.75684879 JMD: 158.18802239 JOD: 0.709 JPY: 159.68752013 KAS: 37.33953079 KAVA: 28.73652994 KCS: 0.16101843 KDA: 177.31049439 KES: 130.01352373 KGS: 87.45484474 KHR: 4080.32531331 KLAY: 34.22614619 KMF: 446.34838973 KNC: 10.55831713 KPW: 900.12062133 KRW: 1336.73751966 KSM: 0.36783929 KWD: 0.31109234 KYD: 0.82036143 KZT: 444.6206382 LAK: 22443.38225296 LBP: 90301.19005818 LDO: 3.67380303 LEO: 0.1096571 LINK: 0.10950671 LKR: 332.67102806 LRC: 157.25774128 LRD: 170.02581961 LSL: 16.93063104 LTC: 0.022400872 LTL: 3.13262754 LUF: 36.59924742 LUNA: 31.73071837 LUNC: 28940.15449359 LVL: 0.637630 … 已截断,完整响应 6526 字符
在线调试
curl -X GET 'https://oit.sh/fx/rates'
响应
等待发送请求