> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exchangeratesapi.com.au/llms.txt
> Use this file to discover all available pages before exploring further.

# Latest Exchange Rates (/latest)

> Get the most recent exchange rates for all supported currencies from the Reserve Bank of Australia

## Overview

The latest rates endpoint returns current exchange rates for all currencies supported by the Reserve Bank of Australia. Rates are updated daily at 4:00 PM AEST and cached for optimal performance.

<Note>
  This endpoint requires authentication. [Get your API key](/quickstart) to start making requests.
</Note>

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key: `Bearer your_api_key_here`
</ParamField>

## Query Parameters

<ParamField query="symbols" type="string" optional>
  Comma-separated list of currency codes to filter results (case-insensitive). If omitted, all available currencies are returned.

  Examples: `USD,EUR,GBP`, `JPY,CAD,NZD`
</ParamField>

<ParamField query="base" type="string" optional>
  Base currency for the rates. Currently only AUD is supported.

  Default: `AUD`
</ParamField>

## Request

<CodeGroup>
  ```bash cURL - All Currencies theme={null}
  curl https://api.exchangeratesapi.com.au/latest \
    -H "Authorization: Bearer your_api_key_here"
  ```

  ```bash cURL - Specific Currencies theme={null}
  curl "https://api.exchangeratesapi.com.au/latest?symbols=USD,EUR,GBP" \
    -H "Authorization: Bearer your_api_key_here"
  ```

  ```javascript JavaScript - All Currencies theme={null}
  const response = await fetch('https://api.exchangeratesapi.com.au/latest', {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  });

  const data = await response.json();

  if (data.success) {
    console.log('Current USD rate:', data.rates.USD);
    console.log('Data from:', data.date);
    console.log('All rates:', data.rates);
  } else {
    console.error('API Error:', data.error);
  }
  ```

  ```javascript JavaScript - Filtered Currencies theme={null}
  const symbols = 'USD,EUR,GBP';
  const response = await fetch(`https://api.exchangeratesapi.com.au/latest?symbols=${symbols}`, {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  });

  const data = await response.json();

  if (data.success) {
    console.log('Filtered rates:', data.rates);
    console.log('Number of currencies:', Object.keys(data.rates).length);
  } else {
    console.error('API Error:', data.error);
  }
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'Authorization': 'Bearer your_api_key_here'
  }

  response = requests.get(
      'https://api.exchangeratesapi.com.au/latest',
      headers=headers
  )

  data = response.json()

  if data['success']:
      print(f"Current USD rate: {data['rates']['USD']}")
      print(f"Data from: {data['date']}")
      print(f"Total currencies: {len(data['rates'])}")
  else:
      print(f"API Error: {data['error']['info']}")
  ```

  ```php PHP theme={null}
  <?php
  $api_key = 'your_api_key_here';

  $curl = curl_init();
  curl_setopt_array($curl, [
      CURLOPT_URL => 'https://api.exchangeratesapi.com.au/latest',
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . $api_key
      ],
  ]);

  $response = curl_exec($curl);
  curl_close($curl);

  $data = json_decode($response, true);

  if ($data['success']) {
      echo "Current USD rate: " . $data['rates']['USD'] . "\n";
      echo "Data from: " . $data['date'] . "\n";
  } else {
      echo "API Error: " . $data['error']['info'] . "\n";
  }
  ?>
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "timestamp": 1725080400,
    "base": "AUD",
    "date": "2025-08-31",
    "rates": {
      "USD": 0.643512,
      "EUR": 0.562934,
      "GBP": 0.487421,
      "JPY": 96.832100,
      "NZD": 1.094200,
      "CAD": 0.893421,
      "CHF": 0.578234,
      "CNY": 4.623451,
      "KRW": 854.721000,
      "SGD": 0.856789,
      "INR": 54.123456,
      "THB": 22.567890,
      "MYR": 2.987654,
      "IDR": 9876.543210,
      "VND": 15432.109876,
      "HKD": 5.012345,
      "PHP": 36.789012,
      "TWD": 20.456789,
      "TWI": 60.500000,
      "SDR": 0.476543
    }
  }
  ```
</ResponseExample>

<ResponseField name="success" type="boolean" required>
  Always `true` for successful responses
</ResponseField>

<ResponseField name="timestamp" type="number" required>
  Unix timestamp when the rates were published by RBA
</ResponseField>

<ResponseField name="base" type="string" required>
  Base currency for all rates (always "AUD")
</ResponseField>

<ResponseField name="date" type="string" required>
  Date when the rates were published (YYYY-MM-DD format)
</ResponseField>

<ResponseField name="rates" type="object" required>
  Object containing exchange rates keyed by currency code
</ResponseField>

<ResponseField name="rates.{CURRENCY}" type="number" required>
  Exchange rate from AUD to the specified currency, with precision varying by currency (up to 6 decimal places for most, whole numbers for IDR/VND)
</ResponseField>

## Understanding Exchange Rates

### Rate Interpretation

All rates are quoted as **AUD to foreign currency**:

* `"USD": 0.643512` means 1 AUD = 0.643512 USD
* `"EUR": 0.562934` means 1 AUD = 0.562934 EUR
* `"JPY": 96.832100` means 1 AUD = 96.832100 JPY

### Precision

* Rates are stored with micro-unit precision internally
* API responses show up to 6 decimal places (varies by currency)
* Actual precision varies by currency based on RBA source data:
  * Most currencies: Up to 6 decimal places (e.g., USD: 0.6566)
  * Some currencies: 2 decimal places (e.g., JPY: 97.26)
  * IDR and VND: Whole numbers only (e.g., IDR: 10739, VND: 17338) as provided by RBA

### Special Currencies

<AccordionGroup>
  <Accordion title="Trade-Weighted Index (TWI)" icon="chart-line">
    The TWI represents the value of the AUD against a basket of currencies weighted by trade volumes.

    * **Included** in latest rates
    * **Not available** for conversion operations
    * Used by economists and analysts for AUD strength analysis
  </Accordion>

  <Accordion title="Special Drawing Rights (SDR)" icon="university">
    SDRs are international reserve assets created by the International Monetary Fund.

    * Basket currency including USD, EUR, CNY, JPY, GBP
    * Used for international accounting and reserves
    * Available for conversion operations
  </Accordion>
</AccordionGroup>

## Rate Update Schedule

### RBA Update Times

* **Daily**: Monday to Friday (excludes Australian public holidays)
* **Time**: 4:00 PM Australian Eastern Time (AEST/AEDT)
* **Source**: Reserve Bank of Australia official rates

### API Update Process

1. **4:00 PM AEST**: RBA publishes new rates
2. **4:05-4:15 PM AEST**: Our system fetches and validates data
3. **4:15 PM AEST**: New rates available via API
4. **Fallback**: If RBA is unavailable, previous day's rates are served with stale data headers

### Staleness Detection

When RBA data is unavailable, responses include:

```http theme={null}
X-Data-Stale: true
X-RBA-Source-Date: 2025-08-30
```

```json theme={null}
{
  "success": true,
  "timestamp": 1725080400,
  "base": "AUD", 
  "date": "2025-08-30",
  "rates": { ... }
}
```

## Response Headers

Successful responses include useful metadata:

```http theme={null}
HTTP/2 200 OK
Content-Type: application/json
Cache-Control: no-store
X-Request-Id: 123e4567-e89b-12d3-a456-426614174000
X-RateLimit-Limit-Monthly: 5000
X-RateLimit-Remaining-Monthly: 4847
X-RateLimit-Reset: 2025-10-01T00:00:00Z
X-Response-Time: 45ms
```

<Note>
  Authenticated endpoints return `Cache-Control: no-store` to prevent caching of user-specific responses and ensure quota tracking accuracy.
</Note>

## Common Use Cases

### 1. **Real-time Rate Display**

```javascript theme={null}
async function updateRateDisplay() {
  try {
    const response = await fetch('https://api.exchangeratesapi.com.au/latest', {
      headers: { 'Authorization': 'Bearer your_api_key_here' }
    });
    
    const data = await response.json();
    
    if (data.success) {
      // Update UI elements
      document.getElementById('usd-rate').textContent = data.rates.USD.toFixed(4);
      document.getElementById('eur-rate').textContent = data.rates.EUR.toFixed(4);
      document.getElementById('last-updated').textContent = new Date(data.timestamp * 1000).toLocaleString();
      
      // Check for stale data
      if (data.stale) {
        document.getElementById('stale-warning').style.display = 'block';
      }
    } else {
      console.error('Failed to fetch rates:', data.error);
    }
  } catch (error) {
    console.error('Network error:', error);
  }
}

// Update rates every 30 minutes
setInterval(updateRateDisplay, 30 * 60 * 1000);
updateRateDisplay(); // Initial load
```

### 2. **Bulk Currency Calculations**

```python theme={null}
import requests

def calculate_portfolio_values(aud_amounts, api_key):
    """Convert AUD amounts to multiple currencies"""
    
    headers = {'Authorization': f'Bearer {api_key}'}
    response = requests.get('https://api.exchangeratesapi.com.au/latest', headers=headers)
    data = response.json()
    
    if not data['success']:
        raise Exception(f"API Error: {data['error']['info']}")
    
    rates = data['rates']
    results = {}
    
    for currency_code, aud_amount in aud_amounts.items():
        if currency_code in rates:
            converted_amount = aud_amount * rates[currency_code]
            results[currency_code] = {
                'aud_amount': aud_amount,
                'converted_amount': round(converted_amount, 2),
                'rate': rates[currency_code],
                'date': data['date']
            }
    
    return results

# Example usage
portfolio = {
    'USD': 10000,  # 10k AUD to convert to USD
    'EUR': 5000,   # 5k AUD to convert to EUR
    'JPY': 2000    # 2k AUD to convert to JPY
}

results = calculate_portfolio_values(portfolio, 'your_api_key_here')
for currency, info in results.items():
    print(f"{info['aud_amount']} AUD = {info['converted_amount']} {currency}")
```

### 3. **Rate Comparison & Alerting**

```javascript theme={null}
class RateMonitor {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.previousRates = {};
    this.thresholds = {};
  }
  
  setThreshold(currency, threshold) {
    this.thresholds[currency] = threshold;
  }
  
  async checkRates() {
    const response = await fetch('https://api.exchangeratesapi.com.au/latest', {
      headers: { 'Authorization': `Bearer ${this.apiKey}` }
    });
    
    const data = await response.json();
    
    if (!data.success) {
      console.error('Rate check failed:', data.error);
      return;
    }
    
    // Compare with previous rates
    for (const [currency, currentRate] of Object.entries(data.rates)) {
      const previousRate = this.previousRates[currency];
      
      if (previousRate) {
        const changePercent = ((currentRate - previousRate) / previousRate) * 100;
        
        if (Math.abs(changePercent) >= (this.thresholds[currency] || 1)) {
          this.sendAlert(currency, previousRate, currentRate, changePercent);
        }
      }
    }
    
    this.previousRates = { ...data.rates };
  }
  
  sendAlert(currency, oldRate, newRate, changePercent) {
    const direction = changePercent > 0 ? 'increased' : 'decreased';
    console.log(`🚨 Alert: ${currency} ${direction} by ${Math.abs(changePercent).toFixed(2)}%`);
    console.log(`   ${oldRate} → ${newRate}`);
  }
}

// Example usage
const monitor = new RateMonitor('your_api_key_here');
monitor.setThreshold('USD', 0.5); // Alert on 0.5% change
monitor.setThreshold('EUR', 0.5);

// Check rates every 10 minutes during market hours
setInterval(() => monitor.checkRates(), 10 * 60 * 1000);
```

### 4. **Caching for Performance**

```php theme={null}
<?php
class ExchangeRateCache {
    private $apiKey;
    private $cacheFile = 'exchange_rates_cache.json';
    private $cacheExpiry = 1800; // 30 minutes
    
    public function __construct($apiKey) {
        $this->apiKey = $apiKey;
    }
    
    public function getLatestRates() {
        // Check cache first
        if ($this->isCacheValid()) {
            return json_decode(file_get_contents($this->cacheFile), true);
        }
        
        // Fetch fresh data
        $rates = $this->fetchFromAPI();
        
        if ($rates) {
            $this->saveToCache($rates);
            return $rates;
        }
        
        // Fallback to cache if API fails
        if (file_exists($this->cacheFile)) {
            return json_decode(file_get_contents($this->cacheFile), true);
        }
        
        throw new Exception('Unable to fetch exchange rates');
    }
    
    private function fetchFromAPI() {
        $curl = curl_init();
        curl_setopt_array($curl, [
            CURLOPT_URL => 'https://api.exchangeratesapi.com.au/latest',
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 10,
            CURLOPT_HTTPHEADER => [
                'Authorization: Bearer ' . $this->apiKey
            ],
        ]);
        
        $response = curl_exec($curl);
        $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        curl_close($curl);
        
        if ($httpCode === 200) {
            $data = json_decode($response, true);
            return $data['success'] ? $data : null;
        }
        
        return null;
    }
    
    private function isCacheValid() {
        if (!file_exists($this->cacheFile)) {
            return false;
        }
        
        return (time() - filemtime($this->cacheFile)) < $this->cacheExpiry;
    }
    
    private function saveToCache($data) {
        file_put_contents($this->cacheFile, json_encode($data));
    }
}

// Usage
$cache = new ExchangeRateCache('your_api_key_here');
$rates = $cache->getLatestRates();

echo "USD Rate: " . $rates['rates']['USD'] . "\n";
echo "Data from: " . $rates['date'] . "\n";
?>
```

## Error Responses

<AccordionGroup>
  <Accordion title="Authentication Errors" icon="key">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": 401,
        "type": "invalid_api_key", 
        "info": "Invalid or missing API key."
      }
    }
    ```
  </Accordion>

  <Accordion title="Rate Limit Exceeded" icon="gauge">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": 429,
        "type": "rate_limit_exceeded",
        "info": "Monthly quota of 5000 requests exceeded. Quota resets on your next billing cycle."
      }
    }
    ```
  </Accordion>

  <Accordion title="Service Unavailable" icon="exclamation-triangle">
    ```json theme={null}
    {
      "success": false,
      "error": {
        "code": 503,
        "type": "service_unavailable",
        "info": "Exchange rates temporarily unavailable. Please try again later."
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Single Currency" icon="filter" href="/api-reference/authenticated/latest-currency">
    Get rate for a specific currency only
  </Card>

  <Card title="Currency Conversion" icon="calculator" href="/api-reference/authenticated/convert-authenticated">
    Convert amounts between currencies
  </Card>

  <Card title="Historical Rates" icon="history" href="/api-reference/authenticated/historical-date">
    Access rates from any date since 2018
  </Card>

  <Card title="Time Series" icon="chart-line" href="/api-reference/authenticated/timeseries">
    Get rates for date ranges
  </Card>
</CardGroup>


## OpenAPI

````yaml GET /latest
openapi: 3.1.0
info:
  title: RBA Exchange Rates API
  description: >-
    Official Reserve Bank of Australia (RBA) exchange rate data through a modern
    REST API. Transforms publicly available RBA data into clean JSON endpoints
    for Australian businesses and developers who need reliable AUD exchange
    rates.
  version: 1.0.0
  license:
    name: MIT
  contact:
    url: https://www.exchangeratesapi.com.au
servers:
  - url: https://api.exchangeratesapi.com.au
    description: Production API
security: []
paths:
  /latest:
    get:
      summary: Latest Exchange Rates
      description: >-
        Get all current exchange rates from the Reserve Bank of Australia with
        optional filtering. Quota limits: Free=300 (one-time trial),
        Starter=5,000/month, Professional=50,000/month, Business=500,000/month.
      operationId: getLatestRates
      parameters:
        - name: symbols
          in: query
          required: false
          description: Comma-separated list of currency codes to filter results
          schema:
            type: string
          example: USD,EUR,GBP
        - name: base
          in: query
          required: false
          description: Base currency (currently only AUD supported)
          schema:
            type: string
            enum:
              - AUD
          example: AUD
      responses:
        '200':
          description: Latest exchange rates
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LatestRatesResponse'
              example:
                success: true
                timestamp: 1725148800
                base: AUD
                date: '2025-09-01'
                rates:
                  USD: 0.678234
                  EUR: 0.612345
                  GBP: 0.534567
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - bearerAuth: []
components:
  schemas:
    LatestRatesResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        timestamp:
          type: integer
          description: Unix timestamp of the rate date
        base:
          type: string
          example: AUD
        date:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: Date of the rates (YYYY-MM-DD)
        rates:
          $ref: '#/components/schemas/RatesObject'
      required:
        - success
        - timestamp
        - base
        - date
        - rates
    RatesObject:
      type: object
      additionalProperties:
        type: number
        minimum: 0
        description: >-
          Exchange rate (AUD per unit of foreign currency) with precision
          varying by currency (up to 6 decimal places for most, whole numbers
          for IDR/VND as provided by RBA)
      description: Object containing currency codes as keys and exchange rates as values
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP status code
            type:
              type: string
              description: Error type identifier
            info:
              type: string
              description: Human-readable error description
          required:
            - code
            - type
            - info
      required:
        - success
        - error
  responses:
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error:
              code: 401
              type: unauthorized
              info: Invalid or missing API key
    ServiceUnavailable:
      description: Service temporarily unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error:
              code: 503
              type: unavailable
              info: Rates temporarily unavailable
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key authentication using Bearer token

````