I am new here. I want to know how can I create my own simple API

I am new here. I want to know how can I create my own simple API to fetch product image,name,is it available in stock and price of the product. Please help me with complete procedure.