Skip to content

Spark API Code Sample In Java

This Sample project is built with Java 8 + Maven.

Apache HttpClient and Gson are used to simplify the codebase.


An OAuth2 client is required.

Please refer to if you don't have any.


  1. Set environment variables: SPARK_CLIENT_ID and SPARK_CLIENT_SECRET
  2. Simply run the main method in SparkAPISampleApp, or mvn compile exec:java -Dexec.mainClass="com.sparkcommodities.api.SparkAPISampleApp"