1

I am interested in writing some basic php to interface with the Poloniex push api.

Their website provides the following info: https://poloniex.com/support/api/

A php wrapper can be found here: http://pastebin.com/iuezwGRZ

From what i can determine there are three APIs being push, public and trading. The public and trading APIs provide functions that can be passed parameters etc. The push api stumps me totally as i cannot determine how it works.

The first link above states the API pushes live data and different feeds can be subscribed to.

My questions are: A) How can php receive a live stream of data? B) How do i subscribe to a feed?

I may have misunderstood the oush api and my apologies in advance if this is the case.

Edit1: I believe i need a WAMP client to connect to a WAMP router such as Minion. https://github.com/Vinelab/minion

Edit2: Node.js example http://pastebin.com/dMX7mZE0

Dercni
  • 1,216
  • 3
  • 18
  • 38

1 Answers1

1

The push API is based on Websocket protocol.

Initially you need first to make a connection to the websocket server,

after that you need to register to a data stream (price update stream for example), after that as soon as the server make an update to something (a price ), all connected clients who where previously registred to it will synchronously received the updated price

Finally you got the last price without the need of doublecheck at regular interval if the price has changed

A. STEFANI
  • 6,707
  • 1
  • 23
  • 48