メインコンテンツへスキップ
GET
Convert exchange rates

はじめに

ベースURL

検証エンドポイント

convertエンドポイントには、APIキー、基準通貨、targetパラメータが必要です。
この成功したリクエストは、最新の為替レートを使用して1 EURをUSDに換算します。

リクエストパラメータ

String
必須
固有のAPIキーです。各ユーザーはCleariflowの各APIごとに固有のAPIキーを持っているため、為替レートAPIのキーはIPジオロケーションAPIなどでは動作しません。
String
必須
最新の為替レートを取得する基準通貨です。このAPIのすべての通貨パラメータと同様に、ISO 4217通貨標準(例:米ドルはUSD)を使用します。
String
必須
基準通貨に対する為替レートを取得する対象通貨です。baseパラメータと同様、ここで渡す通貨もISO 4217標準に従います。他のエンドポイントとは異なり、convert は一度に1つの対象通貨のみを受け付けます。
String
レートを取得したい過去の日付を YYYY-MM-DD 形式で指定します。空白のままにすると、利用可能な最新のレートが使用されます。
Float
対象通貨に換算したい基準通貨の金額です。

レスポンスパラメータ

APIレスポンスは、汎用的で軽量な JSON形式 で返されます。
String
為替レートを取得するために使用した基準通貨です。
String
base_amountが換算された対象通貨です。
String
成功したリクエストに従い、通貨が取得された日付です。
Float
リクエストからの基準通貨の金額です。
Float
base_amountが換算された対象通貨の金額です。
Float
base_amountを基準通貨から対象通貨に換算するために使用された為替レートです。

クエリパラメータ

api_key
string
必須

Your unique API key for authentication

base
string
デフォルト:EUR

The base currency used to get the latest exchange rate(s) for. Uses the ISO 4217 currency standard

target
string
必須

The target currency to convert to. Only one currency is allowed for conversion.

base_amount
number
デフォルト:1

The amount of the base currency you would like to convert to the target currency

date
string<date>

The historical date you'd like to get rates from, in the format of YYYY-MM-DD. If not specified, the latest available rates will be used.

レスポンス

Successful response

base
string
必須

The base currency used to get the exchange rates

例:

"EUR"

target
string
必須

The target currency that the base_amount was converted into

例:

"USD"

date
string<date>
必須

The date the currencies were pulled from, per the successful request

例:

"2024-01-01"

base_amount
number
必須

The amount of the base currency from the request

例:

1

converted_amount
number
必須

The amount of the target currency that the base_amount has been converted into

例:

0.85

exchange_rate
number
必須

The exchange rate used to convert the base_amount from the base currency to the target currency

例:

0.85

last_updated
integer
必須

The Unix timestamp of when the returned data was last updated

例:

1704067200