How to get product stock info in product list rest API in magento 2.3?

To get product details i am using the following rest api. /rest/V1/products?searchCriteria[page_size]=4&searchCriteria[currentPage]=1 In default it does not return stock_item filed in extension_attributes. When i googled about it i found this solution. solution link I have used Kirti Nariya solution and got stock_item field from response. But the problem is i m getting stock_item field only…

error if i want toupgrade

php bin/magento setup:upgrade PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to alloc ate 32768 bytes) in C:\xampp\htdocs\MagentoEbenezer\vendor\donatj\phpuseragentpa rser\src\UserAgentParser.php on line 128 Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 3 2768 bytes) in C:\xampp\htdocs\MagentoEbenezer\vendor\donatj\phpuseragentparser\ src\UserAgentParser.php on line 128 please can i help me to solve this