Skip to main content

Request Headers

Below are request headers for REST and GraphQL APIs.

Common Request Headers

You must supply a set of HTTP headers when making a request to an eBay REST or GraphQL operation. These headers can include both standard HTTP headers and eBay custom headers. All eBay custom headers start with "X-EBAY-C-".

Some eBay custom headers are packed headers, meaning they can contain multiple name/value pairs. The format for a name/value pair is <name>=<value>, and you must separate multiple values in a single header by commas. The following example shows the general format:

  X-EBAY-C-PACKED-EXAMPLE: fig=7,bar="quux",value=42

The table below presents the standard request headers that eBay accepts, as well as the custom eBay headers that you can use. Although not all possible request headers are listed in this table (some headers are still in flux), the ones listed here are stable.

Note: All headers should be treated as case-insensitive and must follow RFC standards.

HTTP headers for eBay REST and GraphQL requests

HTTP Header

Required

Description

Accept

Conditionally required

Accept indicates the formats the client accepts for the response.

Note: This header pairs with the Content-Type header, which specifies the format required by eBay for the request body. Currently, most eBay interfaces require request bodies to be formatted in JSON. See Content-Type Header for details and other supported headers.

JSON is the default and only format returned in response bodies.

Example:
  Accept: application/json

Accept-Charset

Optional

Accept-Charset indicates the character sets the client accepts for the response.

If the server cannot respond using the value specified in Accept-Charset, the server usually ignores the value and without an error responds in utf-8.

Example:
  Accept-Charset: utf-8

Accept-Encoding

Optional –
Conditionally recommended

Accept-Encoding indicates the compression-encoding algorithms the client accepts for the response.

We strongly recommend you include this header in all requests that can potentially return large response payloads. Compression encoding can increase performance by dramatically reducing response-payload size.

Currently, gzip is the only supported compression format.

Example:
  Accept-Encoding: gzip

Accept-Language

Conditionally required

Accept-Language indicates the natural language and locale preferred by the client for the response.

While recommended for all requests, you must supply this header when you are targeting the specific locale of a marketplace that supports multiple locales. For example:

  • Use fr-BE when targeting the Française locale of the Belgium marketplace.
  • Use fr-CA when targeting the Française locale of the Canadian marketplace.

Note: For the language values and locales supported by the different eBay marketplaces, see Marketplace ID values.

Example:
  Accept-Language: fr-CA

Authorization

Required

Authorization specifies the OAuth token and token type used to authorize the request.

You must supply this request header in each request you make to the eBay REST interfaces. For details, see OAuth access tokens.

Example:
  Authorization: Bearer <accessToken>

Content-Type

Conditionally required

Content-Type indicates the format of the request body provided by the client.

Note: This header pairs with the Accept header, which indicates the formats the client accepts for the response. Currently, all Accept headers are formatted in JSON. See Accept Header for details.

This header is usually required for all POST and PUT operations. If omitted in the request, this header defaults to application/json. Supported values include:
  Content-Type: application/json
  Content-Type: multipart/form-data
  Content-Type: application/octet-stream

Content-Language

Conditionally required

This header sets the natural language that will be used in request payload fields that support user-defined text. Supported values for this header include en-US for English or de-DE for German.

While recommended for all requests, you must supply this header when you are targeting the specific locale of a marketplace that supports multiple locales. For example:

  • Use fr-BE when targeting the Française locale of the Belgium marketplace.
  • Use fr-CA when targeting the Française locale of the Canadian marketplace.

Note: For the language values and locales supported by the different eBay marketplaces, see Marketplace ID values.

Marketplace ID Values

The following table lists supported Marketplace IDs, their associated countries/regions, the URLs to the marketplaces, and the locales supported by each marketplace:

Note: The following Marketplace ID values can be used as input values for the X-EBAY-C-MARKETPLACE-ID header.

Marketplace ID values

Marketplace IDs

Country/Region

Marketplace Site

Locale Support

EBAY_US

United States

https://www.ebay.com
(For items in the US motor vehicles or the P&A categories, use EBAY_MOTORS_US.)

en-US

EBAY_AT

Austria

https://www.ebay.at

de-AT

EBAY_AU

Australia

https://www.ebay.com.au

en-AU

EBAY_BE

Belgium

https://www.benl.ebay.be/ (Nederlandse)
https://www.befr.ebay.be/ (Française)

nl-BE, fr-BE

EBAY_CA

Canada

https://www.ebay.ca (English)
https://www.cafr.ebay.ca/ (Française)

en-CA, fr-CA

EBAY_CH

Switzerland

https://www.ebay.ch

de-CH

EBAY_DE

Germany

https://www.ebay.de

de-DE

EBAY_ES

Spain

https://www.ebay.es

es-ES

EBAY_FR

France

https://www.ebay.fr

fr-FR

EBAY_GB

Great Britain

https://www.ebay.co.uk

en-GB

EBAY_HK

Hong Kong

https://www.ebay.com.hk

zh-HK

EBAY_IE

Ireland

https://www.ebay.ie

en-IE

EBAY_IT

Italy

https://www.ebay.it

it-IT

EBAY_MY

Malaysia

https://www.ebay.com.my

en-US

EBAY_NL

Netherlands

https://www.ebay.nl

nl-NL

EBAY_PH

Philippines

https://www.ebay.ph

en-PH

EBAY_PL

Poland

https://www.ebay.pl

pl-PL

EBAY_SG

Singapore

https://www.ebay.com.sg

en_US

EBAY_TW

Taiwan

https://www.ebay.com.tw

zh-TW

EBAY_MOTORS_US

United States

https://www.ebay.com/motors
(Resolves to the parent "Auto Parts and Vehicles" category on the EBAY_US site.)

en-US

In addition to this set of common HTTP headers, some methods or APIs make use of additional headers. Check the documentation of the method for details on any additional headers that might be required to make a request to the interface.