Question

I need my application to be fast so I want to specify exactly what I want in the response rather than having tons of superfluous information in there. I know about ResponseGroups but there isn't a group which limits the information I get back. And if you look at my current implementation it sends back a ton of information that has little to do with the products I'm looking for. The real problem is that it's just bulky.

Is there any way to specify very specific things per product? For example:

  • Formatted price
  • Name
  • Link
  • Image
  • Description

I don't care about anything else.

Note: I'm using Node-APAC to handle requests to the Amazon Product API. So it converts the response XML into JSON for me.

Here's what I get back (the bulk):

{
    ItemSearchResponse: {
        $: {...},
        OperationRequest: [...],
        Items: [
            {
                Request: [...],
                TotalResults: [...],
                TotalPages: [...],
                MoreSearchResultsUrl: [...],
                Item: [
                    {
                        ASIN: [...],
                        DetailPageURL: [...],
                        ItemLinks: [...],
                        SmallImage: [...],
                        MediumImage: [...],
                        LargeImage: [...],
                        ImageSets: [...],
                        ItemAttributes: [...],
                        OfferSummary: [...]
                    },
                    {...},
                    {...},
                    {...},
                    {...}
                ]
            }
        ]
    }
}

What I would like to get back is:

[
  {
    FormattedPrice: 12.99,
    Name: "The Hitchhiker's Guide to the Galaxy"
    Link: "http://www.amazon.com/Hitchhikers-Guide-Galaxy-Douglas-Adams/dp/0345391802"
    Image: "http://g-ecx.images-amazon.com/images/G/01/ciu/eb/05/0663124128a0de9c79891010.L._AA300_.jpg"
    Description: "<Book-Description>"
  },
  {...},
  {...}
]
Was it helpful?

Solution

I don't think there is a way to specify exactly what you want. You have to go through the ReponseGroup. In your case, I would suggest you to pass "Small,OfferSummary" for the ResponseGroup value. It should return what you need while keeping the response size reasonable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top