I am using the below endpoint to retrieve all the products listed on the Magento site.
And It seems, since the number of products on the store is very large (~20k) its throwing 504 Gateway time-out error.
If i limit the number of products by using searchCriteria[pageSize] to some lower value the endpoint works.
So for example : I set the pageSize to 1000, it gets me the top 1000 items from magento each time. Do we have a way to make a single API call and and get all 20K items. Or some kind of batch processing to get products in batch of 1000s.
A 504 Gateway Timeout error by CloudFlare usually means that CloudFlare isn't able to communicate with your server.
Make sure that your server is not overloaded and CloudFlare IPs are not blocked by your server firewall.
@Bhanu Periwal Thanks for reply.
As i mentioned above the number of item is very large and so is the response.
So i am looking for some kind of mechanism where i can get all the item info in small batches and gather all the info at my end.
Use searchCriteria[currentPage] to fetch page by page until you reach the ceil(total_count / page_size) page