calcbench

package module
v0.0.0-...-beaf348 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

README

Calcbench API

This repository contains the Golang implementation for Calcbench API.

Installation

go get github.com/calcbench/go_api_client

Usage

See godoc.

Documentation

Index

Constants

View Source
const APIURL = "https://www.calcbench.com"

APIURL the base API URL for CalcBench API

Variables

This section is empty.

Functions

This section is empty.

Types

type CalcBench

type CalcBench struct {
	Client *http.Client
}

CalcBench is the CalcBench API

func New

func New() (*CalcBench, error)

New creates a new API instance

func (CalcBench) Login

func (c CalcBench) Login(email, password string) (bool, error)

Login authenticates the API using https://www.calcbench.com/api#authentication

func (CalcBench) StandardizedData

func (c CalcBench) StandardizedData(Query StandardizedDataRequest) (StandardizedDataResponse, error)

StandardizedData calls https://www.calcbench.com/api#normalizedData

type CompaniesParameters

type CompaniesParameters struct {
	CompanyIdentifiers []string `json:"companyIdentifiers"`
	EntireUniverse     bool     `json:"entireUniverse,omitempty"`
}

CompaniesParameters specifies the companies to include

type PeriodParameters

type PeriodParameters struct {
	Year       int32  `json:"year"`
	Period     int8   `json:"period"`
	EndYear    int    `json:"endYear,omitempty"`
	EndPeriod  int    `json:"endPeriod"`
	AllHistory bool   `json:"allHistory,omitempty"`
	UpdateDate string `json:"updateDate,omitempty"`
}

PeriodParameters specifies the periods to include

type StandardizedDataPageParameters

type StandardizedDataPageParameters struct {
	Metrics []string `json:"metrics"`
}

StandardizedDataPageParameters specifies the metrics to search for

type StandardizedDataRequest

type StandardizedDataRequest struct {
	CompaniesParameters CompaniesParameters            `json:"companiesParameters"`
	PeriodParameters    PeriodParameters               `json:"periodParameters"`
	PageParameters      StandardizedDataPageParameters `json:"pageParameters"`
}

StandardizedDataRequest for comparisons between companies

type StandardizedDataResponse

type StandardizedDataResponse []StandardizedDataResponseObject

StandardizedDataResponse is a slice of StandardizedDataResponseObject

type StandardizedDataResponseObject

type StandardizedDataResponseObject struct {
	Ticker         string      `json:"ticker"`
	CalendarYear   int         `json:"calendar_year"`
	CalendarPeriod int         `json:"calendar_period"`
	Metric         string      `json:"metric"`
	Value          interface{} `json:"value"`
}

StandardizedDataResponseObject result object

Jump to

Keyboard shortcuts

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