Skip to content

Latest commit

 

History

History
251 lines (148 loc) · 5.77 KB

ForexApi.md

File metadata and controls

251 lines (148 loc) · 5.77 KB

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

# Load the gem
require 'intrinio-sdk'
require 'pp'

# Setup authorization
Intrinio.configure do |config|
  config.api_key['api_key'] = 'YOUR_API_KEY'
  config.allow_retries = true
end

forex_api = Intrinio::ForexApi.new
result = forex_api.get_forex_currencies
pp result

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

# Load the gem
require 'intrinio-sdk'
require 'pp'

# Setup authorization
Intrinio.configure do |config|
  config.api_key['api_key'] = 'YOUR_API_KEY'
  config.allow_retries = true
end

forex_api = Intrinio::ForexApi.new
result = forex_api.get_forex_pairs
pp result

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

# Load the gem
require 'intrinio-sdk'
require 'pp'

# Setup authorization
Intrinio.configure do |config|
  config.api_key['api_key'] = 'YOUR_API_KEY'
  config.allow_retries = true
end

forex_api = Intrinio::ForexApi.new
pair = "EURUSD"
timeframe = "D1"

opts = {
  timezone: "UTC",
  start_date: Date.parse("2018-01-01"),
  start_time: nil,
  end_date: Date.parse("2019-01-01"),
  end_time: nil,
  page_size: 100,
  next_page: nil
}

result = forex_api.get_forex_prices(pair, timeframe, opts)
pp result

Parameters

Name Type Description Notes
pair String The Forex Currency Pair code  
timeframe String The time interval for the quotes  
timezone String Returns trading times in this timezone [optional] [default to UTC]  
start_date Date Return Forex Prices on or after this date [optional]  
start_time String 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 String 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 String Gets the next page of data from a previous API call [optional]  

Return type

ApiResponseForexPrices