Yahoo finance/Google finance/Coinbase/Bittrex/Binance/Tiingo historical quote downloader library and cli written in golang
Yahoo finance/Google finance/Coinbase/Bittrex/Binance/Tiingo historical quote downloader library and cli written in golang
A free quote downloader library and cli
Downloads daily historical price quotes from Tiingo and daily/intraday data from various api's. Written in pure Go. No external dependencies. Now downloads crypto coin historical data from various exchanges.
Update: 08/19/2026 - Added Binance symbol lists: binance-usdt, binance-usdc, binance-btc, binance-eth. market.go is now a table rather than a switch plus a dispatch chain, so market lists are testable and a market can no longer be listed as valid without a way to fetch it. ValidMarkets is deprecated in favor of Markets()
Update: 08/19/2026 - Added Binance support (-source=binance), restoring the source removed in 2024. Uses data-api.binance.vision, which needs no API key and is not geo-restricted; api.binance.com returns 451 outside eligible regions. Supports every period the package defines, including 3d, which no other source offers
Update: 08/19/2026 - Modernization: added Client (context, retries, shared HTTP client) and a Provider registry; split the library into topic files; requires Go 1.24+. Fixes: EUR/GBP-quoted Coinbase pairs were rounded to 2 decimals and lost their price data, all timestamps are now UTC, -markets=etf works from the library API, multi-symbol CSV parsing no longer scrambles symbols, and CSV round-trips no longer append a phantom zero bar. Existing API is unchanged; older entry points still work and are marked deprecated
Update: 09/04/2025 - added Tiingo CSV update mode (-update) with 10-day backfill, optional full re-download on corporate actions, and -concurrency for faster updates
Update: 04/01/2025 - added markets flag, wildcard input files, multiple inputs
Update: 03/02/2025 - Removed obsolete Yahoo support
Update: 02/15/2024 - Major update: updated to Go 1.22, removed bittrex/binance support, fixed nasdaq/tiingo markets
Update: 11/15/2021 - Removed obsolete markets, converted to go modules
Update: 7/18/2021 - Removed obsolete Google support
Update: 6/26/2019 - updated GDAX to Coinbase, added coinbase market
Update: 4/26/2018 - Added preliminary tiingo CRYPTO support. Use -source=tiingo-crypto -token= You can also set env variable TIINGO_API_TOKEN. To get symbol lists, use market: tiingo-btc, tiingo-eth or tiingo-usd
Update: 12/21/2017 - Added Amibroker format option (creates csv file with separate date and time). Use -format=ami
Update: 12/20/2017 - Added Binance exchange support. Use -source=binance
Update: 12/18/2017 - Added Bittrex exchange support. Use -source=bittrex
Update: 10/21/2017 - Added Coinbase GDAX exchange support. Use -source=gdax All times are in UTC. Automatically rate limited.
Update: 7/19/2017 - Added preliminary tiingo support. Use -source=tiingo -token= You can also set env variable TIINGO_API_TOKEN
Update: 5/24/2017 - Now works with the new Yahoo download format. Beware - Yahoo data quality is now questionable and the free Yahoo quotes are likely to permanently go away in the near future. Use with caution!
Still very much in alpha mode. Expect bugs and API changes. Comments/suggestions/pull requests welcome!
Copyright 2025 Mark Chenoweth
Install CLI utility (quote) with:
go install github.com/markcheno/go-quote/quote@latest……Update mode rate limiting
Tiingo rate limit guidance
-delay=100..250 and -concurrency=2..4.429 Too Many Requests responses.-delay > 0 to be polite; set -delay=0 only if your plan allows higher throughput.Requires Go 1.24 or later. Install the package with:
go get github.com/markcheno/go-quote@latestpackage main
import (
"fmt"
"github.com/markcheno/go-quote"
"github.com/markcheno/go-talib"
)
func main() {
spy, _ := quote.NewQuoteFromTiingo("spy", "2016-01-01", "2016-04-01", quote.Daily, "your-tiingo-token")
fmt.Print(spy.CSV())
rsi2 := talib.Rsi(spy.Close, 2)
fmt.Println(rsi2)
}The package-level functions above still work, but new code should prefer a
Client. It takes a context.Context, so requests can be cancelled or given a
deadline, and it lets you set the request delay, retry policy, and HTTP client
per caller instead of through package globals:
…Fetch many symbols with Client.FetchSymbols, which paces requests by
Client.Delay and skips symbols that fail:
quotes, err := c.FetchSymbols(ctx, p, []string{"spy", "qqq", "dia"}, quote.Request{
From: quote.ParseDateString("2024-01-01"),
To: quote.ParseDateString("2024-12-31"),
Period: quote.Daily,
})
if err != nil {
panic(err)
}
err = quotes.WriteFile("indexes.csv", quote.FormatCSV)Client.Provider reports the valid sources and Provider.Periods the periods
each one supports, so an unsupported combination is an error rather than a
silent fallback to daily bars.
Timestamps are UTC. Every source returns UTC, so a Coinbase file and a Tiingo file label the same instant identically. The CSV format carries no timezone, so this also means a file written and read back keeps its instants.
Decimal places come from the data source: 2 for equities, 8 for
cryptocurrencies, recorded in Quote.Precision. CSV parsing infers it from the
decimals present in the file, so reading a file and writing it out again does
not round it.
Adding a data source means implementing quote.Provider and calling
quote.RegisterProvider. That is enough for -source dispatch and period
validation, which are registry-driven. A source added to the package itself also
needs a base-URL seam so it can be tested, Quote.Precision stamped, UTC
timestamps, and updates to three tests that know the set of sources -
docs/adding-a-provider.md is the full checklist.
Three changes need attention if you have existing data or scripts:
DOGE-EUR, ADA-GBP, and ~48 others) were
written with 2 decimal places, which rounded sub-euro prices away entirely -
a full day of DOGE-EUR came out as 0.08,0.08,0.08,0.08. The data in those
files is gone and needs refetching, not reformatting.ValidMarkets grew from 26 to 30 entries. It is an array, so its type
changed from [26]string to [30]string. Ranging over it, indexing it, and
len all still compile; only an explicit var m [26]string = quote.ValidMarkets
breaks. Use the new Markets() []string instead, which is a slice and will not
change type when markets are added.quote -source=bogus && next-step will now stop where it used to continue.MIT License - see LICENSE for more details
No open issues yet, or sync has not completed.