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:
- Log in to the Developers Program and navigate to your Application Keys page.
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.
In the Production token section, click User Tokens in the App ID credential box:
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.
- Click Copy Token.
Step 3: Make the call
This example configures a Browse API search request to retrieve a list of Beatles rock memorabilia from the Production servers.
HTTP method: GET URL (Production): https://api.ebay.com/buy/browse/v1/item_summary/search HTTP headers: Authorization = Bearer <Your-Application-token-value> Search request query parameters: category_ids=108765 q=Beatles filter=price:[200..500] filter=priceCurrency:USD limit=10
Note that the call does not require a request body. Instead, all the parameters for the request are passed as query parameters in the URL:
||Rock & Pop Music Memorabilia category|
||Keyword in search|
Must be used with the
||Number of items to return|
Example cURL request
The following cURL command shows how to configure the search request, it's wrapped for readability.
Insert your OAuth Application access token in the command, then make the call:
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>'
If this example gets you excited about making eBay API calls, check out the following docs: