<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AB-WebLog.com&#187; Shopping.com</title>
	<atom:link href="http://www.ab-weblog.com/en/tag/shopping-com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ab-weblog.com/en</link>
	<description>Andreas Breitschopp</description>
	<lastBuildDate>Wed, 18 Mar 2015 09:47:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using the Shopping.com API in PHP</title>
		<link>http://www.ab-weblog.com/en/using-the-shopping-com-api-in-php/</link>
		<comments>http://www.ab-weblog.com/en/using-the-shopping-com-api-in-php/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 15:19:48 +0000</pubDate>
		<dc:creator>Andreas Breitschopp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Shopping.com]]></category>

		<guid isPermaLink="false">http://www.ab-weblog.com/en/?p=173</guid>
		<description><![CDATA[After an example of the eBay Finding API and the Amazon Product Advertising API in previous posts, I finally want to show an example of the Shopping.com API. First of all you need to register for a free Shopping.com developer &#8230; <a href="http://www.ab-weblog.com/en/using-the-shopping-com-api-in-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After an example of the <a title="Using the eBay Finding API in PHP" href="http://www.ab-weblog.com/en/using-the-ebay-finding-api-in-php/">eBay Finding API</a> and the <a title="Using the Amazon Product Advertising API in PHP" href="http://www.ab-weblog.com/en/using-the-amazon-product-advertising-api-in-php/">Amazon Product Advertising API</a> in previous posts, I finally want to show an example of the Shopping.com API.</p>
<p>First of all you need to register for a free <a title="Shopping.com Developer Website" href="http://developer.shopping.com" target="_blank">Shopping.com developer account</a>.</p>
<p>Then you can start building the API request URL:</p>
<pre class="brush: text; gutter: true">http://publisher.api.shopping.com/publisher/3.0/rest/GeneralSearch?
	apiKey=%apikey%&amp;
	trackingId=%trackingid%&amp;
	subTrackingId=%subTrackingId%&amp;
	categoryId=%categoryId%&amp;
	keyword=%keyword%&amp;
	pageNumber=%pageNumber%&amp;
	numItems=%numItems%&amp;
	hybridSortType=%hybridSortType%
	hybridSortOrder=%hybridSortOrder%</pre>
<p>Now let&#8217;s see what the individual parameters mean:</p>
<ul>
<li><em>GeneralSearch:</em> we need the operation <em><a title="More Info About the Operation GeneralSearch" href="http://developer.shopping.com/docs/read/API_Use_Cases#Searching" target="_blank">GeneralSearch</a></em> for our keyword-based search.</li>
<li><em>apiKey:</em> you get this API key in your Shopping.com developer account.</li>
<li><em>trackingId:</em> you need to request a tracking ID from Shopping.com to earn some money with your traffic.</li>
<li><em>subTrackingId:</em> choose any additional code here you want to use as optional tracking (e. g. for special campaigns).</li>
<li><em>categoryId:</em> the category you want to search in (leave empty to search in all categories).</li>
<li><em>keyword:</em> your search keywords. Make sure you use <em>utf8_decode</em> if the keywords are in UTF-8.</li>
<li><em>pageNumber:</em> for the first request you set this to <em>1</em> and increase it in previous requests if you need more items.</li>
<li><em>numItems:</em> here you can choose how many items (maximal 100) are returned per request.</li>
<li><em>hybridSortType:</em> choose if you want the result to be sorted by <em>relevance</em> or <em>price</em>.</li>
<li><em>hybridSortOrder:</em> choose if you want the result to be sorted <em>ascending</em> or <em>descending</em>.</li>
</ul>
<p>That&#8217;s all: we just need to pass this URL again to the small function we used already in the <a title="Using the eBay Finding API in PHP" href="http://www.ab-weblog.com/en/using-the-ebay-finding-api-in-php/">eBay Finding API</a> and the <a title="Using the Amazon Product Advertising API in PHP" href="http://www.ab-weblog.com/en/using-the-amazon-product-advertising-api-in-php/">Amazon Product Advertising API</a> examples and receive the XML response data:</p>
<pre class="brush: php; gutter: true">/**
 * Returns the SimpleXML object.
 *
 * @param string $url The URL to receive the XML document.
 * @return string The SimpleXML object.
 *
 */
function getXml($url) {
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_HEADER, false);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_TIMEOUT, 3);
	$result = curl_exec($ch);
	curl_close($ch);

	return simplexml_load_string($result);
}</pre>
<p>As you can see the Shopping.com API is very easy to handle as it is also the smallest of these three APIs.</p>
<p><em>Did you use the Shopping.com API yourself already?<br />
Do you know other interesting online shopping APIs?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ab-weblog.com/en/using-the-shopping-com-api-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->