Search code examples
phpebay-api

Get large image gallery for ebay products/items using GetSellerList using their Trading API


I've managed to get my feed data back all good using ebay's trading API, but struggling to figure out how I can get "pictureURLSuperSize" found here as an outputSelector: http://developer.ebay.com/devzone/finding/callref/findItemsAdvanced.html#Response.searchResult.item.pictureURLSuperSize

So far I have manage to get back the entire gallery using a "PictureDetails" TagName, though that only brings back the medium quality image versions (500x300px ish), I want the largest possible! Maybe I need to change the GranularityLevel?

So as a brief insight i'm getting the data with this xml method:

$requestXmlBody = '<?xml version="1.0" encoding="utf-8" ?>';
    $requestXmlBody .= '<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">';
    $requestXmlBody .= '<RequesterCredentials>';
    $requestXmlBody .=      '<eBayAuthToken>'.$this->_keys['production']['UserToken'].'</eBayAuthToken>';
    $requestXmlBody .= '</RequesterCredentials>';
    $requestXmlBody .= '<Pagination ComplexType="PaginationType">';
    $requestXmlBody .=      '<EntriesPerPage>30</EntriesPerPage>';
    $requestXmlBody .=      '<PageNumber>1</PageNumber>';
    $requestXmlBody .= '</Pagination>';
    $requestXmlBody .= '<UserID>username</UserID>';
    $requestXmlBody .= '<StartTimeFrom>';
    $requestXmlBody .= $date4MonthsAgo;
    $requestXmlBody .= '</StartTimeFrom>';
    $requestXmlBody .= '<StartTimeTo>'.$dateNow.'</StartTimeTo>';
    $requestXmlBody .= '<IncludeWatchCount>true</IncludeWatchCount>';
    $requestXmlBody .= '<GranularityLevel>Medium</GranularityLevel>';//could change if its slow
    $requestXmlBody .= '<ErrorLanguage>en_GB</ErrorLanguage>';
    $requestXmlBody .= '</GetSellerListRequest>​';

Further down I'm outputting the data in an item loop:

    $itemId = $items->item($i)->getElementsByTagName('ItemID')->item(0)->nodeValue;
    $itemUrl = $items->item($i)->getElementsByTagName('ViewItemURL')->item(0)->nodeValue;
    $startTime = $items->item($i)->getElementsByTagName('StartTime')->item(0)->nodeValue;
    $endTime = $items->item($i)->getElementsByTagName('EndTime')->item(0)->nodeValue;
    $bidCount = $items->item($i)->getElementsByTagName('BidCount')->item(0)->nodeValue;
    $priceInGBP = $items->item($i)->getElementsByTagName('ConvertedCurrentPrice')->item(0)->nodeValue;
    $status = $items->item($i)->getElementsByTagName('ListingStatus')->item(0)->nodeValue;
    $title = $items->item($i)->getElementsByTagName('Title')->item(0)->nodeValue;
    $image = $items->item($i)->getElementsByTagName('PictureDetails')->item(0)->nodeValue;

Any help would be delightful, thanks!

Joe


Solution

  • Replace the below line:

    $requestXmlBody .= '</GetSellerListRequest>​';
    

    with the below one.

    $requestXmlBody .= '<outputSelector>​PictureURLSuperSize</outputSelector>';
    $requestXmlBody .= '</GetSellerListRequest>​';
    

    You will the the <​PictureURLSuperSize> node in the response.

    Hope this helps.