Friday, December 6, 2013

Teiid Translator for EBay

I wrote a very basic translator for EBay Finding API. Implemented only findByKeyword API call, but this seems enough to issue a query against EBay database of active auctions and retrieve result.

Link to Teiid EBay translator on GitHub.


You should have an active EBay Develpers License, which you can get for free at Also you have to download an actual EBay FindingKitJava archive from EBay Developer website, and extract the finding.jar from lib folder. I used version 1.12.0 of finding API jar (Built-Date: 2011-04-28 14:10:35), let me know if you have problems with other versions. For convenience you can put this jar into your local maven repository, see the "version.ebay-finding-java-driver" parameter in parent pom.xml for the reference.
Put your API key to (see DEVELOPER_KEY static field) and run this class as a unit test to make sure your API key is working.

If everything is fine, you should get a similar result:
Returned results:[
|271336881138|Harry Potter and the Order of the Phoenix  (Xbox 360, 2007)|EBAY-US|null|Video Games||||null|56274325|PayPal|false|91911|Chula Vista,CA,USA|US||||Active|Auction|false||null||Good|null, 
|171183853715|Harry Potter and the Order of the Phoenix Figures Harry, Hermione, Ron and Map|EBAY-US|null|TV, Movie & Video Games||||null|152040891|PayPal|false|34119|Naples,FL,USA|US|||9.8 USD|Active|Auction|false||null||New|null


  • translator-ebay - the actual Teiid translator code;
  • ebay-api- a wrapper for EBayConnection interface;
  • connector-ebay - a JBoss resource adapter. It supposed to get a EBay Developer key as a configuration parameter if translator will be executed in real (non-embedded) Teiid instance.
The EBay Teiid translator is a simple stored procedure, which accepts a keywords separated by space as a single input parameter. The stored procedure input parameter name is obviously "keywords".

call ebaydata.findByKeyword('harry potter phoenix');

Output resultset has several important fields provided by Ebay Finding API:
  • "itemId"
  • "title"
  • "globalId"
  • "subtitle"
  • "primaryCategory"
  • "secondaryCategory"
  • "galleryURL"
  • "viewItemURL"
  • "charityId"
  • "productId"
  • "paymentMethod"
  • "autoPay"
  • "postalCode"
  • "location"
  • "country"
  • "storeInfo"
  • "sellerInfo"
  • "shippingInfo"
  • "sellingStatus"
  • "listingInfo"
  • "returnsAccepted"
  • "galleryPlusPictureURL"
  • "compatibility"
  • "distance"
  • "condition"
  • "delimiter"
The underlying EBay Finding API is a SOAP webservice, see the FindingService.wsdl from downloaded for description of each of the returned fields.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.