Skip to content

Latest commit

 

History

History
260 lines (153 loc) · 6.13 KB

ForexApi.md

File metadata and controls

260 lines (153 loc) · 6.13 KB

IntrinioSDK::ForexApi

All URIs are relative to https://api-v2.intrinio.com

Method HTTP request Description
get_forex_currencies GET /forex/currencies Forex Currencies
get_forex_pairs GET /forex/pairs Forex Currency Pairs
get_forex_prices GET /forex/prices/{pair}/{timeframe} Forex Currency Prices

get_forex_currencies

View Intrinio API Documentation

ApiResponseForexCurrencies get_forex_currencies()

Forex Currencies

Returns a list of forex currencies for which prices are available.

Example

# Setup client
client <- IntrinioSDK::ApiClient$new()

# Configure API key authorization: ApiKeyAuth
client$configuration$apiKey <- "YOUR_API_KEY"

#Configure retries
client$configuration$allowRetries <- TRUE

# Setup API with client
ForexApi <- IntrinioSDK::ForexApi$new(client)
response <- ForexApi$get_forex_currencies()

print(response)
print(response$content)

Parameters

This endpoint does not need any parameter.

Return type

ApiResponseForexCurrencies

get_forex_pairs

View Intrinio API Documentation

ApiResponseForexPairs get_forex_pairs()

Forex Currency Pairs

Returns a list of currency pairs used to request foreign exchange (forex) market price data. The currency that is used as the reference is called quote currency and the currency that is quoted in relation is called the base currency. For example, in the pair code “EURGBP” with a price of 0.88, one Euro (base currency) can be exchanged for 0.88 British Pounds (quote currency).

Example

# Setup client
client <- IntrinioSDK::ApiClient$new()

# Configure API key authorization: ApiKeyAuth
client$configuration$apiKey <- "YOUR_API_KEY"

#Configure retries
client$configuration$allowRetries <- TRUE

# Setup API with client
ForexApi <- IntrinioSDK::ForexApi$new(client)
response <- ForexApi$get_forex_pairs()

print(response)
print(response$content)

Parameters

This endpoint does not need any parameter.

Return type

ApiResponseForexPairs

get_forex_prices

View Intrinio API Documentation

ApiResponseForexPrices get_forex_prices(pair, timeframe, opts)

Forex Currency Prices

Provides a list of forex price quotes for a given forex currency pair and timeframe.

Example

# Setup client
client <- IntrinioSDK::ApiClient$new()

# Configure API key authorization: ApiKeyAuth
client$configuration$apiKey <- "YOUR_API_KEY"

#Configure retries
client$configuration$allowRetries <- TRUE

# Setup API with client
ForexApi <- IntrinioSDK::ForexApi$new(client)

# Required params
pair <- "EURUSD"
timeframe <- "D1"

# Optional params
opts <- list(
  timezone = "UTC",
  start_date = as.Date("2018-01-01"),
  start_time = NULL,
  end_date = as.Date("2019-01-01"),
  end_time = NULL,
  page_size = 100,
  next_page = NULL
)

response <- ForexApi$get_forex_prices(pair, timeframe, opts)

print(response)
print(response$content)

Parameters

Name Type Description Notes
pair Character The Forex Currency Pair code  
timeframe Character The time interval for the quotes  
timezone Character Returns trading times in this timezone [optional] [default to UTC]  
start_date Date Return Forex Prices on or after this date [optional]  
start_time Character Return Forex Prices at or after this time (24-hour in 'hh:mm' format, UTC timezone) [optional]  
end_date Date Return Forex Prices on or before this date [optional]  
end_time Character Return Forex Prices at or before this time (24-hour in 'hh:mm' format, UTC timezone) [optional]  
page_size Integer The number of results to return [optional] [default to 100]  
next_page Character Gets the next page of data from a previous API call [optional]  

Return type

ApiResponseForexPrices