I am developing a simple barcode scanner app which scans a barcode and displays the product info.
Using Zbar library I am able to scan barcode and get the GTIN (barcode number) for any product.
How can I convert the scanned barcode data to actual product information that I can display to the user? Is there some API or library available to accomplish this?
Assuming that you are referring to the common Point Of Sale barcode formats these all carry some variant of a product identifier referred to as a Global Trade Identification Number (GTIN):
Each of these except GTIN-8 can be converted into a GTIN-14 by prefixing with "0"s. (GTIN-8 is a discrete number system that is not currently mapped into any part of the GTIN-14 number system.)
After which the "Lookup" part of the following answer applies:
https://stackoverflow.com/a/31760872/2568535
[*] A zero-suppressed GTIN-12 can be converted to twelve-digit format ("UPC-A") as described here: https://stackoverflow.com/a/31539006/2568535