API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

How to get some product list instead of the complete list.


We have more than 50000 products. and when we fetch these records using soap api, its take lot of time to  fetch these records.

How can we boost the performance or fetching records in parts.

Thanks in advance......
created May 30, 2014 by hemant
0% Accept Rate
Q 4 A 0 C 3

1 Answer

I am having the same issue here. But wait, I am investigating Product_GetAllUpdated where Products can be retrieved on basis of a date. You then have to make some logic to determin fromDate. The PHP code will look like :

$ProductHandles = $client->Product_GetAllUpdated(array('fromDate' => '2014-05-20T00:00:00','includeCalculatedProperties'=>FALSE))->Product_GetAllUpdatedResult->ProductHandle;
answered May 30, 2014 by larsbrandi
Thanks larsbrandi.

But this not help me to solve my issue. I just want to fetch the record in the form of paging. Is there any way to do this?
Hmmmm, Store the data locally. Lets say MySQL, make a temporary table, put your rerieved data in there, update your static table, then do some nice pagination stuff. Thats the way I am doing it. Product_GetAllUpdated is used just to avoid to get the hole dataset every time.
Thanks larsbrandi.

I'm not able to fetch that much records(50000). System got stuck when i am fetching this.
Its working for small data but not working for that much records. If I'm not getting that much record from the api than how could I store it in MySQL?
My PHP code is looking like :
$productHandles = $client->Product_GetAll()->Product_GetAllResult->ProductHandle;
$productDataObjects = $client->Product_GetDataArray(array('entityHandles' => $productHandles))->Product_GetDataArrayResult->ProductData;
You can rule over your php.ini settings by placing the following in top of your php file executing the api :

ini_set('memory_limit', '512M');
ini_set('max_execution_time', 300);

Set memory_limit to something appropiate for you !
Your best bet is probably to split the handles returned by Product_GetAll into batches of e.g. 1000 each, and then throw these batches at Product_GetDataArray individually.

Best regards,
Visma e-conomic A/S