GET DEMO Chat

 

 

How To Implement Product Search by URL

This is the sixth in a series of “How To” posts that illustrate various ways in which you can use the Indix Product API.

We’ve been following along with fictional developers Christy and Ted as they build features into their ecommerce shopping app.

“Uhh, this doesn’t work.”

Alex (Inixini’s CEO co-founder) tried to paste in a product page link in the search box, which didn’t return the results he wanted. Ted told him the app could now search the web for all product offers for a SKU or MPN, but he’d misunderstood that to mean he could also just punch in a URL.

After Alex walked out in frustration, Christy turned to Ted. “Good grief. Sometimes I want to tell him to go build his own darn product. But my gut says we should be able to drop in the new feature….”

To power this feature, Ted and Christy need to use the URL input in the Indix Product API. Let’s say someone wants to look at all the offers for a particular acoustic guitar.

searchbyURL

We would use the Offers Premium endpoint to get the most detailed results on this.

Query: https://api.indix.com/v2/offersPremium/products?countryCode=US&url=https://www.amazon.com/World-Stage-WS112001-Acoustic-Guitar/dp/B00U2O912W&app_key=<enter_app_key>

Sample response:

{
  "message": "ok",
  "result": {
    "count": 1,
    "products": [
      {
        "categoryNamePath": "Musical Instruments > Guitars > Acoustic Guitars > Steel-string Acoustics",
        "categoryId": 22063,
        "mpid": "bd860145049c7509326e3303230f7f70",
        "categoryName": "Steel-string Acoustics",
        "upcs": [],
        "brandName": "Other brands",
        "minSalePrice": 79.99,
        "stores": {
          "24": {
            "storeId": 24,
            "offers": [
              {
                "sku": "B00U2O912W",
                "refurbishedOffers": 0,
                "priceHistoryAvailable": false,
                "salesRank": 0,
                "productUrl": "http://www.amazon.com/dp/B00U2O912W?psc=1",
                "userRatings": 0,
                "maxRating": 0,
                "addOnItem": false,
                "availability": "IN_STOCK",
                "upcs": [],
                "avgRating": 0,
                "shippingText": "",
                "fulfilledBy": "",
                "pid": "3bb74363b042abfb6464fd9ec797ca87",
                "privateAttributes": {},
                "mpns": [],
                "newOffers": 0,
                "listPrice": 84.33,
                "buyBoxWinner": false,
                "additionalImageUrls": [],
                "salePrice": 84.33,
                "cartPrice": false,
                "lastRecordedAt": 1461047860705,
                "imageUrl": "http://ecx.images-amazon.com/images/I/31oid8dtJSL._AC_US200_.jpg",
                "usedOffers": 0,
                "seller": "Amazon.com"
              }
            ],
            "storeName": "Amazon.com",
            "title": "World Stage WS112001 3/4 Size Acoustic Guitar"
          },
          "270": {
            "storeId": 270,
            "offers": [
              {
                "sku": "B00U2O912W",
                "refurbishedOffers": 0,
                "priceHistoryAvailable": false,
                "salesRank": 0,
                "productUrl": "http://www.amazon.com/dp/B00U2O912W?psc=1",
                "userRatings": 0,
                "maxRating": 0,
                "addOnItem": false,
                "availability": "IN_STOCK",
                "upcs": [],
                "avgRating": 0,
                "shippingText": "",
                "fulfilledBy": "",
                "pid": "bd860145049c7509326e3303230f7f70",
                "privateAttributes": {},
                "mpns": [],
                "newOffers": 0,
                "listPrice": 79.99,
                "buyBoxWinner": false,
                "additionalImageUrls": [],
                "salePrice": 79.99,
                "cartPrice": false,
                "lastRecordedAt": 1454726135450,
                "imageUrl": "http://ecx.images-amazon.com/images/I/31oid8dtJSL._AC_US200_.jpg",
                "usedOffers": 0,
                "seller": ""
              }
            ],
            "storeName": "Amazon.com Marketplace",
            "title": "World Stage WS112001 3/4 Size Acoustic Guitar"
          }
... Truncated for brevity

It’s as simple as that. Are you interested in powering comparison shopping for your app? Well, watch this space for our next post!

  Download the Pervasive Commerce White Paper

Leave a Reply

Your email address will not be published. Required fields are marked *