Flipkart Price API with Google Apps Script

Flipkart, the popular shopping website in India that sells everything from erasers to televisions, offers no API and therefore if you were to extract the pricing information of any Flipkart product, screen scraping is the only alternative.

Flipkart stores the pricing data inside <meta> tags with “itemprop” set to “price” and it is thus relatively easy to pull this information for the price tracker tool.

Here’s the Google Apps Script code that extracts the price details, item title and the thumbnail image given the URL of the product page using Regular Expressions. You can easily use this in combination with HTMLService  to create an API that returns pricing data for Flipkart product as JSON or XML.