Examples

Each of the following examples shows the full URL requested and a formatted response. The exact values displayed for each quote in these examples should not be assumed to be accurate.

NOTE: All examples omit authentication, though they do require it.

Spot Endpoint

JSON

https://www.oanda.com/rates/api/v2/rates/spot.json?base=EUR&quote=USD&date_time=2017-01-01

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  "meta": {
    "effective_params": {
      "data_set": "OANDA",
      "base_currencies": [
        "EUR"
      ],
      "quote_currencies": [
        "USD"
      ],
      "date_time": "2017-01-01T00:00:00+00:00"
    },
    "endpoint": "spot",
    "request_time": "2017-01-20T03:45:00+00:00",
    "skipped_currency_pairs": []
  },
  "quotes": [
    {
      "base_currency": "EUR",
      "quote_currency": "USD",
      "date_time": "2017-01-01T00:00:00+00:00",
      "bid": "1.05155",
      "ask": "1.05252",
      "midpoint": "1.05204"
    }
  ]
}

XML

https://www.oanda.com/rates/api/v2/rates/spot.xml?base=EUR&quote=USD&date_time=2017-01-01

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <meta>
    <effective_params>
      <data_set>OANDA</data_set>
      <base_currencies>
        <currency>EUR</currency>
      </base_currencies>
      <quote_currencies>
        <currency>USD</currency>
      </quote_currencies>
      <date_time>2017-01-01T00:00:00+00:00</date_time>
    </effective_params>
    <endpoint>spot</endpoint>
    <request_time>2017-01-20T03:45:00+00:00</request_time>
    <skipped_currency_pairs />
  </meta>
  <quotes>
    <quote>
      <base_currency>EUR</base_currency>
      <quote_currency>USD</quote_currency>
      <date_time>2017-01-01T00:00:00+00:00</date_time>
      <bid>1.05155</bid>
      <ask>1.05252</ask>
      <midpoint>1.05204</midpoint>
    </quote>
  </quotes>
</response>

CSV

https://www.oanda.com/rates/api/v2/rates/spot.csv?base=EUR&quote=USD&date_time=2017-01-01

1
2
base_currency,quote_currency,date_time,bid,ask,midpoint
EUR,USD,2017-01-01T00:00:00+00:00,1.05155,1.05252,1.05204

Candle Endpoint

JSON

https://www.oanda.com/rates/api/v2/rates/candle.json?base=EUR&quote=USD&quote=CAD&date_time=2017-01-01

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
  "meta": {
    "effective_params": {
      "data_set": "OANDA",
      "base_currencies": [
        "EUR"
      ],
      "quote_currencies": [
        "CAD",
        "USD"
      ],
      "date_time": "2017-01-01T00:00:00+00:00",
      "fields": [
        "averages"
      ]
    },
    "endpoint": "candle",
    "request_time": "2017-01-20T03:45:00+00:00",
    "skipped_currency_pairs": []
  },
  "quotes": [
    {
      "base_currency": "EUR",
      "quote_currency": "CAD",
      "start_time": "2017-01-01T00:00:00+00:00",
      "open_time": "2017-01-01T00:00:00+00:00",
      "close_time": "2017-01-01T21:00:00+00:00",
      "average_bid": "1.41294",
      "average_ask": "1.41534",
      "average_midpoint": "1.41414"
    },
    {
      "base_currency": "EUR",
      "quote_currency": "USD",
      "start_time": "2017-01-01T00:00:00+00:00",
      "open_time": "2017-01-01T00:00:00+00:00",
      "close_time": "2017-01-01T21:00:00+00:00",
      "average_bid": "1.05154",
      "average_ask": "1.05254",
      "average_midpoint": "1.05204"
    }
  ]
}

XML

https://www.oanda.com/rates/api/v2/rates/candle.xml?base=EUR&quote=USD&quote=CAD&date_time=2017-01-01

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <meta>
    <effective_params>
      <data_set>OANDA</data_set>
      <base_currencies>
        <currency>EUR</currency>
      </base_currencies>
      <quote_currencies>
        <currency>CAD</currency>
        <currency>USD</currency>
      </quote_currencies>
      <date_time>2017-01-01T00:00:00+00:00</date_time>
      <fields>
        <field>averages</field>
      </fields>
    </effective_params>
    <endpoint>candle</endpoint>
    <request_time>2017-01-20T03:45:00+00:00</request_time>
    <skipped_currency_pairs />
  </meta>
  <quotes>
    <quote>
      <base_currency>EUR</base_currency>
      <quote_currency>CAD</quote_currency>
      <start_time>2017-01-01T00:00:00+00:00</start_time>
      <open_time>2017-01-01T00:00:00+00:00</open_time>
      <close_time>2017-01-01T21:00:00+00:00</close_time>
      <average_bid>1.41294</average_bid>
      <average_ask>1.41534</average_ask>
      <average_midpoint>1.41414</average_midpoint>
    </quote>
    <quote>
      <base_currency>EUR</base_currency>
      <quote_currency>USD</quote_currency>
      <start_time>2017-01-01T00:00:00+00:00</start_time>
      <open_time>2017-01-01T00:00:00+00:00</open_time>
      <close_time>2017-01-01T21:00:00+00:00</close_time>
      <average_bid>1.05154</average_bid>
      <average_ask>1.05254</average_ask>
      <average_midpoint>1.05204</average_midpoint>
    </quote>
  </quotes>
</response>

CSV

https://www.oanda.com/rates/api/v2/rates/candle.csv?base=EUR&quote=USD&quote=CAD&date_time=2017-01-01

1
2
3
base_currency,quote_currency,start_time,open_time,close_time,average_bid,average_ask,average_midpoint
EUR,CAD,2017-01-01T00:00:00+00:00,2017-01-01T00:00:00+00:00,2017-01-01T21:00:00+00:00,1.41294,1.41534,1.41414
EUR,USD,2017-01-01T00:00:00+00:00,2017-01-01T00:00:00+00:00,2017-01-01T21:00:00+00:00,1.05154,1.05254,1.05204

Candles Endpoint

JSON

https://www.oanda.com/rates/api/v2/rates/candles.csv?base=EUR&quote=USD&start_time=2017-01-01&end_time=2017-01-02

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  "meta": {
    "effective_params": {
      "data_set": "OANDA",
      "base_currencies": [
        "EUR"
      ],
      "quote_currencies": [
        "USD"
      ],
      "start_time": "2017-01-01T00:00:00+00:00",
      "end_time": "2017-01-02T00:00:00+00:00",
      "fields": [
        "averages"
      ]
    },
    "endpoint": "candles",
    "request_time": "2017-01-20T03:45:00+00:00",
    "skipped_currency_pairs": []
  },
  "quotes": [
    {
      "base_currency": "EUR",
      "quote_currency": "USD",
      "start_time": "2017-01-01T00:00:00+00:00",
      "open_time": "2017-01-01T00:00:00+00:00",
      "close_time": "2017-01-01T21:00:00+00:00",
      "average_bid": "1.05154",
      "average_ask": "1.05254",
      "average_midpoint": "1.05204"
    }
  ]
}

XML

https://www.oanda.com/rates/api/v2/rates/candles.xml?base=EUR&quote=USD&start_time=2017-01-01&end_time=2017-01-02

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <meta>
    <effective_params>
      <data_set>OANDA</data_set>
      <base_currencies>
        <currency>EUR</currency>
      </base_currencies>
      <quote_currencies>
        <currency>USD</currency>
      </quote_currencies>
      <start_time>2017-01-01T00:00:00+00:00</start_time>
      <end_time>2017-01-02T00:00:00+00:00</end_time>
      <fields>
        <field>averages</field>
      </fields>
    </effective_params>
    <endpoint>candles</endpoint>
    <request_time>2017-01-20T03:45:00+00:00</request_time>
    <skipped_currency_pairs />
  </meta>
  <quotes>
    <quote>
      <base_currency>EUR</base_currency>
      <quote_currency>USD</quote_currency>
      <start_time>2017-01-01T00:00:00+00:00</start_time>
      <open_time>2017-01-01T00:00:00+00:00</open_time>
      <close_time>2017-01-01T21:00:00+00:00</close_time>
      <average_bid>1.05154</average_bid>
      <average_ask>1.05254</average_ask>
      <average_midpoint>1.05204</average_midpoint>
    </quote>
  </quotes>
</response>

CSV

https://www.oanda.com/rates/api/v2/rates/candles.csv?base=EUR&quote=USD&start_time=2017-01-01&end_time=2017-01-02

1
2
base_currency,quote_currency,start_time,open_time,close_time,average_bid,average_ask,average_midpoint
EUR,USD,2017-01-01T00:00:00+00:00,2017-01-01T00:00:00+00:00,2017-01-01T21:00:00+00:00,1.05154,1.05254,1.05204

Aggregated Endpoint

JSON

https://www.oanda.com/rates/api/v2/rates/aggregated.json?base=EUR&quote=USD&quote=CAD&start_time=2017-01-01&end_time=2017-01-08

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
  "meta": {
    "effective_params": {
      "data_set": "OANDA",
      "base_currencies": [
        "EUR"
      ],
      "quote_currencies": [
        "CAD",
        "USD"
      ],
      "start_time": "2017-01-01T00:00:00+00:00",
      "end_time": "2017-01-08T00:00:00+00:00",
      "fields": [
        "averages"
      ]
    },
    "endpoint": "aggregated",
    "request_time": "2017-01-20T03:45:00+00:00",
    "skipped_currency_pairs": []
  },
  "quotes": [
    {
      "base_currency": "EUR",
      "quote_currency": "CAD",
      "start_time": "2017-01-01T00:00:00+00:00",
      "end_time": "2017-01-08T00:00:00+00:00",
      "average_bid": "1.40222",
      "average_ask": "1.40350",
      "average_midpoint": "1.40286"
    },
    {
      "base_currency": "EUR",
      "quote_currency": "USD",
      "start_time": "2017-01-01T00:00:00+00:00",
      "end_time": "2017-01-08T00:00:00+00:00",
      "average_bid": "1.05058",
      "average_ask": "1.05110",
      "average_midpoint": "1.05084"
    }
  ]
}

XML

https://www.oanda.com/rates/api/v2/rates/aggregated.xml?base=EUR&quote=USD&quote=CAD&start_time=2017-01-01&end_time=2017-01-08

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <meta>
    <effective_params>
      <data_set>OANDA</data_set>
      <base_currencies>
        <currency>EUR</currency>
      </base_currencies>
      <quote_currencies>
        <currency>CAD</currency>
        <currency>USD</currency>
      </quote_currencies>
      <start_time>2017-01-01T00:00:00+00:00</start_time>
      <end_time>2017-01-08T00:00:00+00:00</end_time>
      <fields>
        <field>averages</field>
      </fields>
    </effective_params>
    <endpoint>aggregated</endpoint>
    <request_time>2017-01-20T03:45:00+00:00</request_time>
    <skipped_currency_pairs />
  </meta>
  <quotes>
    <quote>
      <base_currency>EUR</base_currency>
      <quote_currency>CAD</quote_currency>
      <start_time>2017-01-01T00:00:00+00:00</start_time>
      <end_time>2017-01-08T00:00:00+00:00</end_time>
      <average_bid>1.40222</average_bid>
      <average_ask>1.40350</average_ask>
      <average_midpoint>1.40286</average_midpoint>
    </quote>
    <quote>
      <base_currency>EUR</base_currency>
      <quote_currency>USD</quote_currency>
      <start_time>2017-01-01T00:00:00+00:00</start_time>
      <end_time>2017-01-08T00:00:00+00:00</end_time>
      <average_bid>1.05058</average_bid>
      <average_ask>1.05110</average_ask>
      <average_midpoint>1.05084</average_midpoint>
    </quote>
  </quotes>
</response>

CSV

https://www.oanda.com/rates/api/v2/rates/aggregated.csv?base=EUR&quote=USD&quote=CAD&start_time=2017-01-01&end_time=2017-01-08

1
2
3
base_currency,quote_currency,start_time,end_time,average_bid,average_ask,average_midpoint
EUR,CAD,2017-01-01T00:00:00+00:00,2017-01-08T00:00:00+00:00,1.40222,1.40350,1.40286
EUR,USD,2017-01-01T00:00:00+00:00,2017-01-08T00:00:00+00:00,1.05058,1.05110,1.05084

Forward Endpoint

JSON

https://www.oanda.com/rates/api/v2/rates/forward.json?base=EUR&quote=USD&tenor=6M&tenor=1Y

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  "meta": {
    "effective_params": {
      "data_set": "OANDA",
      "base_currency": "EUR",
      "quote_currency": "USD",
      "tenors": [
        "6M",
        "1Y"
      ]
    },
    "endpoint": "forward",
    "request_time": "2018-05-01T18:26:37+00:00",
    "skipped_tenors": []
  },
  "quotes": [
    {
      "tenor": "6M",
      "spot_bid": "1.19950",
      "spot_ask": "1.19961",
      "spot_midpoint": "1.19956",
      "forward_points_bid": "177.48",
      "forward_points_ask": "178.78"
    },
    {
      "tenor": "1Y",
      "spot_bid": "1.19950",
      "spot_ask": "1.19961",
      "spot_midpoint": "1.19956",
      "forward_points_bid": "379.97",
      "forward_points_ask": "382.87"
    }
  ]
}

XML

https://www.oanda.com/rates/api/v2/rates/forward.xml?base=EUR&quote=USD&tenor=6M&tenor=1Y

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<response>
    <meta>
        <effective_params>
            <data_set>OANDA</data_set>
            <base_currency>EUR</base_currency>
            <quote_currency>USD</quote_currency>
            <tenors>
                <tenor>6M</tenor>
                <tenor>1Y</tenor>
            </tenors>
        </effective_params>
        <endpoint>forward</endpoint>
        <request_time>2018-05-01T18:28:45+00:00</request_time>
        <skipped_tenors/>
    </meta>
    <quotes>
        <quote>
            <tenor>6M</tenor>
            <spot_bid>1.19975</spot_bid>
            <spot_ask>1.19987</spot_ask>
            <spot_midpoint>1.19981</spot_midpoint>
            <forward_points_bid>177.36</forward_points_bid>
            <forward_points_ask>178.66</forward_points_ask>
        </quote>
        <quote>
            <tenor>1Y</tenor>
            <spot_bid>1.19975</spot_bid>
            <spot_ask>1.19987</spot_ask>
            <spot_midpoint>1.19981</spot_midpoint>
            <forward_points_bid>380.01</forward_points_bid>
            <forward_points_ask>382.91</forward_points_ask>
        </quote>
    </quotes>
</response>

CSV

https://www.oanda.com/rates/api/v2/rates/forward.csv?base=EUR&quote=USD&tenor=6M&tenor=1Y

1
2
3
tenor,spot_bid,spot_ask,spot_midpoint,forward_points_bid,forward_points_ask
6M,1.19970,1.19983,1.19976,177.67,178.97
1Y,1.19970,1.19983,1.19976,379.72,382.62