I’m using Amazon’s Product Advertising API (formerly known as ECS) in one of my projects. I use it to search for books; only printed books to be exact (no eBooks). Querying for said books proved more difficult than it should be.

The ItemSearch API allows search queries to specify the category (i.e. books) to search through. That was easy. Narrowing the search to only printed books was not apparent. After staring at API XML responses for a couple books, I noticed that each book had a <binding>. Examples of <binding>’s included “Hardcover”, “Kindle eBook” and “Paperback”.

Filtering search results by <binding> is available through the power request parameter. I filter my search for only hardcover and paperback bindings. There may be other bindings that qualify as “printed book”, but the two bindings that I filter with are good enough for me.

Here is an example query using the power request parameter. The example calls the Amazon API using the amazon-ecs ruby gem.

1
2
3
4
Amazon::Ecs.item_search(book_title, {
  :search_index => "Books",
  :power => "binding:Hardcover or Paperback"
})