JavaScript API
Updated on April 25th, 2008
Our JavaScript API returns variables in JSON format. This allows you to use fancy pants Ajax in your store, or integrate with external widgets and sites.
API Classes
The easiest way to use our JavaScript API is with our pre-made classes. Simply include the api.js file in your layout or page and you’re ready to roll. Prototype 1.6.0+ is required, so be sure that is included first. This can be all done with the theme_js_url filter.
<script src="{{ 'prototype' | theme_js_url }}" type="text/javascript"></script>
<script src="{{ 'api' | theme_js_url }}" type="text/javascript"></script>Now that you’ve got the file included, you have access to a few helpful classes:
Custom Use
You can use the JavaScript API to access certain variables by accessing different URLs in your store and adding a .js to the end. Ex: http://mystore.bigcartel.com/products.js
- Store
-
Returns store info.
http://mystore.bigcartel.com/store.js
- Products
-
Returns a list of products from any products, category, or artists page.
Examples: http://mystore.bigcartel.com/products.js http://mystore.bigcartel.com/category/tees.js
- Product
-
Returns a specific product.
Examples: http://mystore.bigcartel.com/product/my-tee.js http://mystore.bigcartel.com/product/new-cd.js
- Cart
-
Returns the current cart.
http://mystore.bigcartel.com/cart.js
- Page
-
Returns a info on any custom page.
Examples: http://mystore.bigcartel.com/faq.js http://mystore.bigcartel.com/about-us.js
