All Projects → timpalpant → Go Iex

timpalpant / Go Iex

Licence: lgpl-3.0
A Go library for accessing the IEX Developer API.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Iex

Epv Api Scripts
These API scripts enable CyberArk users to automate privileged account management task like account creation, user management, and more.
Stars: ✭ 77 (-11.49%)
Mutual labels:  rest-api
Flask Restplus Server Example
Real-life RESTful server example on Flask-RESTplus
Stars: ✭ 1,240 (+1325.29%)
Mutual labels:  rest-api
Evolutility Server Node
Model-driven REST or GraphQL backend for CRUD and more, written in Javascript, using Node.js, Express, and PostgreSQL.
Stars: ✭ 84 (-3.45%)
Mutual labels:  rest-api
Gitmessenger
GitMessenger is github chat app built with socket.io , firebase, nodejs and bootstrap where developers can share code,images and much more 😊
Stars: ✭ 78 (-10.34%)
Mutual labels:  rest-api
Current
C++ framework for realtime machine learning.
Stars: ✭ 81 (-6.9%)
Mutual labels:  rest-api
Terraformize
Apply\Destory Terraform modules via a simple REST API endpoint.
Stars: ✭ 84 (-3.45%)
Mutual labels:  rest-api
Pixlab
PixLab Resources & Sample Set
Stars: ✭ 74 (-14.94%)
Mutual labels:  rest-api
Laravel Woocommerce
WooCommerce Rest API for Laravel
Stars: ✭ 86 (-1.15%)
Mutual labels:  rest-api
Bankflix
Aplicação que simula um banco digital, contendo a área do cliente e administrativa, permitindo depósitos e transferências entre contas do mesmo banco. | Application that simulates a digital bank, containing the customer and administrative areas, allowing deposits and transfers between accounts of the same bank.
Stars: ✭ 82 (-5.75%)
Mutual labels:  rest-api
Spring Boot Mongodb Angular Todo App
A Sample App built using Spring Boot, Angular and MongoDB
Stars: ✭ 84 (-3.45%)
Mutual labels:  rest-api
Aztro
The Astrology API 💫 Get daily horoscope!
Stars: ✭ 78 (-10.34%)
Mutual labels:  rest-api
Spring Boot Sample App
Sample app generated from my spring boot archtype on :https://github.com/Romeh/spring-boot-quickstart-archtype
Stars: ✭ 81 (-6.9%)
Mutual labels:  rest-api
Bhagavadgita
A non-profit initiative to help spread the transcendental wisdom from the Bhagavad Gita to people around the world.
Stars: ✭ 84 (-3.45%)
Mutual labels:  rest-api
The Complete Guide To Drf And Vuejs
📢 Source Code from my Web Dev Course *The Complete Guide To Django REST Framework and Vue JS* (Lang: English & Italian)
Stars: ✭ 78 (-10.34%)
Mutual labels:  rest-api
Mezzanine Api
RESTful web API for Mezzanine CMS
Stars: ✭ 84 (-3.45%)
Mutual labels:  rest-api
Restfm
RESTful web services for FileMaker server.
Stars: ✭ 76 (-12.64%)
Mutual labels:  rest-api
Drf Autodocs
Ultimately automated DRF documentation rendering(UNMAINTAINED)
Stars: ✭ 82 (-5.75%)
Mutual labels:  rest-api
Sample Dotnet Core Cqrs Api
Sample .NET Core REST API CQRS implementation with raw SQL and DDD using Clean Architecture.
Stars: ✭ 1,273 (+1363.22%)
Mutual labels:  rest-api
Laravel Api Starter
laravel5.5 + dingo/api + JWT
Stars: ✭ 85 (-2.3%)
Mutual labels:  rest-api
Project
⭐️ Antares Project Application Skeleton. This is the very first place you should start. It allows you to create a brand new awesome project in easy few steps.
Stars: ✭ 84 (-3.45%)
Mutual labels:  rest-api

go-iex

A Go library for accessing the IEX Developer API.

GoDoc Build Status Coverage Status Go Report Card

go-iex is a library to access the IEX Developer API from Go. It provides a thin wrapper for working with the JSON REST endpoints and IEXTP1 pcap data.

IEX is a fair, simple and transparent stock exchange dedicated to investor protection. IEX provides realtime and historical market data for free through the IEX Developer API. By using the IEX API, you agree to the Terms of Use. IEX is not affiliated and does not endorse or recommend this library.

Usage

pcap2csv

You can use the included pcap2csv tool to create intraday minute bars from the pcap data files:

$ go install github.com/timpalpant/go-iex/pcap2csv
$ pcap2csv < input.pcap > output.csv

which produces a CSV with OHLC data:

symbol,time,open,high,low,close,volume
AAPL,2017-07-10T14:33:00Z,148.9100,149.0000,148.9100,148.9800,2527
AMZN,2017-07-10T14:33:00Z,364.8900,364.9600,364.8900,364.9600,1486
DISH,2017-07-10T14:33:00Z,49.6600,49.6600,49.6200,49.6200,1049
ELLO,2017-07-10T14:33:00Z,10.0300,10.1100,10.0300,10.1100,3523
FB,2017-07-10T14:33:00Z,46.4000,46.4000,46.3400,46.3400,1633
FICO,2017-07-10T14:33:00Z,57.4200,57.4200,57.3500,57.3800,1717
GOOD,2017-07-10T14:33:00Z,18.7700,18.7700,18.7300,18.7300,2459

pcap2json

If you just need a tool to convert the provided pcap data files into JSON, you can use the included pcap2json tool:

$ go install github.com/timpalpant/go-iex/pcap2json
$ pcap2json < input.pcap > output.json

Fetch real-time top-of-book quotes

package main

import (
  "fmt"
  "net/http"

  "github.com/timpalpant/go-iex"
)

func main() {
  client := iex.NewClient(&http.Client{})

  quotes, err := client.GetTOPS([]string{"AAPL", "SPY"})
  if err != nil {
      panic(err)
  }

  for _, quote := range quotes {
      fmt.Printf("%v: bid $%.02f (%v shares), ask $%.02f (%v shares) [as of %v]\n",
          quote.Symbol, quote.BidPrice, quote.BidSize,
          quote.AskPrice, quote.AskSize, quote.LastUpdated)
  }
}

Fetch historical top-of-book quote (L1 tick) data.

Historical tick data (TOPS and DEEP) can be parsed using the PcapScanner.

package main

import (
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"os"
	"time"

	"github.com/timpalpant/go-iex"
	"github.com/timpalpant/go-iex/iextp/tops"
)

func main() {
	client := iex.NewClient(&http.Client{})

	// Get historical data dumps available for 2016-12-12.
	histData, err := client.GetHIST(time.Date(2016, time.December, 12, 0, 0, 0, 0, time.UTC))
	if err != nil {
		panic(err)
	} else if len(histData) == 0 {
		panic(fmt.Errorf("Found %v available data feeds", len(histData)))
	}

	// Fetch the pcap dump for that date and iterate through its messages.
	resp, err := http.Get(histData[0].Link)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	packetDataSource, err := iex.NewPcapDataSource(resp.Body)
	if err != nil {
		panic(err)
	}
	pcapScanner := iex.NewPcapScanner(packetDataSource)

	// Write each quote update message to stdout, in JSON format.
	enc := json.NewEncoder(os.Stdout)

	for {
		msg, err := pcapScanner.NextMessage()
		if err != nil {
			if err == io.EOF {
				break
			}

			panic(err)
		}

		switch msg := msg.(type) {
		case *tops.QuoteUpdateMessage:
			enc.Encode(msg)
		default:
		}
	}
}

Iterate over data from a live multicast UDP stream of the DEEP feed.

IEX's live multicast data can also be parsed using the PcapScanner.

package main

import (
	"encoding/json"
	"io"
	"net"
	"os"

	"github.com/timpalpant/go-iex"
	"github.com/timpalpant/go-iex/iextp/deep"
)

func main() {
        multicastAddress := "233.215.21.4:10378"
	addr, err := net.ResolveUDPAddr("udp", multicastAddress)
	if err != nil {
	        panic(err)
	}

	conn, err := net.ListenMulticastUDP("udp", nil, addr)
	if err != nil {
	        panic(err)
	}

	packetDataSource := iex.NewPacketConnDataSource(conn)
	pcapScanner := iex.NewPcapScanner(packetDataSource)

	// Write each quote update message to stdout, in JSON format.
	enc := json.NewEncoder(os.Stdout)

	for {
		msg, err := pcapScanner.NextMessage()
		if err != nil {
			if err == io.EOF {
				break
			}

			panic(err)
		}

		switch msg := msg.(type) {
		case *deep.PriceLevelUpdateMessage:
			enc.Encode(msg)
		default:
		}
	}
}

Contributing

Pull requests and issues are welcomed!

License

go-iex is released under the GNU Lesser General Public License, Version 3.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].