Categorygithub.com/jonwho/go-iex/v2
modulepackage
2.8.0
Repository: https://github.com/jonwho/go-iex.git
Documentation: pkg.go.dev

# README

go-iex

GoDoc releases Go Report Card gopherbadger-tag-do-not-edit

ATTRIBUTION

Data provided by IEX

DESCRIPTION

Client interface to IEX trading API.

ENV

TEST

export IEX_TEST_SECRET_TOKEN=Tsk_ahsvyao12u4u0ausvn1o3rhw988120yf_FAKE
export IEX_TEST_PUBLISHABLE_TOKEN=Tpk_la091720ihakbso128uihotbfao_FAKE

PRODUCTION

export IEX_SECRET_TOKEN=Tsk_ahsvyao12u4u0ausvn1o3rhw988120yf_REAL
export IEX_PUBLISHABLE_TOKEN=Tpk_la091720ihakbso128uihotbfao_REAL

DEV NOTES

USAGE

package main

import (
	"fmt"
	"log"
	"net/url"
	"os"

	iex "github.com/jonwho/go-iex/v2"
)

func main() {
	token := os.Getenv("IEX_SECRET_TOKEN")
	// client will have all currently supported IEX APIs
	client, err := iex.NewClient(token)
	if err != nil {
		log.Fatalln(err)
	}

	quote, err := client.Quote("aapl", nil)
	if err != nil {
		log.Fatalln(err)
	}

	fmt.Println("Symbol", quote.Symbol, "Company Name", quote.CompanyName,
		"Current Price", quote.LatestPrice)

	// if you only want to test against sandbox build a custom client
	token = os.Getenv("IEX_TEST_SECRET_TOKEN")
	baseURL, _ := url.Parse(iex.SandboxBaseURL)
	// get Stocks only API client for sandbox testing
	stock := iex.NewStock(token, iex.DefaultVersion, baseURL, iex.DefaultHTTPClient)

	quote, err = stock.Quote("aapl", nil)
	if err != nil {
		log.Fatalln(err)
	}

	fmt.Println("Symbol", quote.Symbol, "Company Name", quote.CompanyName,
		"Current Price", quote.LatestPrice)

	// you can also use the Get helper on client to unmarshal to your own custom struct
	anonstruct := &struct {
		Symbol string `json:"symbol,omitempty"`
	}{}
	err = client.Get("stock/aapl/quote", anonstruct, nil)
	if err != nil {
		log.Fatalln(err)
	}
	fmt.Println("Symbol", anonstruct.Symbol)
}

SUPPORTED ENDPOINTS

Introduction

  • Batch Requests

Account

  • Metadata
  • Usage
  • Pay as you go
  • Message Budget
  • Signed Requests
  • Setting up signed token
  • Getting the secret for a signed token

API System Metadata

  • Status

Data APIS

  • Data Points
  • Data Tables
  • Time Series

Stock Prices

  • Book
  • Charts
  • Delayed Quote
  • Extended Hours Quote (included as part of Quote response)
  • Historical Prices
  • Intraday Prices
  • Largest Trades
  • Open / Close Price
  • OHLC
  • Previous Day Price
  • Price Only
  • Quote
  • Real-time Quote (included as part of Quote response)
  • Volume by Venue

Stock Profiles

  • Company
  • Insider Roster
  • Insider Summary
  • Insider Transactions
  • Logo
  • Peer Groups

Stock Fundamentals

  • Balance Sheet
  • Cash Flow
  • Dividends (Basic)
  • Earnings
  • Financials
  • Financials As Reported
  • Income Statement
  • SEC Filings
  • Splits (Basic)

Stock Research

  • Advanced Stats
  • Analyst Recommendations (see RecommendationTrends)
  • Estimates
  • Fund Ownership
  • Institutional Ownership
  • Key Stats
  • Price Target
  • Technical Indicators

Corporate Actions

  • Bonus Issue
  • Distribution
  • Dividends
  • Return of Capital
  • Rights Issue
  • Right to Purchase
  • Security Reclassification
  • Security Swap
  • Spinoff
  • Splits

Market Info

  • Collections
  • Earnings Today
  • IPO Calendar
  • List
  • Market Volume (U.S.)
  • Sector Performance
  • Upcoming Events

News

  • News
  • Streaming News
  • Historical News

Cryptocurrency

  • Cryptocurrency Book
  • Cryptocurrency Event
  • Cryptocurrency Price
  • Cryptocurrency Quote

Forex / Currencies

  • Real-time Streaming
  • Latest Currency Rates
  • Currency Conversion
  • Historical Daily

Options

  • End of Day Options

Social Sentiment

  • Social Sentiment

CEO Compensation

  • CEO Compensation

Treasures

  • Daily Treasury Rates

Commodities

  • Oil Prices
  • Natural Gas Price
  • Heating Oil Prices
  • Jet Fuel Prices
  • Diesel Prices
  • Diesel Price
  • Gas Prices
  • Propane Prices

Economic Data

  • CD Rates
  • Consumer Price Index
  • Credit Card Interest Rate
  • Federal Fund Rates
  • Real GDP
  • Institutional Money Funds
  • Initial Claims
  • Industrial Production Index
  • Mortgage Rates
  • Total Housing Starts
  • Total Payrolls
  • Total Vehicle Sales
  • Retail Money Funds
  • Unemployment Rate
  • US Recession Probabilities

Reference Data

  • Search
  • Cryptocurrency Symbols
  • FX Symbols
  • IEX Symbols
  • International Symbols
  • International Exchanges
  • ISIN Mapping
  • Mutual Fund Symbols
  • Options Symbols
  • OTC Symbols
  • Sectors
  • Symbols
  • Tags
  • U.S. Exchanges
  • U.S. Holidays and Trading Dates

Investors Exchange Data

  • DEEP
  • DEEP Auction
  • DEEP Book
  • DEEP Operational Halt Status
  • DEEP Official Price
  • DEEP Security Event
  • DEEP Short Sale Price Test Status
  • DEEP System Event
  • DEEP Trades
  • DEEP Trade Break
  • DEEP Trading Status
  • Last
  • Listed Regulation SHO Threshold Securities List
  • Listed Short Interest List In Dev
  • Stats Historical Daily In Dev
  • Stats Historical Summary
  • Stats Intraday
  • Stats Recent
  • Stats Records
  • TOPS

# Packages

No description provided by the author
No description provided by the author

# Functions

NewAccount return new Account.
NewAPISystemMetadata return new APISystemMetadata.
NewClient creates client interface to IEX Cloud APIs.
NewCommodities return new Commodities.
NewCryptocurrency returns new Cryptocurrency.
NewDataAPI return new DataAPI.
NewEconomicData return new EconomicData.
NewForex return new Forex.
NewInvestorsExchangeData return new InvestorsExchangeData.
NewReferenceData return new ReferenceData.
NewStock return new Stock.
SetAccount set new Account.
SetAPISystemMetadata set new APISystemMetadata.
SetAPIURL assigns API URL.
SetCommodities set new Commodities.
SetCryptocurrency set new Cryptocurrency.
SetDataAPI set new DataAPI.
SetEconomicData set new EconomicData.
SetForex set new Forex.
SetHTTPClient assigns HTTP client.
SetInvestorsExchangeData set new InvestorsExchangeData.
SetReferenceData set new ReferenceData.
SetStock set new Stock.
SetToken assigns secret token.
SetURL assigns URL base.
SetVersion set IEX version.

# Constants

ABS Vector Absolute Value.
ACOS Vector Arccosine.
AD Accumulation/Distribution Line.
ADD Vector Addition.
ADOSC Accumulation/Distribution Oscillator.
ADX Average Directional Movement Index.
ADXR Average Directional Movement Rating.
AO Awesome Oscillator.
APO Absolute Price Oscillator.
AROON Aroon.
AROONOSC Aroon Oscillator.
ASIN Vector Arcsine.
ATAN Vector Arctangent.
ATR Average True Range.
AVGPRICE Average Price.
BBANDS Bollinger Bands.
BOP Balance of Power.
CCI Commodity Channel Index.
CEIL Vector Ceiling.
CMO Change Momentum Oscillator.
COS Vector Cosine.
COSH Vector Hyperbolic Cosine.
CROSSANY Crossany.
CROSSOVER Crossover.
CVI Chaikins Volatility.
DECAY Linear Decay.
DefaultBaseURL default base URL.
DefaultVersion default IEX API version.
DEMA Double Exponential Moving Average.
DI Directional Indicator.
DIV Vector Division.
DM Directional Movement.
DPO Detrended Price Oscillator.
DX Directional Movement Index.
EDECAY Exponential Decay.
EMA Exponential Moving Average.
EMV Ease of Movement.
EXP Vector Exponential.
FISHER Fisher Transform.
FLOOR Vector Floor.
FOSC Forecast Oscillator.
HMA Hull Moving Average.
KAMA Kaufman Adaptive Moving Average.
KVO Klinger Volume Oscillator.
LAG Lag.
LINREG Linear Regression.
LINREGINTERCEPT Linear Regression Intercept.
LINREGSLOPE Linear Regression Slope.
LN Vector Natural Log.
LOG10 Vector Base-10 Log.
MACD Moving Average Convergence/Divergence.
MARKETFI Market Facilitation Index.
MASS Mass Index.
MAX Maximum In Period.
MD Mean Deviation Over Period.
MEDPRICE Median Price.
MFI Money Flow Index.
MIN Minimum In Period.
MOM Momentum.
MSW Mesa Sine Wave.
MUL Vector Multiplication.
NATR Normalized Average True Range.
NVI Negative Volume Index.
OBV On Balance Volume.
PPO Percentage Price Oscillator.
PSAR Parabolic SAR.
PVI Positive Volume Index.
QSTICK Qstick.
ROC Rate of Change.
ROCR Rate of Change Ratio.
ROUND Vector Round.
RSI Relative Strength Index.
SandboxBaseURL use this as URL base if you do not want your account message limits affected on IEX cloud.
SIN Vector Sine.
SINH Vector Hyperbolic Sine.
SMA Simple Moving Average.
SQRT Vector Square Root.
STDDEV Standard Deviation Over Period.
STOCH Stochastic Oscillator.
STOCHRSI Stochastic RSI.
SUB Vector Subtraction.
SUM Sum Over Period.
TAN Vector Tangent.
TANH Vector Hyperbolic Tangent.
TEMA Triple Exponential Moving Average.
TODEG Vector Degree Conversion.
TORAD Vector Radian Conversion.
TR True Range.
TRIMA Triangular Moving Average.
TRIX Trix.
TRUNC Vector Truncate.
TSF Time Series Forecast.
TYPPRICE Typical Price.
ULTOSC Ultimate Oscillator.
VAR Variance Over Period.
VHF Vertical Horizontal Filter.
VIDYA Variable Index Dynamic Average.
VOLATILITY Annualized Historical Volatility.
VOSC Volume Oscillator.
VWMA Volume Weighted Moving Average.
WAD Williams Accumulation/Distribution.
WCPRICE Weight Close Price.
WILDERS Wilders Smoothing.
WILLR Williams %R.
WMA Weighted Moving Average.
ZLEMA Zero-Lag Exponential Moving Average.

# Variables

ChartRanges allowed for Chart API.
DefaultHTTPClient default http client to use.
DividendRanges allowed for Dividends API.
SplitRanges allowed for Splits API.

# Structs

Account struct to interface with /account endpoints.
AdvancedStat struct.
APISystemMetadata struct to interface with / endpoints.
BalanceSheet struct.
Batch struct.
Book struct.
CashFlow struct.
Chart struct.
Client API struct to IEX.
Commodities struct to interface with /data-points endpoints.
Company struct.
CryptoBook struct.
Cryptocurrency struct to interface with / endpoints.
CryptoPrice struct.
CryptoQuote struct.
DataAPI struct to interface with DataAPI endpoints.
DataPoint struct.
DEEP struct.
DelayedQuote struct.
Earnings struct.
EarningsToday struct.
EarningsTodayDTO struct.
EconomicData struct to interface with /data-points endpoints.
Estimates struct.
ExchangeRates struct.
Financials struct.
Forex struct to interface with Forex / Currencies endpoints.
FXSymbols struct.
IncomeStatement struct.
InvestorsExchangeData struct to interface with InvestorsExchangeData endpoints.
IPOCalendar struct.
KeyStat struct.
Logo struct.
Metadata struct.
OHLC struct.
Option struct.
OptionsSymbols struct.
PreviousDayPrice struct.
PriceTarget struct.
Quote struct.
ReferenceData struct to interface with /ref-data endpoints.
Status struct.
Stock struct to interface with /stock endpoints.
SystemEvent struct.
TechnicalIndicator struct.
TechnicalIndicatorParams struct.
UpcomingEvents struct.
Usage struct.

# Type aliases

Asks struct.
Bids struct.
ClientOption is a func that operates on *Client.
Collection struct.
CurrencyConversion struct.
Dividends struct {.
FundOwnership struct.
HistoricalDaily struct.
IEXSymbols struct.
IndicatorName helper type to map to string const.
InsiderRoster struct.
InsiderSummary struct.
InsiderTransactions struct.
InstitutionalOwnership struct.
InternationalExchanges struct.
InternationalSymbols struct.
IntradayPrices struct.
LargestTrades struct.
Last struct.
LatestCurrencyRates struct.
MarketVolume struct.
MutualFundSymbols struct.
News struct.
OTCSymbols struct.
RecommendationTrends struct.
SectorPerformance struct.
Sectors struct.
Splits struct.
Symbols struct.
Tags struct.
TOPS struct.
Trades struct.
UpcomingEarnings struct.
USExchanges struct.
USHolidaysAndTradingDates struct.
VolumeByVenue struct.