Sand AISand AI MAGI-2MAGI-2 hiện đã có trên SandBase: video 1080p với âm thanh gốcDùng thử ngay

X-Rates Monthly Average

Tài liệu API
https://api.sandbase.ai/v1/api/x-rates/monthly-average

Retrieves monthly average exchange rates for a specific currency pair for a given year. Returns up to 12 monthly data points with the average rate and number of days in each month. Defaults to the current year if year is not specified.

Giá
$0.03USD / lượt gọi
Phương thức
POST
Phản hồi
JSON
Tham số
2 bắt buộc · 2 tùy chọn

Phòng thử nghiệm

Đầu vào
Target currency code (e.g. EUR).
Source currency code (e.g. USD).
Year in YYYY format. Defaults to the current year.
Amount to calculate rates for.
Đầu raSẵn sàng

Đầu ra của bạn sẽ xuất hiện ở đây

Hoàn tất đầu vào, rồi nhấp Run.

README API

X-Rates Monthly Average API

Retrieves monthly average exchange rates for a specific currency pair for a given year. Returns up to 12 monthly data points with the average rate and number of days in each month. Defaults to the current year if year is not specified.

Request

curl -X POST "https://api.sandbase.ai/v1/run" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "x-rates/monthly-average", "to": "JPY", "from": "USD", "year": "2024", "amount": 1.0}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
fromstringYesSource currency code (e.g. USD). One of: USD, EUR, GBP, JPY, CHF, CAD, AUD.
tostringYesTarget currency code (e.g. EUR).
amountnumberNoAmount to calculate rates for.
yearstringNoYear in YYYY format. Defaults to the current year.

Pricing

Flat $0.03 per call. Failed calls are not charged.

Khám phá thêm

APIs liên quan

Tất cả APIs
APIGiáPhản hồi
X-Rates$0.03 mỗi lần gọiJSON
X-Rates$0.03 mỗi lần gọiJSON
X-Rates$0.03 mỗi lần gọiJSON
X-Rates$0.03 mỗi lần gọiJSON
X-Rates$0.03 mỗi lần gọiJSON
X-Rates$0.03 mỗi lần gọiJSON

Câu hỏi

FAQ

Làm thế nào để dùng API X-Rates Monthly Average?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/x-rates/monthly-average với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.

API X-Rates Monthly Average có giá bao nhiêu?

$0.03 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.

API X-Rates Monthly Average chấp nhận những tham số nào?

Bắt buộc: to (string) và from (một trong số USD, EUR, GBP, JPY, CHF, CAD, AUD). Tùy chọn: year (string) và amount (number). Bảng Parameters và Playground trên trang này liệt kê mọi trường.

API X-Rates Monthly Average trả về gì?

Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ).

Tôi có cần tài khoản nhà phát triển hoặc API key của X-Rates không?

Không. X-Rates Monthly Average chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của X-Rates.