Find the answer to your question
Advanced Search
I am trying to access the ConvertedCurrentPrice for an Item returned by findItemsAdvanced (Finding API) using JSON. However, I keep getting back[object Object] for the price. How do I access the actual value?
Detailed Description
An easy way to determine how to access the values, is to make an HTTP Get call using your browser. So for instance, consider this request (we are restricting to 2 results for brevity):
http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsAdvanced&SERVICE-VERSION=1.8.0&paginationInput.entriesPerPage=5&SECURITY-APPNAME=<Your APPID>&RESPONSE-DATA-FORMAT=JSON&GLOBAL-ID=EBAY-US&keywords=iPod%20Touch%204g
paste it in a browser like IE or FireFox and it will return a response similar to this (this has been formatted to make it human-readable):
{ "findItemsAdvancedResponse" : [ { "ack" : [ "Success" ],
"itemSearchURL" : [ "http://shop.ebay.com/i.html?_nkw=iPod+Touch+4g&_ddo=1&_ipg=2&_pgn=1" ],
"paginationOutput" : [ { "entriesPerPage" : [ "2" ],
"pageNumber" : [ "1" ],
"totalEntries" : [ "31786" ],
"totalPages" : [ "15893" ]
} ],
"searchResult" : [ { "@count" : "2",
"item" : [ { "autoPay" : [ "true" ],
"condition" : [ { "conditionDisplayName" : [ "Used" ],
"conditionId" : [ "3000" ]
} ],
"country" : [ "US" ],
"galleryPlusPictureURL" : [ "http://galleryplus.ebayimg.com/ws/web/220772438454_1_0_1.jpg" ],
"galleryURL" : [ "http://thumbs3.ebaystatic.com/m/myF4Io-h2WPp9fqvoV5mQPA/140.jpg" ],
"globalId" : [ "EBAY-US" ],
"itemId" : [ "220772438454" ],
"listingInfo" : [ { "bestOfferEnabled" : [ "false" ],
"buyItNowAvailable" : [ "false" ],
"endTime" : [ "2011-04-29T22:34:42.000Z" ],
"gift" : [ "false" ],
"listingType" : [ "StoreInventory" ],
"startTime" : [ "2011-04-19T22:34:42.000Z" ]
} ],
"location" : [ "Glen Allen,VA,USA" ],
"paymentMethod" : [ "PayPal" ],
"postalCode" : [ "23059" ],
"primaryCategory" : [ { "categoryId" : [ "73839" ],
"categoryName" : [ "iPod & MP3 Players" ]
} ],
"productId" : [ { "@type" : "ReferenceID",
"__value__" : "92352708"
} ],
"returnsAccepted" : [ "true" ],
"sellingStatus" : [ { "convertedCurrentPrice" : [ { "@currencyId" : "USD",
"__value__" : "182.99"
} ],
"currentPrice" : [ { "@currencyId" : "USD",
"__value__" : "182.99"
} ],
"sellingState" : [ "Active" ],
"timeLeft" : [ "P9DT13H29M54S" ]
} ],
"shippingInfo" : [ { "expeditedShipping" : [ "true" ],
"handlingTime" : [ "2" ],
"oneDayShippingAvailable" : [ "false" ],
"shipToLocations" : [ "US" ],
"shippingServiceCost" : [ { "@currencyId" : "USD",
"__value__" : "0.0"
} ],
"shippingType" : [ "Free" ]
} ],
"subtitle" : [ "FREE EARBUD+CABLE*FREE SHIPPING *LATEST MODEL*ORIGINAL" ],
"title" : [ "Apple iPod Touch 8GB 4th Gen 4G Generation Camera Music" ],
"viewItemURL" : [ "http://cgi.ebay.com/Apple-iPod-Touch-8GB-4th-Gen-4G-Generation-Camera-Music-/220772438454?pt=Other_MP3_Players" ]
},
{ "autoPay" : [ "false" ],
"condition" : [ { "conditionDisplayName" : [ "Used" ],
"conditionId" : [ "3000" ]
} ],
"country" : [ "US" ],
"galleryPlusPictureURL" : [ "http://galleryplus.ebayimg.com/ws/web/170628876270_1_0_1.jpg" ],
"galleryURL" : [ "http://thumbs3.ebaystatic.com/m/m2pxMsrAG4B2zT_MGXXUJxw/140.jpg" ],
"globalId" : [ "EBAY-US" ],
"itemId" : [ "170628876270" ],
"listingInfo" : [ { "bestOfferEnabled" : [ "false" ],
"buyItNowAvailable" : [ "false" ],
"endTime" : [ "2011-04-20T14:54:55.000Z" ],
"gift" : [ "false" ],
"listingType" : [ "Auction" ],
"startTime" : [ "2011-04-15T14:54:55.000Z" ]
} ],
"location" : [ "Trenton,TX,USA" ],
"paymentMethod" : [ "PayPal" ],
"postalCode" : [ "75490" ],
"primaryCategory" : [ { "categoryId" : [ "73839" ],
"categoryName" : [ "iPod & MP3 Players" ]
} ],
"productId" : [ { "@type" : "ReferenceID",
"__value__" : "92343810"
} ],
"returnsAccepted" : [ "false" ],
"sellingStatus" : [ { "bidCount" : [ "25" ],
"convertedCurrentPrice" : [ { "@currencyId" : "USD",
"__value__" : "212.5"
} ],
"currentPrice" : [ { "@currencyId" : "USD",
"__value__" : "212.5"
} ],
"sellingState" : [ "Active" ],
"timeLeft" : [ "P0DT5H50M7S" ]
} ],
"shippingInfo" : [ { "expeditedShipping" : [ "true" ],
"handlingTime" : [ "2" ],
"oneDayShippingAvailable" : [ "false" ],
"shipToLocations" : [ "US" ],
"shippingServiceCost" : [ { "@currencyId" : "USD",
"__value__" : "15.0"
} ],
"shippingType" : [ "Flat" ]
} ],
"title" : [ "Apple iPod touch 4G (32 GB) used for less then 2 weeks" ],
"viewItemURL" : [ "http://cgi.ebay.com/Apple-iPod-touch-4G-32-GB-used-less-then-2-weeks-/170628876270?pt=Other_MP3_Players" ]
}
]
} ],
"timestamp" : [ "2022-08-23T10:38:06.078Z" ],
"version" : [ "1.13.0" ]
} ] }
This shows you that you can access the value of CurrentPrice as follows:
item.sellingStatus.currentPrice.__value__
Similarly, if you want to access the shipping type, it shows you that you need to use the following:
item.shippingInfo.shippingType