coinigy / api Goto Github PK
View Code? Open in Web Editor NEWCoinigy API Examples
Coinigy API Examples
Could you please provide how to call properly(TICKER) also receive All Markets?
Doing this:
var cn = _scc.CreateChannel("TICKER").Subscribe();
cn.OnMessage(TradeData);
or this
var cn0 = _scc.CreateChannel("TICKER-BTRX--ETH--BTC").Subscribe();
cn0.OnMessage(TradeData);
but it doesn't work
I can use the API fine but when using web socket how do I get the data to a useable form that I can manipulate in my code, I've tried everything I can think of and google has confused me to no end. Thank you.
Although market orders are not yet supported (#7), it would be extremely useful to have a single button to sell multiple assets with one click. Ideally market orders, but this could be implemented by setting a limit order 5% below market.
I could then click one button to sell for example all assets that drop when BTC rises. Similar situation in reverse when BTC drops.
So I could configure a group of assets to sell to BTC, another to sell to USD, and click one button to execute it.
I would pay a premium for this feature.
Submitted PR #26 with:
Just 20 bids/asks returned when I use Websocket connection.
Can I have more?
20 bids/asks is not enough to make good decisions.
I have this code:
var subFavorites = SCsocket.subscribe("FAVORITES");
console.log(">>> FAVORITES ", subFavorites);
subFavorites.watch(function(data) {
console.log("FAVORITES: ", data);
});
And it's printing basically a bunch of exchanges and markets that I didn't bookmarked. Actually I have only two markets bookmarked... Is anyone having the same problem?
Hi,
I'm creating a single-page app that would use Coinigy's api.
I was wondering if you have any plan to implement the api for browsers
Hi.
Such as the title, I can't can message from channel 'BLOCK-LTC' with websocket api
Hello,
I tried placing an order to Bittrex via the API, with an existing API key-secret pair (doesn't work with code that already worked to make such a request, and doesn't work via Postman).
I got as a response an error:
This API key does not have access to the requested method.
I never got this error before.
All seems to me to be correct on my end.
Can yo please help me resolve this issue? I need it for my job for my company's everyday business operations!
Does the Coinigy API support placing market orders?
Hello,
I'm trying to use the addOrder
method of the following data:
URL: https://api.coinigy.com/api/v1/addOrder
Content-Type: application/json
X-API-KEY: <my_api_key>
X-API-SECRET: <my_api_secret>
auth_id: 332719,
exch_id: 15,
mkt_id: 5110,
order_type_id: 2,
price_type_id: 3,
limit_price: 5678,
order_quantity: 1
And I'm getting the error:
"Missing or empty parameters:"
The full response is:
{
"error_num": "1057-33-01"
"err_msg": "Missing or empty parameters"
}
without any parameter stated.
I don't know if there's anything wrong with my request.
All the data that I inserted to it seems to me like it shouldn't make the request unacceptable by your API.
Can someone please help me?
Hello! I am a long time user of coinigy, and have a paid account, still my API keys +websockets give errors. Why is that? And how to fix it ?
Hi all. I am sending a request to get all market data history, but as a response I am getting only today's data.
Here is my request
Url: https://api.coinigy.com/api/v1/data
Body:
{
"exchange_code": "GDAX",
"exchange_market": "BTC/USD",
"type": "history"
}
Please, let me know, is there a way to get data for the last 6 month? Thanks!
I have written a function that passes a set of values to a dictionary and posts to the addOrder endpoint. However, I always receive the following response from the endpoint:
b'{"data":{"internal_order_id":"0"},"notifications":[]}'
Function
`
def makeOrder(self, auth_id, exch_id, mkt_id, order_type_id, price_type_id, limit_price, order_quantity):
headers = {
'Content-Type': 'application/json',
'X-API-KEY': self.APIKEY,
'X-API-SECRET': self.APISECRET,
}
values = {
"auth_id": int(auth_id),
"exch_id": int(exch_id),
"mkt_id": int(mkt_id),
"order_type_id": int(order_type_id),
"price_type_id": int(price_type_id),
"limit_price": int(limit_price),
"order_quantity": float(order_quantity),
}
print(values)
request = requests.post('https://api.coinigy.com/api/v1/addOrder', json=values, headers=headers)
logging.debug(request.content)
print(request.content)
return request.json()['data']['internal_order_id']`
Here is a sample dictionary:
{'mkt_id': 3341, 'limit_price': 3603.78, 'order_quantity': 0.001, 'auth_id': 396720, 'price_type_id': 3, 'order_type_id': 2, 'exch_id': 70}
Has anyone encountered this?
when i subscribe to receive the list of orders from a specific exchange, i receive only the last 40 orders at a time (buy/sell).
What happens if an order has been deleted? do i receive some sort of an indication for that?
In the file https://github.com/Coinigy/api/blob/master/README.md, you have a line that reads:
V2 REST API documentation: https://api.coinigy.com/api/v2/docs/index.html
The link is broken. If you remove the 'index.html' link from the end of the link, it goes where one expects.
More client snippets coming for,
@robborden , you might like to add links in README.
Noticed in the last few days that I'm receiving an unexpected response when placing a sell order on Liqui.
Here is my request code
var request = require('request');
request({
method: 'POST',
url: 'https://api.coinigy.com/api/v1/addOrder',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': API_KEY,
'X-API-SECRET': API_SECRET
},
body: "{ \"auth_id\":"+ auth_id +", \"exch_id\":" + exch_id + ", \"mkt_id\":" + mkt_id + ", \"order_type_id\":" + order_type_id + ", \"price_type_id\":" + price_type_id + ", \"limit_price\":" + rate + ", \"order_quantity\":" + quantity + "}"
}, function (error, response, body) {
winston.debug("[placeOrderSell] Response Received: ", body);
}
This is what I'm receiving in the 'body':
<pre>Array
(
[pair] => gno_eth
[type] => sell
[amount] => 0.13
[rate] => 1.26271351
)
</pre><pre>Array
(
[success] => 1
[return] => Array
(
[received] => 0.13
[remains] => 0
[order_id] => 0
[funds] => Array
(
[gno] => 0.06676548478
[eth] => 2.9836044990406
)
)
)
</pre>{"data":{"internal_order_id":"XXXXXXXX"},"notifications":[]}
I've just removed the actual order ID.
Why is there data within a <pre>
tag? According to the documentation, I should just be receiving a JSON reponse. Or have I missed something?
When I try to request https://api.coinigy.com/api/v1/markets it recently started to return this:
Disallowed Key Characters.
The returned header is:
Server: nginx
Date: Thu, 05 Jul 2018 17:41:05 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Vary: Accept-Encoding
Content-Encoding: gzip
What does it mean?
sacOO7/socketcluster-client-python#5
Code listed here is implementation corresponding to Js example code on this repo.
please provide example code for java. at this time i cant correctly auth with https://github.com/sacOO7/socketcluster-client-java
Hello, there is a missing function which is absolutely needed. I need the function to do the same actions on all of my accounts, instead of repeat the action every time (buy/sell etc.) I`m desperately in search into a platform that can allow this, hope the coinigy developer team will add this feature
I am using refreshBalance in order to update (refresh) information on balances from exchanges and get the updated balances in the script. Unfortunately, refreshBalance just returns non-refreshed information on the balance for a particular requested auth_id (180998).
Other auth_ids work fine. Also, binance balances are succesfully updated on the web interface.
Please take a look and fix.
I'm pulling order history via the API, and saving it in a MongoDB collection, because I need history for more than the past 200 orders. I assumed that order_id was unique, so I could simply pull the freshest data from your API and insert them into my MongoDB collection (with a unique index on order_id) ignoring duplicates. However, I noticed a weird issue with ZCL/BTC on Cryptopia yesterday (have not seen it with any other markets so far) where a small subset of historical buy orders would suddenly show up multiple times with different values for order_id, but everything else appears to be identical. Is it possible that order_id is not unique as I assumed?
Hi,
I've noticed some issues with the open orders not updating correctly.
I had placed 4 orders on Liqui. These orders were either cancelled or filled and were now no longer open orders. However, if I requested the open orders through the coinigy API, these orders are all passed back in the response. If I login to Liqui though and view the open orders, there is nothing there. It has been a month since the first order, so I'm assuming there is just some issue between coinigy and Liqui.
I've also noticed that once an order is placed (regardless of the exchange) and I then request the open orders, the 'remaining quantity' is not being updated. E.G. I placed an order on Poloniex which filled 50, but when I request the open order, the remaining quantity is still the full quantity.
Please could you investigate this. The assistance would be appreciated.
Thanks.
Hi,
I am a Coingy customer and was curios to know if I am at the right place. I would like to get familiar with building some simple web-app based tools. Those might involve displaying open orders, visualising open orders on a chart etc. Is this the correct place to start? The plan is to keep all of this JavaScript based (node.js etc.). The aim is to automate some of my trading activities.
Are there any limitations in terms of pulling all tickers, realt-time data to draw my own charts and plot custom indicators etc?
Thanks.
TRADE and ORDER is working perfeclty
var socketCluster = require('socketcluster-client');
var api_credentials =
{
"apiKey" : "KEY",
"apiSecret" : "SECRET"
}
var options = {
hostname : "sc-02.coinigy.com",
port : "443",
secure : "true"
};
console.log(options);
var SCsocket = socketCluster.connect(options);
// Once connected, authenticate with credentials
SCsocket.on('connect', function (status) {
SCsocket.emit("auth", api_credentials, function (err, token) {
if (!err && token) {
// Subscribe to Bittrex Ethereum/Bitcoin market's live websocket trade feed
var scChannel = SCsocket.subscribe("TICKER");
scChannel.watch(function (data) {
// log output as new messages stream in
console.log(data);
});
} else {
console.log(err);
}
});
});
// Catch and log any error messages
SCsocket.on('error', function (status) {
console.log(status);
});
Since a couple of days I have the problem that I don't get any data from channel TRADE-BINA--BTC--USDT anymore. Sometimes it's working, sometimes not. To narrow it down I have written a tiny node.js tool, and every time I restart it, it successfully subscribes to that channel -> but it's a 50/50 chance to get data on the 'watch' listener.
Since yesterday I have some sporadic socketCluster hangup/connection losses as well.
Does anyone else experience this?
// Using the provided example code (which worked for me last week),
// this results in "Key/Secret Pair Failed".
// Anyone else having this problem, or is it just me?
// (Yes, I have included a real key/secret, but it is to a new trial account with no exchange keys.
// But I get the same error with my paid subscription account. And coinigy support hasn't
// answered my ticket yet, after almost 4 days)
var socketCluster = require('socketcluster-client');
var api_credentials =
{
"apiKey" : "77c6ba0a9f264d497fef1fd298719dce",
"apiSecret" : "e4759419caae402dfc5930ff1c23e065"
}
var options = {
hostname : "sc-02.coinigy.com",
port : "443",
secure : "true"
};
console.log(options);
var SCsocket = socketCluster.connect(options);
SCsocket.on('connect', function (status) {
console.log(status);
SCsocket.on('error', function (err) {
console.log(err);
});
SCsocket.emit("auth", api_credentials, function (err, token) {
if (!err && token) {
var scChannel = SCsocket.subscribe("TRADE-OK--BTC--CNY");
console.log(scChannel);
scChannel.watch(function (data) {
console.log(data);
});
SCsocket.emit("exchanges", null, function (err, data) {
if (!err) {
console.log(data);
} else {
console.log(err)
}
});
SCsocket.emit("channels", "OK", function (err, data) {
if (!err) {
console.log(data);
} else {
console.log(err)
}
});
} else {
console.log(err)
}
});
});
I'm having trouble establishing a websocket connection on this endpoint wss://sc-02.coinigy.com/socketcluster/
.
I'm using a socketcluster compatible client https://github.com/sacOO7/socketcluster-client-python.
Here is a short code snippet I'm using to connect to the websocket endpoint.
from socketclusterclient import Socketcluster
import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
def onconnect(socket):
logging.info("on connect got called")
socket.emit('auth', {'apiKey': 'blabla',
'apiSecret': 'dsadasdasdas34r'})
def ondisconnect(socket):
logging.info("on disconnect got called")
def onConnectError(socket, error):
logging.info("On connect error got called")
def onSetAuthentication(socket, token):
logging.info("Token received " + token)
socket.setAuthtoken(token)
def onAuthentication(socket, isauthenticated):
logging.info("Authenticated is " + str(isauthenticated))
if __name__ == "__main__":
socket = Socketcluster.socket("wss://sc-02.coinigy.com/socketcluster/")
socket.setBasicListener(onconnect, ondisconnect, onConnectError)
socket.setAuthenticationListener(onSetAuthentication, onAuthentication)
socket.connect()
Steps to reproduce
pip install git+git://github.com/sacOO7/socketcluster-client-python.git
python ws.py
Expected behavior
The websocket client successfully authenticates with the server and establishes a websocket connection
Actual behavior
The websocket client does not authenticate with the server and never establishes a websocket connection
Potential solution
I think a python websocket client example would solve my problem and be a great addition to this repo.
Thanks in advance.
Hi,
I'm trying to add ticker to the coinigy_api_rest.py without any luck.
Could someone help me, please.
Also the refresh_balances is producing the following error. Do you need to auth_id?
{'err_num': '1057-23-01', 'err_msg': 'Missing or empty parameters:'}
Thanks.
What is the difference between these three times in the web socket api response?
Ex.
{"market_history_id": 147534224867, "exchange": "BINA", "marketid": 0, "label": "XVG/ETH", "tradeid": "1869859", "time": "2018-01-15T17:11:26", "price": 0.00010021, "quantity": 2497, "total": 0.25022437, "timestamp": "2018-01-15T17:11:35Z", "time_local": "2018-01-15 17:11:26", "type": "BUY", "exchId": 0, "channel": "TRADE-BINA--XVG--ETH"}
Am I doing something wront? Or am I missing something?
I subscribe to a channel like this:
var scChannel = SCsocket.subscribe("MY PRIVATE CHANNEL ID");
Then I logout the response:
scChannel.watch(function (data) {
console.log(data);
}
this gives me:
{ MessageType: 'Favorite',
Data:
[ { exch_id: 7,
exch_code: 'BITF',
exch_name: 'Bitfinex',
mkt_id: 125,
exchmkt_id: 347,
display_name: 'BTC/USD',
mkt_name: 'BTC/USD',
primary_curr: 'USD',
base_curr: 'BTC',
last_price: 6487.7,
btc_volume_24: 25889.177,
volume_24: 25889.177,
percent_24: 0.0245274631 },
{ exch_id: 15,
exch_code: 'BTRX‘,
There I can see no timestamp.
If I subscribe to an orderbook, sometimes there is a timestamp, but most of the time there is not....
Does that make sense?
I used socketcluster-client nodejs .
I want to subcribe all markets, channels. But can't figure a good way to do this.
Can you suggest me about this - code lines ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.