You are here:  » shopzilla.com api


shopzilla.com api

Submitted by harican on Sun, 2010-08-01 11:34 in

HI Dave,

How are you making out with the shopzilla.com api? I have attempted it but there seems to be some issues on shopzilla's end.

One issue I noticed is the way the shopzilla api responds when there are no results for the submitted keyword.

For example, if you run the shopzilla.com api with a very popular keyword like "xbox" The results are displayed immediately, but if you search a less popular keyword like "Richfield Grande Collector Plate Frame" there is major lag and the page does not load.

In addition,
no results require a Magic Parser Format String of xml|PRODUCTRESPONSE/

and

results found require a Magic Parser Format String of xml|PRODUCTRESPONSE/OFFERS/OFFER/

How on earth is it possible to parse the shopzilla.com api with just one Magic Parser Format String if it is different for no results found and results found?

Submitted by support on Mon, 2010-08-02 09:15

Hi harican,

It should only be necessary to use one Format String (the one for a response containing records) - the "no response" result can simply be ignore; otherwise if you would like to display a caption, e.g. "Shopzilla Results" on your site; the neatest solution is to actually parse the results into an array; and then after the call to MagicParser_parse(), count() the array, and if there are results, display your caption, and then foreach() through the array to display each one. Consider the following example to show the idea in principle...

<?php
  $records 
= array();
  function 
myRecordHandler($record)
  {
    global 
$records;
    
$records[] = $record;
  }
  
$url "http://www.example.com/api.asp?q=".urlencode($q);
  
MagicParser_parse($url,"myRecordHandler","xml|PRODUCTRESPONSE/OFFERS/OFFER/");
  function 
myDisplayRecordHandler($record)
  {
    
// original myRecordHandler function to display results
  
}
  if (
count($records))
  {
    print 
"<h2>Example.com Results</h2>";
    foreach(
$records as $record)
    {
      
myRecordHandler($record);
    }
  }
?>

If you're not sure of course, email me your API script so far and I'll check it out for you...

Hope this helps!

Cheers,
David.

Submitted by Deanh01 on Mon, 2010-08-02 21:10

Hi David
I would be very interested in this for my site. I have to use shopzilla. So if you work out a script I love to use it.

Thank You
Dean

Submitted by support on Tue, 2010-08-03 08:20

Hi Dean,

Will follow up by email...

Cheers,
David.

Submitted by Syn on Sat, 2010-11-06 13:35

Hi david

I am also interested in the script for the Shopzilla API

Thank you for your reply

Submitted by support on Sat, 2010-11-06 13:50

Hi Syn,

Welcome to the forum! I'll follow up by email for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by Syn on Sat, 2010-11-06 14:25

Thanks David,

But they dont work with the french API of Shopzilla, i have remplace the api url "http://catalog.bizrate.com/services/catalog/v1/us/product?apiKey=" to "http://catalog.shopzilla.fr/services/catalog/v1/api/product/4?apiKey=" but its doesn't work no result with this one
and with the first url no probleme :/

Submitted by support on Sat, 2010-11-06 14:39

Hi Syn,

If you could reply to my email with your modified version showing the URL that you need to use, and I'll check the response - it may need to be modified slightly...

Cheers,
David.
--
PriceTapestry.com