Sand AISand AI MAGI-2MAGI-2 ya está en SandBase: video en 1080p con audio nativoPruébalo ahora

X-Rates Monthly Average

Documentación de la 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.

Precio
$0.03USD / llamada
Método
POST
Respuesta
JSON
Parámetros
2 obligatorios · 2 opcionales

Entorno de pruebas

Entrada
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.
SalidaListo

Su salida aparecerá aquí

Complete las entradas y luego haga clic en Ejecutar.

README de la 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.

Explorar más

APIs relacionadas

Todas las APIs
APIPrecioRespuesta
X-Rates$0.03 por llamadaJSON
X-Rates$0.03 por llamadaJSON
X-Rates$0.03 por llamadaJSON
X-Rates$0.03 por llamadaJSON
X-Rates$0.03 por llamadaJSON
X-Rates$0.03 por llamadaJSON

Preguntas

FAQ

¿Cómo uso la API de X-Rates Monthly Average?

Envía una solicitud POST a https://api.sandbase.ai/v1/api/x-rates/monthly-average con tu clave API de SandBase en el encabezado Authorization (Bearer) y los parámetros como un cuerpo JSON. También puedes probarlo en el Playground de esta página sin escribir código.

¿Cuánto cuesta la API de X-Rates Monthly Average?

$0.03 por llamada, facturado desde tu saldo de SandBase. Solo se te cobra por las llamadas que haces; no hay suscripción.

¿Qué parámetros acepta la API de X-Rates Monthly Average?

Requeridos: to (string) y from (una de USD, EUR, GBP, JPY, CHF, CAD, AUD). Opcionales: year (string) y amount (number). La tabla de Parámetros y el Playground de esta página enumeran todos los campos.

¿Qué devuelve la API de X-Rates Monthly Average?

Una respuesta JSON devuelta en la misma solicitud HTTP (sincrónica).

¿Necesito una cuenta de desarrollador o una clave API de X-Rates?

No. X-Rates Monthly Average funciona a través de SandBase, así que una sola clave API de SandBase cubre este endpoint y todas las demás APIs y modelos del catálogo. No necesitas solicitar acceso a la API de X-Rates por separado.