> ## 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.

# Historical Rate for Currency and Date (/{date}/{currency})

> Get the exchange rate for a specific currency on a specific historical date

## Overview

The historical date-currency endpoint returns the exchange rate for a single currency on a specific historical date. This is the most precise endpoint when you need a specific rate for exact calculations, invoice processing, or compliance reporting.

<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>

## Path Parameters

<ParamField path="date" type="string" required>
  Date in YYYY-MM-DD format. Must be a valid date from 2018-01-01 onwards and not a weekend or Australian public holiday.

  Examples: `2025-08-31`, `2024-12-31`, `2023-06-15`
</ParamField>

<ParamField path="currency" type="string" required>
  Three-letter currency code (case-insensitive). Must be one of the [supported currencies](/api-reference/public/symbols).

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

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.exchangeratesapi.com.au/2025-08-31/USD \
    -H "Authorization: Bearer your_api_key_here"
  ```

  ```javascript JavaScript theme={null}
  const date = '2025-08-31';
  const currency = 'USD';
  const response = await fetch(`https://api.exchangeratesapi.com.au/${date}/${currency}`, {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  });

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

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

  date = "2025-08-31"
  currency = "USD"
  url = f"https://api.exchangeratesapi.com.au/{date}/{currency}"
  headers = {
      "Authorization": "Bearer your_api_key_here"
  }

  response = requests.get(url, headers=headers)
  data = response.json()
  print(data)
  ```

  ```php PHP theme={null}
  <?php
  $date = '2025-08-31';
  $currency = 'USD';
  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => "https://api.exchangeratesapi.com.au/{$date}/{$currency}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array(
      'Authorization: Bearer your_api_key_here'
    ),
  ));

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

  $data = json_decode($response, true);
  print_r($data);
  ?>
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "timestamp": 1725062400,
    "base": "AUD",
    "date": "2025-08-31",
    "rates": {
      "USD": 0.643512
    }
  }
  ```
</ResponseExample>

### Response Fields

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="timestamp" type="integer">
  Unix timestamp for the specified date (midnight UTC)
</ResponseField>

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

<ResponseField name="date" type="string">
  The requested date in YYYY-MM-DD format
</ResponseField>

<ResponseField name="rates" type="object">
  Object containing the requested currency code and its exchange rate

  <Expandable title="rates object">
    <ResponseField name="{currency}" type="number">
      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)
    </ResponseField>
  </Expandable>
</ResponseField>

## Response Headers

* `Cache-Control: no-store` - Response should not be cached
* `X-Request-Id: <uuid>` - Unique request identifier for debugging

## Error Responses

<ResponseExample>
  ```json 400 Bad Request - Invalid Date Format theme={null}
  {
    "success": false,
    "error": {
      "code": 400,
      "type": "bad_request",
      "info": "Invalid date format. Use YYYY-MM-DD"
    }
  }
  ```

  ```json 400 Bad Request - Invalid Currency Format theme={null}
  {
    "success": false,
    "error": {
      "code": 400,
      "type": "bad_request",
      "info": "Invalid currency format. Use 3-letter currency code (e.g., USD)"
    }
  }
  ```

  ```json 404 Not Found - No Rate Available theme={null}
  {
    "success": false,
    "error": {
      "code": 404,
      "type": "not_found",
      "info": "No USD rate available for date 2025-08-31. RBA data may not be available for this date. Try /latest for current rates."
    }
  }
  ```

  ```json 404 Not Found - No Data for Date theme={null}
  {
    "success": false,
    "error": {
      "code": 404,
      "type": "not_found",
      "info": "No data available for date 2025-12-25"
    }
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "success": false,
    "error": {
      "code": 401,
      "type": "unauthorized",
      "info": "Invalid or missing API key"
    }
  }
  ```
</ResponseExample>

## Rate Limits

This endpoint is subject to your plan's monthly request limits:

| Plan         | Monthly Requests | Historical Access    |
| ------------ | ---------------- | -------------------- |
| Free         | 300              | No historical data   |
| Starter      | 5,000            | Last 30 days         |
| Professional | 50,000           | Full history (2018+) |
| Business     | 500,000          | Full history (2018+) |

<Warning>
  **Free Plan**: No access to historical data\
  **Starter Plan**: Access to last 30 days of historical data\
  **Paid Plans**: Full access to all historical data from 2018 onwards
</Warning>

## Historical Data Availability

### Date Range

* **Available from**: January 1, 2018
* **Updated daily**: New rates published at 4:00 PM AEST by the RBA

### Missing Dates

The RBA doesn't publish exchange rates on:

* **Weekends**: Saturday and Sunday
* **Australian Public Holidays**: New Year's Day, Australia Day, Good Friday, Easter Monday, Anzac Day, Queen's Birthday, Christmas Day, Boxing Day, and other NSW state-specific holidays

Requests for these dates will return a 404 Not Found error.

### Plan-Specific Access

* **Free Plan**: No historical data access
* **Starter Plan**: Last 30 days of historical data
* **Professional & Business Plans**: Full historical archive (2018 onwards)

## Currency Availability

Not all currencies may be available for every historical date. The RBA occasionally:

* **Adds new currencies** to their daily publication
* **Removes currencies** that are no longer actively tracked
* **Skips currencies** on certain dates due to market conditions

If a specific currency rate is not available for the requested date, you'll receive a 404 error with details.

## Use Cases

* **Precise Invoice Calculations**: Get the exact rate for a specific transaction date and currency
* **Audit Trail**: Verify specific rates used in historical transactions
* **Compliance Verification**: ATO reporting with exact RBA rates
* **Contract Settlements**: Apply correct rates for dated financial agreements
* **Accounting Reconciliation**: Match rates to specific accounting periods
* **Regulatory Documentation**: Support compliance with exact rate citations

## Best Practices

* **Error Handling**: Always check for 404 responses, especially for weekend dates or holidays
* **Currency Validation**: Verify currency codes against the [supported currencies](/api-reference/public/symbols) list
* **Date Validation**: Ensure dates are in correct format and within available range
* **Caching**: Cache responses locally as historical rates don't change
* **Batch Requests**: For multiple currencies on the same date, consider using the [historical date endpoint](/api-reference/authenticated/historical-date)

## Precision & Standards

* **Precision**: Rates provided with up to 6 decimal places (varies by currency)
* **Currency-specific precision**: IDR and VND are provided as whole numbers by the RBA source data
* **Source**: Official Reserve Bank of Australia daily rates
* **Rounding**: Rates stored as micro-units (rate × 1e6) and converted for display where applicable
* **Standards**: Complies with Australian financial reporting requirements


## OpenAPI

````yaml GET /{date}/{currency}
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:
  /{date}/{currency}:
    get:
      summary: Historical Rate for Currency and Date
      description: >-
        Get the exchange rate for a specific currency on a specific historical
        date. Historical access: Free=none, Starter=30 days,
        Professional/Business=full history (2018+).
      operationId: getHistoricalRateForCurrencyAndDate
      parameters:
        - name: date
          in: path
          required: true
          description: Date in YYYY-MM-DD format
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          example: '2025-08-31'
        - name: currency
          in: path
          required: true
          description: Currency code
          schema:
            $ref: '#/components/schemas/CurrencyCode'
          example: USD
      responses:
        '200':
          description: Exchange rate for the specified currency and date
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LatestRatesResponse'
              example:
                success: true
                timestamp: 1725062400
                base: AUD
                date: '2025-08-31'
                rates:
                  USD: 0.678234
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - bearerAuth: []
components:
  schemas:
    CurrencyCode:
      type: string
      enum:
        - AUD
        - USD
        - EUR
        - GBP
        - JPY
        - CNY
        - KRW
        - INR
        - SGD
        - NZD
        - THB
        - MYR
        - IDR
        - VND
        - HKD
        - PHP
        - CAD
        - CHF
        - TWD
        - TWI
        - SDR
      description: Three-letter currency code
    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:
    BadRequest:
      description: Bad request - invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error:
              code: 400
              type: bad_request
              info: Invalid currency format. Use 3-letter currency code (e.g., USD)
    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
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error:
              code: 404
              type: not_found
              info: No data available for the specified date
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key authentication using Bearer token

````