Currency Converter

Currency Converter

Finance Credits / request: 1

Converts an amount using TCMB or ECB rates. TCMB default quote is forex selling.

GET https://api.apikodu.com/api/v1/exchangerates/convert
Documentation
Overview

Converts an amount using TCMB or ECB rates. TCMB is TRY-based; ECB is EUR-based. from=to yields rate=1.

Authentication

Every request requires the x-api-key header. Credits used and remaining quota are returned in response headers (x-api-credits-used, x-api-remaining-credits, x-rate-limit-*).

Request
GET https://api.apikodu.com/api/v1/exchangerates/convert?amount=100&from=USD&to=TRY&source=tcmb&quote=forexSelling
Query string. POST JSON body is also accepted.
Parameters
Name Type Required Default Options Description
amount number * Required — — Amount greater than zero.
from string * Required — USD AUD DKK EUR GBP CHF SEK CAD KWD NOK SAR JPY BGN RON RUB IRR CNY PKR QAR KRW AZN AED XDR TRY Source ISO 4217.
to string * Required — — Target ISO 4217.
source string Optional tcmb tcmb ecb tcmb or ecb.
quote string Optional forexSelling forexSelling forexBuying banknoteSelling banknoteBuying TCMB quote only.
Response
Name Type Description
amount number Requested amount.
from string Normalized source code.
to string Normalized target code.
result number Converted amount.
rate number 1 from = rate to.
inverseRate number 1 to = inverseRate from.
source string TCMB or ECB.
quote string TCMB quote name. Null for ECB.
date string Rate date as ISO datetime.
Errors
HTTP code Description
400 -278 amount missing or ≤ 0.
400 -225 from/to/source invalid or not in the rate list.
400 -279 quote is not a TCMB quote name.
503 -224 TCMB cache empty (source=tcmb).
503 -226 ECB cache empty (source=ecb).
401 -100 x-api-key is missing, empty, malformed, inactive, banned, expired, IP-restricted, or not allowed for this API.
429 -221 Per-minute request limit exceeded. Response headers: x-rate-limit-limit, x-rate-limit-remaining, x-rate-limit-reset.
429 — Package credit quota cannot cover this request. Body may be { error, limit, currentUsage, requestCost } (no code field).
500 -1 Unexpected server error. message is a generic error text without technical details.
Notes
  • Success body is { data: { ... } }. Error body is { code, message }. code is an ApiResponseCode enum value (negative integer).

Sample response

{
  "data": {
    "amount": 100.0,
    "from": "USD",
    "to": "TRY",
    "result": 3358.18,
    "rate": 33.5818,
    "inverseRate": 0.029778,
    "source": "TCMB",
    "quote": "forexSelling",
    "date": "2026-09-03T00:00:00Z"
  }
}

Code samples

  
      const response = await fetch('https://api.apikodu.com/api/v1/exchangerates/convert', {
        method: 'GET',
        headers: {
          'x-api-key': 'YOUR_API_KEY'
        }
      });

      const data = await response.json();
      console.log(data);
  
  
      import requests

      headers = {
          'x-api-key': 'YOUR_API_KEY'
      }

      response = requests.get('https://api.apikodu.com/api/v1/exchangerates/convert', headers=headers)
      print(response.json())
  
  
      using var client = new HttpClient();
      client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");

      var response = await client.GetStringAsync("https://api.apikodu.com/api/v1/exchangerates/convert");
      Console.WriteLine(response);
  
  
      $response = file_get_contents('https://api.apikodu.com/api/v1/exchangerates/convert', false, stream_context_create([
          'http' => [
              'header' => "x-api-key: YOUR_API_KEY"
          ]
      ]));

      print_r(json_decode($response, true));
  
  
      curl -X GET 'https://api.apikodu.com/api/v1/exchangerates/convert' \
        -H 'x-api-key: YOUR_API_KEY'
  

Start building in minutes

Create a free account, get your API key and send your first request in minutes.

Get started free