Running the PHP Examples

Updated on Thursday, 19 July, 2012 - 14:23

Download the PHP Client Library

Download a copy of the library from our GitHub PHP page. There are two ways to do this.

  • In Github, click Download and extract the archive manually
  • Use git from the command line:

    git clone https://www.github.com/datasift/datasift-php.git

Learn to Use the PHP Client Library

These steps test the REST API (api.datasift.com) and then the streaming API (stream.datasift.com).

Endpoint Supported?
http://api.datasift.com/validate Yes
http://api.datasift.com/compile Yes
http://api.datasift.com/stream Yes
http://api.datasift.com/dpu Yes
http://stream.datasift.com/usage Yes
http://stream.datasift.com Yes
ws://websocket.datasift.com No *

* Note that there are two endpoints for the streaming API:

  • stream.datasift.com for HTTP access
  • websocket.datasift.com for WS access

The DataSift client libraries use HTTP streaming by default for most languages. There is no technical restriction on hitting the websockets API endpoint. The choice of protocol makes no difference to the data objects that are returned.