Overview
The eBay OData API let's you search for items available via the eBay Finding API using the query syntax and formats in the Open Data Protocol.
Most common OData scenarios are based on structured databases where resources, collections are easily identified. In this particular scenario there are some restrictions from the native API side like retrieving items as root collection without providing a keyword with at least two characters.
To learn more about the OData protocol, you can browse the OData site at http://odata.org.
Our OData service is located at http://ebayodata.cloudapp.net.
Getting Started
In the following section you will find meaningful information about this particular implementation and how to consume data from eBay but in this case taking advantage of the OData protocol.
The eBay OData API is an implementation of the OData protocol built upon the eBay's existing APIs by Microsoft with help of eBay, leveraging the existing Findings and Trading APIs.
Top level colletions
The main resources available from this API are Items, Categories and Deals. A couple of sample queries are provided as examples for each resource, although complete query options are provided further in the document.
| Resource | Path | Expands | Fields |
|---|---|---|---|
| Items |
http://ebayodata.cloudapp.net/Items?search=cable http://ebayodata.cloudapp.net/Items?$filter=User/Id%20eq%20'id' http://ebayodata.cloudapp.net/Items?$filter=PrimaryCategoryId%20eq%20'20336' http://ebayodata.cloudapp.net/Items?$filter=SecondaryCategoryId%20eq%20'20336' (search parameter or $filter with Seller, PrimaryCategoryId or SecondaryCategoryId is required) |
Bidders, Transactions, Shippings, CrossPromotions, User, PrimaryCategory, SecondaryCategory, Shippings (zipcode and country are required as parameter [e.g. ?zipcode=90210&country=US] ) | Id, UserId, Title, Subtitle, SellingState, TimeLeft, Currency, CurrentPrice, MinimumToBid, BidCount, Description, QuantitySold, AutoPay, CharityId, Country, Compatibility, GalleryUrl, GlobalId, PostalCode, ReturnsAccepted, PrimaryCategoryId, SecondaryCategoryId, Condition, ListingInfo, Distance, ShippingInformation, ViewItemUrl, PaymentMethods |
| Categories | http://ebayodata.cloudapp.net/Categories | Parent, Children | Id, Name, Level, LeafCategory, BestOfferEnabled, ParentId |
| Deals | http://ebayodata.cloudapp.net/Deals | Item, PrimaryCategory | Id, Title, Description, EndTime, DealUrl, ConvertedCurrentPrice, PrimaryCategoryId, Location, Quantity, QuantitySold, Msrp, SavingsRate, AutoPay, Hot, Tier, PictureUrl, SmallPictureUrl, Picture175Url |
Individual resources
| Resource | Path | Expands | Fields |
|---|---|---|---|
| Users |
http://ebayodata.cloudapp.net/Users('id') |
Items, Feedback | Id, FeedbackRatingStar, FeedbackScore, NewUser, TopRatedSeller, RegistrationDate, RegistrationSite, Status, PositiveFeedbackPercent |
| Items |
http://ebayodata.cloudapp.net/Items('id') |
Bidders, Transactions, Shippings, CrossPromotions, User, PrimaryCategory, SecondaryCategory | Id, UserId, Title, Subtitle, SellingState, TimeLeft, Currency, CurrentPrice, MinimumToBid, BidCount, Description, QuantitySold, AutoPay, CharityId, Country, Compatibility, GalleryUrl, GlobalId, PostalCode, ReturnsAccepted, PrimaryCategoryId, SecondaryCategoryId, Condition, ListingInfo, Distance, ShippingInformation, ViewItemUrl, PaymentMethods |
| Bidders |
http://ebayodata.cloudapp.net/Bidders(ItemId='id',TimeBidTicks='id') |
ItemId, TimeBidTicks, TimeBid, Action, User, Currency, MaxBid, Quantity | |
| Feedback |
http://ebayodata.cloudapp.net/Feedback(FeedbackId='id',UserId='id') |
User | UserId, FeedbackId, CommentingUser, Type, Comment, Role, Time |
| Deals |
http://ebayodata.cloudapp.net/Deals('id') |
Item | Id, Title, Description, EndTime, DealUrl, ConvertedCurrentPrice, PrimaryCategoryId, Location, Quantity, QuantitySold, Msrp, SavingsRate, AutoPay, Hot, Tier, PictureUrl, SmallPictureUrl, Picture175Url |
| Transactions |
http://ebayodata.cloudapp.net/Transactions(ItemId='id',TransactionId='id') |
Item | ItemId, Id, AmountPaid, Buyer, CreatedDate, QuantityPurchased |
Parameters support
These are the allowed parameters for manipulating the data that comes out from the OData Service, due to the nature of the API $inlinecount and $expand aren't currently supported for this version.
| Name | Description | Values | Example |
|---|---|---|---|
| filter | Filter the results | See filtering support section | http://ebayodata.cloudapp.net/Items?search=cable&$filter=BidCount%20gt%202 |
| format | Results format | json, jsonp, atom (default) | http://ebayodata.cloudapp.net/Items?search=cable&$filter=BidCount%20gt%202&$format=json |
| top/skip | Paging options | Integer values | http://ebayodata.cloudapp.net/Items?search=cable&$filter=BidCount%20gt%202&$top=2 |
| orderby | Sort results | Resource field (See supported orderby fields section) | http://ebayodata.cloudapp.net/Items?search=cable&$orderby=ListingInfo/EndTime%20asc |
| select | Fields to return | Fields for the resource type (see field list in resource table) | http://ebayodata.cloudapp.net/Items?search=cable&$select=UserId,Title |
Filtering support
These are the supported fields and operations while filtering out the data that comes out from the OData Service. All these items along with its corresponding operators can be used for filtering data.
Order by support
| Field | Methods | Example |
|---|---|---|
| BidCount |
asc | desc (see the required 'Aution' filter in the example) |
http://ebayodata.cloudapp.net/Items/?search=cable&$orderby=BidCount%20asc&$filter=ListingInfo/ListingType%20eq%20'Auction' |
| CurrentPrice | desc | http://ebayodata.cloudapp.net/Items?search=cable&$orderby=CurrentPrice%20desc |
| ListingInfo/EndTime | asc | http://ebayodata.cloudapp.net/Items?search=cable&$orderby=ListingInfo/EndTime%20asc |
| ListingInfo/StartTime | desc | http://ebayodata.cloudapp.net/Items?search=cable&$orderby=ListingInfo/StartTime%20desc |
| CurrentPrice,ShippingInformation/ShippingServiceCost | asc | desc |
http://ebayodata.cloudapp.net/Items/?search=cable&$orderby=CurrentPrice,ShippingInformation/ShippingServiceCost%20desc http://ebayodata.cloudapp.net/Items/?search=cable&$orderby=CurrentPrice,ShippingInformation/ShippingServiceCost%20asc |