Coder Social home page Coder Social logo

go-finance's Introduction

Stock/Financial data at your fingertips

[go-finance] Aims to provide an easy to use stock data client api

  • Uses Yahoo Finance csv http api

Install

go get github.com/TrevorDev/go-finance

Setup API (stable)

Add the following to the top of your .go file:

import (
	"github.com/TrevorDev/go-finance"
)

Basic Usage

out, err := finance.GetStockInfo([]string{"MSFT", "GOOG"},[]string{finance.Last_Trade_Price_Only,finance.Price_Per_Earning_Ratio})
if(err!=nil){
	//This may happen often if yahoo's server is under high volume
	fmt.Println(err)
}else{
	//outputs map of stock symbols and their specified attributes given above
	fmt.Println(out)

	//outputs microsofts current price per earing ratio as a string
	fmt.Println(out["MSFT"][finance.Price_Per_Earning_Ratio])
}

Possibly supported attributes

finance.Ask
finance.Average_Daily_Volume				
finance.Ask_Size
finance.Bid
finance.Ask_Real_time			
finance.Bid_Real_time
finance.Book_Value
finance.Bid_Size
finance.Change_And_Percent_Change				
finance.Change
finance.Commission	
finance.Change_Real_time			
finance.After_Hours_Change_Real_time		
finance.Dividend_Per_Share
finance.Last_Trade_Date	
finance.Trade_Date
finance.Earnings_Per_Share
finance.Error_Indication_returned_for_symbol_changed_Per_invalid											
finance.EPS_Estimate_Current_Year
finance.EPS_Estimate_Next_Year
finance.EPS_Estimate_Next_Quarter	
finance.Float_Shares
finance.Days_Low
finance.Days_High
finance.Year_Low
finance.Year_High
finance.Holdings_Gain_Percent		
finance.Annualized_Gain
finance.Holdings_Gain
finance.Holdings_Gain_Percent_Real_time					
finance.Holdings_Gain_Real_time
finance.More_Info
finance.Order_Book_Real_time				
finance.Market_Capitalization
finance.Market_Cap_Real_time
finance.EBITDA
finance.Change_From_Year_Low				
finance.Percent_Change_From_Year_Low		
finance.Last_Trade_Real_time_With_Time
finance.Change_Percent_Real_time
finance.Last_Trade_Size
finance.Change_From_Year_High		
finance.Percebt_Change_From_Year_High		
finance.Last_Trade_With_Time
finance.Last_Trade_Price_Only	
finance.High_Limit
finance.Low_Limit
finance.Days_Range
finance.Days_Range_Real_time			
finance.Fifty_day_Moving_Average
finance.Two_Hundred_Day_Moving_Average	
finance.Change_From_200_day_Moving_Average		
finance.Percent_Change_From_200_day_Moving_Average		
finance.Change_From_50_day_Moving_Average
finance.Percent_Change_From_50_day_Moving_Average		
finance.Name
finance.Notes
finance.Open
finance.Previous_Close	
finance.Price_Paid
finance.Change_in_Percent	
finance.Price_Per_Sales
finance.Price_Per_Book
finance.Ex_Dividend_Date
finance.Price_Per_Earning_Ratio
finance.Dividend_Pay_Date		
finance.Price_Per_Earning_Ratio_Real_time	
finance.PEG_Ratio
finance.Price_Per_EPS_Estimate_Current_Year						
finance.Price_Per_EPS_Estimate_Next_Year
finance.Symbol
finance.Shares_Owned		
finance.Short_Ratio
finance.Last_Trade_Time	
finance.Trade_Links
finance.Ticker_Trend
finance.One_Year_Target_Price	
finance.Volume
finance.Holdings_Value	
finance.Holdings_Value_Real_time			
finance.Year_Range
finance.Days_Value_Change	
finance.Days_Value_Change_Real_time			
finance.Stock_Exchange
finance.Dividend_Yield

Contributors

go-finance's People

Contributors

phone avatar trevordev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-finance's Issues

Similar projects

While googling my own project (too lazy to type in github url) I noticed yours. Since mine predates yours by a tiny bit I suppose either it wasn't in the search results yet or you had different ideas regarding API. Anyway, in case you hadn't found it, here's a ping :).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.