Android Question Free database to lookup grocery item barcodes

rleiman

Well-Known Member
Licensed User
Greetings,

I have a requirement from a customer who wants me to make an app that looks up the barcode from grocery items and extracts details such as the product name, photo of the product, etc. from a free trusted web site.

I plan to use the b4aZbarBarcodeScanner to read the barcodes. When I get the barcode number, I will do the web site lookup and process the information if it's found on the web site database.

My question is this. Is there a B4A library or class that I can use to extract the information from the web site? If no library exists, can you point me to B4A documentation that demonstrates how to do it?

Thanks.
 

stevel05

Expert
Licensed User
That will depend on what data the website returns and what format the data is in. If the website has a REST api it may return a JSON string or similar, If not are you planning to scrape the page?
 
Upvote 0

rleiman

Well-Known Member
Licensed User
That will depend on what data the website returns and what format the data is in. If the website has a REST api it may return a JSON string or similar, If not are you planning to scrape the page?
Thanks for the quick reply.

This is the first time trying this so I would like to find out the easiest way to do it. I took a look at scraping and saw several companies advertising software to extract the data. Is there a B4A scraping library? If not, can you recommend a web site that returns the data in JSON format and a B4A JSON library that contains a sample app so I can see what the coding looks like?
 
Upvote 0

stevel05

Expert
Licensed User
I haven't come across a scraping library but there are several ways you could do it depending on the structure of the page, Which site are you looking at? Have you checked if it has an API?
 
Upvote 0

rleiman

Well-Known Member
Licensed User
I haven't come across a scraping library but there are several ways you could do it depending on the structure of the page, Which site are you looking at? Have you checked if it has an API?
Hi Steve,

I will do a search of web sites now to see what I find. I hope to find a free one.
 
Upvote 0

stevel05

Expert
Licensed User
That should make it pretty straightforward to parse the JSON response and get the info you need.
 
Upvote 0

rleiman

Well-Known Member
Licensed User
That should make it pretty straightforward to parse the JSON response and get the info you need.
I found a B4A tutorial on extracting data from a JSON text file but would like to know how to extract it from a web page and how to call the web page and get a response from the web site with the JSON data.

I will also try to find other sites that have an API that returns JSON data.
 
Upvote 0

rleiman

Well-Known Member
Licensed User
There don't appear to be many that are kept up to date, have a look at this page for some suggestions: https://opendata.stackexchange.com/...database-of-all-products-with-ean-13-barcodes Amazon may be promising if it has what you are after.
It's unfortunate that all of the sites that have what I'm looking for want a lot of money to use their API. I will have to not have bar code scanning in the app and let the user enter the product info by hand. When I did a Google search for free barcode lookup services they all looked like they would do it for free. When I signed up to the sites, and requested the API key, that's when they wanted the money. 😭

If anyone comes across a site with a free API, please let me know.

Sorry about my rambling.
 
Upvote 0

stevel05

Expert
Licensed User
You could collect the info from users if they agree or opt to upload it and create your own database.
 
Upvote 0

Herbert32

Active Member
Licensed User
It takes a lot of time and money to collect the data which you are expecting. So for this nature it will need some money to participate from the work others already did for you.

Your Keywords for research will be GTIN, GS1, EPC, EAN ...

Maybe this will help you also:

Don't expect too much for free in this kind of business... - Here you always get what you pay for it
 
Upvote 0

rleiman

Well-Known Member
Licensed User
It takes a lot of time and money to collect the data which you are expecting. So for this nature it will need some money to participate from the work others already did for you.

Your Keywords for research will be GTIN, GS1, EPC, EAN ...

Maybe this will help you also:

Don't expect too much for free in this kind of business... - Here you always get what you pay for it
We decided to not include this feature in our free app since we couldn't afford the fees for the lookups. Thanks everyone for trying to help.
 
Upvote 0
Top