drawrowfly / amazon-product-api

Amazon Scraper. Scrape products from the amazon search result or reviews from the specific product
627 stars 181 forks source link

Support fetching information for a specific vendor #27

Closed centic9 closed 2 years ago

centic9 commented 3 years ago

Is there a chance to support fetching price-information for a given vendor?

I tried various search-options, but could not get the tool to return the price from a given vendor, e.g. at https://www.amazon.de/dp/B001AXFZ60 currently Amazon asks 65,68.

If you go the "other vendors" page at https://www.amazon.de/gp/offer-listing/B001AXFZ60/ref=dp_olp_pn there are e.g. "Baby-Direkt" with a price of 71,90 (plus shipping costs).

Is there a way to get this information? I am willing to spend some time on implementing such a feature, but would need a few hints as to how I would go about it.

drawrowfly commented 3 years ago

You can copy amazon session from your browser and set it in the cookie param. For now you can only do it when using as module not the CLI

centic9 commented 3 years ago

I took a closer look, it seems I can make the page return results for one vendor or merchant by using query-params in the query-URL.

For product-search via "amazon.XX/s" it uses "me", e.g. https://www.amazon.de/s?me=A3TN1BADY8I80N For asin-search "amazon.XX/dp" it uses "m", e.g. https://www.amazon.de/dp/B001AXFZ60/?m=A3TN1BADY8I80N

Adding this via a new "seller" option to the module and CLI seems to work, i.e. returned products and prices reflect what this seller is offering.

See https://github.com/centic9/amazon-product-api/commit/e2443b20afc6993f5aad36d2598c33ed2e334411

I can prepare a PR if you are interested in adding this functionality.