In this post I am going to explain How to Get Product Stock Information in Magento 2.

Use below methods to get product stock information in Magento 2 such as stock status, minimum stock quantity, minimum sale quantity, minimum quantity, etc.

Using below code snippet you can get product stock data by passing product id.

1. Using Dependency Injection

Add below code snippet in Block class.

Add below code snippet in template file.

2. Using Object Manager

That’s it. Enjoy Magento 2!!

Check this Best Magento 2 Tutorial.