{"repo":"markcheno/go-quote","free":true,"listed":false,"github":"https://github.com/markcheno/go-quote","clone":"git clone https://github.com/markcheno/go-quote.git","description":"Yahoo finance/Google finance/Coinbase/Bittrex/Binance/Tiingo historical quote downloader library and cli written in golang","language":"Go","stars":346,"topics":["binance","binance-api","bitcoin","bittrex","bittrex-api","cli","coinbase","ethereum","financial-data","gdax","gdax-api","golang","historical-cryptocurrency-prices","historical-data","litecoin","quotes","tiingo","yahoo","yahoo-finance-api"],"license":"MIT","category":"data_pipeline","readme_excerpt":"# go-quote\n\n[![GoDoc](http://godoc.org/github.com/markcheno/go-quote?status.svg)](http://godoc.org/github.com/markcheno/go-quote)\n\nA free quote downloader library and cli\n\nDownloads 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.\n\n- 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\n\n- Update: 04/01/2025 - added markets flag, wildcard input files, multiple inputs\n\n- Update: 03/02/2025 - Removed obsolete Yahoo support\n\n- Update: 02/15/2024 - Major update: updated to Go 1.22, removed bittrex/binance support, fixed nasdaq/tiingo markets\n\n- Update: 11/15/2021 - Removed obsolete markets, converted to go modules\n\n- Update: 7/18/2021 - Removed obsolete Google support\n\n- Update: 6/26/2019 - updated GDAX to Coinbase, added coinbase market\n\n- Update: 4/26/2018 - Added preliminary [tiingo](https://api.tiingo.com/) CRYPTO support. Use -source=tiingo-crypto -token=<your_tingo_token> You can also set env variable TIINGO_API_TOKEN. To get symbol lists, use market: tiingo-btc, tiingo-eth or tiingo-usd\n\n- Update: 12/21/2017 - Added Amibroker format option (creates csv file with separate date and time). Use -format=ami\n\n- Update: 12/20/2017 - Added [Binance](https://www.binance.com/trade.html) exchange support. Use -source=binance\n\n- Update: 12/18/2017 - Added [Bittrex](https://bittrex.com/home/markets) exchange support. Use -source=bittrex\n\n- Update: 10/21/2017 - Added Coinbase [GDAX](https://www.gdax.com/trade/BTC-USD) exchange support. Use -source=gdax All times are in UTC. Automatically rate limited.\n\n- Update: 7/19/2017 - Added preliminary [tiingo](https://api.tiingo.com/) support. Use -source=tiingo -token=<your_tingo_token> You can also set env variable TIINGO_API_TOKEN\n\n- 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!\n\nStill very much in alpha mode. Expect bugs and API changes. Comments/suggestions/pull requests welcome!\n\nCopyright 2024 Mark Chenoweth\n\nInstall CLI utility (quote) with:\n\n```bash\ngo install github.com/markcheno/go-quote/quote@latest\n```\n\n```\nUsage:\n  quote -h | -help\n  quote -v | -version\n  quote <market> [-output=<outputFile>]\n  quote -markets=<markets> -all=true -outfile=stocks.csv\n  quote [-years=<years>|(-start=<datestr> [-end=<datestr>])] [options] [-infile=<filename>|<symbol> ...]\n  quote -update=<path> [-end=<datestr>] [-backfill-days=10] [-full-redownload-on-ca] [-concurrency=<n>] [-token=<tiingo_token>]\n\nOptions:\n  -h -help             show help\n  -v -version          show version\n  -years=<years>       number of years to download [default=5]\n  -start=<datestr>     yyyy[-[mm-[dd]]]\n  -end=<datestr>       yyyy[-[mm-[dd]]] [default=today]\n  -infile=<filename>   list of symbols to download\n  -markets=<list>      list of markets to download (comma separated)\n  -outfile=<filename>  output filename\n  -period=<period>     1m|3m|5m|15m|30m|1h|2h|4h|6h|8h|12h|d|3d|w|m [default=d]\n  -source=<source>     tiingo|tiingo-crypto|coinbase [default=tiingo]\n  -token=<tiingo_tok>  tingo api token [default=TIINGO_API_TOKEN]\n  -format=<format>     (csv|json|hs|ami) [default=csv]\n  -all=<bool>          all in one file (true|false) [default=false]\n  -log=<dest>          filename|stdout|stderr|discard [default=stdout]\n  -delay=<ms>          delay in milliseconds between quote requests\n  -update=<path>       update an existing Tiingo CSV (single or -all multi) in place\n  -backfill-days=<n>   days of overlap to rewrite [default=10]\n  -full-redownload-on-ca  if splits/dividends detected, fully redownload the symbol block\n  -concurrency=<n>     concurrent symbol fetches in update mode [default=1]\n\nNote: not all periods work with all sources\n\nValid markets:\netf,nasdaq,nasdaq100,amex,nyse,megacap,largecap,midcap,smallcap,microcap,nanocap,\ntelecommunications,health_care,finance,real_estate,consumer_discretionary,\nconsumer_staples,industrials,basic_materials,energy,utilities\ncoinbase,tiingo-usd,tiingo-btc,tiingo-eth\n```\n\n## CLI Examples\n\n```bash\n# display usage\nquote -help\n\n# downloads 10 years of smallcap, midcap, largecap and megacap stocks to stocks.csv\nquote -markets=smallcap,midcap,largecap,megacap -all=true -years=10 -outfile=stocks.csv\n\n# downloads 10 years of spy,qqq and djia to indexes.csv\nquote -years=10 -outfile=indexes.csv -all=true spy qqq djia\n\n# downloads 5 years of Tiingo SPY history to spy.csv (TIINGO_API_TOKEN must be set)\nquote spy\n\n# downloads 1 year of bitcoin history to BTC-USD.csv\nquote -years=1 -source=coinbase BTC-USD\n\n\n# downloads full etf symbol list to etf.txt, also works for nasdaq,nasdaq100,nyse,amex\nquote etf\n\n# download fresh etf list and 5 years of etf data all in one file\nquote -markets=etf -all=true -outfile=etf.csv\n\n# update a large multi-symbol CSV in place (Tiingo), 4 concurrent fetchers\nquote -update=stocks.csv -concurrency=4\n\n# update a single-symbol CSV inferred from filename (e.g., spy.csv)\nquote -update=spy.csv -backfill-days=10 -full-redownload-on-ca\n\n# control request pacing with -delay and concurrency\nquote -delay=100 -update=stocks.csv -concurrency=8\n```\n\nUpdate mode rate limiting\n\n- -delay=0: no global throttle; workers issue requests immediately.\n- -delay>0: a single global limiter spaces requests across all workers by ~delay ms. Use higher -concurrency to overlap work while keeping polite pacing.\n\nTiingo rate limit guidance\n\n- Start conservatively: `-delay=100..250` and `-concurrency=2..4`.\n- Increase gradually and watch for `429 Too Many Requests` responses.\n- Leave `-delay` > 0 to be polite; set `-delay=0` only if your plan allows higher throughput.\n\n## Install library\n\nInstall the package with:\n\n```bash\ngo get github.com/markcheno/go-quote@latest\n```\n\n## Library example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/markcheno/go-quote\"\n\t\"github.com/markcheno/go-talib\"\n)\n\nfunc main() {\n\tspy, _ := quote.NewQuoteFromTiingo(\"spy\", \"2016-01-01\", \"2016-04-01\", quote.Daily, \"your-tiingo-token\")\n\tfmt.Print(spy.CSV())\n\trsi2 := talib.Rsi(spy.Close, 2)\n\tfmt.Println(rsi2)\n}\n```\n\n## License\n\nMIT License - see LICENSE for more details\n","default_branch":"master","files":9,"tree":[".gitignore","CLAUDE.md","LICENSE","README.md","go.mod","quote.go","quote/main.go","quote/quote","quote_test.go"],"storefront":"/r/markcheno","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/markcheno/go-quote/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}