fmpcloud

package module
v0.0.0-...-8beb2d8 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: MIT Imports: 12 Imported by: 0

README

Go API client for Financial Modeling Prep (fmpcloud.io)

GitHub release (latest by date) GitHub GitHub go.mod Go version Go Report Card

Overview

Support Methods

  • Company Valuation

  • Calendars

  • Institutional Fund

  • International Filings

  • Stock Time Series

  • Market Indexes

  • Commodities

  • ETF

  • Mutual Funds

  • EuroNext

  • TSX

  • Stock Market

  • Cryptocurrencies

  • Forex (FX)

  • Technical Indicators

  • Stock Analysis

  • Economic Calendar

  • Formulas

  • Status

  • Insider Trading

  • Alternative Data

  • Bulk Endpoints

Installation

go get -u github.com/spacecodewor/fmpcloud-go

Example:

APIClient, err := NewAPIClient(Config{APIKey: "YOU_KEY"})
if err != nil {
    log.Println("Error init api client: " + err.Error())
}

// Get rating by symbol
rating, err := APIClient.CompanyValuation.Rating("AAPL")
if err != nil {
    log.Println("Error get rating: " + err.Error())
}

// Get Company profile by symbol
profile, err := APIClient.Stock.CompanyProfile("AAPL")
if err != nil {
    log.Println("Error get company profile: " + err.Error())
}

// Get real-time single quote
quote, err := APIClient.Stock.Quote("AAPL")
if err != nil {
    log.Println("Error get quote: " + err.Error())
}

// Crypto avalible symbol list
cList, err := APIClient.Crypto.AvalibleSymbols()
if err != nil {
    log.Println("Error get crypto symbols list: " + err.Error())
}

// Crypto quotes list
cQuotes, err := APIClient.Crypto.Quotes()
if err != nil {
    log.Println("Error get crypto quotes: " + err.Error())
}

// Forex avalible symbol list
fList, err := APIClient.Forex.AvalibleSymbols()
if err != nil {
    log.Println("Error get forex symbols list: " + err.Error())
}

// Forex quotes list
fQuotes, err := APIClient.Forex.Quotes()
if err != nil {
    log.Println("Error get forex quotes: " + err.Error())
}

Example custom client:

// Init new instance for zap logger and config custom
cfg := zap.NewProductionConfig()
cfg.EncoderConfig.EncodeTime = zapcore.RFC3339TimeEncoder

logger, err := cfg.Build()
if err != nil {
    return nil, errors.Wrap(err, "Logger Error: init")
}

// Init your custome API client
APIClient, err := NewAPIClient(Config{
    APIKey:  "YOU_KEY",      // Set Your API Key from site, default: demo
    Debug:   true,           // Set flag for debug request and response, default: false
    Timeout: 60,             // Set timeout for http client, default: 25
    APIUrl:  APIFmpcloudURL, // Set custom url (APIFmpcloudURL || APIFinancialModelingPrepURL), default: APIFinancialModelingPrepURL
    Logger:  logger,         // Set your (zap) logger, default: init new
})

if err != nil {
    log.Println("Error init api client: " + err.Error())
}

FAQ

Historical candles support (count) (Daily from 1980):

  • 1 minute 400 periods (1 day)
  • 5 minutes 400 periods (1 week)
  • 15 min 200 periods (2 days)
  • 30 minutes 200 periods (4 days)
  • 1 hour 200 periods (8 days)
  • 4 hours 200 periods (33 days)

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Client *HTTPClient
}

API client

func (*API) Call

func (c *API) Call(endpoint string, requestParam map[string]string) (resp []byte, err error)

Call ...

type APIClient

type APIClient struct {
	Stock              *Stock
	Forex              *Forex
	Form13F            *Form13F
	Crypto             *Crypto
	CompanyValuation   *CompanyValuation
	TechnicalIndicator *TechnicalIndicator
	InsiderTrading     *InsiderTrading
	AlternativeData    *AlternativeData
	Economics          *Economics
	API                *API
	Logger             *zap.Logger
	Debug              bool
}

APIClient ...

func NewAPIClient

func NewAPIClient(cfg Config) (*APIClient, error)

NewAPIClient creates a new API client

type APIUrl

type APIUrl string

APIUrl type for api url

const (
	APIFmpcloudURL              APIUrl = "https://fmpcloud.io/api"
	APIFinancialModelingPrepURL APIUrl = "https://financialmodelingprep.com/api"
)

Core params

type AlternativeData

type AlternativeData struct {
	Client *HTTPClient
}

AlternativeData client

func (*AlternativeData) COTAnalysisListByPeriod

func (a *AlternativeData) COTAnalysisListByPeriod(from, to *time.Time) (aList []objects.COTAnalysis, err error)

COTAnalysisListByPeriod - Analysis of reports for time period

func (*AlternativeData) COTAnalysisListBySymbol

func (a *AlternativeData) COTAnalysisListBySymbol(symbol string) (aList []objects.COTAnalysis, err error)

COTAnalysisListBySymbol - Analysis of reports for trading symbol

func (*AlternativeData) COTReportListByPeriod

func (a *AlternativeData) COTReportListByPeriod(from, to *time.Time) (rList []objects.COTReport, err error)

COTReportListByPeriod - List of reports for period of time

func (*AlternativeData) COTReportListBySymbol

func (a *AlternativeData) COTReportListBySymbol(symbol string) (rList []objects.COTReport, err error)

COTReportBySymbol - List of reports for specific symbol

func (*AlternativeData) COTSymbolList

func (a *AlternativeData) COTSymbolList() (sList []objects.COTSymbol, err error)

COTSymbolList - COT Trading Symbols List

type CompanyValuation

type CompanyValuation struct {
	Client *HTTPClient
}

CompanyValuation client

func (*CompanyValuation) AnalystEstimates

func (c *CompanyValuation) AnalystEstimates(req objects.RequestAnalystEstimates) (vList []objects.AnalystEstimates, err error)

AnalystEstimates - analyst estimates of a stock (Annual || Quarter)

func (*CompanyValuation) AnalystStockRecommendations

func (c *CompanyValuation) AnalystStockRecommendations(req objects.RequestAnalystStockRecommendations) (rList []objects.AnalystStockRecommendations, err error)

AnalystStockRecommendations - monthly stock analyst ratings

func (*CompanyValuation) AvailableTradedList

func (c *CompanyValuation) AvailableTradedList() (fList []objects.AvailableTraded, err error)

AvailableTradedList - All tradable Symbols

func (*CompanyValuation) BalanceSheetStatement

func (c *CompanyValuation) BalanceSheetStatement(req objects.RequestBalanceSheetStatement) (sList []objects.BalanceSheetStatement, err error)

BalanceSheetStatement - balance sheet statement

func (*CompanyValuation) BalanceSheetStatementAsReported

BalanceSheetStatementAsReported - balance sheet statement AS REPORTED

func (*CompanyValuation) BalanceSheetStatementGrowth

func (c *CompanyValuation) BalanceSheetStatementGrowth(req objects.RequestBalanceSheetStatementGrowth) (sList []objects.BalanceSheetStatementGrowth, err error)

BalanceSheetStatementGrowth - balance sheet statement growth

func (*CompanyValuation) BulkBalanceSheetStatement

func (c *CompanyValuation) BulkBalanceSheetStatement(year int, period string) (sList []objects.BalanceSheetStatement, err error)

BulkBalanceSheetStatement ...

func (*CompanyValuation) BulkCashFlowStatement

func (c *CompanyValuation) BulkCashFlowStatement(year int, period string) (sList []objects.CashFlowStatement, err error)

BulkCashFlowStatement ...

func (*CompanyValuation) BulkEarningsSurpises

func (c *CompanyValuation) BulkEarningsSurpises(year int) (sList []objects.EarningSurprise, err error)

BulkEarningsSurpises ...

func (*CompanyValuation) BulkIncomeStatement

func (c *CompanyValuation) BulkIncomeStatement(year int, period string) (pList []objects.IncomeStatement, err error)

BulkIncomeStatement ...

func (*CompanyValuation) BulkKeyMetrics

func (c *CompanyValuation) BulkKeyMetrics(year int, period string) (sList []objects.KeyMetrics, err error)

BulkCashFlowStatement ...

func (*CompanyValuation) BulkRating

func (c *CompanyValuation) BulkRating() (sList []objects.Rating, err error)

BulkRating ...

func (*CompanyValuation) BulkRatios

func (c *CompanyValuation) BulkRatios(year int, period string) (sList []objects.FinancialRatios, err error)

BulkRatios ...

func (*CompanyValuation) BulkScores

func (c *CompanyValuation) BulkScores() (sList []objects.Score, err error)

BulkScores - Stock Financial scores (bulk)

func (*CompanyValuation) CashFlowStatement

func (c *CompanyValuation) CashFlowStatement(req objects.RequestCashFlowStatement) (sList []objects.CashFlowStatement, err error)

CashFlowStatement - cash flow statement

func (*CompanyValuation) CashFlowStatementAsReported

func (c *CompanyValuation) CashFlowStatementAsReported(req objects.RequestCashFlowStatementAsReported) (sList []objects.CashFlowStatementAsReported, err error)

CashFlowStatementAsReported - cash flow statement AS REPORTED

func (*CompanyValuation) CashFlowStatementGrowth

func (c *CompanyValuation) CashFlowStatementGrowth(req objects.RequestCashFlowStatementGrowth) (sList []objects.CashFlowStatementGrowth, err error)

CashFlowStatementGrowth - cash flow statement growth

func (*CompanyValuation) CompanyOutlook

func (c *CompanyValuation) CompanyOutlook(symbol string) (co *objects.CompanyOutlook, err error)

CompanyOutlook - Company Outlook

func (*CompanyValuation) DCFBulk

func (c *CompanyValuation) DCFBulk() (dList []objects.DailyDiscountedCashFlow, err error)

DCFBulk ...

func (*CompanyValuation) DailyDiscountedCashFlow

func (c *CompanyValuation) DailyDiscountedCashFlow(req objects.RequestDailyDiscountedCashFlow) (vList []objects.DailyDiscountedCashFlow, err error)

DailyDiscountedCashFlow - daily historical DCF

func (*CompanyValuation) DailyHistoryMarketCapitalization

func (c *CompanyValuation) DailyHistoryMarketCapitalization(req objects.RequestMarketCapitalization) (rList []objects.MarketCapitalization, err error)

DailyHistoryMarketCapitalization - daily historical market capitalization

func (*CompanyValuation) DailyHistoryRating

func (c *CompanyValuation) DailyHistoryRating(req objects.RequestRating) (rList []objects.Rating, err error)

DailyHistoryRating - daily historical rating

func (*CompanyValuation) DelstedCompanies

func (c *CompanyValuation) DelstedCompanies(limit int64) (cList []objects.DelstedCompany, err error)

DelstedCompanies - delsted companies

func (*CompanyValuation) DiscountedCashFlow

func (c *CompanyValuation) DiscountedCashFlow(symbol string) (vList []objects.DiscountedCashFlow, err error)

DiscountedCashFlow - discounted cash flow value

func (*CompanyValuation) DividendCalendar

func (c *CompanyValuation) DividendCalendar(from, to *time.Time) (dList []objects.DividendCalendar, err error)

DividendCalendar - dividend calendar

func (*CompanyValuation) ETFCountryWeightings

func (c *CompanyValuation) ETFCountryWeightings(symbol string) (cList []objects.ETFCountryWeighting, err error)

ETFCountryWeightings - ETF country weightings

func (*CompanyValuation) ETFHolders

func (c *CompanyValuation) ETFHolders(symbol string) (hList []objects.ETFHolder, err error)

ETFHolders - ETF holders

func (*CompanyValuation) ETFList

func (c *CompanyValuation) ETFList() (fList []objects.ETF, err error)

ETFList - All ETF symbols

func (*CompanyValuation) ETFSectorWeightings

func (c *CompanyValuation) ETFSectorWeightings(symbol string) (sList []objects.ETFSectorWeighting, err error)

ETFSectorWeightings - ETF sector weightings

func (*CompanyValuation) ETFStockExposure

func (c *CompanyValuation) ETFStockExposure(symbol string) (eList []objects.ETFStockExposure, err error)

ETFStockExposure - ETF stock exposure

func (*CompanyValuation) EarningCalendar

func (c *CompanyValuation) EarningCalendar(from, to *time.Time) (eList []objects.EarningCalendar, err error)

EarningCalendar - earning Calendar (between from and to maximum interval can be 3 months)

func (*CompanyValuation) EarningCalendarConfirmed

func (c *CompanyValuation) EarningCalendarConfirmed(from, to *time.Time) (eList []objects.EarningCalendarConfirmed, err error)

EarningCalendarConfirmed - Earnings calendar confirmed (between the "from" and "to" parameters the maximum time interval can be 3 months)

func (*CompanyValuation) EarningCallTranscript

func (c *CompanyValuation) EarningCallTranscript(req objects.RequestEarningCallTranscript) (tList []objects.EarningCallTranscript, err error)

EarningCallTranscript - transcript of specific earning

func (*CompanyValuation) EarningSurpriseList

func (c *CompanyValuation) EarningSurpriseList(symbol string) (eList []objects.EarningSurprise, err error)

EarningSurpriseList ...

func (*CompanyValuation) EconomicCalendar

func (c *CompanyValuation) EconomicCalendar(req objects.RequestEconomicCalendar) (eList []objects.EconomicCalendar, err error)

EconomicCalendar - Economic Calendar for time period

func (*CompanyValuation) EconomicCalendarEventList

func (c *CompanyValuation) EconomicCalendarEventList() (eList []objects.EconomicCalendarEventList, err error)

EconomicCalendarEventList - Example of historical consumer sentiment in U.S. (take event name and country from event list endpoint)

func (*CompanyValuation) EmployeeCount

func (c *CompanyValuation) EmployeeCount(symbol string) (eList *objects.EmployeeCount, err error)

EmployeeCount - Historical number of employees

func (*CompanyValuation) EnterpriseValue

func (c *CompanyValuation) EnterpriseValue(req objects.RequestEnterpriseValue) (vList []objects.EnterpriseValue, err error)

EnterpriseValue - enterprise value

func (*CompanyValuation) FinancialRatios

func (c *CompanyValuation) FinancialRatios(req objects.RequestFinancialRatios) (rList []objects.FinancialRatios, err error)

FinancialRatios - financial ratios

func (*CompanyValuation) FinancialRatiosTTM

func (c *CompanyValuation) FinancialRatiosTTM(symbol string) (rList []objects.FinancialRatiosTTM, err error)

FinancialRatiosTTM - financial ratios TTM

func (*CompanyValuation) FinancialStatementList

func (c *CompanyValuation) FinancialStatementList() (fsList []string, err error)

FinancialStatementList - List of symbols that have financial statements

func (*CompanyValuation) FinancialStatementsGrowth

func (c *CompanyValuation) FinancialStatementsGrowth(req objects.RequestFinancialStatementsGrowth) (vList []objects.FinancialStatementsGrowth, err error)

FinancialStatementsGrowth - financial statements growth

func (*CompanyValuation) FullFinancialStatementAsReported

FullFinancialStatementAsReported - full financial statement AS REPORTED

func (*CompanyValuation) Grade

func (c *CompanyValuation) Grade(req objects.RequestGrade) (gList []objects.Grade, err error)

Grade - stock grade from analysts

func (*CompanyValuation) HistoricalSocialSentiment

func (c *CompanyValuation) HistoricalSocialSentiment(symbol string) (sList []objects.SocialSentiment, err error)

HistoricalSocialSentiment - Historical Social Media sentiment for stock (time in UTC)

func (*CompanyValuation) HistoryDiscountedCashFlow

func (c *CompanyValuation) HistoryDiscountedCashFlow(req objects.RequestHistoryDiscountedCashFlow) (vList []objects.HistoryDiscountedCashFlow, err error)

HistoryDiscountedCashFlow - history DCF

func (*CompanyValuation) HistoryEarningCalendar

func (c *CompanyValuation) HistoryEarningCalendar(symbol string) (eList []objects.EarningCalendar, err error)

HistoryEarningCalendar - historical earning calendar

func (*CompanyValuation) HistoryEconomicCalendar

func (c *CompanyValuation) HistoryEconomicCalendar(req objects.RequestHistoryEconomicCalendar) (hList []objects.HistoryEconomicCalendar, err error)

HistoryEconomicCalendar - Economic calendar event list

func (*CompanyValuation) IPOCalendar

func (c *CompanyValuation) IPOCalendar(from, to *time.Time) (ipoList []objects.IPOCalendar, err error)

IPOCalendar - IPO calendar

func (*CompanyValuation) IPOCalendarConfirmed

func (c *CompanyValuation) IPOCalendarConfirmed(from, to *time.Time) (ipoList []objects.IPOCalendarConfirmed, err error)

IPOCalendarConfirmed - IPO Calendar confirmed (between the "from" and "to" parameters the maximum time interval can be 3 months)

func (*CompanyValuation) IPOCalendarProspectus

func (c *CompanyValuation) IPOCalendarProspectus(from, to *time.Time) (ipoList []objects.IPOCalendarProspectus, err error)

IPOCalendarProspectus - IPO Calendar with prospectus (between the "from" and "to" parameters the maximum time interval can be 3 months)

func (*CompanyValuation) IncomeStatement

func (c *CompanyValuation) IncomeStatement(req objects.RequestIncomeStatement) (sList []objects.IncomeStatement, err error)

IncomeStatement - income statement

func (*CompanyValuation) IncomeStatementAsReported

func (c *CompanyValuation) IncomeStatementAsReported(req objects.RequestIncomeStatementAsReported) (sList []objects.IncomeStatementAsReported, err error)

IncomeStatementAsReported - income statement AS REPORTED

func (*CompanyValuation) IncomeStatementGrowth

func (c *CompanyValuation) IncomeStatementGrowth(req objects.RequestIncomeStatementGrowth) (sList []objects.IncomeStatementGrowth, err error)

IncomeStatementGrowth - income statement growth

func (*CompanyValuation) InstitutionalHolders

func (c *CompanyValuation) InstitutionalHolders(symbol string) (hList []objects.InstitutionalHolder, err error)

InstitutionalHolders - institutional holders

func (*CompanyValuation) KeyMetrics

func (c *CompanyValuation) KeyMetrics(req objects.RequestKeyMetrics) (mList []objects.KeyMetrics, err error)

KeyMetrics - key metrics

func (*CompanyValuation) KeyMetricsTTM

func (c *CompanyValuation) KeyMetricsTTM(symbol string) (mList []objects.KeyMetricsTTM, err error)

KeyMetricsTTM - key metrics ttm

func (*CompanyValuation) MarketCapitalization

func (c *CompanyValuation) MarketCapitalization(symbol string) (rList []objects.MarketCapitalization, err error)

MarketCapitalization - market capitalization

func (*CompanyValuation) MutualFundHolders

func (c *CompanyValuation) MutualFundHolders(symbol string) (hList []objects.MutualFundHolder, err error)

MutualFundHolders - mutual fund holders

func (*CompanyValuation) PressReleases

func (c *CompanyValuation) PressReleases(req objects.RequestPressReleases) (prList []objects.PressReleases, err error)

PressReleases - stock press releases

func (*CompanyValuation) Rating

func (c *CompanyValuation) Rating(symbol string) (rList []objects.Rating, err error)

Rating - get rating by symbol

func (*CompanyValuation) RatiosTTMBulk

func (c *CompanyValuation) RatiosTTMBulk() (rList []objects.FinancialRatiosTTM, err error)

RatiosTTMBulk ...

func (*CompanyValuation) RssFeed

func (c *CompanyValuation) RssFeed() (fList []objects.RssFeed, err error)

RssFeed - SEC RSS feeds is a very helpful resource for staying current on the most recent financial statements posted on the SEC

func (*CompanyValuation) SECFilings

func (c *CompanyValuation) SECFilings(req objects.RequestSECFilings) (eList []objects.SECFiling, err error)

SECFilings - SEC Filings with type or no (10-K || 4 || 8-K || 424B2 || FWP || SC 13G/A || SD || 10-Q || PX14A6G || DEFA14A || DEF 14A || 8-A12B || CERT || 25 ...)

func (*CompanyValuation) Score

func (c *CompanyValuation) Score(symbol string) (sList []objects.Score, err error)

Score - Stock Financial scores

func (*CompanyValuation) SharesFloat

func (c *CompanyValuation) SharesFloat(symbol string) (ipoList []objects.IPOCalendar, err error)

SharesFloat - Shares float for symbol

func (*CompanyValuation) SharesFloatAll

func (c *CompanyValuation) SharesFloatAll() (sList []objects.SharesFloat, err error)

SharesFloatAll - All latest shares float available

func (*CompanyValuation) SocialSentimentChange

func (c *CompanyValuation) SocialSentimentChange(tType, source string) (sList []objects.SocialSentimentChange, err error)

SocialSentimentChange - Biggest changes in social sentiment per type and source

func (*CompanyValuation) SocialSentimentTrending

func (c *CompanyValuation) SocialSentimentTrending(tType, source string) (sList []objects.SocialSentiment, err error)

SocialSentimentTrending - Trending social sentiment

func (*CompanyValuation) SplitCalendar

func (c *CompanyValuation) SplitCalendar(from, to *time.Time) (sList []objects.SplitCalendar, err error)

SplitCalendar - stock split calendar

func (*CompanyValuation) StockNews

func (c *CompanyValuation) StockNews(req objects.RequestStockNews) (vList []objects.StockNews, err error)

StockNews - stock news

func (*CompanyValuation) StockScreener

func (c *CompanyValuation) StockScreener(req objects.RequestStockScreener) (sList []objects.StockScreener, err error)

StockScreener - stock screener

type Config

type Config struct {
	Logger        *zap.Logger
	HTTPClient    *resty.Client
	APIKey        string
	APIUrl        APIUrl
	Debug         bool
	RetryCount    *int
	RetryWaitTime *time.Duration
	Timeout       int
}

Config for create new API client

type Crypto

type Crypto struct {
	Client *HTTPClient
}

Crypto client

func (*Crypto) AvalibleSymbols

func (c *Crypto) AvalibleSymbols() (sList []objects.CryptoSymbol, err error)

AvalibleSymbols - available symbol list

func (*Crypto) Candles

func (c *Crypto) Candles(req objects.RequestCryptoCandleList) (cList []objects.CryptoCandle, err error)

Candles - Historical candles

func (*Crypto) DailyChangeAndVolume

func (c *Crypto) DailyChangeAndVolume(symbol string) (cList *objects.CryptoDailyCandleList, err error)

DailyChangeAndVolume - Daily candle change and volume

func (*Crypto) DailyLastNDays

func (c *Crypto) DailyLastNDays(symbol string, days int) (cList *objects.CryptoDailyCandleList, err error)

DailyLastNDays - Daily candle list last N days

func (*Crypto) DailyLine

func (c *Crypto) DailyLine(symbol string, serieType objects.CryptoSerieType) (cList *objects.CryptoDailyLineList, err error)

DailyLine - Daily line

func (*Crypto) DailySpecificPeriod

func (c *Crypto) DailySpecificPeriod(symbol string, from time.Time, to time.Time) (cList *objects.CryptoDailyCandleList, err error)

DailySpecificPeriod - Daily candle list by specific period

func (*Crypto) Quotes

func (c *Crypto) Quotes() (qList []objects.CryptoQuote, err error)

Quotes - all real-time prices

type Economics

type Economics struct {
	Client *HTTPClient
}

Economics client

func (*Economics) Indicator

func (e *Economics) Indicator(indicator string, from *time.Time, to *time.Time) (iList []objects.EconomicsIndicator, err error)

Indicator - https://site.financialmodelingprep.com/developer/docs/economic-indicator-api

func (*Economics) MarketRiskPremium

func (e *Economics) MarketRiskPremium() (mList []objects.EconomicsMarketRisk, err error)

MarketRiskPremium - Market Risk Premium for each countr

func (*Economics) TreasuryRates

func (e *Economics) TreasuryRates(from time.Time, to time.Time) (tList []objects.EconomicsTreasuryRates, err error)

TreasuryRates - Historical treasury rates (between the "from" and "to" parameters the maximum time interval can be 3 months)

type Event

type Event struct {
	Event   string   `json:"event"`
	Message string   `json:"message"`
	Status  int      `json:"status"`
	Symbol  string   `json:"s"`
	Type    string   `json:"type"`
	Time    int64    `json:"t"`
	Ap      *float64 `json:"ap"`
	As      *float64 `json:"as"`
	Bp      *float64 `json:"bp"`
	Bs      *float64 `json:"bs"`
	Lp      *float64 `json:"lp"`
	Ls      *float64 `json:"ls"`
}

Event ...

type Forex

type Forex struct {
	Client *HTTPClient
}

Forex client

func (*Forex) AvalibleSymbols

func (f *Forex) AvalibleSymbols() (sList []objects.ForexSymbol, err error)

AvalibleSymbols - available symbol list

func (*Forex) Candles

func (f *Forex) Candles(req objects.RequestForexCandleList) (cList []objects.ForexCandle, err error)

Candles - historical candles

func (*Forex) DailyChangeAndVolume

func (f *Forex) DailyChangeAndVolume(symbol string) (cList *objects.ForexDailyCandleList, err error)

DailyChangeAndVolume - daily candle change and volume

func (*Forex) DailyLastNDays

func (f *Forex) DailyLastNDays(symbol string, days int) (cList *objects.ForexDailyCandleList, err error)

DailyLastNDays - daily candle list last N days

func (*Forex) DailyLine

func (f *Forex) DailyLine(symbol string, serieType objects.ForexSerieType) (cList *objects.ForexDailyLineList, err error)

DailyLine - faily line

func (*Forex) DailySpecificPeriod

func (f *Forex) DailySpecificPeriod(symbol string, from time.Time, to time.Time) (cList *objects.ForexDailyCandleList, err error)

DailySpecificPeriod - daily candle list by specific period

func (*Forex) ListSymbolsAndQuotes

func (f *Forex) ListSymbolsAndQuotes() (bList []objects.ForexBindAsk, err error)

ListSymbolsAndQuotes - Forex List And Price (Get last bid/ask data)

func (*Forex) Quotes

func (f *Forex) Quotes() (qList []objects.ForexQuote, err error)

Quotes - all real-time prices

type Form13F

type Form13F struct {
	Client *HTTPClient
}

Form13F client

func (*Form13F) CusipMapper

func (f *Form13F) CusipMapper(cusip string) (cList []objects.Cusip, err error)

CusipMapper - Cusip mapper

func (*Form13F) GetCompanyByCIK

func (f *Form13F) GetCompanyByCIK(cik string) (cList []objects.Form, err error)

GetCompanyByCIK - 13F get company name by cik

func (*Form13F) List

func (f *Form13F) List() (fList []objects.Form, err error)

List - 13F List

func (*Form13F) SearchByName

func (f *Form13F) SearchByName(name string) (fList []objects.Form, err error)

SearchByName - 13F cik search by name

func (*Form13F) ThirteenList

func (f *Form13F) ThirteenList(cik string, date *time.Time) (fList []objects.Thirteen, err error)

ThirteenList - 13F

type HTTPClient

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

HTTPClient ...

func (*HTTPClient) Get

func (h *HTTPClient) Get(endpoint string, data map[string]string) (response *resty.Response, err error)

Get ...

type InsiderTrading

type InsiderTrading struct {
	Client *HTTPClient
}

InsiderTrading client

func (*InsiderTrading) List

List - Stock insider trading list

func (*InsiderTrading) MapperCikCompany

func (i *InsiderTrading) MapperCikCompany(symbol string) (iList []objects.InsiderTradingMapperCikCompany, err error)

MapperCikCompany - Company CIK mapper

func (*InsiderTrading) MapperCikName

func (i *InsiderTrading) MapperCikName(name *string) (iList []objects.InsiderTradingMapperCikName, err error)

MapperCikName - List with names and their CIK

func (*InsiderTrading) RSSFeed

func (i *InsiderTrading) RSSFeed(limit int64) (iList []objects.InsiderTradingRSSFeed, err error)

RSSFeed - RSS Feed of form 3,4 and 5

func (*InsiderTrading) TransactionType

func (i *InsiderTrading) TransactionType() (tList []string, err error)

TransactionType - list

type Stock

type Stock struct {
	Client *HTTPClient
}

Stock client

func (*Stock) Actives

func (s *Stock) Actives() (aList []objects.Active, err error)

Actives - stock market top active

func (*Stock) AvalibleSymbols

func (s *Stock) AvalibleSymbols() (sList []objects.StockSymbolList, err error)

AvalibleSymbols - all avalible symbol list

func (*Stock) AvalibleSymbolsByExchange

func (s *Stock) AvalibleSymbolsByExchange(exchange objects.StockSymbolExchange) (sList []objects.StockSymbol, err error)

AvalibleSymbolsByExchange - symbol list by exchange

func (*Stock) BatchEODCandleList

func (s *Stock) BatchEODCandleList(symbolList []string, date time.Time) (sList []objects.StockEODCandle, err error)

BatchEODCandleList - specific Stocks Batch EOD stock prices

func (*Stock) BatchQuote

func (s *Stock) BatchQuote(symbolList []string) (qList []objects.StockQuote, err error)

BatchQuote - real-time batch quote

func (*Stock) BulkPeers

func (s *Stock) BulkPeers() (pList []objects.StockBulkPeers, err error)

BulkPeers - Stock peers for all symbols with profile CSV

func (*Stock) BulkProfile

func (s *Stock) BulkProfile() (companyProfile []objects.StockCompanyProfile, err error)

BulkProfile - get all available profiles

func (*Stock) Candles

func (s *Stock) Candles(req objects.RequestStockCandleList) (cList []objects.StockCandle, err error)

Candles - historical candles

func (*Stock) CompanyCoreInformation

func (s *Stock) CompanyCoreInformation(symbol string) (company []objects.CompanyCoreInformation, err error)

CompanyCoreInformation - Company core information

func (*Stock) CompanyExecutive

func (s *Stock) CompanyExecutive(symbol string) (companyProfile []objects.CompanyExecutive, err error)

CompanyExecutive - get a list of company's executives and members of the Board.

func (*Stock) CompanyProfile

func (s *Stock) CompanyProfile(symbol string) (companyProfile []objects.StockCompanyProfile, err error)

CompanyProfile - get general information of a company. You can query by symbol.

func (*Stock) DailyBatch

func (s *Stock) DailyBatch(symbolList []string, from *time.Time, to *time.Time) (cList []objects.StockBatchData, err error)

DailyBatch - daily candle list

func (*Stock) DailyChangeAndVolume

func (s *Stock) DailyChangeAndVolume(symbol string) (cList *objects.StockDailyCandleList, err error)

DailyChangeAndVolume - daily candle change and volume

func (*Stock) DailyLastNDays

func (s *Stock) DailyLastNDays(symbol string, days int) (cList *objects.StockDailyCandleList, err error)

DailyLastNDays - daily candle list last N days

func (*Stock) DailyLine

func (s *Stock) DailyLine(symbol string, serieType objects.StockSerieType) (cList *objects.StockDailyLineList, err error)

DailyLine - daily line

func (*Stock) DailySpecificPeriod

func (s *Stock) DailySpecificPeriod(symbol string, from time.Time, to time.Time) (cList *objects.StockDailyCandleList, err error)

DailySpecificPeriod - daily candle list by specific period

func (*Stock) Dividends

func (s *Stock) Dividends(symbol string) (dList *objects.StockDividends, err error)

Dividends - stock dividends

func (*Stock) EODBatchPrices

func (s *Stock) EODBatchPrices(date time.Time) (sList []objects.StockEODCandle, err error)

EODBatchPrices ...

func (*Stock) EODCandleList

func (s *Stock) EODCandleList(date time.Time) (sList []objects.StockEODCandle, err error)

EODCandleList - all stocks Batch EOD stock price

func (*Stock) ExchangeTradingHours

func (s *Stock) ExchangeTradingHours() (eList []objects.Exchange, err error)

ExchangeTradingHours - stock market trading hours

func (*Stock) Gainers

func (s *Stock) Gainers() (gList []objects.Gainer, err error)

Gainers - stock market top gainers

func (*Stock) HistoryIndexConstituentList

func (s *Stock) HistoryIndexConstituentList(index objects.Index) (sList []objects.HistoryIndexSymbol, err error)

HistoryIndexConstituentList - historical index companies list (SP500, Nasdaq, DJ)

func (*Stock) HistorySectorPerformance

func (s *Stock) HistorySectorPerformance() (eList []objects.HistorySector, err error)

HistorySectorPerformance - historical stock market sector performance

func (*Stock) IndexConstituentList

func (s *Stock) IndexConstituentList(index objects.Index) (sList []objects.IndexSymbol, err error)

IndexConstituentList - list of index companies (SP500, Nasdaq, DJ)

func (*Stock) Losers

func (s *Stock) Losers() (lList []objects.Loser, err error)

Losers - stock market top losers

func (*Stock) OTCRealTimePrice

func (s *Stock) OTCRealTimePrice(symbolList []string) (pList *objects.OTCRealTimePrice, err error)

OTCRealTimePrice - Prices of OTC companies

func (*Stock) Peers

func (s *Stock) Peers(symbol string) (pList []objects.StockPeers, err error)

Peers - Stock peers based on sector, exchange and market cap

func (*Stock) PriceChange

func (s *Stock) PriceChange(symbol string) (sList []objects.StockPriceChange, err error)

PriceChangeBatch - Price percentage change for multiple timeframes

func (*Stock) PriceChangeBatch

func (s *Stock) PriceChangeBatch(symbolList []string) (sList []objects.StockPriceChange, err error)

PriceChangeBatch - Multiple companies price percentage change

func (*Stock) Quote

func (s *Stock) Quote(symbol string) (qList []objects.StockQuote, err error)

Quote - real-time single quote

func (*Stock) QuoteByExchange

func (s *Stock) QuoteByExchange(exchange objects.StockSearch) (qList []objects.StockQuote, err error)

QuoteByExchange - real-time single quote

func (*Stock) QuoteShort

func (s *Stock) QuoteShort(symbol string) (qList []objects.StockQuoteShot, err error)

QuoteShort - real-time single quote short

func (*Stock) Search

func (s *Stock) Search(req objects.RequestStockSearch) (sList []objects.StockSymbol, err error)

Search - Search via ticker and company name

func (*Stock) SearchByName

func (s *Stock) SearchByName(req objects.RequestStockSearch) (sList []objects.StockSymbol, err error)

SearchByName - Search only via company name

func (*Stock) SearchTiker

func (s *Stock) SearchTiker(req objects.RequestStockSearch) (sList []objects.StockSymbol, err error)

SearchTiker - Search only via ticker

func (*Stock) SectorPerformance

func (s *Stock) SectorPerformance() (eList []objects.Sector, err error)

SectorPerformance - stock market sector performance

func (*Stock) Splits

func (s *Stock) Splits(symbol string) (sList *objects.StockSplit, err error)

Splits - stock splits

func (*Stock) SurvivorshipBiasFree

func (s *Stock) SurvivorshipBiasFree(symbol string, date time.Time) (sBias *objects.SurvivorshipBiasFree, err error)

SurvivorshipBiasFree - Survivorship Bias Free end of day (only for api v4)

type TechnicalIndicator

type TechnicalIndicator struct {
	Client *HTTPClient
}

TechnicalIndicator client

func (*TechnicalIndicator) Indicators

func (t *TechnicalIndicator) Indicators(req objects.RequestIndicators) (iList []objects.ResponseIndicators, err error)

Indicators - Daily Indicators. Types: SMA - EMA - WMA - DEMA - TEMA - williams - RSI - ADX - standardDeviation

type WebsocketClient

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

WebsocketClient ...

func NewWebsocketClient

func NewWebsocketClient(cfg WebsocketConfig) (*WebsocketClient, error)

NewWebsocketClient creates a new API client

func (*WebsocketClient) Close

func (w *WebsocketClient) Close() error

func (*WebsocketClient) Login

func (w *WebsocketClient) Login() error

func (*WebsocketClient) RunReadLoop

func (w *WebsocketClient) RunReadLoop(fn func(event Event) error) error

func (*WebsocketClient) Subscribe

func (w *WebsocketClient) Subscribe(tiker string) error

func (*WebsocketClient) Unsubscribe

func (w *WebsocketClient) Unsubscribe(tiker string) error

type WebsocketConfig

type WebsocketConfig struct {
	Logger *zap.Logger
	APIKey string
	URL    WebsocketURL
	Debug  bool
}

WebsocketConfig for create new Websocket client

type WebsocketURL

type WebsocketURL string

WebsocketURL type for websocket url

const (
	WebsocketStock  WebsocketURL = "wss://websockets.financialmodelingprep.com"
	WebsocketCrypto WebsocketURL = "wss://crypto.financialmodelingprep.com"
	WebsocketForex  WebsocketURL = "wss://forex.financialmodelingprep.com"
)

Core params

func (WebsocketURL) String

func (w WebsocketURL) String() string

String ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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