Pages:
Author

Topic: Poloniex API for PHP - page 2. (Read 11228 times)

full member
Activity: 210
Merit: 100
February 07, 2017, 04:17:15 PM
#8
Yeap ... this is the key Smiley
Thanks again

Code:

$polo = new Poloniex("L5knblahblah", "5Xnrblahblah");
$ticker = $polo->returnTicker();
print_r($ticker['BTC_ETH']['lowestAsk']);

full member
Activity: 210
Merit: 100
February 07, 2017, 03:57:12 PM
#7
Thanks man
I will give it a try and get back
legendary
Activity: 1442
Merit: 1186
February 07, 2017, 12:21:17 AM
#6
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.

Code:
require("Poloniex.php");

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.

Code:
$polo = new Poloniex($key, $secret);
or
Code:
$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

Code:
$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

Code:
$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.

Code:
$polo = new Poloniex($key, $secret);
$orderbook = $polo->returnOrderBook("ETHBTC");
print_r($orderbook);
or blank for all orderbooks
Code:
$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.
full member
Activity: 210
Merit: 100
February 06, 2017, 06:35:06 PM
#5
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.  
legendary
Activity: 854
Merit: 1000
April 06, 2016, 06:33:07 AM
#4
Great work! I always support developers who work on using APIs Smiley Hope you continue development
tyz
legendary
Activity: 3360
Merit: 1533
April 06, 2016, 06:28:59 AM
#3
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-PHP
It'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 Smiley.
Have a nice day.
full member
Activity: 145
Merit: 112
To the moon!
April 05, 2016, 02:38:37 AM
#2
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-PHP
It'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 Smiley.
Have a nice day.

Check out NickelBot. There is an API and Adapter that cover Poloniex: https://github.com/AdamCox9/nickelbot/tree/master/adapters/poloniex

I'm looking for developers to help build some custom bots: https://github.com/AdamCox9/nickelbot/tree/master/bots

You can see the sample website up and running at http://www.nickelbot.com/
newbie
Activity: 14
Merit: 0
April 03, 2016, 01:38:44 AM
#1
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-PHP
It'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 Smiley.
Have a nice day.
Pages:
Jump to: