---
title: "Panggilan pertama ke API nilai tukar | exchangerate.dev"
description: "Buka terminal dan tempel satu perintah curl untuk mendapatkan kurs pertama dalam JSON. Anda tidak memerlukan key untuk mencoba endpoint data; tambahkan nanti."
canonical: "https://exchangerate.dev/id/docs/quickstart"
---

# Panggilan pertama ke API nilai tukar

Buka terminal dan tempel satu perintah. Anda tidak memerlukan key untuk mencoba endpoint data.

## 1. Minta dua nilai tukar

USD pada path adalah mata uang dasar, sedangkan EUR dan GBP pada `symbols` adalah mata uang tujuan. Ganti kode tersebut sesuai kebutuhan.

### curl

```bash
curl -fsS --max-time 10 "https://api.exchangerate.dev/v1/latest/USD?symbols=EUR,GBP"
```

### Python

```python
from urllib.request import Request, urlopen
import json

# Identify your application explicitly when calling the API.
request = Request("https://api.exchangerate.dev/v1/latest/USD?symbols=EUR,GBP", headers={"User-Agent": "exchangerate-docs/1.0"})
with urlopen(request, timeout=10) as response:
    data = json.load(response)

print(data["rates"]["EUR"])
```

### JavaScript / Node.js

```javascript
const response = await fetch("https://api.exchangerate.dev/v1/latest/USD?symbols=EUR,GBP", {
  signal: AbortSignal.timeout(10_000),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
console.log(data.rates.EUR);
```

Panduan integrasi: [Python](https://exchangerate.dev/learn/python-exchange-rates) · [JavaScript / Node.js](https://exchangerate.dev/learn/javascript-currency-conversion) · [Google Sheets](https://exchangerate.dev/learn/google-sheets-exchange-rates) · [Excel](https://exchangerate.dev/learn/excel-exchange-rates) · [Go](https://exchangerate.dev/id/learn/go-exchange-rates) · [Swift](https://exchangerate.dev/id/learn/swift-exchange-rates) · [Zapier](https://exchangerate.dev/id/learn/zapier-exchange-rates)

## 2. Baca respons

Nilainya berubah, tetapi bentuk respons tetap. Baca `rates.EUR` dan simpan `source`, `market_session`, serta `data_updated_at` bersama angkanya.

```json
{
  "result": "success",
  "base": "USD",
  "source": "live",
  "sources": {
    "EUR": "live",
    "GBP": "live"
  },
  "market_session": "open",
  "timestamp": "2026-06-15T12:00:00Z",
  "data_updated_at": "2026-06-15T12:00:00Z",
  "effective_at": {
    "EUR": "2026-06-15T12:00:00Z",
    "GBP": "2026-06-15T12:00:00Z"
  },
  "rates": {
    "EUR": 0.86207,
    "GBP": 0.74627
  },
  "stale": {
    "EUR": false,
    "GBP": false
  },
  "derived_symbols": [],
  "unavailable": [],
  "notice": "Indicative rates, not for settlement."
}
```

## 3. Tambahkan key ketika memerlukan kuota akun

Buat key gratis dan kirim sebagai `Authorization: Bearer YOUR_KEY`. Simpan di server, jangan pernah menaruhnya dalam JavaScript publik.

```bash
curl "https://api.exchangerate.dev/v1/latest/USD?symbols=EUR,GBP" \
  -H "Authorization: Bearer YOUR_KEY"
```

**Nilai tukar indikatif**

Gunakan untuk aplikasi, model, dan analisis. Ini bukan kuotasi yang dapat dieksekusi atau harga penyelesaian.

Source: https://exchangerate.dev/id/docs/quickstart
