finnhub

package module
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2020 License: Apache-2.0 Imports: 23 Imported by: 10

README

Go API client for finnhub.io

Overview

Installation

Install package:

$ go get -u github.com/Finnhub-Stock-API/finnhub-go

Example (check out other methods documentation here):

package main

import (
	"context"
	"fmt"
	finnhub "github.com/Finnhub-Stock-API/finnhub-go"
	"github.com/antihax/optional"
)

func main() {
	finnhubClient := finnhub.NewAPIClient(finnhub.NewConfiguration()).DefaultApi
	auth := context.WithValue(context.Background(), finnhub.ContextAPIKey, finnhub.APIKey{
		Key: "<API_KEY>", // Replace this
	})

	//Stock candles
	stockCandles, _, err := finnhubClient.StockCandles(auth, "AAPL", "D", 1590988249, 1591852249, nil)
	fmt.Printf("%+v\n", stockCandles)

	// Example with required parameters
	news, _, err := finnhubClient.CompanyNews(auth, "AAPL", "2020-05-01", "2020-05-01")
	if err != nil {
		panic(err)
	}
	fmt.Printf("%+v\n", news)

	// Example with required and optional parameters
	investorsOwnershipOpts := &finnhub.InvestorsOwnershipOpts{Limit: optional.NewInt64(10)}
	ownerships, _, err := finnhubClient.InvestorsOwnership(auth, "AAPL", investorsOwnershipOpts)
	fmt.Printf("%+v\n", ownerships)

	//Aggregate Indicator
	aggregateIndicator, _, err := finnhubClient.AggregateIndicator(auth, "AAPL", "D")
	fmt.Printf("%+v\n", aggregateIndicator)

	// Basic financials
	basicFinancials, _, err := finnhubClient.CompanyBasicFinancials(auth, "MSFT", "margin")
	fmt.Printf("%+v\n", basicFinancials)

	// Company earnings
	earningsSurprises, _, err := finnhubClient.CompanyEarnings(auth, "AAPL", nil)
	fmt.Printf("%+v\n", earningsSurprises)

	// Company EPS estimates
	epsEstimate, _, err := finnhubClient.CompanyEpsEstimates(auth, "AAPL", nil)
	fmt.Printf("%+v\n", epsEstimate)

	// Company executive
	executive, _, err := finnhubClient.CompanyExecutive(auth, "AAPL")
	fmt.Printf("%+v\n", executive)

	// Company peers
	peers, _, err := finnhubClient.CompanyPeers(auth, "AAPL")
	fmt.Printf("%+v\n", peers)

	// Company profile
	profile, _, err := finnhubClient.CompanyProfile(auth, &finnhub.CompanyProfileOpts{Symbol: optional.NewString("AAPL")})
	fmt.Printf("%+v\n", profile)
	profileISIN, _, err := finnhubClient.CompanyProfile(auth, &finnhub.CompanyProfileOpts{Isin: optional.NewString("US0378331005")})
	fmt.Printf("%+v\n", profileISIN)
	profileCusip, _, err := finnhubClient.CompanyProfile(auth, &finnhub.CompanyProfileOpts{Cusip: optional.NewString("037833100")})
	fmt.Printf("%+v\n", profileCusip)

	//Company profile2
	profile2, _, err := finnhubClient.CompanyProfile2(auth, &finnhub.CompanyProfile2Opts{Symbol: optional.NewString("AAPL")})
	fmt.Printf("%+v\n", profile2)

	// Revenue Estimates
	revenueEstimates, _, err := finnhubClient.CompanyRevenueEstimates(auth, "AAPL", nil)
	fmt.Printf("%+v\n", revenueEstimates)

	// List country
	countries, _, err := finnhubClient.Country(auth)
	fmt.Printf("%+v\n", countries)

	// Covid-19
	covid19, _, err := finnhubClient.Covid19(auth)
	fmt.Printf("%+v\n", covid19)

	// Crypto candles
	cryptoCandles, _, err := finnhubClient.CryptoCandles(auth, "BINANCE:BTCUSDT", "D", 1590988249, 1591852249)
	fmt.Printf("%+v\n", cryptoCandles)

	// Crypto exchanges
	cryptoExchange, _, err := finnhubClient.CryptoExchanges(auth)
	fmt.Printf("%+v\n", cryptoExchange)

	//Crypto symbols
	cryptoSymbol, _, err := finnhubClient.CryptoSymbols(auth, "BINANCE")
	fmt.Printf("%+v\n", cryptoSymbol[0:5])

	// Earnings calendar
	earningsCalendar, _, err := finnhubClient.EarningsCalendar(auth, &finnhub.EarningsCalendarOpts{
		From: optional.NewString("2020-06-12"), To: optional.NewString("2020-06-20")})
	fmt.Printf("%+v\n", earningsCalendar)

	// Economic code
	economicCode, _, err := finnhubClient.EconomicCode(auth)
	fmt.Printf("%+v\n", economicCode)

	// Economic data
	economicData, _, err := finnhubClient.EconomicData(auth, "MA-USA-656880")
	fmt.Printf("%+v\n", economicData)

	// Filings
	filings, _, err := finnhubClient.Filings(auth, &finnhub.FilingsOpts{Symbol: optional.NewString("AAPL")})
	fmt.Printf("%+v\n", filings)

	//Financials
	financials, _, err := finnhubClient.Financials(auth, "AAPL", "bs", "annual")
	fmt.Printf("%+v\n", financials)

	// Financials Reported
	financialsReported, _, err := finnhubClient.FinancialsReported(auth, &finnhub.FinancialsReportedOpts{Symbol: optional.NewString("AAPL")})
	fmt.Printf("%+v\n", financialsReported)

	// Forex candles
	forexCandles, _, err := finnhubClient.ForexCandles(auth, "OANDA:EUR_USD", "D", 1590988249, 1591852249)
	fmt.Printf("%+v\n", forexCandles)

	// Forex exchanges
	forexExchanges, _, err := finnhubClient.ForexExchanges(auth)
	fmt.Printf("%+v\n", forexExchanges)
	// Forex rates
	forexRates, _, err := finnhubClient.ForexRates(auth, nil)
	fmt.Printf("%+v\n", forexRates)

	// Forex symbols
	forexSymbols, _, err := finnhubClient.ForexSymbols(auth, "OANDA")
	fmt.Printf("%+v\n", forexSymbols)

	//Fund ownership
	fundOwnership, _, err := finnhubClient.FundOwnership(auth, "AAPL", nil)
	fmt.Printf("%+v\n", fundOwnership)

	// General news
	generalNews, _, err := finnhubClient.GeneralNews(auth, "general", nil)
	fmt.Printf("%+v\n", generalNews)

	// Ipo calendar
	ipoCalendar, _, err := finnhubClient.IpoCalendar(auth, "2020-01-01", "2020-06-15")
	fmt.Printf("%+v\n", ipoCalendar)

	//Major development
	majorDevelopment, _, err := finnhubClient.MajorDevelopments(auth, "AAPL", nil)
	fmt.Printf("%+v\n", majorDevelopment)

	// News sentiment
	newsSentiment, _, err := finnhubClient.NewsSentiment(auth, "AAPL")
	fmt.Printf("%+v\n", newsSentiment)

	// Pattern recognition
	patterns, _, err := finnhubClient.PatternRecognition(auth, "AAPL", "D")
	fmt.Printf("%+v\n", patterns)

	// Price target
	priceTarget, _, err := finnhubClient.PriceTarget(auth, "AAPL")
	fmt.Printf("%+v\n", priceTarget)

	//Quote
	quote, _, err := finnhubClient.Quote(auth, "AAPL")
	fmt.Printf("%+v\n", quote)

	// Recommendation trends
	recommendationTrend, _, err := finnhubClient.RecommendationTrends(auth, "AAPL")
	fmt.Printf("%+v\n", recommendationTrend)

	// Stock dividens
	dividends, _, err := finnhubClient.StockDividends(auth, "KO", "2019-01-01", "2020-06-30")
	fmt.Printf("%+v\n", dividends)

	// Splits
	splits, _, err := finnhubClient.StockSplits(auth, "AAPL", "2000-01-01", "2020-06-15")
	fmt.Printf("%+v\n", splits)

	// Stock symbols
	stockSymbols, _, err := finnhubClient.StockSymbols(auth, "US")
	fmt.Printf("%+v\n", stockSymbols[0:5])

	// Support resistance
	supportResitance, _, err := finnhubClient.SupportResistance(auth, "AAPL", "D")
	fmt.Printf("%+v\n", supportResitance)

	// Technical indicator
	technicalIndicator, _, err := finnhubClient.TechnicalIndicator(auth, "AAPL", "D", 1583098857, 1584308457, "sma", &finnhub.TechnicalIndicatorOpts{
		IndicatorFields: map[string]interface{}{
			"timeperiod": 3,
		},
	})
	fmt.Printf("%+v\n", technicalIndicator)

	// Transcripts
	transcripts, _, err := finnhubClient.Transcripts(auth, "AAPL_162777")
	fmt.Printf("%+v\n", transcripts)

	// Transcripts list
	transcriptsList, _, err := finnhubClient.TranscriptsList(auth, "AAPL")
	fmt.Printf("%+v\n", transcriptsList)

	// Upgrade/downgrade
	upgradeDowngrade, _, err := finnhubClient.UpgradeDowngrade(auth, &finnhub.UpgradeDowngradeOpts{Symbol: optional.NewString("BYND")})
	fmt.Printf("%+v\n", upgradeDowngrade)

	// Tick Data
	tickData, _, err := client.StockTick(auth, "AAPL", "2020-03-25", 500, 0)
    fmt.Printf("%+v\n", tickData)

    // Indices Constituents
    indicesConstData, _, err := client.IndicesConstituents(auth, "^GSPC")
    fmt.Printf("%+v\n", indicesConstData)

    // Indices Historical Constituents
    indicesHistoricalConstData, _, err := client.IndicesHistoricalConstituents(auth, "^GSPC")
    fmt.Printf("%+v\n", indicesHistoricalConstData)

    // ETFs Profile
    etfsProfileData, _, err := client.EtfsProfile(auth, "^GSPC")
    fmt.Printf("%+v\n", etfsProfileData)

    // ETFs Holdings
    etfsHoldingsData, _, err := client.EtfsHoldings(auth, "^GSPC")
    fmt.Printf("%+v\n", etfsHoldingsData)

    // ETFs Industry Exposure
    etfsIndustryExposureData, _, err := client.EtfsIndustryExposure(auth, "^GSPC")
    fmt.Printf("%+v\n", etfsIndustryExposureData)

    // ETFs Country Exposure
    etfsCountryExposureData, _, err := client.EtfsCountryExposure(auth, "^GSPC")
    fmt.Printf("%+v\n", etfsCountryExposureData)
}

License

Apache License

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	DefaultApi *DefaultApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Finnhub API API v1.0.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

ChangeBasePath changes base path to allow switching to mocks

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() *Configuration

Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

APIResponse stores the API response returned by the server.

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

NewAPIResponse returns a new APIResonse object.

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

NewAPIResponseWithError returns a new APIResponse object with the provided error message.

type AggregateIndicators

type AggregateIndicators struct {
	TechnicalAnalysis TechnicalAnalysis `json:"technicalAnalysis,omitempty"`
	Trend             Trend             `json:"trend,omitempty"`
}

AggregateIndicators struct for AggregateIndicators

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type BasicFinancials added in v1.0.2

type BasicFinancials struct {
	// Symbol of the company.
	Symbol string `json:"symbol,omitempty"`
	// Metric type.
	MetricType string                 `json:"metricType,omitempty"`
	Metric     map[string]interface{} `json:"metric,omitempty"`
}

BasicFinancials struct for BasicFinancials

type Company

type Company struct {
	// Executive name
	Name string `json:"name,omitempty"`
	// Age
	Age int64 `json:"age,omitempty"`
	// Title
	Title string `json:"title,omitempty"`
	// Year appointed
	Since string `json:"since,omitempty"`
	// Sex
	Sex string `json:"sex,omitempty"`
	// Total compensation
	Compensation int64 `json:"compensation,omitempty"`
	// Compensation currency
	Currency string `json:"currency,omitempty"`
}

Company struct for Company

type CompanyEarningsOpts

type CompanyEarningsOpts struct {
	Limit optional.Int64
}

CompanyEarningsOpts Optional parameters for the method 'CompanyEarnings'

type CompanyEpsEstimatesOpts

type CompanyEpsEstimatesOpts struct {
	Freq optional.String
}

CompanyEpsEstimatesOpts Optional parameters for the method 'CompanyEpsEstimates'

type CompanyExecutive

type CompanyExecutive struct {
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
	// Array of company's executives and members of the Board.
	Executive []map[string]interface{} `json:"executive,omitempty"`
}

CompanyExecutive struct for CompanyExecutive

type CompanyNewsStatistics

type CompanyNewsStatistics struct {
	//
	ArticlesInLastWeek int64 `json:"articlesInLastWeek,omitempty"`
	//
	Buzz float32 `json:"buzz,omitempty"`
	//
	WeeklyAverage float32 `json:"weeklyAverage,omitempty"`
}

CompanyNewsStatistics struct for CompanyNewsStatistics

type CompanyProfile

type CompanyProfile struct {
	// Address of company's headquarter.
	Address string `json:"address,omitempty"`
	// City of company's headquarter.
	City string `json:"city,omitempty"`
	// Country of company's headquarter.
	Country string `json:"country,omitempty"`
	// Currency used in company filings.
	Currency string `json:"currency,omitempty"`
	// CUSIP number.
	Cusip string `json:"cusip,omitempty"`
	// Sedol number.
	Sedol string `json:"sedol,omitempty"`
	// Company business summary.
	Description string `json:"description,omitempty"`
	// Listed exchange.
	Exchange string `json:"exchange,omitempty"`
	// GICS industry group.
	Ggroup string `json:"ggroup,omitempty"`
	// GICS industry.
	Gind string `json:"gind,omitempty"`
	// GICS sector.
	Gsector string `json:"gsector,omitempty"`
	// GICS sub-industry.
	Gsubind string `json:"gsubind,omitempty"`
	// ISIN number.
	Isin string `json:"isin,omitempty"`
	// NAICS national industry.
	NaicsNationalIndustry string `json:"naicsNationalIndustry,omitempty"`
	// NAICS industry.
	Naics string `json:"naics,omitempty"`
	// NAICS sector.
	NaicsSector string `json:"naicsSector,omitempty"`
	// NAICS subsector.
	NaicsSubsector string `json:"naicsSubsector,omitempty"`
	// Company name.
	Name string `json:"name,omitempty"`
	// Company phone number.
	Phone string `json:"phone,omitempty"`
	// State of company's headquarter.
	State string `json:"state,omitempty"`
	// Company symbol/ticker as used on the listed exchange.
	Ticker string `json:"ticker,omitempty"`
	// Company website.
	Weburl string `json:"weburl,omitempty"`
	// IPO date.
	Ipo string `json:"ipo,omitempty"`
	// Market Capitalization.
	MarketCapitalization float32 `json:"marketCapitalization,omitempty"`
	// Number of oustanding shares.
	ShareOutstanding float32 `json:"shareOutstanding,omitempty"`
	// Number of employee.
	EmployeeTotal int64 `json:"employeeTotal,omitempty"`
	Logo string `json:"logo,omitempty"`
	// Finnhub industry classification.
	FinnhubIndustry string `json:"finnhubIndustry,omitempty"`
}

CompanyProfile struct for CompanyProfile

type CompanyProfile2

type CompanyProfile2 struct {
	// Country of company's headquarter.
	Country string `json:"country,omitempty"`
	// Currency used in company filings.
	Currency string `json:"currency,omitempty"`
	// Listed exchange.
	Exchange string `json:"exchange,omitempty"`
	// Company name.
	Name string `json:"name,omitempty"`
	// Company symbol/ticker as used on the listed exchange.
	Ticker string `json:"ticker,omitempty"`
	// IPO date.
	Ipo string `json:"ipo,omitempty"`
	// Market Capitalization.
	MarketCapitalization float32 `json:"marketCapitalization,omitempty"`
	// Number of oustanding shares.
	ShareOutstanding float32 `json:"shareOutstanding,omitempty"`
	Logo string `json:"logo,omitempty"`
	// Company phone number.
	Phone string `json:"phone,omitempty"`
	// Company website.
	Weburl string `json:"weburl,omitempty"`
	// Finnhub industry classification.
	FinnhubIndustry string `json:"finnhubIndustry,omitempty"`
}

CompanyProfile2 struct for CompanyProfile2

type CompanyProfile2Opts

type CompanyProfile2Opts struct {
	Symbol optional.String
	Isin   optional.String
	Cusip  optional.String
}

CompanyProfile2Opts Optional parameters for the method 'CompanyProfile2'

type CompanyProfileOpts

type CompanyProfileOpts struct {
	Symbol optional.String
	Isin   optional.String
	Cusip  optional.String
}

CompanyProfileOpts Optional parameters for the method 'CompanyProfile'

type CompanyRevenueEstimatesOpts

type CompanyRevenueEstimatesOpts struct {
	Freq optional.String
}

CompanyRevenueEstimatesOpts Optional parameters for the method 'CompanyRevenueEstimates'

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	Debug         bool              `json:"debug,omitempty"`
	Servers       []ServerConfiguration
	HTTPClient    *http.Client
}

Configuration stores the configuration of the API client

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration returns a new Configuration object

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

AddDefaultHeader adds a new HTTP header to the default header in the request

func (*Configuration) ServerUrl

func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error)

ServerUrl returns URL based on server settings

type CountryMetadata added in v1.1.3

type CountryMetadata struct {
	// Country name
	Country string `json:"country,omitempty"`
	// Alpha 2 code
	Code2 string `json:"code2,omitempty"`
	// Alpha 3 code
	Code3 string `json:"code3,omitempty"`
	// UN code
	CodeNo string `json:"codeNo,omitempty"`
	// Currency name
	Currency string `json:"currency,omitempty"`
	// Currency code
	CurrencyCode string `json:"currencyCode,omitempty"`
}

CountryMetadata struct for CountryMetadata

type CovidInfo added in v1.1.2

type CovidInfo struct {
	// State.
	State string `json:"state,omitempty"`
	// Number of confirmed cases.
	Case float32 `json:"case,omitempty"`
	// Number of confirmed deaths.
	Death float32 `json:"death,omitempty"`
	// Updated time.
	Updated time.Time `json:"updated,omitempty"`
}

CovidInfo struct for CovidInfo

type CryptoCandles

type CryptoCandles struct {
	// List of open prices for returned candles.
	O []float32 `json:"o,omitempty"`
	// List of high prices for returned candles.
	H []float32 `json:"h,omitempty"`
	// List of low prices for returned candles.
	L []float32 `json:"l,omitempty"`
	// List of close prices for returned candles.
	C []float32 `json:"c,omitempty"`
	// List of volume data for returned candles.
	V []float32 `json:"v,omitempty"`
	// List of timestamp for returned candles.
	T []int64 `json:"t,omitempty"`
	// Status of the response. This field can either be ok or no_data.
	S string `json:"s,omitempty"`
}

CryptoCandles struct for CryptoCandles

type CryptoSymbol

type CryptoSymbol struct {
	// Symbol description
	Description string `json:"description,omitempty"`
	// Display symbol name.
	DisplaySymbol string `json:"displaySymbol,omitempty"`
	// Unique symbol used to identify this symbol used in <code>/crypto/candle</code> endpoint.
	Symbol string `json:"symbol,omitempty"`
}

CryptoSymbol struct for CryptoSymbol

type DefaultApiService

type DefaultApiService service

DefaultApiService DefaultApi service

func (*DefaultApiService) AggregateIndicator

func (a *DefaultApiService) AggregateIndicator(ctx _context.Context, symbol string, resolution string) (AggregateIndicators, *_nethttp.Response, error)

AggregateIndicator Aggregate Indicators Get aggregate signal of multiple technical indicators such as MACD, RSI, Moving Average v.v.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol symbol
  • @param resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.

@return AggregateIndicators

func (*DefaultApiService) CompanyBasicFinancials added in v1.0.2

func (a *DefaultApiService) CompanyBasicFinancials(ctx _context.Context, symbol string, metric string) (BasicFinancials, *_nethttp.Response, error)

CompanyBasicFinancials Basic Financials Get company basic financials such as margin, P/E ratio, 52-week high/low etc.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.
  • @param metric Metric type. Can be 1 of the following values <code>all, price, valuation, margin</code>

@return BasicFinancials

func (*DefaultApiService) CompanyEarnings

func (a *DefaultApiService) CompanyEarnings(ctx _context.Context, symbol string, localVarOptionals *CompanyEarningsOpts) ([]EarningResult, *_nethttp.Response, error)

CompanyEarnings Earnings Surprises Get company historical quarterly earnings surprise going back to 2000.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.
  • @param optional nil or *CompanyEarningsOpts - Optional Parameters:
  • @param "Limit" (optional.Int64) - Limit number of period returned. Leave blank to get the full history.

@return []EarningResult

func (*DefaultApiService) CompanyEpsEstimates

func (a *DefaultApiService) CompanyEpsEstimates(ctx _context.Context, symbol string, localVarOptionals *CompanyEpsEstimatesOpts) (EarningsEstimates, *_nethttp.Response, error)

CompanyEpsEstimates Earnings Estimates Get company&#39;s EPS estimates.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.
  • @param optional nil or *CompanyEpsEstimatesOpts - Optional Parameters:
  • @param "Freq" (optional.String) - Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>

@return EarningsEstimates

func (*DefaultApiService) CompanyExecutive

func (a *DefaultApiService) CompanyExecutive(ctx _context.Context, symbol string) (CompanyExecutive, *_nethttp.Response, error)

CompanyExecutive Company Executive Get a list of company&#39;s executives and members of the Board.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.

@return CompanyExecutive

func (*DefaultApiService) CompanyNews

func (a *DefaultApiService) CompanyNews(ctx _context.Context, symbol string, from string, to string) ([]News, *_nethttp.Response, error)

CompanyNews Company News List latest company news by symbol. This endpoint is only available for North American companies.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Company symbol.
  • @param from From date <code>YYYY-MM-DD</code>.
  • @param to To date <code>YYYY-MM-DD</code>.

@return []News

func (*DefaultApiService) CompanyPeers

func (a *DefaultApiService) CompanyPeers(ctx _context.Context, symbol string) ([]string, *_nethttp.Response, error)

CompanyPeers Peers Get company peers. Return a list of peers in the same country and GICS sub-industry

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.

@return []string

func (*DefaultApiService) CompanyProfile

func (a *DefaultApiService) CompanyProfile(ctx _context.Context, localVarOptionals *CompanyProfileOpts) (CompanyProfile, *_nethttp.Response, error)

CompanyProfile Company Profile Get general information of a company. You can query by symbol, ISIN or CUSIP

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *CompanyProfileOpts - Optional Parameters:
  • @param "Symbol" (optional.String) - Symbol of the company: AAPL e.g.
  • @param "Isin" (optional.String) - ISIN
  • @param "Cusip" (optional.String) - CUSIP

@return CompanyProfile

func (*DefaultApiService) CompanyProfile2

func (a *DefaultApiService) CompanyProfile2(ctx _context.Context, localVarOptionals *CompanyProfile2Opts) (CompanyProfile2, *_nethttp.Response, error)

CompanyProfile2 Company Profile 2 Get general information of a company. You can query by symbol, ISIN or CUSIP. This is the free version of &lt;a href&#x3D;\&quot;#company-profile\&quot;&gt;Company Profile&lt;/a&gt;.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *CompanyProfile2Opts - Optional Parameters:
  • @param "Symbol" (optional.String) - Symbol of the company: AAPL e.g.
  • @param "Isin" (optional.String) - ISIN
  • @param "Cusip" (optional.String) - CUSIP

@return CompanyProfile2

func (*DefaultApiService) CompanyRevenueEstimates

func (a *DefaultApiService) CompanyRevenueEstimates(ctx _context.Context, symbol string, localVarOptionals *CompanyRevenueEstimatesOpts) (RevenueEstimates, *_nethttp.Response, error)

CompanyRevenueEstimates Revenue Estimates Get company&#39;s revenue estimates.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.
  • @param optional nil or *CompanyRevenueEstimatesOpts - Optional Parameters:
  • @param "Freq" (optional.String) - Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>

@return RevenueEstimates

func (*DefaultApiService) Country added in v1.1.0

Country Country Metadata List all countries and metadata.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []CountryMetadata

func (*DefaultApiService) Covid19

Covid19 COVID-19 Get real-time updates on the number of COVID-19 (Corona virus) cases in the US with a state-by-state breakdown. Data is sourced from CDC and reputable sources. You can also access this API &lt;a href&#x3D;\&quot;https://rapidapi.com/Finnhub/api/finnhub-real-time-covid-19\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;nofollow\&quot;&gt;here&lt;/a&gt;

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []CovidInfo

func (*DefaultApiService) CryptoCandles

func (a *DefaultApiService) CryptoCandles(ctx _context.Context, symbol string, resolution string, from int64, to int64) (CryptoCandles, *_nethttp.Response, error)

CryptoCandles Crypto Candles Get candlestick data for crypto symbols.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Use symbol returned in <code>/crypto/symbol</code> endpoint for this field.
  • @param resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
  • @param from UNIX timestamp. Interval initial value.
  • @param to UNIX timestamp. Interval end value.

@return CryptoCandles

func (*DefaultApiService) CryptoExchanges

func (a *DefaultApiService) CryptoExchanges(ctx _context.Context) ([]string, *_nethttp.Response, error)

CryptoExchanges Crypto Exchanges List supported crypto exchanges

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []string

func (*DefaultApiService) CryptoSymbols

func (a *DefaultApiService) CryptoSymbols(ctx _context.Context, exchange string) ([]CryptoSymbol, *_nethttp.Response, error)

CryptoSymbols Crypto Symbol List supported crypto symbols by exchange

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param exchange Exchange you want to get the list of symbols from.

@return []CryptoSymbol

func (*DefaultApiService) EarningsCalendar

func (a *DefaultApiService) EarningsCalendar(ctx _context.Context, localVarOptionals *EarningsCalendarOpts) (EarningsCalendar, *_nethttp.Response, error)

EarningsCalendar Earnings Calendar Get historical and coming earnings release dating back to 2003. You can setup &lt;a href&#x3D;\&quot;#webhook\&quot;&gt;webhook&lt;/a&gt; to receive real-time earnings update.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *EarningsCalendarOpts - Optional Parameters:
  • @param "From" (optional.String) - From date: 2020-03-15.
  • @param "To" (optional.String) - To date: 2020-03-16.
  • @param "Symbol" (optional.String) - Filter by symbol: AAPL.
  • @param "International" (optional.Bool) - Set to <code>true</code> to include international markets. Default value is <code>false</code>

@return EarningsCalendar

func (*DefaultApiService) EconomicCode added in v1.1.0

EconomicCode Economic Code List codes of supported economic data.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []EconomicCode

func (*DefaultApiService) EconomicData added in v1.1.0

func (a *DefaultApiService) EconomicData(ctx _context.Context, code string) (EconomicData, *_nethttp.Response, error)

EconomicData Economic Data Get economic data.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param code Economic code.

@return EconomicData

func (*DefaultApiService) EtfsCountryExposure added in v1.2.0

func (a *DefaultApiService) EtfsCountryExposure(ctx _context.Context, symbol string) (EtFsCountryExposure, *_nethttp.Response, error)

EtfsCountryExposure ETFs Country Exposure Get ETF country exposure data.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol ETF symbol.

@return EtFsCountryExposure

func (*DefaultApiService) EtfsHoldings added in v1.2.0

func (a *DefaultApiService) EtfsHoldings(ctx _context.Context, symbol string) (EtFsHoldings, *_nethttp.Response, error)

EtfsHoldings ETFs Holdings Get current ETF holdings.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol ETF symbol.

@return EtFsHoldings

func (*DefaultApiService) EtfsIndustryExposure added in v1.2.0

func (a *DefaultApiService) EtfsIndustryExposure(ctx _context.Context, symbol string) (EtFsIndustryExposure, *_nethttp.Response, error)

EtfsIndustryExposure ETFs Industry Exposure Get ETF industry exposure data.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol ETF symbol.

@return EtFsIndustryExposure

func (*DefaultApiService) EtfsProfile added in v1.2.0

func (a *DefaultApiService) EtfsProfile(ctx _context.Context, symbol string) (EtFsProfile, *_nethttp.Response, error)

EtfsProfile ETFs Profile Get ETF profile information. Currently support all US ETFs.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol ETF symbol.

@return EtFsProfile

func (*DefaultApiService) Filings

func (a *DefaultApiService) Filings(ctx _context.Context, localVarOptionals *FilingsOpts) ([]Filing, *_nethttp.Response, error)

Filings Filings List company&#39;s filing. Limit to 250 documents at a time. This data is available for bulk download on &lt;a href&#x3D;\&quot;https://www.kaggle.com/finnhub/sec-filings\&quot; target&#x3D;\&quot;_blank\&quot;&gt;Kaggle SEC Filings database&lt;/a&gt;.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *FilingsOpts - Optional Parameters:
  • @param "Symbol" (optional.String) - Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings.
  • @param "Cik" (optional.String) - CIK.
  • @param "AccessNumber" (optional.String) - Access number of a specific report you want to retrieve data from.
  • @param "Form" (optional.String) - Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company.
  • @param "From" (optional.String) - From date: 2020-03-15.
  • @param "To" (optional.String) - To date: 2020-03-16.

@return []Filing

func (*DefaultApiService) Financials

func (a *DefaultApiService) Financials(ctx _context.Context, symbol string, statement string, freq string) (FinancialStatements, *_nethttp.Response, error)

Financials Financial Statements Get standardized balance sheet, income statement and cash flow for global companies going back 30+ years.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.
  • @param statement Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively.
  • @param freq Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow.

@return FinancialStatements

func (*DefaultApiService) FinancialsReported

func (a *DefaultApiService) FinancialsReported(ctx _context.Context, localVarOptionals *FinancialsReportedOpts) (FinancialsAsReported, *_nethttp.Response, error)

FinancialsReported Financials As Reported Get financials as reported. This data is available for bulk download on &lt;a href&#x3D;\&quot;https://www.kaggle.com/finnhub/reported-financials\&quot; target&#x3D;\&quot;_blank\&quot;&gt;Kaggle SEC Financials database&lt;/a&gt;.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *FinancialsReportedOpts - Optional Parameters:
  • @param "Symbol" (optional.String) - Symbol.
  • @param "Cik" (optional.String) - CIK.
  • @param "AccessNumber" (optional.String) - Access number of a specific report you want to retrieve financials from.
  • @param "Freq" (optional.String) - Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>.

@return FinancialsAsReported

func (*DefaultApiService) ForexCandles

func (a *DefaultApiService) ForexCandles(ctx _context.Context, symbol string, resolution string, from int64, to int64) (ForexCandles, *_nethttp.Response, error)

ForexCandles Forex Candles Get candlestick data for forex symbols.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Use symbol returned in <code>/forex/symbol</code> endpoint for this field.
  • @param resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
  • @param from UNIX timestamp. Interval initial value.
  • @param to UNIX timestamp. Interval end value.

@return ForexCandles

func (*DefaultApiService) ForexExchanges

func (a *DefaultApiService) ForexExchanges(ctx _context.Context) ([]string, *_nethttp.Response, error)

ForexExchanges Forex Exchanges List supported forex exchanges

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []string

func (*DefaultApiService) ForexRates

func (a *DefaultApiService) ForexRates(ctx _context.Context, localVarOptionals *ForexRatesOpts) (Forexrates, *_nethttp.Response, error)

ForexRates Forex rates Get rates for all forex pairs. Ideal for currency conversion

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *ForexRatesOpts - Optional Parameters:
  • @param "Base" (optional.String) - Base currency. Default to EUR.

@return Forexrates

func (*DefaultApiService) ForexSymbols

func (a *DefaultApiService) ForexSymbols(ctx _context.Context, exchange string) ([]ForexSymbol, *_nethttp.Response, error)

ForexSymbols Forex Symbol List supported forex symbols.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param exchange Exchange you want to get the list of symbols from.

@return []ForexSymbol

func (*DefaultApiService) FundOwnership

func (a *DefaultApiService) FundOwnership(ctx _context.Context, symbol string, localVarOptionals *FundOwnershipOpts) (FundOwnership, *_nethttp.Response, error)

FundOwnership Fund Ownership Get a full list fund and institutional investors of a company in descending order of the number of shares held.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.
  • @param optional nil or *FundOwnershipOpts - Optional Parameters:
  • @param "Limit" (optional.Int64) - Limit number of results. Leave empty to get the full list.

@return FundOwnership

func (*DefaultApiService) GeneralNews

func (a *DefaultApiService) GeneralNews(ctx _context.Context, category string, localVarOptionals *GeneralNewsOpts) ([]News, *_nethttp.Response, error)

GeneralNews General News Get latest market news.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param category This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>.
  • @param optional nil or *GeneralNewsOpts - Optional Parameters:
  • @param "MinId" (optional.String) - Use this field to get only news after this ID. Default to 0

@return []News

func (*DefaultApiService) IndicesConstituents added in v1.2.0

func (a *DefaultApiService) IndicesConstituents(ctx _context.Context, symbol string) (IndicesConstituents, *_nethttp.Response, error)

IndicesConstituents Indices Constituents Get a list of index&#39;s constituents. Currently support &lt;code&gt;^GSPC (S&amp;P 500)&lt;/code&gt;, &lt;code&gt;^NDX (Nasdaq 100)&lt;/code&gt;, &lt;code&gt;^DJI (Dow Jones)&lt;/code&gt;

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol symbol

@return IndicesConstituents

func (*DefaultApiService) IndicesHistoricalConstituents added in v1.2.0

func (a *DefaultApiService) IndicesHistoricalConstituents(ctx _context.Context, symbol string) (IndicesHistoricalConstituents, *_nethttp.Response, error)

IndicesHistoricalConstituents Indices Historical Constituents Get full history of index&#39;s constituents including symbols and dates of joining and leaving the Index. Currently support &lt;code&gt;^GSPC (S&amp;P 500)&lt;/code&gt;, &lt;code&gt;^NDX (Nasdaq 100)&lt;/code&gt;, &lt;code&gt;^DJI (Dow Jones)&lt;/code&gt;

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol symbol

@return IndicesHistoricalConstituents

func (*DefaultApiService) InvestorsOwnership

func (a *DefaultApiService) InvestorsOwnership(ctx _context.Context, symbol string, localVarOptionals *InvestorsOwnershipOpts) (InvestorsOwnership, *_nethttp.Response, error)

InvestorsOwnership Investors Ownership Get a full list of shareholders/investors of a company in descending order of the number of shares held.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.
  • @param optional nil or *InvestorsOwnershipOpts - Optional Parameters:
  • @param "Limit" (optional.Int64) - Limit number of results. Leave empty to get the full list.

@return InvestorsOwnership

func (*DefaultApiService) IpoCalendar

func (a *DefaultApiService) IpoCalendar(ctx _context.Context, from string, to string) (IpoCalendar, *_nethttp.Response, error)

IpoCalendar IPO Calendar Get recent and coming IPO.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param from From date: 2020-03-15.
  • @param to To date: 2020-03-16.

@return IpoCalendar

func (*DefaultApiService) MajorDevelopments

func (a *DefaultApiService) MajorDevelopments(ctx _context.Context, symbol string, localVarOptionals *MajorDevelopmentsOpts) (MajorDevelopments, *_nethttp.Response, error)

MajorDevelopments Major Developments List latest major developments of a company going back 20 years with 12M+ data points. This data can be used to highlight the most significant events.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Company symbol.
  • @param optional nil or *MajorDevelopmentsOpts - Optional Parameters:
  • @param "From" (optional.String) - From time: 2020-01-01.
  • @param "To" (optional.String) - To time: 2020-01-05.

@return MajorDevelopments

func (*DefaultApiService) NewsSentiment

func (a *DefaultApiService) NewsSentiment(ctx _context.Context, symbol string) (NewsSentiment, *_nethttp.Response, error)

NewsSentiment News Sentiment Get company&#39;s news sentiment and statistics. This endpoint is only available for US companies.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Company symbol.

@return NewsSentiment

func (*DefaultApiService) PatternRecognition

func (a *DefaultApiService) PatternRecognition(ctx _context.Context, symbol string, resolution string) (PatternRecognition, *_nethttp.Response, error)

PatternRecognition Pattern Recognition Run pattern recognition algorithm on a symbol. Support double top/bottom, triple top/bottom, head and shoulders, triangle, wedge, channel, flag, and candlestick patterns.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol
  • @param resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.

@return PatternRecognition

func (*DefaultApiService) PriceTarget

func (a *DefaultApiService) PriceTarget(ctx _context.Context, symbol string) (PriceTarget, *_nethttp.Response, error)

PriceTarget Price Target Get latest price target consensus.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.

@return PriceTarget

func (*DefaultApiService) Quote

func (a *DefaultApiService) Quote(ctx _context.Context, symbol string) (Quote, *_nethttp.Response, error)

Quote Quote &lt;p&gt;Get real-time quote data for US stocks. Constant polling is not recommended. Use websocket if you need real-time update.&lt;/p&gt;&lt;p&gt;Real-time stock prices for international markets are supported for Enterprise clients via our partner&#39;s feed. &lt;a href&#x3D;\&quot;mailto:support@finnhub.io\&quot;&gt;Contact Us&lt;/a&gt; to learn more.&lt;/p&gt;

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol

@return Quote

func (*DefaultApiService) RecommendationTrends

func (a *DefaultApiService) RecommendationTrends(ctx _context.Context, symbol string) ([]RecommendationTrend, *_nethttp.Response, error)

RecommendationTrends Recommendation Trends Get latest analyst recommendation trends for a company.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol of the company: AAPL.

@return []RecommendationTrend

func (*DefaultApiService) SimilarityIndex added in v1.2.0

func (a *DefaultApiService) SimilarityIndex(ctx _context.Context, localVarOptionals *SimilarityIndexOpts) (SimilarityIndex, *_nethttp.Response, error)

SimilarityIndex Similarity Index &lt;p&gt;Calculate the textual difference between a company&#39;s 10-K / 10-Q reports and the same type of report in the previous year using Cosine Similarity. For example, this endpoint compares 2019&#39;s 10-K with 2018&#39;s 10-K. Companies breaking from its routines in disclosure of financial condition and risk analysis section can signal a significant change in the company&#39;s stock price in the upcoming 4 quarters.&lt;/p&gt;

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *SimilarityIndexOpts - Optional Parameters:
  • @param "Symbol" (optional.String) - Symbol. Required if cik is empty
  • @param "Cik" (optional.String) - CIK. Required if symbol is empty
  • @param "Freq" (optional.String) - <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>

@return SimilarityIndex

func (*DefaultApiService) StockBidask added in v1.1.4

func (a *DefaultApiService) StockBidask(ctx _context.Context, symbol string) (LastBidAsk, *_nethttp.Response, error)

StockBidask Last Bid-Ask Get last bid/ask data for US stocks.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol.

@return LastBidAsk

func (*DefaultApiService) StockCandles

func (a *DefaultApiService) StockCandles(ctx _context.Context, symbol string, resolution string, from int64, to int64, localVarOptionals *StockCandlesOpts) (StockCandles, *_nethttp.Response, error)

StockCandles Stock Candles &lt;p&gt;Get candlestick data for stocks going back 25 years for US stocks.&lt;/p&gt;&lt;p&gt;Real-time stock prices for international markets are supported for Enterprise clients via our partner&#39;s feed. &lt;a href&#x3D;\&quot;mailto:support@finnhub.io\&quot;&gt;Contact Us&lt;/a&gt; to learn more.&lt;/p&gt;

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol.
  • @param resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
  • @param from UNIX timestamp. Interval initial value.
  • @param to UNIX timestamp. Interval end value.
  • @param optional nil or *StockCandlesOpts - Optional Parameters:
  • @param "Adjusted" (optional.String) - By default, <code>adjusted=false</code>. Use <code>true</code> to get adjusted data.

@return StockCandles

func (*DefaultApiService) StockDividends

func (a *DefaultApiService) StockDividends(ctx _context.Context, symbol string, from string, to string) ([]Dividends, *_nethttp.Response, error)

StockDividends Dividends Get dividends data for common stocks going back 30 years.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol.
  • @param from YYYY-MM-DD.
  • @param to YYYY-MM-DD.

@return []Dividends

func (*DefaultApiService) StockSplits

func (a *DefaultApiService) StockSplits(ctx _context.Context, symbol string, from string, to string) ([]Split, *_nethttp.Response, error)

StockSplits Splits Get splits data for stocks.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol.
  • @param from YYYY-MM-DD.
  • @param to YYYY-MM-DD.

@return []Split

func (*DefaultApiService) StockSymbols

func (a *DefaultApiService) StockSymbols(ctx _context.Context, exchange string) ([]Stock, *_nethttp.Response, error)

StockSymbols Stock Symbol List supported stocks. A list of supported CFD Indices can be found &lt;a href&#x3D;\&quot;https://docs.google.com/spreadsheets/d/1BAbIXBgl405fj0oHeEyRFEu8mW4QD1PhvtaBATLoR14/edit?usp&#x3D;sharing\&quot; target&#x3D;\&quot;_blank\&quot;&gt;here&lt;/a&gt;.

@return []Stock

func (*DefaultApiService) StockTick

func (a *DefaultApiService) StockTick(ctx _context.Context, symbol string, date string, limit int64, skip int64) (TickData, *_nethttp.Response, error)

StockTick Tick Data &lt;p&gt;Get historical tick data for US stocks from all 13 exchanges. You can send the request directly to our tick server at &lt;a href&#x3D;\&quot;https://tick.finnhub.io/\&quot;&gt;https://tick.finnhub.io/&lt;/a&gt; with the same path and parameters or get redirected there if you call our main server. Data is updated at the end of each trading day.&lt;/p&gt;&lt;p&gt;Tick data from 1985 is available for Enterprise clients. &lt;a href&#x3D;\&quot;mailto:support@finnhub.io\&quot;&gt;Contact us&lt;/a&gt; to learn more.&lt;/p&gt;

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol.
  • @param date Date: 2020-04-02.
  • @param limit Limit number of ticks returned. Maximum value: <code>25000</code>
  • @param skip Number of ticks to skip. Use this parameter to loop through the entire data.

@return TickData

func (*DefaultApiService) SupportResistance

func (a *DefaultApiService) SupportResistance(ctx _context.Context, symbol string, resolution string) (SupportResistance, *_nethttp.Response, error)

SupportResistance Support/Resistance Get support and resistance levels for a symbol.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Symbol
  • @param resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.

@return SupportResistance

func (*DefaultApiService) TechnicalIndicator

func (a *DefaultApiService) TechnicalIndicator(ctx _context.Context, symbol string, resolution string, from int64, to int64, indicator string, localVarOptionals *TechnicalIndicatorOpts) (map[string]interface{}, *_nethttp.Response, error)

TechnicalIndicator Technical Indicators Return technical indicator with price data. List of supported indicators can be found &lt;a href&#x3D;\&quot;https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp&#x3D;sharing\&quot; target&#x3D;\&quot;_blank\&quot;&gt;here&lt;/a&gt;.

@return map[string]interface{}

func (*DefaultApiService) Transcripts

Transcripts Earnings Call Transcripts &lt;p&gt;Get earnings call transcripts, audio and participants&#39; list. This endpoint is only available for US companies. &lt;p&gt;17+ years of data is available with 170,000+ audio which add up to 6TB in size.&lt;/p&gt;

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>.

@return EarningsCallTranscripts

func (*DefaultApiService) TranscriptsList

TranscriptsList Earnings Call Transcripts List List earnings call transcripts&#39; metadata. This endpoint is only available for US companies.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param symbol Company symbol: AAPL. Leave empty to list the latest transcripts

@return EarningsCallTranscriptsList

func (*DefaultApiService) UpgradeDowngrade

func (a *DefaultApiService) UpgradeDowngrade(ctx _context.Context, localVarOptionals *UpgradeDowngradeOpts) ([]UpgradeDowngrade, *_nethttp.Response, error)

UpgradeDowngrade Stock Upgrade/Downgrade Get latest stock upgrade and downgrade.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param optional nil or *UpgradeDowngradeOpts - Optional Parameters:
  • @param "Symbol" (optional.String) - Symbol of the company: AAPL. If left blank, the API will return latest stock upgrades/downgrades.
  • @param "From" (optional.String) - From date: 2000-03-15.
  • @param "To" (optional.String) - To date: 2020-03-16.

@return []UpgradeDowngrade

type Development

type Development struct {
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
	// Published time in <code>YYYY-MM-DD HH:MM:SS</code> format.
	Datetime time.Time `json:"datetime,omitempty"`
	// Development headline.
	Headline string `json:"headline,omitempty"`
	// Development description.
	Description string `json:"description,omitempty"`
}

Development struct for Development

type Dividends

type Dividends struct {
	// Symbol.
	Symbol string `json:"symbol,omitempty"`
	// Ex-Dividend date.
	Date string `json:"date,omitempty"`
	// Amount in local currency.
	Amount float32 `json:"amount,omitempty"`
	// Adjusted dividend.
	AdjustedAmount float32 `json:"adjustedAmount,omitempty"`
	// Pay date.
	PayDate string `json:"payDate,omitempty"`
	// Record date.
	RecordDate string `json:"recordDate,omitempty"`
	// Declaration date.
	DeclarationDate string `json:"declarationDate,omitempty"`
	// Currency.
	Currency string `json:"currency,omitempty"`
}

Dividends struct for Dividends

type EarningEstimate

type EarningEstimate struct {
	// Average EPS estimates.
	EpsAvg float32 `json:"epsAvg,omitempty"`
	// Highest estimate.
	EpsHigh float32 `json:"epsHigh,omitempty"`
	// Lowest estimate.
	EpsLow float32 `json:"epsLow,omitempty"`
	// Number of Analysts.
	NumberAnalysts int64 `json:"numberAnalysts,omitempty"`
	// Period.
	Period string `json:"period,omitempty"`
}

EarningEstimate struct for EarningEstimate

type EarningRelease

type EarningRelease struct {
	// Symbol.
	Symbol string `json:"symbol,omitempty"`
	// Date.
	Date string `json:"date,omitempty"`
	// Indicates whether the earnings is announced before market open(<code>bmo</code>), after market close(<code>amc</code>), or during market hour(<code>dmh</code>).
	Hour string `json:"hour,omitempty"`
	// Earnings year.
	Year int64 `json:"year,omitempty"`
	// Earnings quarter.
	Quarter int64 `json:"quarter,omitempty"`
	// EPS estimate.
	EpsEstimate float32 `json:"epsEstimate,omitempty"`
	// EPS actual.
	EpsActual float32 `json:"epsActual,omitempty"`
	// Revenue estimate.
	RevenueEstimate int64 `json:"revenueEstimate,omitempty"`
	// Revenue actual.
	RevenueActual int64 `json:"revenueActual,omitempty"`
}

EarningRelease struct for EarningRelease

type EarningResult

type EarningResult struct {
	// Actual earning result.
	Actual float32 `json:"actual,omitempty"`
	// Estimated earning.
	Estimate float32 `json:"estimate,omitempty"`
	// Reported period.
	Period string `json:"period,omitempty"`
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
}

EarningResult struct for EarningResult

type EarningsCalendar added in v1.1.1

type EarningsCalendar struct {
	// Array of earnings release.
	EarningsCalendar []map[string]interface{} `json:"earningsCalendar,omitempty"`
}

EarningsCalendar struct for EarningsCalendar

type EarningsCalendarOpts

type EarningsCalendarOpts struct {
	From          optional.String
	To            optional.String
	Symbol        optional.String
	International optional.Bool
}

EarningsCalendarOpts Optional parameters for the method 'EarningsCalendar'

type EarningsCallTranscripts

type EarningsCallTranscripts struct {
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
	// Transcript content.
	Transcript []map[string]interface{} `json:"transcript,omitempty"`
	// Participant list
	Participant []map[string]interface{} `json:"participant,omitempty"`
	// Audio link.
	Audio string `json:"audio,omitempty"`
	// Transcript's ID.
	Id string `json:"id,omitempty"`
	// Title.
	Title string `json:"title,omitempty"`
	// Time of the event.
	Time time.Time `json:"time,omitempty"`
	// Year of earnings result in the case of earnings call transcript.
	Year int64 `json:"year,omitempty"`
	// Quarter of earnings result in the case of earnings call transcript.
	Quarter int64 `json:"quarter,omitempty"`
}

EarningsCallTranscripts struct for EarningsCallTranscripts

type EarningsCallTranscriptsList

type EarningsCallTranscriptsList struct {
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
	// Array of transcripts' metadata
	Transcripts []map[string]interface{} `json:"transcripts,omitempty"`
}

EarningsCallTranscriptsList struct for EarningsCallTranscriptsList

type EarningsEstimates

type EarningsEstimates struct {
	// List of estimates
	Data []map[string]interface{} `json:"data,omitempty"`
	// Frequency: annual or quarterly.
	Freq string `json:"freq,omitempty"`
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
}

EarningsEstimates struct for EarningsEstimates

type EconomicCalendar

type EconomicCalendar struct {
	// Array of economic events.
	EconomicCalendar []map[string]interface{} `json:"economicCalendar,omitempty"`
}

EconomicCalendar struct for EconomicCalendar

type EconomicCode

type EconomicCode struct {
	// Finnhub economic code used to get historical data
	Code string `json:"code,omitempty"`
	// Country
	Country string `json:"country,omitempty"`
	// Indicator name
	Name string `json:"name,omitempty"`
	// Unit
	Unit string `json:"unit,omitempty"`
}

EconomicCode struct for EconomicCode

type EconomicData added in v1.1.0

type EconomicData struct {
	// Array of economic data for requested code.
	Data []map[string]interface{} `json:"data,omitempty"`
	// Finnhub economic code
	Code string `json:"code,omitempty"`
}

EconomicData struct for EconomicData

type EconomicEvent added in v1.1.0

type EconomicEvent struct {
	// Actual release
	Actual float32 `json:"actual,omitempty"`
	// Previous release
	Prev float32 `json:"prev,omitempty"`
	// Country
	Country string `json:"country,omitempty"`
	// Unit
	Unit string `json:"unit,omitempty"`
	// Estimate
	Estimate float32 `json:"estimate,omitempty"`
	// Event
	Event string `json:"event,omitempty"`
	// Impact level
	Impact string `json:"impact,omitempty"`
	// Release time
	Time string `json:"time,omitempty"`
}

EconomicEvent struct for EconomicEvent

type Estimate

type Estimate struct {
	// Average revenue estimates.
	RevenueAvg int64 `json:"revenueAvg,omitempty"`
	// Highest estimate.
	RevenueHigh int64 `json:"revenueHigh,omitempty"`
	// Lowest estimate.
	RevenueLow int64 `json:"revenueLow,omitempty"`
	// Number of Analysts.
	NumberAnalysts int64 `json:"numberAnalysts,omitempty"`
	// Period.
	Period string `json:"period,omitempty"`
}

Estimate struct for Estimate

type EtFsCountryExposure added in v1.2.0

type EtFsCountryExposure struct {
	// ETF symbol.
	Symbol string `json:"symbol,omitempty"`
	// Array of countries and and exposure levels.
	CountryExposure []map[string]interface{} `json:"countryExposure,omitempty"`
}

EtFsCountryExposure struct for EtFsCountryExposure

type EtFsHoldings added in v1.2.0

type EtFsHoldings struct {
	// ETF symbol.
	Symbol string `json:"symbol,omitempty"`
	// Array of holdings.
	Holdings []map[string]interface{} `json:"holdings,omitempty"`
}

EtFsHoldings struct for EtFsHoldings

type EtFsIndustryExposure added in v1.2.0

type EtFsIndustryExposure struct {
	// ETF symbol.
	Symbol string `json:"symbol,omitempty"`
	// Array of industries and exposure levels.
	SectorExposure []map[string]interface{} `json:"sectorExposure,omitempty"`
}

EtFsIndustryExposure struct for EtFsIndustryExposure

type EtFsProfile added in v1.2.0

type EtFsProfile struct {
	// Use symbol returned in <code>/forex/symbol</code> endpoint for this field.
	Symbol  string                 `json:"symbol,omitempty"`
	Profile map[string]interface{} `json:"profile,omitempty"`
}

EtFsProfile struct for EtFsProfile

type EtfCountryExposureData added in v1.2.1

type EtfCountryExposureData struct {
	// Country
	Country string `json:"country,omitempty"`
	// Percent of exposure.
	Exposure string `json:"exposure,omitempty"`
}

EtfCountryExposureData struct for EtfCountryExposureData

type EtfHoldingsData added in v1.2.1

type EtfHoldingsData struct {
	// Symbol description
	Symbol string `json:"symbol,omitempty"`
	// Number of shares owned by the ETF.
	Share float32 `json:"share,omitempty"`
	// Portfolio's percent
	Percent float32 `json:"percent,omitempty"`
}

EtfHoldingsData struct for EtfHoldingsData

type EtfSectorExposureData added in v1.2.1

type EtfSectorExposureData struct {
	// Industry
	Industry string `json:"industry,omitempty"`
	// Percent of exposure.
	Exposure string `json:"exposure,omitempty"`
}

EtfSectorExposureData struct for EtfSectorExposureData

type Filing

type Filing struct {
	// Access number.
	AccessNumber string `json:"accessNumber,omitempty"`
	// Symbol.
	Symbol string `json:"symbol,omitempty"`
	// CIK.
	Cik string `json:"cik,omitempty"`
	// Form type.
	Form string `json:"form,omitempty"`
	// Filed date <code>%Y-%m-%d %H:%M:%S</code>.
	FiledDate time.Time `json:"filedDate,omitempty"`
	// Accepted date <code>%Y-%m-%d %H:%M:%S</code>.
	AcceptedDate time.Time `json:"acceptedDate,omitempty"`
	// Report's URL.
	ReportUrl string `json:"reportUrl,omitempty"`
	// Filing's URL.
	FilingUrl string `json:"filingUrl,omitempty"`
}

Filing struct for Filing

type FilingsOpts

type FilingsOpts struct {
	Symbol       optional.String
	Cik          optional.String
	AccessNumber optional.String
	Form         optional.String
	From         optional.String
	To           optional.String
}

FilingsOpts Optional parameters for the method 'Filings'

type FinancialStatements

type FinancialStatements struct {
	// Symbol of the company.
	Symbol string `json:"symbol,omitempty"`
	// An array of map of key, value pairs containing the data for each period.
	Financials []map[string]interface{} `json:"financials,omitempty"`
}

FinancialStatements struct for FinancialStatements

type FinancialsAsReported

type FinancialsAsReported struct {
	// Symbol
	Symbol string `json:"symbol,omitempty"`
	// CIK
	Cik string `json:"cik,omitempty"`
	// Array of filings.
	Data []map[string]interface{} `json:"data,omitempty"`
}

FinancialsAsReported struct for FinancialsAsReported

type FinancialsReportedOpts

type FinancialsReportedOpts struct {
	Symbol       optional.String
	Cik          optional.String
	AccessNumber optional.String
	Freq         optional.String
}

FinancialsReportedOpts Optional parameters for the method 'FinancialsReported'

type ForexCandles

type ForexCandles struct {
	// List of open prices for returned candles.
	O []float32 `json:"o,omitempty"`
	// List of high prices for returned candles.
	H []float32 `json:"h,omitempty"`
	// List of low prices for returned candles.
	L []float32 `json:"l,omitempty"`
	// List of close prices for returned candles.
	C []float32 `json:"c,omitempty"`
	// List of volume data for returned candles.
	V []float32 `json:"v,omitempty"`
	// List of timestamp for returned candles.
	T []float32 `json:"t,omitempty"`
	// Status of the response. This field can either be ok or no_data.
	S string `json:"s,omitempty"`
}

ForexCandles struct for ForexCandles

type ForexRatesOpts

type ForexRatesOpts struct {
	Base optional.String
}

ForexRatesOpts Optional parameters for the method 'ForexRates'

type ForexSymbol

type ForexSymbol struct {
	// Symbol description
	Description string `json:"description,omitempty"`
	// Display symbol name.
	DisplaySymbol string `json:"displaySymbol,omitempty"`
	// Unique symbol used to identify this symbol used in <code>/forex/candle</code> endpoint.
	Symbol string `json:"symbol,omitempty"`
}

ForexSymbol struct for ForexSymbol

type Forexrates

type Forexrates struct {
	// Base currency.
	Base  string                 `json:"base,omitempty"`
	Quote map[string]interface{} `json:"quote,omitempty"`
}

Forexrates struct for Forexrates

type FundOwnership

type FundOwnership struct {
	// Symbol of the company.
	Symbol string `json:"symbol,omitempty"`
	// Array of investors with detailed information about their holdings.
	Ownership []map[string]interface{} `json:"ownership,omitempty"`
}

FundOwnership struct for FundOwnership

type FundOwnershipOpts

type FundOwnershipOpts struct {
	Limit optional.Int64
}

FundOwnershipOpts Optional parameters for the method 'FundOwnership'

type GeneralNewsOpts

type GeneralNewsOpts struct {
	MinId optional.String
}

GeneralNewsOpts Optional parameters for the method 'GeneralNews'

type GenericOpenAPIError

type GenericOpenAPIError struct {
	// contains filtered or unexported fields
}

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type IndexHistoricalConstituent added in v1.2.0

type IndexHistoricalConstituent struct {
	// Symbol
	Symbol string `json:"symbol,omitempty"`
	// <code>add</code> or <code>remove</code>.
	Action string `json:"action,omitempty"`
	// Date of joining or leaving the index.
	Date string `json:"date,omitempty"`
}

IndexHistoricalConstituent struct for IndexHistoricalConstituent

type Indicator

type Indicator struct {
	// Number of buy signals
	Buy int64 `json:"buy,omitempty"`
	// Number of neutral signals
	Neutral int64 `json:"neutral,omitempty"`
	// Number of sell signals
	Sell int64 `json:"sell,omitempty"`
}

Indicator struct for Indicator

type IndicesConstituents added in v1.2.0

type IndicesConstituents struct {
	// Index's symbol.
	Symbol string `json:"symbol,omitempty"`
	// Array of constituents.
	Constituents []string `json:"constituents,omitempty"`
}

IndicesConstituents struct for IndicesConstituents

type IndicesHistoricalConstituents added in v1.2.0

type IndicesHistoricalConstituents struct {
	// Index's symbol.
	Symbol string `json:"symbol,omitempty"`
	// Array of historical constituents.
	HistoricalConstituents []map[string]interface{} `json:"historicalConstituents,omitempty"`
}

IndicesHistoricalConstituents struct for IndicesHistoricalConstituents

type Investor

type Investor struct {
	// Investor's name.
	Name string `json:"name,omitempty"`
	// Number of shares held by the investor.
	Share int64 `json:"share,omitempty"`
	// Number of share changed (net buy or sell) from the last period.
	Change int64 `json:"change,omitempty"`
	// Filing date.
	FilingDate string `json:"filingDate,omitempty"`
}

Investor struct for Investor

type InvestorsOwnership

type InvestorsOwnership struct {
	// Symbol of the company.
	Symbol string `json:"symbol,omitempty"`
	// Array of investors with detailed information about their holdings.
	Ownership []map[string]interface{} `json:"ownership,omitempty"`
}

InvestorsOwnership struct for InvestorsOwnership

type InvestorsOwnershipOpts

type InvestorsOwnershipOpts struct {
	Limit optional.Int64
}

InvestorsOwnershipOpts Optional parameters for the method 'InvestorsOwnership'

type IpoCalendar added in v1.1.1

type IpoCalendar struct {
	// Array of IPO events.
	IpoCalendar []map[string]interface{} `json:"ipoCalendar,omitempty"`
}

IpoCalendar struct for IpoCalendar

type IpoEvent

type IpoEvent struct {
	// Symbol.
	Symbol string `json:"symbol,omitempty"`
	// IPO date.
	Date string `json:"date,omitempty"`
	// Exchange.
	Exchange string `json:"exchange,omitempty"`
	// Company's name.
	Name string `json:"name,omitempty"`
	// IPO status. Can take 1 of the following values: <code>expected</code>,<code>priced</code>,<code>withdrawn</code>,<code>filed</code>
	Status string `json:"status,omitempty"`
	// Projected price or price range.
	Price string `json:"price,omitempty"`
	// Number of shares offered during the IPO.
	NumberOfShares int64 `json:"numberOfShares,omitempty"`
	// Total shares value.
	TotalSharesValue int64 `json:"totalSharesValue,omitempty"`
}

IpoEvent struct for IpoEvent

type LastBidAsk added in v1.1.4

type LastBidAsk struct {
	// Bid price.
	B float32 `json:"b,omitempty"`
	// Ask price.
	A float32 `json:"a,omitempty"`
	// Bid volume.
	Bv float32 `json:"bv,omitempty"`
	// Ask volume.
	Av float32 `json:"av,omitempty"`
	// Reference UNIX timestamp in ms.
	T int64 `json:"t,omitempty"`
}

LastBidAsk struct for LastBidAsk

type MajorDevelopments

type MajorDevelopments struct {
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
	// Array of major developments.
	MajorDevelopment []map[string]interface{} `json:"majorDevelopment,omitempty"`
}

MajorDevelopments struct for MajorDevelopments

type MajorDevelopmentsOpts

type MajorDevelopmentsOpts struct {
	From optional.String
	To   optional.String
}

MajorDevelopmentsOpts Optional parameters for the method 'MajorDevelopments'

type News

type News struct {
	// News category.
	Category string `json:"category,omitempty"`
	// Published time in UNIX timestamp.
	Datetime int64 `json:"datetime,omitempty"`
	// News headline.
	Headline string `json:"headline,omitempty"`
	// News ID. This value can be used for <code>minId</code> params to get the latest news only.
	Id int64 `json:"id,omitempty"`
	// Thumbnail image URL.
	Image string `json:"image,omitempty"`
	// Related stocks and companies mentioned in the article.
	Related string `json:"related,omitempty"`
	// News source.
	Source string `json:"source,omitempty"`
	// News summary.
	Summary string `json:"summary,omitempty"`
	// URL of the original article.
	Url string `json:"url,omitempty"`
}

News struct for News

type NewsSentiment

type NewsSentiment struct {
	Buzz CompanyNewsStatistics `json:"buzz,omitempty"`
	// News score.
	CompanyNewsScore float32 `json:"companyNewsScore,omitempty"`
	// Sector average bullish percent.
	SectorAverageBullishPercent float32 `json:"sectorAverageBullishPercent,omitempty"`
	// Sectore average score.
	SectorAverageNewsScore float32   `json:"sectorAverageNewsScore,omitempty"`
	Sentiment              Sentiment `json:"sentiment,omitempty"`
	// Requested symbol.
	Symbol string `json:"symbol,omitempty"`
}

NewsSentiment struct for NewsSentiment

type PatternRecognition added in v1.1.1

type PatternRecognition struct {
	// Array of patterns.
	Points []map[string]interface{} `json:"points,omitempty"`
}

PatternRecognition struct for PatternRecognition

type PriceTarget

type PriceTarget struct {
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
	// Highes analysts' target.
	TargetHigh float32 `json:"targetHigh,omitempty"`
	// Lowest analysts' target.
	TargetLow float32 `json:"targetLow,omitempty"`
	// Mean of all analysts' targets.
	TargetMean float32 `json:"targetMean,omitempty"`
	// Median of all analysts' targets.
	TargetMedian float32 `json:"targetMedian,omitempty"`
	// Updated time of the data
	LastUpdated time.Time `json:"lastUpdated,omitempty"`
}

PriceTarget struct for PriceTarget

type Quote

type Quote struct {
	// Open price of the day
	O float32 `json:"o,omitempty"`
	// High price of the day
	H float32 `json:"h,omitempty"`
	// Low price of the day
	L float32 `json:"l,omitempty"`
	// Current price
	C float32 `json:"c,omitempty"`
	// Previous close price
	Pc float32 `json:"pc,omitempty"`
}

Quote struct for Quote

type RecommendationTrend added in v1.1.1

type RecommendationTrend struct {
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
	// Number of recommendations that fall into the Buy category
	Buy int64 `json:"buy,omitempty"`
	// Number of recommendations that fall into the Hold category
	Hold int64 `json:"hold,omitempty"`
	// Updated period
	Period string `json:"period,omitempty"`
	// Number of recommendations that fall into the Sell category
	Sell int64 `json:"sell,omitempty"`
	// Number of recommendations that fall into the Strong Buy category
	StrongBuy int64 `json:"strongBuy,omitempty"`
	// Number of recommendations that fall into the Strong Sell category
	StrongSell int64 `json:"strongSell,omitempty"`
}

RecommendationTrend struct for RecommendationTrend

type Report

type Report struct {
	// Access number.
	AccessNumber string `json:"accessNumber,omitempty"`
	// Symbol.
	Symbol string `json:"symbol,omitempty"`
	// CIK.
	Cik string `json:"cik,omitempty"`
	// Year.
	Year int64 `json:"year,omitempty"`
	// Quarter.
	Quarter int64 `json:"quarter,omitempty"`
	// Form type.
	Form string `json:"form,omitempty"`
	// Period start date <code>%Y-%m-%d %H:%M:%S</code>.
	StartDate time.Time `json:"startDate,omitempty"`
	// Period end date <code>%Y-%m-%d %H:%M:%S</code>.
	EndDate time.Time `json:"endDate,omitempty"`
	// Filed date <code>%Y-%m-%d %H:%M:%S</code>.
	FiledDate time.Time `json:"filedDate,omitempty"`
	// Accepted date <code>%Y-%m-%d %H:%M:%S</code>.
	AcceptedDate time.Time              `json:"acceptedDate,omitempty"`
	Report       map[string]interface{} `json:"report,omitempty"`
}

Report struct for Report

type RevenueEstimates

type RevenueEstimates struct {
	// List of estimates
	Data []map[string]interface{} `json:"data,omitempty"`
	// Frequency: annual or quarterly.
	Freq string `json:"freq,omitempty"`
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
}

RevenueEstimates struct for RevenueEstimates

type Sentiment

type Sentiment struct {
	//
	BearishPercent int64 `json:"bearishPercent,omitempty"`
	//
	BullishPercent int64 `json:"bullishPercent,omitempty"`
}

Sentiment struct for Sentiment

type ServerConfiguration

type ServerConfiguration struct {
	Url         string
	Description string
	Variables   map[string]ServerVariable
}

ServerConfiguration stores the information about a server

type ServerVariable

type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}

ServerVariable stores the information about a server variable

type SimilarityIndex added in v1.2.0

type SimilarityIndex struct {
	// Symbol.
	Symbol string `json:"symbol,omitempty"`
	// CIK.
	Cik string `json:"cik,omitempty"`
	// Array of filings with its cosine similarity compared to the same report of the previous year.
	Similarity []map[string]interface{} `json:"similarity,omitempty"`
}

SimilarityIndex struct for SimilarityIndex

type SimilarityIndexOpts added in v1.2.0

type SimilarityIndexOpts struct {
	Symbol optional.String
	Cik    optional.String
	Freq   optional.String
}

SimilarityIndexOpts Optional parameters for the method 'SimilarityIndex'

type Split added in v1.1.1

type Split struct {
	// Symbol.
	Symbol string `json:"symbol,omitempty"`
	// Split date.
	Date string `json:"date,omitempty"`
	// From factor.
	FromFactor float32 `json:"fromFactor,omitempty"`
	// To factor.
	ToFactor float32 `json:"toFactor,omitempty"`
}

Split struct for Split

type Stock

type Stock struct {
	// Symbol description
	Description string `json:"description,omitempty"`
	// Display symbol name.
	DisplaySymbol string `json:"displaySymbol,omitempty"`
	// Unique symbol used to identify this symbol used in <code>/stock/candle</code> endpoint.
	Symbol string `json:"symbol,omitempty"`
	// Security type.
	Type string `json:"type,omitempty"`
	// Price's currency. This might be different from the reporting currency of fundamental data.
	Currency string `json:"currency,omitempty"`
}

Stock struct for Stock

type StockCandles

type StockCandles struct {
	// List of open prices for returned candles.
	O []float32 `json:"o,omitempty"`
	// List of high prices for returned candles.
	H []float32 `json:"h,omitempty"`
	// List of low prices for returned candles.
	L []float32 `json:"l,omitempty"`
	// List of close prices for returned candles.
	C []float32 `json:"c,omitempty"`
	// List of volume data for returned candles.
	V []float32 `json:"v,omitempty"`
	// List of timestamp for returned candles.
	T []int64 `json:"t,omitempty"`
	// Status of the response. This field can either be ok or no_data.
	S string `json:"s,omitempty"`
}

StockCandles struct for StockCandles

type StockCandlesOpts

type StockCandlesOpts struct {
	Adjusted optional.String
}

StockCandlesOpts Optional parameters for the method 'StockCandles'

type StockTranscripts

type StockTranscripts struct {
	// Transcript's ID used to get the <a href=\"#transcripts\">full transcript</a>.
	Id string `json:"id,omitempty"`
	// Title.
	Title string `json:"title,omitempty"`
	// Time of the event.
	Time time.Time `json:"time,omitempty"`
	// Year of earnings result in the case of earnings call transcript.
	Year int64 `json:"year,omitempty"`
	// Quarter of earnings result in the case of earnings call transcript.
	Quarter int64 `json:"quarter,omitempty"`
}

StockTranscripts struct for StockTranscripts

type SupportResistance added in v1.1.1

type SupportResistance struct {
	// Array of support and resistance levels.
	Levels []float32 `json:"levels,omitempty"`
}

SupportResistance struct for SupportResistance

type TechnicalAnalysis

type TechnicalAnalysis struct {
	Count Indicator `json:"count,omitempty"`
	// Aggregate Signal
	Signal string `json:"signal,omitempty"`
}

TechnicalAnalysis struct for TechnicalAnalysis

type TechnicalIndicatorOpts

type TechnicalIndicatorOpts struct {
	IndicatorFields map[string]interface{}
}

TechnicalIndicatorOpts Optional parameters for the method 'TechnicalIndicator'

type TickData

type TickData struct {
	// Symbol.
	S string `json:"s,omitempty"`
	// Number of ticks skipped.
	Skip int64 `json:"skip,omitempty"`
	// Number of ticks returned. If <code>count</code> < <code>limit</code>, all data for that date has been returned.
	Count int64 `json:"count,omitempty"`
	// Total number of ticks for that date.
	Total int64 `json:"total,omitempty"`
	// List of volume data.
	V []float32 `json:"v,omitempty"`
	// List of price data.
	P []float32 `json:"p,omitempty"`
	// List of timestamp in UNIX ms.
	T []int64 `json:"t,omitempty"`
	// List of venues/exchanges.
	X []string `json:"x,omitempty"`
}

TickData struct for TickData

type TranscriptContent

type TranscriptContent struct {
	// Speaker's name
	Name string `json:"name,omitempty"`
	// Speaker's speech
	Speech []string `json:"speech,omitempty"`
}

TranscriptContent struct for TranscriptContent

type TranscriptParticipant

type TranscriptParticipant struct {
	// Participant's name
	Name string `json:"name,omitempty"`
	// Participant's description
	Description string `json:"description,omitempty"`
}

TranscriptParticipant struct for TranscriptParticipant

type Trend

type Trend struct {
	// ADX reading
	Adx float32 `json:"adx,omitempty"`
	// Whether market is trending or going sideway
	Trending bool `json:"trending,omitempty"`
}

Trend struct for Trend

type UpgradeDowngrade

type UpgradeDowngrade struct {
	// Company symbol.
	Symbol string `json:"symbol,omitempty"`
	// Upgrade/downgrade time in UNIX timestamp.
	GradeTime int64 `json:"gradeTime,omitempty"`
	// From grade.
	FromGrade string `json:"fromGrade,omitempty"`
	// To grade.
	ToGrade string `json:"toGrade,omitempty"`
	// Company/analyst who did the upgrade/downgrade.
	Company string `json:"company,omitempty"`
	// Action can take any of the following values: <code>up(upgrade), down(downgrade), main(maintains), init(initiate), reit(reiterate)</code>.
	Action string `json:"action,omitempty"`
}

UpgradeDowngrade struct for UpgradeDowngrade

type UpgradeDowngradeOpts

type UpgradeDowngradeOpts struct {
	Symbol optional.String
	From   optional.String
	To     optional.String
}

UpgradeDowngradeOpts Optional parameters for the method 'UpgradeDowngrade'

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL