Giter Club home page Giter Club logo

binance-go-api-wrapper's Introduction

Go wrapper for Binance REST API

binance-go-api-wrapper is a Go client library wrapper for accessing Binance's web REST API.

For details of the REST API, see Binance's website https://www.binance.com/restapipub.html

Initially created as a submission to their API coding competition but I'll continue working on this for my own eventual use. https://support.binance.com/hc/en-us/articles/115001909972

Install

Install the package with:

go get github.com/waylandc/binance-go-api-wrapper/binance

Example

Before running this, you need to create API keys from Binance website and set the BINANCE_KEY and BINANCE_SECRET environment variables.

package main
import (
	"os"
	"fmt"
	"github.com/waylandc/binance-go-api-wrapper/binance"
)

func main() {
	session := binance.New(os.Getenv("BINANCE_KEY"), os.Getenv("BINANCE_SECRET"))
	prices, err := session.GetAllPrices()
	if err != nil {
		fmt.Println(err)
	}

	i := 0
	for i < len(prices)-1 {
		fmt.Printf("Symbol: %s Price: %f\n", prices[i].Symbol, prices[i].Price)
		i++
	}
	
}

Appreciation/Donation

Please use my referral link to sign up your Binance account https://www.binance.com/register.html?ref=10911890

License

MIT License - see LICENSE file for details

binance-go-api-wrapper's People

Contributors

waylandc avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.