Skip to content

Latest commit

 

History

History
105 lines (66 loc) · 2.91 KB

HistoricalDataApi.md

File metadata and controls

105 lines (66 loc) · 2.91 KB

Intrinio::HistoricalDataApi

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

Method HTTP request Description
get_historical_data GET /historical_data/{identifier}/{tag} Historical Data

get_historical_data

View Intrinio API Documentation

ApiResponseHistoricalData get_historical_data(identifier, tag, opts)

Historical Data

Returns historical values for the given tag and the entity represented by the given identifier

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

historicalData_api = Intrinio::HistoricalDataApi.new
identifier = "AAPL"
tag = "marketcap"

opts = {
  frequency: "daily",
  type: nil,
  start_date: Date.parse("2015-01-01"),
  end_date: nil,
  sort_order: "desc",
  page_size: 100,
  next_page: nil
}

result = historicalData_api.get_historical_data(identifier, tag, opts)
pp result

Parameters

Name Type Description Notes
identifier String An identifier for an entity such as a Company, Security, Index, etc (Ticker, FIGI, ISIN, CUSIP, CIK, LEI, Intrinio ID)  
tag String An Intrinio data tag ID or code (<a href='https://data.intrinio.com/data-tags&#39;&gt;reference&lt;/a>)  
frequency String Return historical data in the given frequency [optional] [default to daily]  
type String Filter by type, when applicable [optional]  
start_date Date Get historical data on or after this date [optional]  
end_date Date Get historical date on or before this date [optional]  
sort_order String Sort by date `asc` or `desc` [optional] [default to desc]  
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

ApiResponseHistoricalData