Making a call

Welcome to the eBay RESTful APIs!

This guide offers a taste of how to make calls to the eBay APIs in 3 quick steps.

The sample described below makes a GET request to eBay—you'll soon be retrieving live search data from the eBay production servers!

Step 1: Become an eBay Developers Program member

You're not already a member?
Follow the steps on the page Creating an eBay Developers Program account.

Step 2: Get an access token

Calls to the eBay APIs are authorized with an access token.

Get an access token through your developer account:

  1. Log in to the Developers Program and navigate to your Application Keys page.
  2. If you don't already have a Production key set, create one now by clicking Create a Keyset the Production keyset section.

    eBay creates and displays a set of application keys that let you make calls to the eBay Production environment. Instead of using these keys now, this exercise uses a temporary Application token.

  3. In the Production token section, click User Tokens in the App ID credential box:

    Getting your OAuth tokens

  4. Click Get OAuth Application Token.

    Tip: eBay creates and displays an Application token. This token is valid for a limited time span. If you get an invalid token error when you make a call using this token, simply create a new token and use the new token in your call.

  5. Click Copy Token.

Step 3: Make the call

Inset your Application token into the following call example. The example makes a call to the eBay Production servers to retrieve a list of Beatles rock memorabilia (note that the URL is wrapped for readability):

  HTTP method:  GET
  URL (Production): https://api.ebay.com/buy/browse/v1/item_summary/search?

  HTTP headers:
    Authorization = Bearer <Your-Application-token-value>

  Browse request parameters:
    category_ids=108765
    q=Beatles
    filter=price:[200..500]
    filter=priceCurrency:USD
    limit=10

Call details

Note that the call does not require a request body. Instead, all the parameters for the call are passed as query parameters in the URL:

Query Parameter Description
category_ids=108765 Rock & Pop Music Memorabilia category
q=Beatles Keyword in search
filter=price:[200..500] Price range
filter=priceCurrency:USD Must be used with the price filter
limit=10 Number of items to return

Example cURL request

The following command shows how to configure a cURL command for the Browse request (wrapped for readability):

curl -X GET 'https://api.ebay.com/buy/browse/v1/item_summary/search?
   category_ids=108765&
   q=Beatles&
   filter=price:[200..500]&
   filter=priceCurrency:USD&
   limit=10'
 -H 'Authorization: Basic <Your-App-access-token>' 

What's next?

If this example gets you excited about making eBay API calls, check out the following docs: