There are a number of routes that you could take depending on the scope and requirements of your project. I recommend using Amazon's product affiliate API, however there are a few other options available as well.
If you want an accurate and comprehensive database of products that can be looked up by UPC or EAN, you can use GS1 US. This organization is responsible for distributing and maintaining UPC and EAN codes for products in the US. While this information is very accurate, this data is NOT free and requires a subscription.
Free with Terms & Conditions
Amazon offers a comprehensive database of product information. This API is available through their affiliate program. The information supplied via this API contains much of the information you're looking for such as weight, price, and category. While this information does not cost money, be sure to read through their terms of service.
A final solution involves scraping content off product database providers over the web. There are a number of online databases that may provide more information than the options above. Products can be programmatically retrieved by UPC or EAN using the examples below. Again, be careful not to break any terms of service with these approaches as well.