Giter Club home page Giter Club logo

amazon-wish-lister's Introduction

Amazon Wish Lister

GitHub Page: http://doitlikejustin.github.io/amazon-wish-lister/

This is a little API to retrieve Amazon Wish List data. There is no official API, as Amazon shut it down a couple years ago. The only way around that... screen scraping. It works with both old and new (beta) Amazon Wish List design.

The following Amazon stores have wishlist functionality - Canada, USA, Brasil, Japan, UK, Germany, France, India, Italy, Spain.

Amazon Wish Lister uses phpQuery (server-side CSS3 selector driven DOM API based on jQuery) to scrape Amazon's Wish List page and exports to JSON, XML, or PHP Array Object.

  • Scrapes the following from your Amazon Wish List:
    1. Item name
    2. Item link
    3. Price of item when added to wish list
    4. Current price of item
    5. Date added to wish list
    6. Priority (set by you)
    7. Item rating
    8. Total ratings
    9. Comments on item (set by you)
    10. Picture of item
  • Perfect if you want to host display your wish list on your own website.
  • Best used if cached, or saved in database.
  • Supports multi-page Amazon Wish Lists as well as Amazon Wish List "Ideas"
  • Return list as JSON, XML, or just dump PHP Array Object.

Demo Site: http://www.justinscarpetti.com/projects/amazon-wish-lister/
JSON Output: http://www.justinscarpetti.com/projects/amazon-wish-lister/api/?id=37XI10RRD17X2

How to use

You just need to add a few parameters to get your wish list. All of the parameters, except for the Amazon ID, will have a default... well the default for the Amazon ID is my Amazon ID, you probably don't want that.

The rest (how you style it) is up to you. Happy coding.

Amazon Country

?tld=AMAZON_COUNTRY
?tld=co.uk

Defaults to com.

Tested with: ca, com, com.br, co.jp, co.uk, es, de, fr, in, it.

The following stores currently do not offer wishlists: com.au, com.mx, nl.

Amazon ID

?id=YOUR_AMAZON_ID
?id=37XI10RRD17X2

Reveal (What to get)

?reveal=unpurchased (Default)
?reveal=all
?reveal=purchased

Sort

?sort=date (Default)
?sort=priority
?sort=title
?sort=price-low (low to high)
?sort=price-high (high to low)
?sort=updated

Output Format

?format=json Valid JSON (Default).
?format=xml Invalid XML (included for compatibility reasons).
?format=XML Valid XML.
?format=array a PHP array.
?format=rss an RSS feed. You may wish to customise the fields it returns.

Amazon Associate / Affiliate tag

?tag=affiliate-tag

Example

wishlist.php?id=37XI10RRD17X2&reveal=all&sort=priority&format=json
wishlist.php?tld=co.uk&id=13GFCFR2B2IX4&tag=shkspr-21

What it returns

Below is an example if you had http://amzn.com/B0002FTH66 on your wishlist (item #37 on your wishlist).

[
    {
        "num": 37,
        "name": "Scotch Box Sealing Tape Dispenser H180, 2 in",
        "link": "http://www.amazon.com/Scotch-Sealing-Tape-Dispenser-H180/dp/B0002FTH66/ref=wl_it_dp_v_nS_nC/185-8110132-3235609?ie=UTF8&colid=3DR0P4HP87IIJ&coliid=I19JS64ZHWBA5M",
        "old-price": "$24.09",
        "new-price": "$19.99",
        "date-added": "June 7, 2012",
        "priority": "low",
        "rating": "4.7 out of 5 stars",
        "total-ratings": "63",
        "comment": "I like taping stuff",
        "picture": "http://ecx.images-amazon.com/images/I/41BKbZu836L._SL500_SL135_.jpg",
        "page": 2,
        "AISN": "B0002FTH66",
        "large-ssl-image": "https://images-eu.ssl-images-amazon.com/images/I/41BKbZu836L._SL500_SL1350_.jpg",
        "affiliate-url": "http://www.amazon.com/dp/B0002FTH66/ref=nosim?tag=yourid-21"
    }
]

Support

https://github.com/doitlikejustin/amazon-wish-lister/issues

amazon-wish-lister's People

Contributors

doitlikejustin avatar edent avatar ethanclevenger91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazon-wish-lister's Issues

Invalid price JSON data fixed

Hi Justin,

I was looking at your wishlist scraper, and I was able to get it to return correct price data by fixing the class names. I forked your repo -- take a look at it and see what you think.

screen shot 2014-03-19 at 4 06 36 pm

Thanks.

work with baby and wedding registries

the baby registry and wedding registry have a very similar structure, but doesn't seem to scrape correctly if I have replace the full url with the one with the registry

null

Hi !
Nice scraper, but could you check this list:

15QUHRVU564QK

Result: null
Using your demo site to enter ID.

Regards

Only getting first page of items

I'm on the UK amazon site, and if I view wishlists on the website it loads more items as you scroll down the page. The script is only returning the items that are displayed when the page first opens, not the hidden items that you have to scroll down to see.

Can't find package on composer

I am trying to use this package but can't find it on composer, is it on there?

If not is it a possibility that it could be added?

Returns invalid Price and Ratings JSON data

I'm in the US and the demo, as well as my test wish lists, all return incorrect price and rating data.

Example:
I'm loading the JSON output from this URL:
http://www.justinscarpetti.com/projects/amazon-wish-lister/api/?id=31PZU8RK9FP4D&format=json

Here's a snippet of one JSON object output. (You can see old-price = N/A, new price isn't set, rating isn't set, and total-ratings isn't set)

  {
    "num": 1,
    "name": "Lupine 1-Inch Red 15-22-Inch Martingale Combo Collar for Large Dogs",
    "link": "http:\/\/www.amazon.com\/dp\/B001PNK5F6\/ref=gl_it_dp_v_S_ttl\/175-1155974-2931639?_encoding=UTF8&colid=31PZU8RK9FP4D&coliid=I1IN80OT8Z6UYO",
    "old-price": "N\/A",
    "new-price": "",
    "date-added": "November 20, 2013",
    "priority": "",
    "rating": "N\/A",
    "total-ratings": "",
    "comment": "",
    "picture": "http:\/\/ecx.images-amazon.com\/images\/I\/41AbIcYrA%2BL._SL500_SL135_.jpg",
    "page": 1
  }

Amazon may have updated something recently that threw off the screen scraper

old price is always n/a

from the demo page, i enter this wishlist id: 38RNAXKYXRZHG, and even though some prices have changed since I added to my wishlist, old_price always shows 'N/A'.

null

Thank you for the code. I been using your code for a few years to pull an Amazon wish list and it worked great.
Today I'm trying after a year and it doesn't work. I used your site to pull the same wish list but it returns only 10 items. Can you please help me with the issue?

I'm never worked on PHP, but I think this is where the issue exists.

$items = pq('.g-items-section div[id^="item_"]');
//loop through items
foreach($items as $item)

though i have a few items on the wish list, it doesn't get into the foreach.

CSV?

I was looking for something like this, but I'm not sure what to do with the various output formats you have. What would be easier for me would be a CSV file I could import into a spreadsheet. Would it be possible to add that as an option, in addition to JSON, XML, and PHP? Thanks!

how to actually use it to give gifts effectivly

I am trying to use this to automate my gift giving process...
I am able to pull json data from the api - however when I follow the link - it directs me to the generic product page - when I go to the 'buy now' button I see no way to send it to the person of the wish-list...

is this expected behavior? or any Ideas on what may be the issue?

Amazon wishlist update

It would appear Amazon changed their code to not allow bots to extract info. Therefore, this no longer works...?

Picking up the wrong price

$array[$i]['price'] = pq($item)->find('span.wlPriceBold strong')->html();

The above line is where it should pick up the price for the item. What is happening is that occasionally it is picking up the Used & New price instead. The striked-out price is never picked up, only the Used & New price.

Demo returns null

Just tried this demo URL:

http://www.justinscarpetti.com/projects/amazon-wish-lister/api/?id=37XI10RRD17X2

Returns null in the page

Is this broken now?

My ID Returns "null"

Your ID works fine:
http://www.justinscarpetti.com/projects/amazon-wish-lister/api/?id=37XI10RRD17X2
but mine returns a "null"
http://www.justinscarpetti.com/projects/amazon-wish-lister/api/?id=AT9ERHVAMVGT5

I followed you instructions from your page (http://www.justinscarpetti.com/projects/amazon-wish-lister) but my user ID did not show.
So, I went to my Profile (http://www.amazon.com/gp/pdp/profile/AT9ERHVAMVGT5) and took the 13 digit number
Q: Does the ID have to be a Seller ID or can it be a standard buyer ID?
I tried to see what would happen if I switched out my ID with your in the profile http://www.amazon.com/gp/pdp/profile/37XI10RRD17X2 and it took me to an error page
Thanks for any help!

how to get a user's id

I am very new to whole of amazon api. It would be really good if you could guide me. I want a user to visit my website and retrieve his wish list of amazon. How do i go about getting his user id in the first place?

Safety issues

Hi Justin,
I plan on running this script on AWS and use this as a backend for an iOS app which uses a user's wishlist. Can you tell me about the potential legal issues and if I could get IP banned for using this screen scraping tool?

Sorry I put this as an issue, I didn't know how else I could comment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.