Search code examples
barcodeebay-api

get item detail through ebay api


I am aim to get item detail (name, category, even price) through ebay api, JSON format.

Here is a sample item searched by ebay, EAN barcode 0705632085943: https://www.ebay.co.uk/sch/i.html?_osacat=0&_odkw=0705632085943&_from=R40&_trksid=m570.l1313&_nkw=0705632085943&_sacat=0

I had read this page released by ebay: getProductDetails : https://developer.ebay.com/devzone/product/CallRef/getProductDetails.html

So in my project, I used:

http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=getProductDetails&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=My-App-Name&RESPONSE-DATA-FORMAT=JSON&productDetailsRequest.productIdentifier.EAN = 5053826000186

But, back with:

{"errorMessage":[{"error":[{"errorId":["2000"],"domain":["CoreRuntime"],"severity":["Error"],"category":["Request"],"message":["Service operation getProductDetails is unknown"],"subdomain":["Inbound_Meta_Data"],"parameter":[{"@name":"Param1","__value__":"getProductDetails"}]}]}]}

I known little about web-language and started with Swift. Does there has any feasible advice in dealing with this?


Solution

  • This should work if you are using a valid EAN code from eBay

    http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByProduct&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=YOUR_APP_ID&RESPONSE-DATA-FORMAT=JSON&REST-PAYLOAD&paginationInput.entriesPerPage=2&productId.@type=EAN&productId=5053826000186

    From the Doc:

    The EAN value for books (most commonly used in European countries). If you know a book's EAN, you can use this instead of the eBay Reference ID to search for that book.

    http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByProduct&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=YOUR_APP_ID&RESPONSE-DATA-FORMAT=JSON&REST-PAYLOAD&paginationInput.entriesPerPage=2&productId.@type=ReferenceID&productId=53039031