1.1 Hacks #1-12
Using Amazon.com is easy. Even novice web users with a bit of timeand curiosity can find exactly what they're looking for and completea transaction fairly effortlessly. Beneath this user-friendlyexterior, though, is a powerful application that helps peoplediscover information, voice opinions, participate in a community, andsell things.
First and foremost, Amazon.com is a web application not to be confused withsimple, flat, static pages. In reality, each "page" at Amazon isgenerated right when you request it, personalized for your viewingpleasure and particular interests. Amazon can track which productsyou've viewed and display a list of similar or related products. Orit can include an item from your Wish List on another item's productdetail page. When browsing the site, most of the factors that makethe experience unique are hidden from view. But the nature of theWebwhich for the most part consists of simple, text-basedpages addressed by URLexposes some of these factors, andallows you to play with the settings embedded in URLs and pages toexert some minor control over the application and the pages it cooksup and serves you.
Hack 8 Browse and Search Categories with Browse Nodes
Use browse node IDs to find books based oncategories .
Just as Amazon has alphanumeric IDs forevery item they sell, they also have ID numbers representing eachsubject area to which items belong. Once you know the browse node IDsfor subject areas you're interested in, you can bypass the standardsearch forms and perform narrow, specialized searches from a URL.
8.1 Finding Browse Node IDs
The first trick isfinding the browse node IDs. They're not quite as easy to come by asASINs because they don't appear in URLs as frequently. They alsodon't seem to follow any logical pattern, so there's no way to guess.Instead you can browse the "category tree" thatAmazon has made available through theirAssociates program. You don't have to be an associate to browse thetree, however; you can reach it at http://associates.amazon.com/exec/panama/associates/resources/build-links/amazon-recommends/browse-bestsellers.html.
Once at this page you'll see a list of the highest product categorylevels: Baby, Books, Camera, Cell Phones, and so on. Click Books andyou'll start to see browse node codes in the URL; in this case:
http://associates.amazon.com/exec/panama/associates/resources/build-links/ [RETURN] amazon-recommends/browse-bestsellers.html/086-9645301-8693838?t=&
node=1000 [RETURN] &mode=browse-books
The only section we're concerned with is the node= and its value. The node here is 1000 and represents all books. Onthis page the categories are refined further under books: Arts &Photography, Biographies & Memoirs, Business & Investing,etc. Click on the entry "Science Fiction & Fantasy." Once againyou'll see a new node value in the URL, 25. You can continue to drillthis way and find IDs. As you do so, you'll soon find yourself a fewlevels deep, for example, All Products Books Subjects Science Fiction & Fantasy Fantasy Magic & Wizards. Checking the URL, the node ID in thiscase is 16205.
| Browse node IDs are constantly in flux. As product hierarchies changeand evolve, the browse nodes evolve along with them. Remember thatbrowse node IDs are temporary guides, not permanent markers. It's agood idea to frequently check to make sure any browse node IDs you'reusing are still being used by Amazon. |
|
Not all browse node IDs are available through this interface, butit's a good place to start looking for them.
8.2 Perform a Keyword Search Within a Browse Node
If you'd like to limit a search to a narrowlydefined category, you can do so through the URL if you know thebrowse node. As with finding product detail pages, it's just a matterof knowing the proper URL patterns (supplied by Bruce Bracken andJames Crowley at Amazon) and filling in values in the proper places.Using our previous example, we can perform a search for "merlin"inside of browse node 16205, "Magic & Wizards." The URL is:
http://amazon.com/exec/obidos/search-handle-url/index=books [RETURN] &field-keywords=
merlin&field-browse=
16205Instead of finding all products across every category with thekeyword "merlin", this URL shows us only those books within aspecific category.
You can also search for multiple keywords by separating them withpunctuation. The pipe symbol ( | ) means "or," and acomma (,) means "and." So if you wanted to findevery book within "Magic & Wizards" that contains either "king"or "merlin", separate the terms in the URL like so:
http://amazon.com/exec/obidos/search-handle-url/index=books [RETURN] &field-keywords=
merlin|king&field-browse=16205
If you'd like to find every book that has both terms:
http://amazon.com/exec/obidos/search-handle-url/index=books [RETURN] &field-keywords=
merlin,king&field-browse=16205
Both the "or" and "and" operators also work if you want to browsewith multiple browse node codes. Say you want to list books thatcontain the keyword "merlin" in both the "Magic & Wizards"(16205) category or "Epic Fantasy" (16197) category. You wouldcombine them with the pipe:
http://amazon.com/exec/obidos/search-handle-url/index=books [RETURN] &field-keywords=merlin&
field-browse=16205|16197If you want to find books that are specifically listed in both ofthose subject areas, you would use the "and" operation with a comma:
http://amazon.com/exec/obidos/search-handle-url/index=books [RETURN] &field-keywords=merlin&
field-browse=16205,161978.3 Find Every Item Within a Browse Node
Instead of narrowing down your search results,suppose you'd like to see every product within aspecific category. The URL is the same as the keyword search; youjust replace the keyword with a dash ( - ) followedby any string of characters. So the following URL would return everybook within the "Magic & Wizards" category:
http://amazon.com/exec/obidos/search-handle-url/index=books [RETURN] &field-keywords=
-junk&field-browse=16205
8.4 Sort Your Browse Node Search Results
By default, .
Figure 1-14. Sorting Amazon search results
But you can save yourself a step by sorting results in your initialrequest. The rank variable allows you to specifythe sort. The values available for books are summarized in .
Table 1-2. Specifying sort order using the rank URL variable
Rank value | Sort order |
---|
pmrank | Featured Items |
salesrank | Best-Selling |
reviewrank | Average Customer Review |
pricerank | Price (Low to High) |
-pricerank | Price (High to Low) |
daterank | Publication Date |
titlerank | |