All Projects → pharrisee → poloniex-api

pharrisee / poloniex-api

Licence: MIT License
ARCHIVED --- A Go wrapper to the Poloniex API

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to poloniex-api

poloniex
Poloniex API in Go
Stars: ✭ 14 (-6.67%)
Mutual labels:  poloniex, poloniex-api
poloniex-api
PHP wrapper for the Poloniex API
Stars: ✭ 20 (+33.33%)
Mutual labels:  poloniex, poloniex-api
approveapi-go
A Go library for using ApproveAPI
Stars: ✭ 16 (+6.67%)
Mutual labels:  api-client
nodejs-passdock
PassDock API methods for iOS Wallet (PassBook)
Stars: ✭ 13 (-13.33%)
Mutual labels:  api-client
salt-netapi-client
Java bindings for the Salt API
Stars: ✭ 78 (+420%)
Mutual labels:  api-client
ruby-ipfs-http-client
A client library for the IPFS HTTP API, implemented in Ruby.
Stars: ✭ 21 (+40%)
Mutual labels:  api-client
adyen-dotnet-api-library
Adyen API Library for .NET
Stars: ✭ 69 (+360%)
Mutual labels:  api-client
laravel-bitcoinrpc
Bitcoin JSON-RPC Service Provider for Laravel.
Stars: ✭ 83 (+453.33%)
Mutual labels:  api-client
go-kkbox
KKBOX Open API SDK for Golang.
Stars: ✭ 16 (+6.67%)
Mutual labels:  api-client
poloniex-orderbook
Poloniex Orderbook manager
Stars: ✭ 36 (+140%)
Mutual labels:  poloniex
thetvdb2
Thetvdb.com API v2 Client
Stars: ✭ 33 (+120%)
Mutual labels:  api-client
tyfon
typed functions over network
Stars: ✭ 38 (+153.33%)
Mutual labels:  api-client
webapi
WAI based library for web api
Stars: ✭ 27 (+80%)
Mutual labels:  api-client
vsphere-automation-sdk-rest
REST (Postman and JavaScript) samples and API reference documentation for vSphere using the VMware REST API
Stars: ✭ 194 (+1193.33%)
Mutual labels:  api-client
Custom-Software-For-Xiaomi-Dafang
API and panel site for Xiaomi Dafang
Stars: ✭ 36 (+140%)
Mutual labels:  api-client
fusionauth-typescript-client
A TypeScript client for FusionAuth
Stars: ✭ 37 (+146.67%)
Mutual labels:  api-client
healthchecksio
Update and display the status of your healthchecks.io checks.
Stars: ✭ 30 (+100%)
Mutual labels:  api-client
helpscout-docs-api-php
DocsApi client for HelpScout
Stars: ✭ 21 (+40%)
Mutual labels:  api-client
canvas python sdk
Canvas Python SDK
Stars: ✭ 21 (+40%)
Mutual labels:  api-client
GenomicDataCommons
Provide R access to the NCI Genomic Data Commons portal.
Stars: ✭ 64 (+326.67%)
Mutual labels:  api-client

ARCHIVED

This repository is no longer maintained

Go Poloniex API wrapper

This API should be a complete wrapper for the Poloniex api, including the public, private and websocket APIs.

Install

go get -u github.com/pharrisee/poloniex-api

Usage

To use create a copy of config-example.json and fill in your API key and secret.

{
    "key":"put your key here",
    "secret":"put your secret here"
}

You can also pass your key/secret pair in code rather than creating a config.json.

Examples

Public API

package main

import (
    "log"

    "github.com/k0kubun/pp"
    "github.com/pharrisee/poloniex-api"
)

func main() {
    p := poloniex.NewPublicOnly()
    ob, err := p.OrderBook("BTC_ETH")
    if err != nil {
        log.Fatalln(err)
    }
    pp.Println(ob.Asks[0], ob.Bids[0])
}

Private API

package main

import (
    "fmt"
    "log"

    "github.com/pharrisee/poloniex-api"
)

func main() {
    p := poloniex.New("config.json")
    balances, err := p.Balances()
    if err != nil {
        log.Fatalln(err)
    }
    fmt.Printf("%+v\n", balances)
}

Websocket API

package main

import (
    "log"

    poloniex "github.com/pharrisee/poloniex-api"

    "github.com/k0kubun/pp"
)

func main() {
	p := poloniex.NewWithCredentials("Key goes here", "secret goes here")
	p.Subscribe("ticker")
	p.Subscribe("USDT_BTC")
	p.StartWS()

	p.On("ticker", func(m poloniex.WSTicker) {
		pp.Println(m)
	}).On("USDT_BTC-trade", func(m poloniex.WSOrderbook) {
		pp.Println(m)
	})

	for _ = range time.Tick(1 * time.Second) {

	}
}

Websocket Events

When subscribing to an event stream there are a few input types, and strangely more output types.

Ticker

event name: ticker

Sends ticker updates when any of currencyPair, last, lowestAsk, highestBid, percentChange, baseVolume, quoteVolume, isFrozen, 24hrHigh or 24hrLow changes for any market.

You are required to filter which markets you are interested in.

Market_Name

Subscribing to an orderbook change stream can be confusing (both to think about and describe), since a single subscription can lead to multiple event streams being created.

using USDT_BTC as an example market below, any valid market name could be used (e.g. BTC_NXT or ETH_ETC)

Subscribing to USDT_BTC will lead to these events being emitted.

Event Purpose
USDT_BTC all events, trade, modify and remove for a single market
trade trade events for all markets
modify modify events for all markets
remove remove events for all markets
USDT_BTC-trade trade events for single market
USDT_BTC-modify modify events for single market
USDT_BTC-remove remove event for single market

This gives flexibility when writing the event handlers, meaning that you could for example have one routing which sends all trades for all markets to a local database for later processing.

see https://poloniex.com/support/api/ for a fuller description of the event types.

Support Development

Coin Address
BTC 1M2quzgptKWAVSmDyD7vAQbxYb8BNJmjEf
BCH 1CcDLKYTy2pCLTYTYBbBPkK79JeJ4v3GmV
ZEC t1bC8TnYYh6k71QMTTpJZdmKKzqPiqhuBxU
DCR DsdK14zAJ7sKU2MYYozFtmuk9sAoxD7XCs9
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].