Skip to content

Package googlefinance implements a simple interface for fetching historical prices from google.com/finance.

License

Notifications You must be signed in to change notification settings

tiloso/googlefinance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

googlefinance GoDoc

Package googlefinance implements a simple interface for fetching historical prices from google.com/finance.

Install

go get github.com/tiloso/googlefinance

Introduction

An example on how to use it:

package main

import (
  "fmt"
  "time"

  "github.com/tiloso/googlefinance"
)

type Quote struct {
  Date                    time.Time
  Open, High, Low, Close  float64
  Volume                  uint32
}

func main() {
  var qs []Quote
  d, _ := time.Parse("2-Jan-06", "22-Oct-14")

  if err := googlefinance.Date(d).Key("NASDAQ:GOOG").Get(&qs); err != nil {
    fmt.Printf("err: %v\n", err)
  }
  fmt.Printf("%+v\n", qs)
  // Output: [{Date:2014-10-22 00:00:00 +0000 UTC Open:529.89 High:539.8 Low:528.8 Close:532.71 Volume:2917183}]
}

For more details please take a look at godoc.org

About

Package googlefinance implements a simple interface for fetching historical prices from google.com/finance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages