tostringwymagane
Target currency code (e.g. USD, JPY). Supports all codes returned by get_currency_symbols.
https://api.sandbase.ai/v1/api/xe/convert-currencyConvert a specific amount from source to target currency. Returns the same structure as get_live_exchange_rate with the specified amount applied to the mid-market rate.
Twój wynik pojawi się tutaj
Uzupełnij dane wejściowe, a następnie kliknij Uruchom.
Convert a specific amount from source to target currency. Returns the same structure as get_live_exchange_rate with the specified amount applied to the mid-market rate.
curl -X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "xe/convert-currency", "to": "USD", "from": "EUR", "amount": 100.0}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Amount to convert |
from | string | Yes | Source currency code (e.g. EUR, GBP). Supports all codes returned by get_currency_symbols. |
to | string | Yes | Target currency code (e.g. USD, JPY). Supports all codes returned by get_currency_symbols. |
Flat $0.03 per call. Failed calls are not charged.
Zacznij tworzyć
Punkt końcowy API platformy z jednolitym uwierzytelnianiem i śledzeniem użycia.
curl -X POST "https://api.sandbase.ai/v1/api/xe/convert-currency" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "USD",
"from": "EUR",
"amount": 100
}'Ustaw klucz API SandBase w środowisku serwera. Żądania używają uwierzytelniania Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Przechowuj klucz na serwerze. Nie ujawniaj go w kodzie przeglądarkowym.
tostringwymaganeTarget currency code (e.g. USD, JPY). Supports all codes returned by get_currency_symbols.
fromstringwymaganeSource currency code (e.g. EUR, GBP). Supports all codes returned by get_currency_symbols.
amountnumberwymaganeAmount to convert
Zapisany przykładowy response dla tego API; podczas wyświetlania nie jest wykonywane żadne żądanie na żywo.
Nie opublikowano zapisanego response. Uruchom API w Playground, aby sprawdzić jego odpowiedź.
Odkryj więcej
| API | Cena | Odpowiedź |
|---|---|---|
XE Convert CurrencyTo API XE | $0.03 za wywołanie | JSON |
XE | $0.06 za wywołanie | JSON |
XE | $0.03 za wywołanie | JSON |
XE | $0.03 za wywołanie | JSON |
XE | $0.03 za wywołanie | JSON |
XE | $0.03 za wywołanie | JSON |
Pytania
Wyślij żądanie POST do https://api.sandbase.ai/v1/api/xe/convert-currency z kluczem API SandBase w nagłówku Authorization (Bearer) oraz parametrami w treści JSON. Możesz też wypróbować je w Playground na tej stronie bez pisania kodu.
$0.03 za wywołanie, rozliczane z salda SandBase. Płacisz tylko za wykonane wywołania; nie ma subskrypcji.
Wymagane: to (string), from (string) i amount (number). Tabela Parameters oraz Playground na tej stronie zawierają wszystkie pola.
Odpowiedź JSON zwrócona w tym samym żądaniu HTTP (synchronicznie).
Nie. XE Convert Currency działa przez SandBase, więc jeden klucz API SandBase obejmuje ten endpoint i każde inne API oraz model w katalogu. Nie musisz osobno ubiegać się o dostęp do API XE.