Welcome Guest, Login Now
Search Wine Search
  Webmaster Tools

WineFetch API: Sample Request


Interacting with WineFetch through the WineFetch API is simple. From your webserver, you will make an HTTP request to WineFetch and WineFetch will return the search results in an XML format. You can then display the results in a style that matches your site.
Sample format of an HTTP request
http://api.winefetch.com/search?key=&kw=&year=&sortby=&offset=&limit=

key WineFetch API Key. You will need to login to get your api key.
Login now or Create a New Account.
kw Query terms for the search.
year Vintage year of the wines to search.
site By setting this parameter, you are going to search one particular wine retailers' inventory. The name of the wine retailer must match WineFetch's retailer list. View WineFetch retailer list.
zip A valid US zip code to search. You can use the 'radius' field to to search within a particular number of miles from this zip code.
radius The number of miles around a particular US zip code to search within. The field 'zip' must be a valid US zip code for this parameter to take effect. Default value is 10 miles.
start Return the results starting at the specified result number. If left blank, the results will start at 1.
limit The maximum number of results returned per query. The maximum number of results that can be requested is 20. If left blank, the default is 10.

XML Response Definitions
WineFetch will return and xml document with the following key / value pairs
query_kw Keywords sent in the API request.
query_year Year sent in the API request.
totalresults Total number of WineFetch results. Can be used to determine pagination.
start Record number of the first result returned.
end Record number of the last result returned.
items XML structure of search results
wine Child of item. The name of the wine.
year Child of item. The year of the wine.
size Child of item. The size of the wine bottle.
price Child of item. The price of the wine.
saleprice Child of item. The sales price of the wine.
wine_site Child of item. The site where the wine is being sold.
url Child of item. The url for the wine.

Example HTTP Request for 'Rosenblum Zinfandel' and the year '2002':
http://api.winefetch.com/search?key=abc&kw=Rosenblum+Zinfandel&year=2002&offset=0&limit=20

Example XML Response for the above HTTP Request:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<wfresponse>
  <query_kw>Rosenblum Zinfandel</query_kw>
  <query_year>2002</query_year>
  <query_site>Wine.com</query_site>
  <query_zip>10001</query_zip>
  <query_radius>10</query_radius>
  <totalresults>17</totalresults>
  <start>1</start>
  <end>20</end>
  <items>
    <item>
      <winery><![CDATA[Rosenblum]]></winery>
      <wine><![CDATA[Zinfandel Rockpile Rockpile Road Vineyard]]></wine>
      <year>2002</year>
      <varietal>Zinfandel</varietal>
      <country>United States</country>
      <price>19</price>
      <wine_site>Beverages and More</wine_site>
      <url>http://api.winefetch.com/rd/Beverages-and-More/2361</url>
    </item>
    ...
  </items>
</wfresponse>
My AccountTell a FriendContact UsWine ResourcesTerms of ServicePrivacy PolicyWebmaster Tools
©2004 - 2008 WineFetch, Inc. All rights reserved