tostringrequerido
Target currency code (e.g. EUR).
https://api.sandbase.ai/v1/api/x-rates/monthly-averageRetrieves 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.
Su salida aparecerá aquí
Complete las entradas y luego haga clic en Ejecutar.
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.
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.
| Name | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Source currency code (e.g. USD). One of: USD, EUR, GBP, JPY, CHF, CAD, AUD. |
to | string | Yes | Target currency code (e.g. EUR). |
amount | number | No | Amount to calculate rates for. |
year | string | No | Year in YYYY format. Defaults to the current year. |
Flat $0.03 per call. Failed calls are not charged.
Empiece a construir
Endpoint de la API de la plataforma con autenticación unificada y seguimiento de uso.
curl -X POST "https://api.sandbase.ai/v1/api/x-rates/monthly-average" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "JPY",
"from": "USD",
"year": "2024",
"amount": 1
}'Configure su clave de API de SandBase en el entorno de su servidor. Las solicitudes usan autenticación Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserve su clave en el servidor. No la exponga en código del navegador.
tostringrequeridoTarget currency code (e.g. EUR).
fromstringrequeridoSource currency code (e.g. USD).
Valores posibles: USD, EUR, GBP, JPY, CHF, CAD, AUD
yearstringYear in YYYY format. Defaults to the current year.
amountnumberAmount to calculate rates for.
Valor predeterminado: 1
Respuesta de ejemplo guardada para esta API; no se realiza ninguna solicitud en vivo al verla.
No se ha publicado ninguna respuesta guardada. Ejecute la API en Playground para inspeccionar su respuesta.
Explorar más
| API | Precio | Respuesta |
|---|---|---|
X-Rates Monthly AverageEsta API X-Rates | $0.03 por llamada | JSON |
X-Rates | $0.03 por llamada | JSON |
X-Rates | $0.03 por llamada | JSON |
X-Rates | $0.03 por llamada | JSON |
X-Rates | $0.03 por llamada | JSON |
X-Rates | $0.03 por llamada | JSON |
Preguntas
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.
$0.03 por llamada, facturado desde tu saldo de SandBase. Solo se te cobra por las llamadas que haces; no hay suscripción.
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.
Una respuesta JSON devuelta en la misma solicitud HTTP (sincrónica).
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.