Skip to content

Latest commit

 

History

History
883 lines (530 loc) · 23.2 KB

StockExchangeApi.md

File metadata and controls

883 lines (530 loc) · 23.2 KB

Intrinio::StockExchangeApi

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

Method HTTP request Description
get_all_stock_exchanges GET /stock_exchanges All Stock Exchanges
get_stock_exchange_betas GET /stock_exchanges/{identifier}/betas Security Betas
get_stock_exchange_by_id GET /stock_exchanges/{identifier} Lookup Stock Exchange
get_stock_exchange_gainers GET /stock_exchanges/{identifier}/gainers Top Gainers by Exchange
get_stock_exchange_losers GET /stock_exchanges/{identifier}/losers Top Losers by Exchange
get_stock_exchange_price_adjustments GET /stock_exchanges/{identifier}/prices/adjustments Stock Price Adjustments by Exchange
get_stock_exchange_prices GET /stock_exchanges/{identifier}/prices Stock Prices by Exchange
get_stock_exchange_quote GET /stock_exchanges/{identifier}/quote Realtime Quote Prices by Exchange
get_stock_exchange_realtime_prices GET /stock_exchanges/{identifier}/prices/realtime Realtime Stock Prices by Exchange
get_stock_exchange_securities GET /stock_exchanges/{identifier}/securities Securities by Exchange

get_all_stock_exchanges

View Intrinio API Documentation

ApiResponseStockExchanges get_all_stock_exchanges(opts)

All Stock Exchanges

Returns all Stock Exchanges matching the specified parameters

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

stockExchange_api = Intrinio::StockExchangeApi.new

opts = {
  city: "New York",
  country: "UNITED STATES OF AMERICA",
  country_code: "US",
  page_size: 100
}

result = stockExchange_api.get_all_stock_exchanges(opts)
pp result

Parameters

Name Type Description Notes
city String Filter by city [optional]  
country String Filter by country [optional]  
country_code String Filter by ISO country code [optional]  
page_size Integer The number of results to return [optional] [default to 100]  

Return type

ApiResponseStockExchanges

get_stock_exchange_betas

View Intrinio API Documentation

ApiResponseStockExchangeBetas get_stock_exchange_betas(identifier, opts)

Security Betas

Returns security beta data in the Stock Exchange with 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

stockExchange_api = Intrinio::StockExchangeApi.new
identifier = "USCOMP"

opts = {
  type: "weekly",
  date: "2024-04-24",
  page_size: 100,
  next_page: nil
}

result = stockExchange_api.get_stock_exchange_betas(identifier, opts)
pp result

Parameters

Name Type Description Notes
identifier String A Stock Exchange identifier (MIC or Intrinio ID)  
type String Only of the given type [optional] [default to weekly]  
date Object Return data for this period end date. [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

ApiResponseStockExchangeBetas

get_stock_exchange_by_id

View Intrinio API Documentation

StockExchange get_stock_exchange_by_id(identifier)

Lookup Stock Exchange

Returns the Stock Exchange with 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

stockExchange_api = Intrinio::StockExchangeApi.new
identifier = "USCOMP"

result = stockExchange_api.get_stock_exchange_by_id(identifier)
pp result

Parameters

Name Type Description Notes
identifier String A Stock Exchange identifier (MIC or Intrinio ID)  

Return type

StockExchange

get_stock_exchange_gainers

View Intrinio API Documentation

ApiResponseStockExchangeMovers get_stock_exchange_gainers(identifier, opts)

Top Gainers by Exchange

Returns securities with the highest gain percent change traded on the chosen stock exchange.

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

stockExchange_api = Intrinio::StockExchangeApi.new
identifier = "USCOMP"

opts = {
  min_price: 8.14,
  page_size: 100,
  source: "delayed_sip"
}

result = stockExchange_api.get_stock_exchange_gainers(identifier, opts)
pp result

Parameters

Name Type Description Notes
identifier String A Stock Exchange identifier (MIC or Intrinio ID)  
min_price Float The minimum price filter [optional]  
page_size Integer The number of results to return [optional] [default to 100]  
source String Return the realtime price from the specified source instead of the most recent. [optional]  

Return type

ApiResponseStockExchangeMovers

get_stock_exchange_losers

View Intrinio API Documentation

ApiResponseStockExchangeMovers get_stock_exchange_losers(identifier, opts)

Top Losers by Exchange

Returns securities with the highest loss percent change traded on the chosen stock exchange.

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

stockExchange_api = Intrinio::StockExchangeApi.new
identifier = "USCOMP"

opts = {
  min_price: 8.14,
  page_size: 100,
  source: "delayed_sip"
}

result = stockExchange_api.get_stock_exchange_losers(identifier, opts)
pp result

Parameters

Name Type Description Notes
identifier String A Stock Exchange identifier (MIC or Intrinio ID)  
min_price Float The minimum price filter [optional]  
page_size Integer The number of results to return [optional] [default to 100]  
source String Return the realtime price from the specified source instead of the most recent. [optional]  

Return type

ApiResponseStockExchangeMovers

get_stock_exchange_price_adjustments

View Intrinio API Documentation

ApiResponseStockExchangeStockPriceAdjustments get_stock_exchange_price_adjustments(identifier, opts)

Stock Price Adjustments by Exchange

Returns stock price adjustments for the Stock Exchange with 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

stockExchange_api = Intrinio::StockExchangeApi.new
identifier = "USCOMP"

opts = {
  date: Date.parse("2018-08-14"),
  page_size: 100,
  next_page: nil
}

result = stockExchange_api.get_stock_exchange_price_adjustments(identifier, opts)
pp result

Parameters

Name Type Description Notes
identifier String A Stock Exchange identifier (MIC or Intrinio ID)  
date Date The date for which to return price adjustments [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

ApiResponseStockExchangeStockPriceAdjustments

get_stock_exchange_prices

View Intrinio API Documentation

ApiResponseStockExchangeStockPrices get_stock_exchange_prices(identifier, opts)

Stock Prices by Exchange

Returns end-of-day stock prices for Securities on the Stock Exchange with identifier and on the price_date (or the latest date that 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

stockExchange_api = Intrinio::StockExchangeApi.new
identifier = "USCOMP"

opts = {
  date: Date.parse("2018-08-14"),
  start_date: Date.parse("2020-08-14"),
  end_date: Date.parse("2022-08-14"),
  page_size: 100,
  next_page: nil,
  tickers: ["AAPL,MSFT,NVDA"],
  next_page2: nil
}

result = stockExchange_api.get_stock_exchange_prices(identifier, opts)
pp result

Parameters

Name Type Description Notes
identifier String A Stock Exchange identifier (MIC or Intrinio ID)  
date Date The date for which to return prices. May not be used with the start_date and end_date parameters. [optional]  
start_date Date The start of the date range you're querying. May not be used with date parameter. [optional]  
end_date Date The end of the date range you're querying. May not be used with date parameter. [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]  
tickers Array<String> The comma-delimited list of ticker symbols to filter down to. If not provided, the entire stock exchange is returned. [optional]  
next_page2 String Gets the next page of data from a previous API call [optional]  

Return type

ApiResponseStockExchangeStockPrices

get_stock_exchange_quote

View Intrinio API Documentation

ApiResponseStockExchangeQuote get_stock_exchange_quote(identifier, tickers, opts)

Realtime Quote Prices by Exchange

Returns many popular metrics for securities from a given exchange 'identifier' from multiple products conveniently in one API. Realtime stock price data requires at least one realtime product subscription (IEX, NASDAQ Basic, and/or Delayed SIP). If you are subscribed to multiple realtime stock price products, the api will return the most recent realtime stock price. Previous close price and percent change fields require both an EoD US Stock Price subscription and a realtime stock price subscription. Market_cap, price_to_earnings, and dividendyield data fields require a fundamentals subscription.

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

stockExchange_api = Intrinio::StockExchangeApi.new
identifier = "USCOMP"
tickers = ["AAPL,MSFT,NVDA"]

opts = {
  source: "delayed_sip",
  active_only: nil
}

result = stockExchange_api.get_stock_exchange_quote(identifier, tickers, opts)
pp result

Parameters

Name Type Description Notes
identifier String A Stock Exchange identifier (MIC or Intrinio ID)  
tickers Array<String> The comma-delimited list of ticker symbols to return quotes for.  
source String Return the realtime price from the specified source instead of the most recent. [optional]  
active_only BOOLEAN Returns prices only from the most recent trading day. [optional]  

Return type

ApiResponseStockExchangeQuote

get_stock_exchange_realtime_prices

View Intrinio API Documentation

ApiResponseStockExchangeRealtimeStockPrices get_stock_exchange_realtime_prices(identifier, opts)

Realtime Stock Prices by Exchange

Returns realtime stock prices for the Stock Exchange with 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

stockExchange_api = Intrinio::StockExchangeApi.new
identifier = "USCOMP"

opts = {
  source: ["iex,delayed_sip"],
  active_only: nil,
  traded_today: nil,
  page_size: 100,
  tickers: ["AAPL,MSFT,NVDA"],
  next_page: nil
}

result = stockExchange_api.get_stock_exchange_realtime_prices(identifier, opts)
pp result

Parameters

Name Type Description Notes
identifier String A Stock Exchange identifier (MIC or Intrinio ID)  
source Array<String> Return realtime prices from the specified comma-delimited data sources. If no source is specified, all sources available to user are used. [optional]  
active_only BOOLEAN Returns prices only from the most recent trading day. [optional]  
traded_today BOOLEAN Returns prices only from securities which have traded on the most recent trading day. [optional]  
page_size Integer The number of results to return [optional] [default to 100]  
tickers Array<String> The comma-delimited list of ticker symbols to filter to. If not provided, the entire stock exchange is returned. [optional]  
next_page String Gets the next page of data from a previous API call [optional]  

Return type

ApiResponseStockExchangeRealtimeStockPrices

get_stock_exchange_securities

View Intrinio API Documentation

ApiResponseStockExchangeSecurities get_stock_exchange_securities(identifier, opts)

Securities by Exchange

Returns Securities traded on the Stock Exchange with 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

stockExchange_api = Intrinio::StockExchangeApi.new
identifier = "USCOMP"

opts = {
  page_size: 100,
  next_page: nil
}

result = stockExchange_api.get_stock_exchange_securities(identifier, opts)
pp result

Parameters

Name Type Description Notes
identifier String A Stock Exchange identifier (MIC or Intrinio ID)  
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

ApiResponseStockExchangeSecurities