Amazon product advertising API changes

At the time I wrote the Umlaut Amazon adapter, which uses the Amazon product services API (which may actually be currently called the “AWSECommerceService”, at that time just called “AWS”), you could ask for a variety of ResponseGroup’s when you made your request. I asked for ResponseGroup=Large,Subjects.

“Subjects” meant that included in the response would be the Amazon assigned “subjects” for the item. I was asking for those, and storing them, although I wasn’t actually doing anything with them, I figured they might be useful later.

It appears that ResponseGroup=Subjects is no longer available. In fact, while the error message if you ask for them says it’s “deprecated”, it’s kind of beyond “deprecated” — if you ask for it, you don’t get a resposne back at _all_ not even with other response groups, in this case “Large”.  You just get an error message. Um, that’s a  bit beyond “deprecated”, Amazon.

This error response is returned with a “410 Gone” HTTP status code. I guess that’s more or less appropriate. My existing code (that I wrote years ago) wasn’t actually testing for HTTP status code, but was looking at the returned XML for an error message (back then, and it may still be true, you’d often get a 200 http response, but with an error reported in the XML).   Previously, the error was included in the XML at the confusing xpath: “/ItemLookupResponse/Items/Request/Errors/Error”  (not sure if this used to have namespaces or not)

But now the error is returned in a different XML structure, simply at:

<?xml version=\"1.0\"?>
  <ItemLookupErrorResponse xmlns="http://ecs.amazonaws.com/doc/2005-10-05/">
     <Error>
        <Code>Deprecated</Code>
        <Message>Feature Subjects is deprecated.</Message>
     </Error>
     <RequestID>[redacted]</RequestID>
   </ItemLookupErrorResponse>"

So my code wasn’t even identifying the error. Doh. Also, this element is in a namespace, if you are using a namespace-aware parser (this old code uses Hpricot, so it wasn’t, namespaces didn’t matter).

Tricky. My code broke. Now it’s fixed. Curious if either of these chagnes are documented anywhere, but don’t really have time to look. I certainly never noticed it in the periodic notices Amazon sends me, but maybe I missed it. I did notice plenty of other things that didn’t effect me. Other changes are currently noted on the api home page, but not this more-than-a-deprecation of ResponseGroup=Subjects.

One thought on “Amazon product advertising API changes

  1. heh, no kidding, we met the same surprise. Do you know is any other way to pull subjects from Amazon?

Leave a comment