E-junkie Products API
E-junkie has a Products API you can use to query for a JSON array of basic product details from our database, such as the item name and number, current price, image(s) (if uploaded), description (if provided for the seller's E-junkie Shop page), etc. This API is also used by our optional Templating Engine if you wish to use that to generate your site content.
The examples below use placeholders for specific details; the seller's E-junkie Client ID and API key can be found via the Products API link in the left-hand sidebar menu of the seller's E-junkie Dashboard, and product details would of course be provided in the API response.
XXXXXX
would be the product's Item Number—may differ from the static Item ID if the seller enters a custom Item Number, which is also used in purchase link URLs;YYYYYY
would be the seller's E-junkie Client ID;0123456789abcdef0123456789abcdef
would be the seller's 32-byte hexadecimal API Key.
TIP: You can use the XXXXXX
and YYYYYY
strings to dynamically generate purchase links in your site; see further tips here.
E-junkie Products API query examples:
cURL:
curl -X POST 'https://api.e-junkie.com/api/YYYYYY/?page=1' -F key=0123456789abcdef0123456789abcdef
PHP:
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.e-junkie.com/api/YYYYYY/?page=1'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('key' => '0123456789abcdef0123456789abcdef'))); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $server_output = curl_exec ($ch); curl_close ($ch); echo $server_output; ?>
Node.js:
var request = require('request'); var options = { method: 'POST', url: 'https://api.e-junkie.com/api/YYYYYY', qs: { page: '1' }, body:require('querystring').stringify({'key': '0123456789abcdef0123456789abcdef'}), headers: { 'Content-Type': 'application/x-www-form-urlencoded', } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Ruby:
require 'uri' require 'net/http' url = URI('https://api.e-junkie.com/api/YYYYYY/?page=1') http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Post.new(url) request.body = 'key=0123456789abcdef0123456789abcdef' response = http.request(request) puts response.read_body
Python:
import http.client conn = http.client.HTTPSConnection('api.e-junkie.com') payload = 'key=0123456789abcdef0123456789abcdef' headers = { 'Content-Type' : 'application/x-www-form-urlencoded' } conn.request('POST', '/api/YYYYYY/?page=1', payload, headers) res = conn.getresponse() data = res.read() print(data.decode('utf-8'))
Example JSON array returned by API:
The following key names typically match the corresponding field/input names in E-junkie Dashboard product settings, which you can discover in browser devtools. Comments // like this
added here for clarification.
{ "totalCount": 1, "size": 30, "page": 1, "totalPages": 1, "products": [ { "id": "XXXXXX", "name": "Item Name Here", "number": "XXXXXX", // may differ from 'id' "needs_options": "false", // Variations describing item options "needs_advance_options": "false", // Variants affecting item SKU/price/weight/stock "option1": null, "option2": null, "option3": null, "option1_options": null, "option2_options": null, "option3_options": null, "price": "0.00", "on0": null, "on0_options": "", "on1": null, "on1_options": "", "on2": null, "on2_options": "", "variable_pricing": false, "suggested_amount": "0.00", // for Let Buyer Edit Price "out_of_stock": false, "currency": "USD", "description": "Brief description here", "details": "Detailed description here, may have multiple lines", "image": "https://s3.amazonaws.com/static.e-junkie.com/ej/media/content/ZZZZZZ.jpg", "thumbnail": "https://s3.amazonaws.com/static.e-junkie.com/products/thumbnails/XXXXXX.jpg", "tagline": "Slogan goes here", "download_link": "http://", // seller-hosted sample file, not E-junkie delivered "homepage_link": "http://example.com", "purchased": 1024, "tags": [ "This", "That", "Other", null, null ], "item_expiry": null, "aff_perc": "0.00", "file_size": "1234567890", // Bytes of uploaded file for delivery "source_country": "", "needs_download": "true", "needs_keygen": "false", // Send Codes: Generated "product_extension": ".pdf", // of uploaded file for delivery "needs_exhaust_password": "false", // Send Codes: Stored "needs_multiple": "false", // Bundle Other Products "sub_items": [ { "option1_value": "", "option2_value": "", "option3_value": "", "price": "0.00" } ], "images": [ "https://s3.amazonaws.com/static.e-junkie.com/products/images/XXXXXX-1.jpg", "https://s3.amazonaws.com/static.e-junkie.com/products/images/XXXXXX-2.jpg", "https://s3.amazonaws.com/static.e-junkie.com/products/images/XXXXXX-3.jpg", null, null ] } ], "response": { "code": "200", "status": "Success" } }