Currently I’m working eBay Trading APIs.
I want to get all active listings but getting 194.
I have 2269 active listings in my seller account.
here is my code.
$curl_resource = $this->initialize_requests("GetSellerList", false);
$xmlStr="<?xml version="1.0" encoding="UTF-8"?>
<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>".$this->userToken."</eBayAuthToken>
</RequesterCredentials>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<GranularityLevel>Coarse</GranularityLevel>
<StartTimeFrom>2017-06-21T06:38:48.420Z</StartTimeFrom>
<StartTimeTo>2017-08-23T06:38:48.420Z</StartTimeTo>
<IncludeWatchCount>true</IncludeWatchCount>
<Pagination>
<EntriesPerPage>50</EntriesPerPage>
</Pagination>
</GetSellerListRequest>";
$response = $this->getResponse($curl_resource, $xmlStr);
$responseObject = simplexml_load_string($response);
print_r($responseObject);
I think I should change <startTimeFrom>
and <startTimeTo>
after every call until it return null or something.
or is there a better way to do this?
2
Answers
You need to pass page number in you XML feed,because eBay API returns only 200 listings per page so you need to loop through the API call.
For example:
eBay returns 200 entries as a response in a single call, so you need to loop through the same call by passing the PageNumber element in the Pagination index while creating an XML.