tostringerforderlich
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.
Ihre Ausgabe wird hier angezeigt
Vervollständigen Sie die Eingaben und klicken Sie dann auf Ausführen.
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.
Jetzt loslegen
Plattform-API-Endpunkt mit einheitlicher Authentifizierung und Nutzungsnachverfolgung.
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
}'Legen Sie Ihren SandBase API-Schlüssel in Ihrer Serverumgebung fest. Anfragen verwenden Bearer-Authentifizierung.
export SANDBASE_API_KEY="YOUR_API_KEY"Bewahren Sie Ihren Schlüssel auf dem Server auf. Geben Sie ihn nicht in Browser-Code preis.
tostringerforderlichTarget currency code (e.g. EUR).
fromstringerforderlichSource currency code (e.g. USD).
Mögliche Werte: USD, EUR, GBP, JPY, CHF, CAD, AUD
yearstringYear in YYYY format. Defaults to the current year.
amountnumberAmount to calculate rates for.
Standard: 1
Gespeicherte Beispielantwort für diese API; beim Anzeigen wird keine Live-Anfrage gesendet.
Es wurde keine gespeicherte Antwort veröffentlicht. Führen Sie die API in Playground aus, um die Antwort zu prüfen.
Mehr entdecken
| API | Preis | Antwort |
|---|---|---|
X-Rates Monthly AverageDiese API X-Rates | $0.03 pro Aufruf | JSON |
X-Rates | $0.03 pro Aufruf | JSON |
X-Rates | $0.03 pro Aufruf | JSON |
X-Rates | $0.03 pro Aufruf | JSON |
X-Rates | $0.03 pro Aufruf | JSON |
X-Rates | $0.03 pro Aufruf | JSON |
Fragen
Senden Sie eine POST-Anfrage an https://api.sandbase.ai/v1/api/x-rates/monthly-average mit Ihrem SandBase API-Schlüssel im Authorization-Header (Bearer) und den Parametern als JSON-Body. Sie können das auch ohne Code direkt auf dieser Seite im Playground testen.
$0.03 pro Aufruf, abgerechnet von Ihrem SandBase-Guthaben. Es werden nur die von Ihnen getätigten Aufrufe berechnet; es gibt kein Abo.
Erforderlich: to (string) und from (eines von USD, EUR, GBP, JPY, CHF, CAD, AUD). Optional: year (string) und amount (number). Die Parametertabelle und der Playground auf dieser Seite listen jedes Feld auf.
Eine JSON-Antwort, die in derselben HTTP-Anfrage zurückgegeben wird (synchron).
Nein. X-Rates Monthly Average läuft über SandBase, daher deckt ein SandBase API-Schlüssel diesen Endpunkt und jede andere API sowie jedes Modell im Katalog ab. Sie müssen keinen separaten Zugang für X-Rates API beantragen.