Introduction
Welcome to the PriceYuge API ! You can get the information on how to access the PriceYuge API platform here. Using this API, the developer can build an end to end price comparison app. Build the next gen app and start affiliate revenue from the sales.
You can view code examples in the dark area to the right; switch the programming language of the examples with the tabs in the top right.
Note: The free accounts will have the store URL with the affiliate ID mapped with priceyuge's default ID for a couple of stores. Premium uses can setup there own affiliate ID.
Authentication
Make sure to replace
YOUR_API_KEY
with your API key.
PriceYuge uses API keys to allow access to the API. You can register a new API key at our developer portal.
PriceYuge expects the API key to be included in all API requests to the server as a query parameter that looks like the following:
api_key=YOUR_API_KEY
Endpoint
HTTP Request Endpoint
All the requests to the PriceYuge API should be send to the below endpoint.
GET https://price-api.datayuge.com
Request Path
The path includes the API version. Please make sure to use the latest API version in your apps.
GET /api/{api_version}/
Note The current API version is v1
Support both HTTP
& HTTPS
. All request url should be send to
For Price Comparison API -
https://price-api.datayuge.com/api/v1/compare/
For Coupons & Deals API -
https://price-api.datayuge.com/api/v1/offers/
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is a mandatory parameter. It is required to access the API. |
Price Comparison API
List Categories
curl --request GET \
--url 'https://price-api.datayuge.com/api/v1/compare/list/categories?api_key=API_KEY&page=1' \
--header 'content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://price-api.datayuge.com/api/v1/compare/list/categories?api_key=API_KEY&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://price-api.datayuge.com/api/v1/compare/list/categories"
querystring = {"api_key":"API_KEY","page":"1"}
headers = {'content-type': 'application/json'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://price-api.datayuge.com/api/v1/compare/list/categories?api_key=API_KEY&page=1",
"method": "GET",
"headers": {
"content-type": "application/json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Use this endpoint to get all the categories and subcategories. This can be used to build the app structure.
The API returns JSON structured like this:
{
"current_page": 1,
"data": [
{
"id": 1,
"category": "mobile",
"category_name": "Mobile, Tablets & Accessories",
"sub_category": "mobile-accessories",
"sub_category_name": "Mobile Accessories",
"child_category": "power-banks",
"child_category_name": "Power Banks",
"child_property": null,
"can_compare": 1,
"created_at": "2017-07-14 07:48:06",
"updated_at": "2017-07-14 07:48:06"
},
],
"from": 1,
"last_page": 38,
"next_page_url": "https://price-api.datayuge.com/api/v1/compare/list/categories?page=2",
"path": "https://price-api.datayuge.com/api/v1/compare/list/categories",
"per_page": 15,
"prev_page_url": null,
"to": 15,
"total": 568
}
HTTP Request
GET /list/categories
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
page | optional | Pass this parameter for pagination. |
Search Product
curl --request GET \
--url 'https://price-api.datayuge.com/api/v1/compare/search?api_key=API_KEY&product=Iphone&filter=brand%3Aapple&price_start=20000&price_end=30000&page=1' \
--header 'content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://price-api.datayuge.com/api/v1/compare/search?api_key=API_KEY&product=Iphone&filter=brand%3Aapple&price_start=20000&price_end=30000&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://price-api.datayuge.com/api/v1/compare/search"
querystring = {"api_key":"API_KEY","product":"Iphone","filter":"brand:apple","price_start":"20000","price_end":"30000","page":"1"}
headers = {'content-type': 'application/json'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://price-api.datayuge.com/api/v1/compare/search?api_key=API_KEY&product=Iphone&filter=brand%3Aapple&price_start=20000&price_end=30000&page=1",
"method": "GET",
"headers": {
"content-type": "application/json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
This endpoint is used to search the product from the stores.
The API returns JSON structured like this:
{
"data": [
{
"product_title": "Apple iPhone 6 32GB",
"can_compare": true,
"product_lowest_price": 26490,
"product_link": "https://price-api.datayuge.com/api/v1/compare/detail?id=ZToxMjIyNA",
"product_id": "ZToxMjIyNA",
"product_category": "mobile",
"product_sub_category": "mobile",
"product_image": "http://images-api.datayuge.in/image/MTIyMjQtMjYtMQ.jpg"
},
{
"product_title": "Apple iPhone 6",
"can_compare": true,
"product_lowest_price": 27990,
"product_link": "https://price-api.datayuge.com/api/v1/compare/detail?id=ZTo0MzQw",
"product_id": "ZTo0MzQw",
"product_category": "mobile",
"product_sub_category": "mobile",
"product_image": "http://images-api.datayuge.in/image/NDM0MC01Mi0x.jpg"
},
],
"meta": {
"items": 1392,
"filters": [
{
"price": {
"min": 39,
"max": 50500
}
},
{
"brand": [
{
"name": "Exilient",
"property": "brand:exilient",
"doc_count": 17
},
]
}
]
}
}
HTTP Request
GET /search
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
product | required | Enter the product you are trying to search. Eg: Iphone 6. Note: The parameter should be encoded. |
page | optional | Pass this parameter for pagination. |
filter | optional | Pass the filter parameter value here Ex. brand:hp. For multiple brands, separate by pipe "|" Ex. brand:hp|brand:kingston |
price_start | optional | Pass this value to filter by price. Note: The price_start value should be equal or greater than min value in the API meta response. |
price_end | optional | Pass this value to filter by price. Note: The price_start value should be equal or lesser than max value in the API meta response. |
Product Detail
curl --request GET \
--url 'https://price-api.datayuge.com/api/v1/compare/detail?api_key=API_KEY&id=ZToxMjIyNA' \
--header 'content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://price-api.datayuge.com/api/v1/compare/detail?api_key=API_KEY&id=ZToxMjIyNA",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://price-api.datayuge.com/api/v1/compare/detail"
querystring = {"api_key":"API_KEY","id":"ZToxMjIyNA"}
headers = {'content-type': 'application/json'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://price-api.datayuge.com/api/v1/compare/detail?api_key=API_KEY&id=ZToxMjIyNA",
"method": "GET",
"headers": {
"content-type": "application/json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
This resource will the detailed about the product. It may include the basic product details, images, colour options and pricing from different stores.
The API will show the prices and details from various stores and may/may not be the real time prices. The prices are mostly updated once in a day to decrease the load on respective e-Commerce store. Hence if the store is refreshing the price multiple times in a day, it may not be reflected immediately.
The API here returns the base URL of the respective stores. For free users, the base URL for a couple of sites won’t be available. Premium users can configure there affiliate parameters in the dashboard.
For fashion and apparels, the API returns a listing of the product since these can’t be compared.
Note: The response for fashion items is different from comparable items. Please see the output for non-comparable items.
The API returns JSON structured like this:
{
"data": {
"product_name": "Apple iPhone 6 32GB",
"product_model": "iPhone 6 32GB",
"product_brand": "Apple",
"product_id": "ZToxMjIyNA",
"product_ratings": "4.2",
"product_category": "mobile",
"product_sub_category": "mobile",
"is_available": true,
"available_colors": [
"All Colours",
"Gold",
"Grey",
"Silver"
],
"product_images": [
"http://images-api.datayuge.in/image/MTIyMjQtMjYtMQ.jpg",
"http://images-api.datayuge.in/image/MTIyMjQtMjYtMg.jpg",
"http://images-api.datayuge.in/image/MTIyMjQtMjYtMw.jpg",
"http://images-api.datayuge.in/image/MTIyMjQtMjYtNA.jpg"
],
"is_comparable": true,
"spec_available": true,
"review_available": true,
"stores": [
{
"amazon": {
"product_store": "Amazon.in",
"product_store_logo": "http://c223968.r68.cf1.rackcdn.com/amazon_store.png",
"product_store_url": "https://price-api.datayuge.com/redirect?id=aHR0cDovL3d3dy5hbWF6b24uaW4vZ3Avb2ZmZXItbGlzdGluZy9CMDFOQ040SUNPLz9zb3J0PXByaWNl",
"product_price": "28490",
"product_offer": "",
"product_color": "grey",
"product_delivery": "2-4",
"product_delivery_cost": "0",
"is_emi": "1",
"is_cod": "1",
"return_time": "10 Days"
}
},
{
"flipkart": {
"product_store": "Flipkart",
"product_store_logo": "http://c223968.r68.cf1.rackcdn.com/flipkart_store.png",
"product_store_url": "https://price-api.datayuge.com/redirect?id=aHR0cHM6Ly9kbC5mbGlwa2FydC5jb20vZGwvYXBwbGUtaXBob25lLTYtc3BhY2UtZ3JleS0zMi1nYi9wL2l0bWV0bWgzaGZobnh0Y2o_cGlkPU1PQkVUTUgzWllORFBWVkM",
"product_price": "28999",
"product_offer": "Extra 5% off* on Axis Bank Buzz Credit Cards",
"product_color": "grey",
"product_delivery": "3-5",
"product_delivery_cost": "0",
"is_emi": "1",
"is_cod": "1",
"return_time": "10 Days"
}
},
{
"snapdeal": []
},
{
"ebay": {
"product_store": "eBay",
"product_store_logo": "http://c223968.r68.cf1.rackcdn.com/ebay_store.png",
"product_store_url": "http://www.ebay.in/itm/Apple-India-Warranty-iPhone-6-32GB-1GB-4-7-8MP-1-2MP-SpaceGrey-/132137594925",
"product_price": "29499",
"product_offer": "",
"product_color": "grey",
"product_delivery": "3-5",
"product_delivery_cost": "0",
"is_emi": "1",
"is_cod": "0",
"return_time": "30 days"
}
},
{
"paytm": []
},
{
"croma": {
"product_store": "Croma Retail",
"product_store_logo": "http://c223968.r68.cf1.rackcdn.com/croma_store.png",
"product_store_url": "http://www.croma.com//apple-iphone-6-space-grey-32gb-/p/202452",
"product_price": "27999",
"product_offer": "",
"product_color": "grey",
"product_delivery": "5-7",
"product_delivery_cost": "0",
"is_emi": "1",
"is_cod": "1",
"return_time": "15 days"
}
},
{
"yebhi": []
},
{
"indiatimes": []
},
{
"homeshop18": []
},
{
"naaptol": []
},
{
"infibeam": {
"product_store": "Infibeam",
"product_store_logo": "http://c223968.r68.cf1.rackcdn.com/infibeam_store.png",
"product_store_url": "https://price-api.datayuge.com/redirect?id=aHR0cHM6Ly93d3cuaW5maWJlYW0uY29tL01vYmlsZXMvYXBwbGUtaXBob25lLTYvUC1tb2JpLTM3ODc1MzA5MzM3LWNhdC16Lmh0bWwjdmFyaWFudElkPVAtbW9iaS0yMTk2OTg4NDM0Ng",
"product_price": "28095",
"product_offer": "",
"product_color": "grey",
"product_delivery": "2-3",
"product_delivery_cost": "0",
"is_emi": "1",
"is_cod": "0",
"return_time": "3 days"
}
},
{
"tatacliq": {
"product_store": "Tata CliQ",
"product_store_logo": "http://c223968.r68.cf1.rackcdn.com/tatacliq_store.png",
"product_store_url": "https://www.tatacliq.com/apple-iphone-6-32gb-space-grey/p-mp000000001306324",
"product_price": "27999",
"product_offer": "",
"product_color": "grey",
"product_delivery": "4-5",
"product_delivery_cost": "0",
"is_emi": "1",
"is_cod": "1",
"return_time": ""
}
},
{
"shopclues": {
"product_store": "Shopclues",
"product_store_logo": "http://c223968.r68.cf1.rackcdn.com/shopclues_store.png",
"product_store_url": "http://www.shopclues.com/apple-iphone-6-32gb-p-114982165.html",
"product_price": "29499",
"product_offer": "5% Instant Discount on State Bank Debit & Credit Cards T&C 10% SuperCash on Mobikwik | Max Cashback Rs.300 T&C ",
"product_color": "",
"product_delivery": "7-9",
"product_delivery_cost": "0",
"is_emi": "1",
"is_cod": "0",
"return_time": "10 days"
}
}
]
}
}
HTTP Request
GET /detail
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
id | required | The custom PriceYuge product ID. Eg. ZToxMjIyNA |
Product Specs
curl --request GET \
--url 'https://price-api.datayuge.com/api/v1/compare/specs?api_key=API_KEY&id=ZToxMjIyNA' \
--header 'content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://price-api.datayuge.com/api/v1/compare/specs?api_key=API_KEY&id=ZToxMjIyNA",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://price-api.datayuge.com/api/v1/compare/specs"
querystring = {"api_key":"API_KEY","id":"ZToxMjIyNA"}
headers = {'content-type': 'application/json'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://price-api.datayuge.com/api/v1/compare/specs?api_key=API_KEY&id=ZToxMjIyNA",
"method": "GET",
"headers": {
"content-type": "application/json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
This resource will get you the product’s detailed specifications if available. Note that the specifications are available for only comparable products. Else the specification will return a default error message.
The API returns JSON structured like this:
{
"data": {
"main_specs": [
"4.7 inch Screen",
"Single SIM",
"8 MP Camera",
"iOS 8 OS",
"1 GB RAM",
"32 GB ROM",
"GSM Phone"
],
"sub_specs": {
"Design and Build": [
{
"spec_key": "Dimensions",
"spec_value": "5.4x2.6x0.2 inches"
},
{
"spec_key": "Weight",
"spec_value": "129 grams"
}
],
"Software": [
{
"spec_key": "Operating System",
"spec_value": "iOS 8"
}
],
"Display": [
{
"spec_key": "Size (in inches)",
"spec_value": "4.7"
},
{
"spec_key": "Resolution",
"spec_value": "750x1334 pixels"
},
{
"spec_key": "Pixel Density",
"spec_value": "326 pixels per inch (ppi)"
},
{
"spec_key": "Display Type",
"spec_value": "IPS LCD"
},
{
"spec_key": "Touchscreen type",
"spec_value": "Capacitive"
},
{
"spec_key": "Color Reproduction",
"spec_value": "16M Colors"
},
{
"spec_key": "Protection",
"spec_value": "Ion-Strengthened Glass"
},
{
"spec_key": "Screen to body percentage",
"spec_value": "65.8 %"
}
],
"Camera": [
{
"spec_key": "Rear Flash",
"spec_value": "Yes, Dual LED"
},
{
"spec_key": "Selfie Flash",
"spec_value": "No"
},
{
"spec_key": "Primary ",
"spec_value": "8 M.Pixels"
},
{
"spec_key": "Front",
"spec_value": "1.2 M.Pixels"
},
{
"spec_key": "Video ",
"spec_value": "1080p@60fps, 720p@240fps"
}
],
"Storage": [
{
"spec_key": "Internal",
"spec_value": "32GB"
},
{
"spec_key": "RAM",
"spec_value": "1GB"
},
{
"spec_key": "Expandable",
"spec_value": "No"
}
],
"Battery": [
{
"spec_key": "Capacity",
"spec_value": "1810 mAh"
},
{
"spec_key": "Type",
"spec_value": "Li-Po"
},
{
"spec_key": "Talk Time",
"spec_value": "14 hrs (3G)"
},
{
"spec_key": "Standby Time",
"spec_value": "250 hrs (3G)"
},
{
"spec_key": "Turbo Charge",
"spec_value": "No"
}
],
"Connectivity": [
{
"spec_key": "USB",
"spec_value": "v2.0"
},
{
"spec_key": "Voice Over LTE (VoLTE)",
"spec_value": "Yes"
},
{
"spec_key": "2G",
"spec_value": "Yes"
},
{
"spec_key": "3G",
"spec_value": "Yes"
},
{
"spec_key": "4G",
"spec_value": "Yes"
},
{
"spec_key": "SIM Configuration",
"spec_value": "Single SIM (Nano SIM)"
},
{
"spec_key": "Wi-Fi",
"spec_value": "Yes with dual-band, hotspot"
},
{
"spec_key": "Bluetooth",
"spec_value": "v4.0 with A2DP"
},
{
"spec_key": "GPS",
"spec_value": "Yes"
},
{
"spec_key": "NFC Chipset",
"spec_value": "Yes"
},
{
"spec_key": "Infrared",
"spec_value": "No"
}
],
"Processor": [
{
"spec_key": "Variant",
"spec_value": "A8"
},
{
"spec_key": "Architecture",
"spec_value": "Typhoon"
},
{
"spec_key": "No of Cores",
"spec_value": "2 (Dual Core)"
},
{
"spec_key": "Frequency",
"spec_value": "1.4 GHz"
},
{
"spec_key": "Make",
"spec_value": "Apple"
},
{
"spec_key": "GPU",
"spec_value": "PowerVR GX6450"
}
],
"Sensors": [
{
"spec_key": "Proximity",
"spec_value": "Yes"
},
{
"spec_key": "Accelerometer",
"spec_value": "Yes"
},
{
"spec_key": "Gyroscope",
"spec_value": "Yes"
},
{
"spec_key": "Ambient Light",
"spec_value": "Yes"
},
{
"spec_key": "Fingerprint sensor",
"spec_value": "Yes"
}
],
"Sound": [
{
"spec_key": "Loudspeaker",
"spec_value": "Yes"
},
{
"spec_key": "Headphones",
"spec_value": "Yes"
}
]
}
}
}
HTTP Request
GET /specs
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
id | required | The custom PriceYuge product ID. Eg. ZToxMjIyNA |
Product Images
curl --request GET \
--url 'https://price-api.datayuge.com/api/v1/compare/images?api_key=API_KEY&id=ZToxMjIyNA' \
--header 'content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://price-api.datayuge.com/api/v1/compare/images?api_key=API_KEY&id=ZToxMjIyNA",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://price-api.datayuge.com/api/v1/compare/images"
querystring = {"api_key":"API_KEY","id":"ZToxMjIyNA"}
headers = {'content-type': 'application/json'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://price-api.datayuge.com/api/v1/compare/images?api_key=API_KEY&id=ZToxMjIyNA",
"method": "GET",
"headers": {
"content-type": "application/json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
This resource will get you the product’s images in various sizes.
The API returns JSON structured like this:
{
"images": {
"large": [
"http://images-api.datayuge.in/image/large-MTIyMjQtMjYtMQ.jpg",
"http://images-api.datayuge.in/image/large-MTIyMjQtMjYtMg.jpg",
"http://images-api.datayuge.in/image/large-MTIyMjQtMjYtMw.jpg",
"http://images-api.datayuge.in/image/large-MTIyMjQtMjYtNA.jpg"
],
"medium": "http://images-api.datayuge.in/image/med-MTIyMjQtMjYtNA.jpg",
"thumb": "http://images-api.datayuge.in/image/thumb-MTIyMjQtMjYtNA.jpg"
}
}
HTTP Request
GET /images
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
id | required | The custom PriceYuge product ID. Eg. ZToxMjIyNA |
Product Prices
curl --request GET \
--url 'https://price-api.datayuge.com/api/v1/compare/price?api_key=API_KEY&id=ZToxMjIyNA' \
--header 'content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://price-api.datayuge.com/api/v1/compare/price?api_key=API_KEY&id=ZToxMjIyNA",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://price-api.datayuge.com/api/v1/compare/price"
querystring = {"api_key":"API_KEY","id":"ZToxMjIyNA"}
headers = {'content-type': 'application/json'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://price-api.datayuge.com/api/v1/compare/price?api_key=API_KEY&id=ZToxMjIyNA",
"method": "GET",
"headers": {
"content-type": "application/json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Use this API if you want to only update the product price without calling the whole product details.
The API returns JSON structured like this:
{
"amazon": "28490",
"flipkart": "28990",
"snapdeal": "",
"ebay": "29499",
"paytm": "",
"croma": "27999",
"yebhi": "",
"indiatimes": "",
"homeshop18": "",
"naaptol": "",
"infibeam": "28095",
"tatacliq": "27999",
"shopclues": "29499"
}
HTTP Request
GET /price
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
id | required | The custom PriceYuge product ID. Eg. ZToxMjIyNA |
Suggest Keywords
curl --request GET \
--url 'https://price-api.datayuge.com/api/v1/compare/search/suggest?api_key=API_KEY&product=Iphone' \
--header 'content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://price-api.datayuge.com/api/v1/compare/search/suggest?api_key=API_KEY&product=Iphone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://price-api.datayuge.com/api/v1/compare/search/suggest"
querystring = {"api_key":"API_KEY","product":"Iphone"}
headers = {'content-type': 'application/json'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://price-api.datayuge.com/api/v1/compare/search/suggest?api_key=API_KEY&product=Iphone",
"method": "GET",
"headers": {
"content-type": "application/json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Use this endpoint to suggest keywords for matching the product.
The API returns JSON structured like this:
{
"keywords": [
"iphone 6",
"iphone 7",
"iphone 6s",
"iphone 5s",
"iphone se",
"iphone 7 plus"
]
}
HTTP Request
GET /search/suggest
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
product | required | The product name Eg. Iphone |
List Products by Category
curl --request GET \
--url 'https://price-api.datayuge.com/api/v1/compare/list?api_key=API_KEY&product=Iphone&sub_category=mobiles&can_compare=1&page=1&filter=200088-200485&sort=popularity' \
--header 'content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://price-api.datayuge.com/api/v1/compare/list?api_key=API_KEY&product=Iphone&sub_category=mobiles&can_compare=1&page=1&filter=200088-200485&sort=popularity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://price-api.datayuge.com/api/v1/compare/list"
querystring = {"api_key":"API_KEY","product":"Iphone","sub_category":"mobiles","can_compare":"1","page":"1","filter":"200088-200485","sort":"popularity"}
headers = {'content-type': 'application/json'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://price-api.datayuge.com/api/v1/compare/list?api_key=API_KEY&product=Iphone&sub_category=mobiles&can_compare=1&page=1&filter=200088-200485&sort=popularity",
"method": "GET",
"headers": {
"content-type": "application/json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Use this resources to show all the products in a particular category. This can be used to build the app index.
The API returns JSON structured like this:
{
"data": [
{
"product_title": "Xiaomi Redmi 4A",
"can_compare": true,
"product_lowest_price": 5998,
"product_link": "https://price-api.datayuge.com/api/v1/compare/detail?id=ZToxMTYwNQ",
"product_id": "ZToxMTYwNQ",
"product_category": "mobile",
"product_sub_category": "mobile"
},
{
"product_title": "Xiaomi Redmi 4",
"can_compare": true,
"product_lowest_price": 6998,
"product_link": "https://price-api.datayuge.com/api/v1/compare/detail?id=ZToxMTE0Ng",
"product_id": "ZToxMTE0Ng",
"product_category": "mobile",
"product_sub_category": "mobile"
},
{
"product_title": "Xiaomi Redmi Note 4 64GB",
"can_compare": true,
"product_lowest_price": 12999,
"product_link": "https://price-api.datayuge.com/api/v1/compare/detail?id=ZToxMjAwOA",
"product_id": "ZToxMjAwOA",
"product_category": "mobile",
"product_sub_category": "mobile"
},
]
}
HTTP Request
GET /list
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
sub_category | required | The sub category/ child category returned from the List Products by Category |
can_compare | required | The sub category/ child category returned from the List Products by Category |
page | optional | Pass this parameter for pagination. |
product | optional | Pass the search parameter here. |
filter | optional | Pass the filter parameter value here Ex. brand:hp. For multiple brands, separate by pipe "|" Ex. brand:hp|brand:kingston |
price_start | optional | Pass this value to filter by price. Note: The price_start value should be equal or greater than min value in the API meta response. |
price_end | optional | Pass this value to filter by price. Note: The price_start value should be equal or lesser than max value in the API meta response. |
sort | optional | Sort the product by prices. Available values are popularity , hightolow , lowtohigh |
List Filters
curl --request GET \
--url 'https://price-api.datayuge.com/api/v1/compare/list/filters?api_key=API_KEY&sub_category=mobiles' \
--header 'content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://price-api.datayuge.com/api/v1/compare/list/filters?api_key=API_KEY&sub_category=mobiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://price-api.datayuge.com/api/v1/compare/list/filters"
querystring = {"api_key":"API_KEY","sub_category":"mobiles"}
headers = {'content-type': 'application/json'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://price-api.datayuge.com/api/v1/compare/list/filters?api_key=API_KEY&sub_category=mobiles",
"method": "GET",
"headers": {
"content-type": "application/json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Show all the available filters while listing product based on category
HTTP Request
GET /list/filters
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
sub_category | required | The sub category/ child category returned from the List Products by Category |
Note: The filer value for the specific subcategories should be passed to the list product by categories. Ex. pass filter=200088-200485
. Pass multiple values seperated by pipe |
Coupons & Deals API *New
The Coupons & Deals API will list the available coupon and deals across various categories. This can be used to build a cash back/coupon code aggregator website. Please note that the categories used in the price comparison API and Coupons & Deals API are different.
The path includes the API version. Please make sure to use the latest API version in your apps.
GET /api/{api_version}/offers
List Category of Offers
This endpoint will list all the categories available in the Coupons & Deals API.
Use the category_tag
to filter based on the available set of categories.
HTTP Request
GET /list/categories
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
List Stores for Coupon Offers
This endpoint will list the available set of stores which coupon codes type offers are available. These are the offers which can be availed by applying a coupon code.
HTTP Request
GET /list/stores/coupons
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
List Coupon Code Offers
Use this endpoint to list all the offers which are available by applying an coupon code.
HTTP Request
GET /list/coupons
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
store_tag | optional | The store_tag (of store name) returned from listing the available stores.List Stores for Coupon Offers |
category_tag | optional | The category_tag (of category) returned from category lists.List Category link |
List Stores for Deals
This endpoint will list the available set of stores which deal type offers are available.
HTTP Request
GET /list/stores/deals
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
List Deals
Use this endpoint to list all the offers which is deal from the store.
HTTP Request
GET /list/deals
Query Parameters
Parameter | Require | Description |
---|---|---|
api_key | required | This is the mandatory parameter. |
store_tag | optional | The store_tag (of store name) returned from listing the available stores. List Stores for Deals |
category_tag | optional | The category_tag (of category) returned from category lists.List Category link |
Error Codes
PriceYuge Severs the following error codes.
Response Error Codes
Error Code | Meaning |
---|---|
600 | Invalid API Credentials |
601 | Inactive Account |
602 | Invalid Route or API version not active |
HTTP Error Codes
Error Code | Meaning |
---|---|
400 | Bad Request |
401 | Unauthorized – Your API key is wrong |
403 | Forbidden |
404 | Not Found |
405 | Method Not Allowed |
429 | Too Many Requests - You’re requesting too many requests! Slow down! Note: The normal rate limiting is 60 requests per minute unless modified by DataYuge Team on your account. |
500 | Internal Server Error – We had a problem with our server. Try again later. |
503 | Service Unavailable – We’re temporarily offline for maintenance. Please try again later. |