Ingredients from Factual API

215 Views Asked by At

currenlty I am workign on an Android Project working in Android Studio. I have implemented a UPC capturing tool, but I will need to pass the UPC into Factual API for actual details of UPC.

I tried implementing it with the Java code, but it was too complicated. There is also a solution for you to feed in a http request and it will reply back with the UPC info.

I am trying to get certain information from an item. I have the UPC Code, but I am trying to get a particular field/row variable and not the rest of the information.

Here is the request form: http://developer.factual.com/working-with-factual-products/

This is a specific request: api.v3.factual.com/t/products-cpg?q=073420516208&KEY=*************

At the moment, the request replies with:

{"version":3,"status":"ok","response":{"data":[{"avg_price":2.99,"brand":"Daisy","category":"Dairy & Dairy-Substitute Products","ean13":"0073420516208","factual_id":"273757d6-3a1d-4896-9257-abd996f0be42",
"image_urls":["http://i.walmartimages.com/i/p/00/07/34/20/51/0007342051620_300X300.jpg","http://media.itemmaster.com:80///0/0/0/322/42f87aad-9f4e-440a-b3c2-facf0690b0c7.png?originalFormat=tif&size=600x600",
"http://media.itemmaster.com:80///0/0/0/408/0510b719-3d4e-4f87-afc6-a6197b5fde83.jpg?originalFormat=tif&tkn=914dad50-013c-11e4-acaa-005056ab571e&resize=600x600"],
"product_name":"Cottage Cheese","size":["16 oz"],"upc":"073420516208"}],"included_rows":1}}

How can I get just certain of the information, namely ingredients, from the get request?

And how can I request this in Android. I have tried building URI or URL from it, but it always says URISyntaxException. I have tried using URLEncode, but still does not work.

0

There are 0 best solutions below