Web Content Display Web Content Display

Breadcrumb Breadcrumb

Digital Solutions Blogs


Data Acquisition using API2Cart

Payas Tikotekar
Posted 6/12/15


We here at Dunn Solutions are building a Recommendation Engine. The Recommendation Engine will highlight products that a customer may wish to purchase, thus benefiting both the customer and the e-commerce vendor. It involves a close collaboration between the Application Development Group and the Business Intelligence Group, here at Dunn Solutions.

This post documents the preliminary phase of data acquisition for the project. API2Cart was used to acquire data from Big-Commerce. The data was then cleaned, stored and aggregated into a MySQL De-normalized table. 


API2Cart provides a unified interface to interact with more than 30 shopping cart platforms. The interface allows the user to read data from and write data to the supported shopping cart platform.

Connecting API2Cart to Big-Commerce

Create an API2Cart account here. Once an account is created an API Key will be generated. This along with the Store Key (sample generation below) will be needed to interact with API2Cart.

The API2Cart website has a Store List web page which allows a signed user to add a store. In the case of Big-Commerce, the following details are required as shown – 

These details can be obtained from your Big-Commerce account, API settings.

Once the correct details are entered, API2Cart generates a Store Key.

Using API2Cart with Java –

API2Cart supports PHP, Java and C# as programming languages which can connect to it. In this example we use Java.

To create a connection to API2Cart, use the above Store Key and API Key to build an HTTP GET request which is sent to this URL -  https://api.api2cart.com/v1.0/.

Once a connection is made, a user can use the Request variable to make subsequent calls to API2Cart. API2Cart supports a set of methods which can be called to get or set the following entities –

  1. Cart ( Methods deal with the creation, deletion and information retrieval of shopping carts )
  2. Product ( Methods deal with the actual products in the e-commerce platform )
  3. Category ( Methods deal with the categories of products )
  4. Order ( Methods deal with the actual orders placed by the customers )
  5. Customer ( Methods deal with the reading and writing of customer methods )

API2Cart Method Examples

Let’s look at the methods provided by API2Cart for the entity Order –

  • order.count returns the total number of orders present in the e-commerce platform
  • order.list returns a list of orders
  • order.info returns all the information about a particular order
  • order.add and order.update are used to set some order information on the e-commerce platform

Using these methods, a user can extract all the information pertaining to a particular product. Additionally, updates can be made to the e-commerce platform.

API2Cart Response

Once the request is processed by API2Cart a response is generated either in XML or JSON depending on user preference. For our example we will use JSON. The JSON object can be manipulated to store into a database of choice. Following is a sample JSON response from API2Cart for the method order.count

Final Data Acquisition Step

Once the data is obtained from API2Cart using the above methodology, it is cleaned. This process involves keeping the fields needed and storing them into useful data structures for further processing. The data obtained from this step can be used as an input to data mining and predictive analytics algorithms. The results from these can then be sent back to the e-commerce platform using API2Cart once again.

In this way API2Cart can be used to obtain and manipulate data from many different e-commerce platforms.

In conclusion following are some of the merits and demerits of API2Cart


  • Ability to work with many different e-commerce platforms using the same interface
  • Ease of setup and use
  • Support for Java, PHP and C#
  • Response can be generated either in JSON or XML
  • Excellent customer service


  • Large requests take a long time to return
  • For the .list methods, only a maximum of 200 entities can be fetched with a single request
  • At the time of writing, the documentation on the website was incomplete for Java and C#