Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

pipeline status

A client library for the ebay API targeting .NET standard 2.0.

Usage Examples

var client = new EbayClient("clientId", "clientSecret");
var item = await client.BrowseAPI.Item.GetItem("itemId");
var itemSearch = await client.BrowseAPI.ItemSummary.Search("drone", 10);

Supported APIs

Currently, only the Browse API is supported. follows the same hierarchical structure as the official documentation.

For instance, to call 'Get Item', you would do: client.BrowseAPI.Item.GetItem(<itemId>);

Getting started

Add the package:

dotnet add package Ebay.Net

Authentication supports both Production and Sandbox environments. You set the Environment enum during initialisation of the client or authenticator like shown in examples below. The default is Environment.Production.

You will require your ClientID and your ClientSecret, which you can grab from here.

You authenticate via OAuth2 in any of the following ways:

// Simplest way is to pass your clientId and secret directly
var client = new EbayClient("clientId", "clientSecret", Environment.Production);

// Format specification:
// You can use and encode: yourClientId:yourClientSecret
var client = new EbayClient("base64encoded");

// Manually create and set the authenticator:
// You can also add your own implementation by implementing IOAuth2Authenticator
var auth = new OAuth2Authenticator("base64encoded");
var client = new EbayClient(auth); will handle token expiration and renew for you.

Error and Exception Handling

Any error in the library will result in a generic EbayException. You can extract the message to determine the cause of the issue.

    var client = new EbayClient(...);
    var item = await client.BrowseAPI.Item.GetItem("Fake-Item-Will-Throw-Exception");
catch(EbayException ex)
    var message = ex.Message;
    var stackTrace = e.InnerException;