Sand AISand AI MAGI-2MAGI-2 agora está na SandBase: vídeo em 1080p com áudio nativoExperimente agora

X-Rates Monthly Average

Docs da 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.

Preço
$0.03USD / chamada
Método
POST
Resposta
JSON
Parâmetros
2 obrigatórios · 2 opcionais

Playground

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.
SaídaPronto

Sua saída aparecerá aqui

Preencha as entradas e clique em Executar.

README da 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 mais

APIs relacionadas

Todas as APIs
APIPreçoResposta
X-Rates$0.03 por chamadaJSON
X-Rates$0.03 por chamadaJSON
X-Rates$0.03 por chamadaJSON
X-Rates$0.03 por chamadaJSON
X-Rates$0.03 por chamadaJSON
X-Rates$0.03 por chamadaJSON

Perguntas

FAQ

Como eu uso a API X-Rates Monthly Average?

Envie uma solicitação POST para https://api.sandbase.ai/v1/api/x-rates/monthly-average com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.

Quanto custa a API X-Rates Monthly Average?

$0.03 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.

Quais parâmetros a API X-Rates Monthly Average aceita?

Obrigatórios: to (string) e from (um de USD, EUR, GBP, JPY, CHF, CAD, AUD). Opcionais: year (string) e amount (number). A tabela de Parâmetros e o Playground nesta página listam todos os campos.

O que a API X-Rates Monthly Average retorna?

Uma resposta JSON retornada na mesma solicitação HTTP (síncrona).

Preciso de uma conta de desenvolvedor X-Rates ou de uma chave de API?

Não. X-Rates Monthly Average funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do X-Rates separadamente.