https://github.com/dannyben/quandl
Go library for accessing Quandl API
https://github.com/dannyben/quandl
api command-line economic-data go quandl quandl-api
Last synced: 12 months ago
JSON representation
Go library for accessing Quandl API
- Host: GitHub
- URL: https://github.com/dannyben/quandl
- Owner: DannyBen
- License: mit
- Created: 2014-10-09T08:26:55.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-06-16T06:34:51.000Z (about 10 years ago)
- Last Synced: 2025-04-18T14:54:36.337Z (about 1 year ago)
- Topics: api, command-line, economic-data, go, quandl, quandl-api
- Language: Go
- Size: 31.3 KB
- Stars: 15
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Go Quandl
==================================================
[](https://travis-ci.org/DannyBen/quandl)
[](http://godoc.org/github.com/DannyBen/quandl)
---
This library provides easy access to the
[Quandl API](https://www.quandl.com/help/api)
using the Go programming language.
The full documentation is at:
[godoc.org/github.com/DannyBen/quandl](http://godoc.org/github.com/DannyBen/quandl)
---
Install
--------------------------------------------------
$ go get github.com/DannyBen/quandl
Features
--------------------------------------------------
* Supports 3 call types to Quandl: `GetSymbol`, `GetList` and `GetSearch`.
* Returns either a native [Go object](https://github.com/DannyBen/quandl/blob/master/quandlResponseTypes.go), or a raw (CSV/JSON/XML)
response.
* Built in cache handling.
Usage
--------------------------------------------------
Basic usage looks like this:
```go
quandl.APIKey = "YOUR KEY"
data, err := quandl.GetSymbol("WIKI/AAPL", nil)
```
and will return a native Go object. To use the data in the
response, iterate through its Data property:
```go
for i, item := range data.Data {
fmt.Println(i, item[0], item[2])
}
```
To receive a raw response from Quandl (CSV, JSON, XML)
you can use:
```go
data, err := quandl.GetSymbolRaw("WIKI/AAPL", "csv", nil)
```
To pass options to the Quandl API, use something like this:
```go
v := quandl.Options{}
v.Set("trim_start", "2014-01-01")
v.Set("trim_end", "2014-02-02")
data, err := quandl.GetSymbol("WIKI/AAPL", v)
```
More examples are in the
[quandl_test file](https://github.com/DannyBen/quandl/blob/master/quandl_test.go)
or in the
[official godoc documentation](http://godoc.org/github.com/DannyBen/quandl#pkg-examples)
Development
--------------------------------------------------
Before running tests, set your API key in an environment variable.
$ export QUANDL_KEY=your_key_here
$ go test -v