plateadodev (OP)
Newbie
Offline
Activity: 14
Merit: 0
|
|
April 03, 2016, 06:38:44 AM Last edit: April 03, 2016, 06:54:15 AM by plateadodev |
|
Hi there, Today I started to work on a PHP class to use Poloniex API in a simple way (only public API by now). https://github.com/platedodev/Poloniex-API-for-PHPIt'll be finish in a week or two, hope you find it useful. If you've any idea or suggestion to share with me or would like me to develop something, let me know . Have a nice day.
|
|
|
|
|
tyz
Legendary
Offline
Activity: 3360
Merit: 1533
|
|
April 06, 2016, 11:28:59 AM |
|
Thanks for sharing! It is definetely very useful for programmers. From time to time, I develop scripts using a various exchanges. I add you Github resource to my favourites. When I gonna use it then I will give a feedback about the quality and possible improvements. Hi there, Today I started to work on a PHP class to use Poloniex API in a simple way (only public API by now). https://github.com/platedodev/Poloniex-API-for-PHPIt'll be finish in a week or two, hope you find it useful. If you've any idea or suggestion to share with me or would like me to develop something, let me know . Have a nice day.
|
|
|
|
Emerge
Legendary
Offline
Activity: 854
Merit: 1000
|
|
April 06, 2016, 11:33:07 AM |
|
Great work! I always support developers who work on using APIs Hope you continue development
|
|
|
|
petricag
|
|
February 06, 2017, 11:35:06 PM |
|
I don't seem to find a simple example about how to use all these classes you guys are publishing. A lot of code, and private and public, secret key ? wtf ? ... a lot of mambo jambo for someone that don't know oop and just want to use a simple function, to retrieve some info like
include(poloniexApi.php) $ethSellPrice = get_eth_sell_price() -> should return best sell price at the moment the function is called $ethBuyPrice = get_eth_buy_price() -> should return best buy price at the moment the function is called
Can anyone point me in the right direction, without having to learn all the OOP concept? I really needed for my simple page to track the profit of my small portfolio ... no bot trading, or anything fancy .. just refresh a page, these simple functions get the values, and are entered into calculation.
|
|
|
|
coinableS
Legendary
Offline
Activity: 1442
Merit: 1181
|
|
February 07, 2017, 05:21:17 AM |
|
I don't seem to find a simple example about how to use all these classes you guys are publishing. A lot of code, and private and public, secret key ? wtf ? ... a lot of mambo jambo for someone that don't know oop and just want to use a simple function, to retrieve some info like
include(poloniexApi.php) $ethSellPrice = get_eth_sell_price() -> should return best sell price at the moment the function is called $ethBuyPrice = get_eth_buy_price() -> should return best buy price at the moment the function is called
Can anyone point me in the right direction, without having to learn all the OOP concept? I really needed for my simple page to track the profit of my small portfolio ... no bot trading, or anything fancy .. just refresh a page, these simple functions get the values, and are entered into calculation.
OP is creating a library to be used with Polo. Libraries are always created with classes and functions. To use his library you would first save the Poloniex.php file to your server and then require it. Then instantiate the class with your Poloniex API key and API secret. You can have your API key and secret stored in a variable or just insert it in. $polo = new Poloniex($key, $secret); or $polo = new Poloniex("L5knblahblah", "5Xnrblahblah"); Then you can start using the different functions. One is returnTicker()You would use it by hitting the class ($polo) then the function $polo = new Poloniex($key, $secret); $ticker = $polo->returnTicker();
The in-code notation tells us this will come back as an array. So we can output it with var_dump or print_r $polo = new Poloniex($key, $secret); $ticker = $polo->returnTicker(); print_r($ticker);
Let's look at another one that includes a parameter, returnOrderBook()We can either enter in a currency pair or leave it blank to retrieve all. $polo = new Poloniex($key, $secret); $orderbook = $polo->returnOrderBook("ETHBTC"); print_r($orderbook);
or blank for all orderbooks $polo = new Poloniex($key, $secret); $orderbook = $polo->returnOrderBook(); print_r($orderbook);
Hope that helps. Keep going through the different public functions to see what's available.
|
|
|
|
petricag
|
|
February 07, 2017, 08:57:12 PM |
|
Thanks man I will give it a try and get back
|
|
|
|
petricag
|
|
February 07, 2017, 09:17:15 PM |
|
Yeap ... this is the key Thanks again $polo = new Poloniex("L5knblahblah", "5Xnrblahblah"); $ticker = $polo->returnTicker(); print_r($ticker['BTC_ETH']['lowestAsk']);
|
|
|
|
bitKaBoom
|
|
February 09, 2017, 04:47:53 AM |
|
Thanks, I will use it for my new profitable bot. Good job friend!
|
|
|
|
DreamSpace
|
|
February 11, 2017, 01:17:40 PM |
|
Great work, i will try it out. Just thought about it and here it is .
|
|
|
|
nemgun
|
|
February 12, 2017, 02:15:18 PM |
|
Nice work, i am also working on some libraries but only to querry prices and other informations from public API exchanges. Coinables is awesome, i learned a lot from his videos. I am also happy that for the first time some one used this $uri = file_get_contents('https://poloniex.com/public?command='.$command); Usually people calls Curl but it is like 4 or 5 lines of code, while file_get_contents is just one line, which is less time consuming especially if you have several calls to do, plus, a short code is a quick code.
|
|
|
|
coinableS
Legendary
Offline
Activity: 1442
Merit: 1181
|
|
February 12, 2017, 10:35:09 PM |
|
Nice work, i am also working on some libraries but only to querry prices and other informations from public API exchanges. Coinables is awesome, i learned a lot from his videos. I am also happy that for the first time some one used this $uri = file_get_contents('https://poloniex.com/public?command='.$command); Usually people calls Curl but it is like 4 or 5 lines of code, while file_get_contents is just one line, which is less time consuming especially if you have several calls to do, plus, a short code is a quick code. Thanks nemgun. Yea file_get_contents() is the quick and dirty way. cURL should be used for most production applications as it is more secure and is able to verify SSL certs.
|
|
|
|
nemgun
|
|
February 12, 2017, 11:22:51 PM |
|
Nice work, i am also working on some libraries but only to querry prices and other informations from public API exchanges. Coinables is awesome, i learned a lot from his videos. I am also happy that for the first time some one used this $uri = file_get_contents('https://poloniex.com/public?command='.$command); Usually people calls Curl but it is like 4 or 5 lines of code, while file_get_contents is just one line, which is less time consuming especially if you have several calls to do, plus, a short code is a quick code. Thanks nemgun. Yea file_get_contents() is the quick and dirty way. cURL should be used for most production applications as it is more secure and is able to verify SSL certs. Yes, but i think that all of these are going to be deprecated soon, nodejs and other langueages will soon kick PHP off the scene. If someone wants to have an idea about security, just try to do it usin ajax requests in javascript console. you won't be able to do it unless you are on an empty tab because of the security locks, this means that file_get_contents isn't compliant, but it is still handy for tutorials, if you want to use for production, just amend the library.
|
|
|
|
|
amGigolo
|
|
March 04, 2017, 11:29:47 PM |
|
I was looking into this and the api but i cant see to find does this send back any alerts on confirmations of a deposit etc?
|
|
|
|
numismatist
Legendary
Offline
Activity: 1245
Merit: 1004
|
|
March 06, 2017, 02:30:35 AM |
|
Yeap ... this is the key Thanks again $polo = new Poloniex("L5knblahblah", "5Xnrblahblah"); $ticker = $polo->returnTicker(); print_r($ticker['BTC_ETH']['lowestAsk']);
Looks like this ticker is real time data. What would interest me is the product of some historical data on a graph plot, like XMRBTC * BTC_USDT to observe the Monero value moving over time. This is tradeable when you can differentiate cheap vs. expensive and if currently following along Bitcoin or against it.
|
|
|
|
nemgun
|
|
March 06, 2017, 02:01:16 PM |
|
Yeap ... this is the key Thanks again $polo = new Poloniex("L5knblahblah", "5Xnrblahblah"); $ticker = $polo->returnTicker(); print_r($ticker['BTC_ETH']['lowestAsk']);
Looks like this ticker is real time data. What would interest me is the product of some historical data on a graph plot, like XMRBTC * BTC_USDT to observe the Monero value moving over time. This is tradeable when you can differentiate cheap vs. expensive and if currently following along Bitcoin or against it. Interesting indeed, i would like to see the result when done. https://poloniex.com/public?command=returnChartData¤cyPair=BTC_XMRhttps://poloniex.com/public?command=returnChartData¤cyPair=USDT_BTCDo this : $polo = new Poloniex("L5knblahblah", "5Xnrblahblah"); $XMR = "BTC_XMR",$USDT="USDT_BTC"; $XMRh = $polo->returnCharData($XMR, 1405699200, 9999999999, 14400); // the other values are taken from poloniex api documentation $USDTh= $polo->returnChartData($USDT, 1405699200, 9999999999, 14400); $Info = [$XMRh, $USDTh]; echo(json_encode($Info));
You can write this in a info.php page, and then call it with ajax in annother page to read the data from, you could then process them in a highcharts or charts.js object to display the chart.
|
|
|
|
freemanjackal
|
|
March 18, 2017, 08:17:21 PM |
|
what you posted isnt working, and it is just showing information that should not be public cause can be used by any atacker to harm or shut down your site
|
|
|
|
Rotsor
Full Member
Offline
Activity: 309
Merit: 102
Presale is live!
|
|
March 19, 2017, 09:58:10 AM |
|
what you posted isnt working, and it is just showing information that should not be public cause can be used by any atacker to harm or shut down your site
It's a spam. See how old is the OG post.
|
|
|
|
nemgun
|
|
March 19, 2017, 10:01:10 AM |
|
what you posted isnt working, and it is just showing information that should not be public cause can be used by any atacker to harm or shut down your site
It's a spam. See how old is the OG post. He is talking about nickelbot i think, because the library itself will work unless poloniex changes their methods, even if so, one can just change it and it will work again, i made a library for poloniex but without Private API support, i had a look at it, and the one provided here is correct, so it will work. If this one doesn't suits you, you can use the Poloniex-node-api.
|
|
|
|
|