O'Reilly logo

Amazon Hacks by Paul Bausch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Browse and Search Categories with Browse Nodes

Use browse node IDs to find books based on categories.

Just as Amazon has alphanumeric IDs for every item they sell, they also have ID numbers representing each subject area to which items belong. Once you know the browse node IDs for subject areas you’re interested in, you can bypass the standard search forms and perform narrow, specialized searches from a URL.

Finding Browse Node IDs

The first trick is finding the browse node IDs. They’re not quite as easy to come by as ASINs because they don’t appear in URLs as frequently. They also don’t seem to follow any logical pattern, so there’s no way to guess. Instead you can browse the “category tree” that Amazon has made available through their Associates program. You don’t have to be an associate to browse the tree, 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 category levels: Baby, Books, Camera, Cell Phones, and so on. Click Books and you’ll start to see browse node codes in the URL; in this case:


The only section we’re concerned with is the node= and its value. The node here is 1000 and represents all books. On this page the categories are refined further under books: Arts & Photography, Biographies & Memoirs, Business & Investing, etc. Click on the entry “Science Fiction & Fantasy.” Once again you’ll see a new node value in the URL, 25. You can continue to drill this way and find IDs. As you do so, you’ll soon find yourself a few levels deep, for example, All Products Books Subjects Science Fiction & Fantasy Fantasy Magic & Wizards. Checking the URL, the node ID in this case is 16205.


Browse node IDs are constantly in flux. As product hierarchies change and evolve, the browse nodes evolve along with them. Remember that browse node IDs are temporary guides, not permanent markers. It’s a good idea to frequently check to make sure any browse node IDs you’re using are still being used by Amazon.

Not all browse node IDs are available through this interface, but it’s a good place to start looking for them.

Perform a Keyword Search Within a Browse Node

If you’d like to limit a search to a narrowly defined category, you can do so through the URL if you know the browse node. As with finding product detail pages, it’s just a matter of knowing the proper URL patterns (supplied by Bruce Bracken and James 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:


Instead of finding all products across every category with the keyword “merlin”, this URL shows us only those books within a specific category.

You can also search for multiple keywords by separating them with punctuation. The pipe symbol (|) means “or,” and a comma (,) means “and.” So if you wanted to find every book within “Magic & Wizards” that contains either “king” or “merlin”, separate the terms in the URL like so:


If you’d like to find every book that has both terms:


Both the “or” and “and” operators also work if you want to browse with multiple browse node codes. Say you want to list books that contain the keyword “merlin” in both the “Magic & Wizards” (16205) category or “Epic Fantasy” (16197) category. You would combine them with the pipe:


If you want to find books that are specifically listed in both of those subject areas, you would use the “and” operation with a comma:


Find Every Item Within a Browse Node

Instead of narrowing down your search results, suppose you’d like to see every product within a specific category. The URL is the same as the keyword search; you just replace the keyword with a dash (-) followed by any string of characters. So the following URL would return every book within the “Magic & Wizards” category:


Sort Your Browse Node Search Results

By default, the search results for any of the URLs above are returned in the order of “featured items”—those items Amazon most wants you to know about. You could always re-sort your results with the drop-down menu Amazon provides, as shown in Figure 1-14.

Sorting Amazon search results

Figure 1-14. Sorting Amazon search results

But you can save yourself a step by sorting results in your initial request. The rank variable allows you to specify the sort. The values available for books are summarized in Table 1-2.

Table 1-2. Specifying sort order using the rank URL variable

Rank value

Sort order


Featured Items




Average Customer Review


Price (Low to High)


Price (High to Low)


Publication Date


Alphabetical (A-Z)


Alphabetical (Z-A)

All you need to do is append the sort method to the end of the URL. To get every item from within the “Magic & Wizards” browse node, sorted by publication date, use the following URL:



Each variable/value pair in a URL is separated by ampersands (&). If you’re experiencing problems when you add a new variable, make sure it’s separated from the previous variable/value pair with an &.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required