An example Spark API application that shows the 10 most recently updated listings for a user. Includes the OAuth 2 flow prior to retrieving user data.
Switch branches/tags
Nothing to show
Clone or download
joshcom Merge pull request #5 from dgmyrek/master
Updated to latest version of sparkapip4p2 client.
Latest commit d81e0f7 Aug 13, 2014

Spark API 15 Minute Application

A simple "10 most recently updated listings" web app built on Spark API. This project is intended for educational purposes, rather than production deployment.


  • Basic understanding of PHP.
  • A web server that can run PHP scripts (e.g. Apache + mod_php)
  • A Spark API key (get one here:
  • cURL for PHP (required by the sparkapi4p2 library).

This application uses sparkapi4p2, available here: For simplicity, this API client is packaged in with the example application.


NOTE: This application will NOT work with a Spark API Auth key.

In order for this example application to function, you'll need to supply your Client Key, Client Secret, and Client Redirect URI in sparkle_functions.php:

$GLOBALS['client_id']     = "<YOUR OAUTH2 CLIENT KEY>";

$GLOBALS['client_secret'] = "<YOUR OAUTH2 CLIENT SECRET>";

$GLOBALS['redirect_uri']  = "<THE URL TO callback.php>";

From there, visit index.php on your web server to see the application in action.