analytics API1.2.0

getTrafficReport

GET
/traffic_report
This method returns a report that details the user traffic received by a seller's listings.

A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated.

When using this call:
  • Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details.
  • You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request.
  • Parameter names are case sensitive, but metric names are not.

    For example, the following are correct:

    • sort=LISTING_IMPRESSION_TOTAL
    • sort=lisitng_impression_total
    • metric=lisitng_impression_total
    However, these are incorrect:
    • SORT=LISTING_IMPRESSION_TOTAL
    • SORT=lisitng_impression_total
    • Metric=lisitng_impression_total
For more information, see Traffic report details.

Input

Resource URI (production)

GET https://api.ebay.com/sell/analytics/v1/traffic_report?

URI parameters

ParameterTypeDescription
dimensionarray of stringThis query parameter specifies the dimension, or "attribute," that is applied to the report metric.

Valid values: DAY or LISTING

Examples
  • If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in:
    12-06-17: 32, 12-07-17: 54, ...
  • If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range.

    For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range.

Occurrence: Required

metricarray of stringThis query parameter specifies the metrics you want covered in the report.

Specify a comma-separated list of the metrics you want included in the report.

Valid values:
  • CLICK_THROUGH_RATE
    The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page.
    Localized name: Click through rate
  • LISTING_IMPRESSION_SEARCH_RESULTS_PAGE
    The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page.
    Localized name: Listing impressions from the search results page
  • LISTING_IMPRESSION_STORE
    The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page.
    Localized name: Listing impressions from your Store
  • LISTING_IMPRESSION_TOTAL
    The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page.
    This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE.
    Localized name: Total listing impressions
  • LISTING_VIEWS_SOURCE_DIRECT
    The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark.
    Localized name: Direct views
  • LISTING_VIEWS_SOURCE_OFF_EBAY
    The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page.
    Localized name: Off eBay views
  • LISTING_VIEWS_SOURCE_OTHER_EBAY
    The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store.
    Localized name: Views from non-search and non-store pages within eBay
  • LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE
    The number of times the item displayed on the search results page.
    Localized name: Views on the search results page
  • LISTING_VIEWS_SOURCE_STORE
    The number of times a View Item page was accessed via the seller's store.
    Localized name: Views from your Store
  • LISTING_VIEWS_TOTAL
    Total number of listings viewed.
    This number sums:
    LISTING_VIEWS_SOURCE_DIRECT
    LISTING_VIEWS_SOURCE_OFF_EBAY
    LISTING_VIEWS_SOURCE_OTHER_EBAY
    LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE
    LISTING_VIEWS_SOURCE_STORE.
    Localized name: Total views
  • SALES_CONVERSION_RATE
    The number of completed transactions divided by the number of View Item page views. Equals:
    TRANSACTION / LISTING_VIEWS_TOTAL
    Localized name: Sales conversion rate
  • TRANSACTION
    The total number of completed transactions.
    Localized name: Transaction count

Occurrence: Required

filterarray of FilterFieldThis query parameter refines the information returned in the traffic report.

Configure the following properties of the filter parameter to tune the traffic report to your needs:
  • date_range
    Limits the report to the specified range of dates.

    Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows:
    [YYYYMMDD..YYYYMMDD]

    The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year.

    The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate.

    Required: Always
  • listing_ids
    This filter limits the results to only the supplied list of listingId values.

    You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|").

    This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument.
  • marketplace_ids
    This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }").

    Valid values:
    • EBAY_AU
    • EBAY_DE
    • EBAY_GB
    • EBAY_US
    • EBAY_MOTORS

    Required if you set the dimension parameter to DAY.
  • traffic_source
    Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items.

    Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values.

Example filter parameter
The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters:

filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828]

Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters.

Occurrence: Required

sortarray of SortFieldThis query parameter sorts the report on the specified metric.

The metric you specify must be included in the configuration of the report's metric parameter.

Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE.

Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE.

Occurrence: Optional

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

OAuth scope

This request requires an access token created with the authorization code grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):

https://api.ebay.com/oauth/api_scope/sell.analytics.readonly

See OAuth access tokens for more information.

Output

HTTP response headers

Output container/fieldTypeDescription
dimensionMetadataarray of MetadataA complex type containing the header of the report and the type of data containted in the rows of the report.

Occurrence: Always

dimensionMetadata.metadataHeaderMetadataHeaderThe container that returns the dimensionKeys and metrics headers for the report.

Occurrence: Always

dimensionMetadata.metadataHeader.keystringThe key value used for the report.

For example: "key": "LISTING_ID"

Occurrence: Always

dimensionMetadata.metadataHeader.metadataKeysarray of DefinitionThe list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name.

For example:

"metadataKeys": [
  "key": "LISTING_TITLE",
  "localizedName": "Listing title",
  "dataType": "STRING"

Occurrence: Always

dimensionMetadata.metadataHeader.metadataKeys.dataTypeDataTypeEnumIndicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE.

Occurrence: Always

dimensionMetadata.metadataHeader.metadataKeys.keystringThe value the dimension or metric parameter as submitted in the request.

Occurrence: Always

dimensionMetadata.metadataHeader.metadataKeys.localizedNamestringThe localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl".

Occurrence: Always

dimensionMetadata.metadataRecordsarray of MetadataRecordA list of the individual report records.

Occurrence: Always

dimensionMetadata.metadataRecords.metadataValuesarray of ValueA list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report.

Occurrence: Always

dimensionMetadata.metadataRecords.metadataValues.applicablebooleanIf set to true, this flag indicates the value in the value field is valid as computed.

A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day.

Occurrence: Always

dimensionMetadata.metadataRecords.metadataValues.valueanyThe value of the report data.

Occurrence: Always

dimensionMetadata.metadataRecords.valueValueThe value of the key on which the report is based.

For example, if the key is the listing ID, the value of this container could be:

"value": {
  "value": "142133954229",
  "applicable": true
}

Occurrence: Always

dimensionMetadata.metadataRecords.value.applicablebooleanIf set to true, this flag indicates the value in the value field is valid as computed.

A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day.

Occurrence: Always

dimensionMetadata.metadataRecords.value.valueanyThe value of the report data.

Occurrence: Always

endDatestring

The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock.

If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date.

Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z
Example: 2018-08-20T07:09:00.000Z

Occurrence: Always

headerHeaderA complex type containing the header for the report.

Occurrence: Always

header.dimensionKeysarray of DefinitionA list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields.

Occurrence: Always

header.dimensionKeys.dataTypeDataTypeEnumIndicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE.

Occurrence: Always

header.dimensionKeys.keystringThe value the dimension or metric parameter as submitted in the request.

Occurrence: Always

header.dimensionKeys.localizedNamestringThe localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl".

Occurrence: Always

header.metricsarray of DefinitionThe list of metrics returned in the report. The values for each are is returned in the associated key fields.

Occurrence: Always

header.metrics.dataTypeDataTypeEnumIndicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE.

Occurrence: Always

header.metrics.keystringThe value the dimension or metric parameter as submitted in the request.

Occurrence: Always

header.metrics.localizedNamestringThe localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl".

Occurrence: Always

lastUpdatedDatestringThe date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated.

Occurrence: Always

recordsarray of RecordA complex type containing the individual data records for the traffic report.

Occurrence: Always

records.dimensionValuesarray of ValueA list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values.

Occurrence: Always

records.dimensionValues.applicablebooleanIf set to true, this flag indicates the value in the value field is valid as computed.

A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day.

Occurrence: Always

records.dimensionValues.valueanyThe value of the report data.

Occurrence: Always

records.metricValuesarray of ValueA list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value.

Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader.

Occurrence: Always

records.metricValues.applicablebooleanIf set to true, this flag indicates the value in the value field is valid as computed.

A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day.

Occurrence: Always

records.metricValues.valueanyThe value of the report data.

Occurrence: Always

startDatestringThe start date of the date range used to calculate the report, in ISO 8601 format.

Occurrence: Always

warningsarray of ErrorDetailV3An array of any process errors or warnings that were generated during the processing of the call processing.

Occurrence: Conditional

warnings.categorystringIdentifies whether the error was in the REQUEST or happened when running the APPLICATION.

Occurrence: Conditional

warnings.domainstringThe primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS.

Occurrence: Conditional

warnings.errorIdintegerA positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500.

Occurrence: Conditional

warnings.inputRefIdsarray of stringIdentifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation.

Occurrence: Conditional

warnings.longMessagestringA more detailed explanation of the error than given in the message error field.

Occurrence: Conditional

warnings.messagestringInformation on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale.

Occurrence: Conditional

warnings.outputRefIdsarray of stringIdentifies specific response elements associated with the error, if any. Path format is the same as inputRefId.

Occurrence: Conditional

warnings.parametersarray of ErrorParameterV3This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value.

Occurrence: Conditional

warnings.parameters.namestringName of the entity that threw the error.

Occurrence: Conditional

warnings.parameters.valuestringA description of the error.

Occurrence: Conditional

warnings.subdomainstringIf present, indicates which subsystem in which the error occurred.

Occurrence: Conditional

HTTP status codes

This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.

StatusMeaning
200Success
400Bad Request
500Internal Server Error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
50001API_ANALYTICSREQUESTInvalid dimension specified. For help, see the documentation.
50002API_ANALYTICSREQUESTInvalid metric {metricName} specified. For help, see the documentation.
50003API_ANALYTICSREQUESTInvalid date range. End date must be before or equal to start date.
50004API_ANALYTICSREQUESTInvalid date range. Start date must be before or equal to end date.
50005API_ANALYTICSREQUESTNo filter is specified, which is required. For help, see the documentation.
50008API_ANALYTICSREQUESTThe call requires at least one metric. For help, see the documentation.
50009API_ANALYTICSREQUESTThe call requires at least one URI query parameter. For help, see the documentation.
50013API_ANALYTICSREQUESTInvalid date range format - Start Date. The format is yyyyMMdd.
50014API_ANALYTICSREQUESTInvalid date range format - End Date. The format is yyyyMMdd.
50018API_ANALYTICSREQUESTNeither the start date nor the end date can be in the future.
50021API_ANALYTICSREQUESTInvalid filter field {filterField} specified.
50022API_ANALYTICSREQUESTSpecify at least one marketplace ID.
50023API_ANALYTICSREQUESTThe marketplace ID {marketplaceId} is not supported by this call. For help, see the documentation.
50024API_ANALYTICSREQUESTThe marketplace ID {marketplaceId} is not valid.
50025API_ANALYTICSREQUESTThe start date is too far in the past. The start date must be less than or equal to {maxStartDateInThePast}.
50026API_ANALYTICSREQUESTThe date range is too long. The date range must be less than or equal to {maxDateWindow}.
50027API_ANALYTICSREQUESTThe 'listing_id' value is empty.
50028API_ANALYTICSREQUESTThe maximum number of listing IDs has been exceeded. The maximum number of listing IDs is {maxListingIdsNumber}.
50029API_ANALYTICSREQUESTInvalid listing ID {listingId}.
50030API_ANALYTICSREQUESTData for the listing ID {listingId} could not be found.
50031API_ANALYTICSREQUESTDate range is required.
50032API_ANALYTICSAPPLICATIONWe are unable to process data for accounts, like this one, which have listed in more than a few thousand leaf categories in the past couple years.
50033API_ANALYTICSREQUESTInvalid date range filter format {invalidDateRangeFilter}.
50034API_ANALYTICSREQUESTInvalid listing ids filter format {invalidListingIdsFilter}.
50035API_ANALYTICSREQUESTRequested sort field is not part of the list of metrics requested.
50050API_ANALYTICSAPPLICATIONWe are doing some maintenance and cannot show all your information right now. We are still tracking everything, and you will see your updated stats soon.
50500API_ANALYTICSAPPLICATIONInternal server error. Wait a few minutes and try the call again. If error persists contact the eBay Developer Program.
50600API_ANALYTICSREQUESTData for the listing Ids {delayedListingIds} is not yet updated to {endDate}

Samples

New to making API calls? Please see Making a Call.

Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.

Sample 1: Generate Traffic Report by Days

This sample generates the metrics for how often the seller's listings appeared in the search results page and the seller's store, and the sales conversion rate for each date in the date range. It also limits the report to the seller's listings on the eBay US site.

Input

The input fields are marketplace_ids, date_range, dimension, and metric fields.
GET
https://api.ebay.com/sell/analytics/v1/traffic_report?filter=marketplace_ids:%7BEBAY_US%7D,date_range:%5B20160601..20160828%5D&dimension=DAY&metric=LISTING_IMPRESSION_SEARCH_RESULTS_PAGE,LISTING_IMPRESSION_STORE,SALES_CONVERSION_RATE

Output

The output contains the metrics (metrics.key) and the records container. Each record contains the aggregate records.dimensionValues.value, which is the date, and the metric value (metricValues.value) of the metric.

Sample 2: Generate Traffic Report by Listing

This sample generates the metrics for how often the seller's listings appeared in the search results page and the seller's store, and the sales conversion rate for each listing within the date range. It also limits the report to the seller's listing on the eBay US site and sorts the LISTING_IMPRESSION_STORE metric in ascending order.

Input

The input fields are marketplace_ids, date_range, dimension, and metric fields.
GET
https://api.ebay.com/sell/analytics/v1/traffic_report?filter=marketplace_ids:%7BEBAY_US%7D,date_range:%5B20161007..20161009%5D&dimension=LISTING&metric=LISTING_IMPRESSION_SEARCH_RESULTS_PAGE,LISTING_IMPRESSION_STORE,SALES_CONVERSION_RATE&sort=LISTING_IMPRESSION_STORE

Output

The output contains the metrics (metrics.key), and the records container (records). Each record contains the aggregate records.dimensionValues.value, which is the listing Id, and the metric value (metricValues.value) of the metric.

It also includes the metadata (metadataKeys.key) and metadata records container (metadataRecords). Each of these records contain the metadataRecords.value, which is the listing Id and the (metadataRecords.metadataValues.value), which in this case, the listing title.