快工助手跨境电商知识与商机助手

v2.principal.get_session_livestream_performance

Shopee 官方资料 · Shopee Open Platform 接口参考 · 适合开发者

stable本次发布有变化全部展示

来自 Shopee 官方资料快照 ·

打开官方原文 ↗
  1. 当前资料结构化阅读页
  2. 固定快照已留存,可追溯
  3. 官方原文可核对
查看技术与溯源信息
平台 / profile
Shopee / profile.shopee.api_reference
语言
en-US
发布版本
cn-20260909-2
标签
zhuge/sourceplatform/shopeeaudience/developercategory/api_doctopic/apitopic/developer

资料正文

§1 v2.principal.get_session_livestream_performance

Queries livestream session performance data for the specified sessions within the selected time range. Supports request granularity by day, week, month, quarter, year, or customize, and returns both overall summary metrics and session-level detailed metrics.

#

§2 Overview

Overview

FieldValue
ModuleBrandPortal
API typePrincipal
HTTP methodPOST
Path/api/v2/principal/get_session_livestream_performance
Production URLhttps://partner.shopeemobile.com/api/v2/principal/get_session_livestream_performance
Sandbox URLhttps://partner.test-stable.shopeemobile.com/api/v2/principal/get_session_livestream_performance
PermissionBrand Portal Service
#

§3 Request parameters

Request parameters

NameTypeRequiredSampleDescription
start_datestringYes2026-01-01Start date of the requested period in YYYY-MM-DD format. Limitations: - Must use the YYYY-MM-DD format.; - Must be a valid calendar date.; - Must not be later than end_date.; - Validation is based on the requested timezone.; - The earliest selectable date is calculated as: current day in timezone - 1 day - 2 years.; - The exact boundary rules depend on granularity: -- For customize, start_date must not be earlier than the earliest selectable date.; -- For day, start_date must equal end_date.; -- For week, start_date must be a Sunday.; -- For month, start_date must be the first day of the month.; -- For quarter, start_date must be the first day of the quarter.; -- For year, start_date must be the first day of the year.
end_datestringYes2026-01-31End date of the requested period in YYYY-MM-DD format. Limitations: - Must use the YYYY-MM-DD format. - Must be a valid calendar date. - Must not be earlier than start_date. - Validation is based on the requested timezone. - For customize, end_date must not be later than the day before the current day in the requested timezone. The inclusive date range from start_date to end_date must not exceed 366 days. - For day, end_date must equal start_date. - For week, end_date must be within the selected week range: from start_date (Sunday) to the end of that Sunday-to-Saturday week, or to the latest selectable day if the week extends beyond today. Formally: startDate ≤ endDate ≤ min(startDate + 6 days, today - 1 day). - For month, end_date must be within the selected month: from the 1st day of the month to the last calendar day of that month, or to the latest selectable day for the current month. Formally: startDate ≤ endDate ≤ min(month end, today - 1 day). - For quarter, end_date must be within the selected quarter: from the 1st day of the quarter to the last calendar day of that quarter, or to the latest selectable day for the current quarter. Formally: startDate ≤ endDate ≤ min(quarter end, today - 1 day). - For year, end_date must be within the selected year: from January 1st to December 31st of that year, or to the latest selectable day for the current year. Formally: startDate ≤ endDate ≤ min(Dec 31, today - 1 day).
timezonestringYesGMT+8Timezone used for date boundary calculation, selectable date validation, and timestamp conversion. Limitations: - Enum values: ["GMT+7", "GMT+8", "GMT-3"]; - The API internally normalizes the open API timezone value for livestream metric queries.; - All date validation rules are evaluated in the requested timezone.
granularitystringYesmonthAggregation granularity that determines the validation rules for the requested date range and the reporting period.; Limitations: - Supported values are customize, day, week, month, quarter, and year.; - customize is validated as a free date range and is internally queried with the affiliate-compatible livestream granularity.; - day represents a single calendar day.; - week requires a Sunday-based calendar week.; - month requires a calendar month range.; - quarter requires a calendar quarter range.; - year requires a calendar year range.; - Any other value is rejected as invalid_parameter.
session_listobject[]NoList of livestream session query targets.; Limitations: - Must contain at least one object.; - Must contain at most 100 objects.; - Every shop_id must belong to the specified principal_id.; - Duplicate shop_id values are rejected.; - Each object must provide a non-empty session_ids list.; - Null session_id values are rejected.; - Duplicate session_id values across the whole request are rejected.; - The total number of unique session_ids across the whole request must not exceed 100.
session_list.shop_idint64Yes181050132Shop identifier that owns the specified livestream sessions. Limitations: - Required for every object in session_list.; - Must belong to the specified principal_id.
session_list.session_idsint64[]Yes[1453493,1453494]List of livestream session identifiers to be queried under the specified shop. Limitations: - Required for every object in session_list.; - Must contain at least one session_id.; - Must contain at most 100 session_ids per object.; - Null session_id values are rejected.; - Duplicate session_id values across the whole request are rejected.; - Across the whole request, the total number of unique session_ids must not exceed 100.
session_list.currencystringNoLOCALCurrency used for amount-based metrics for the specified livestream sessions. Limitations: - Optional for every object in session_list.; - Supported values are LOCAL and USD.; - Invalid currency values are rejected as invalid_parameter.; - Defaults to USD when omitted.
page_sizeint64No100Number of detail records to return in the current response page.; Limitations: - Only supported when session_list is omitted or an empty array.; - Default value is 100.; - Must be between 1 and 200, inclusive.
cursorint64No0Zero-based offset of the first detail record to return.; Limitations: - Only supported when session_list is omitted or an empty array.; - Default value is 0.; - Must be greater than or equal to 0.
#

§4 Response parameters

Response parameters

NameTypeRequiredSampleDescription
request_idstringbb8d45e5-db10-4de4-8fb6-56d2fb316996The identifier for an API request, used for troubleshooting and log tracing.
errorstringIndicate error type if any error happened. Empty string if no error.
messagestringIndicate error details if any error happened. Empty string if no error.
responseobjectBusiness response payload. See Business Response Parameters below.
response.summaryobject[]Aggregated summary metrics for the requested date range, representing the overall livestream session performance of the selected sessions. Summary values are returned in USD when data exists.
response.summary.currencystringUSDCurrency code used for all amount-based metrics in the summary. Summary values are returned in USD.
response.summary.likesint6411841Total number of likes in the selected livestream sessions.
response.summary.commentsint642007Total number of comments acquired during the selected livestream sessions.
response.summary.buyersint64448Number of unique buyers who placed orders from the selected livestream sessions.
response.summary.ordersint64508Number of placed orders (paid and unpaid) during the selected livestream sessions, including cancelled orders.
response.summary.total_viewsint64201558Total views from the selected livestream sessions.
response.summary.unique_viewersint64141232Total unique viewers from the selected livestream sessions.
response.summary.total_live_durationint641025729Total duration of the selected livestream sessions.
response.summary.average_views_durationfloat47.39170301348136Average time viewers watch the selected livestream sessions.
response.summary.new_followersint64468Total followers gained from the selected livestream sessions.
response.summary.atc_unitsint644402Number of Add To Cart button clicks for all products in the orange bag during the selected livestream sessions.
response.summary.units_soldint64523Number of items sold from placed orders during the selected livestream sessions.
response.summary.sales_grossfloat120130.36750199998Value of placed orders (paid and unpaid) during the selected livestream sessions, reflecting the sales amount received by sellers after deducting seller rebates. Note: This value includes sales from cancelled orders.
response.summary.sales_netfloat90505.17313499999Value of placed orders (paid and unpaid) during the selected livestream sessions, reflecting the sales amount received by sellers after deducting seller rebates. Note: This value excludes the refund amount for all non-cancelled and invalid items.
response.summary.conversion_ratefloat0.002520366346163387Livestream orders / Livestream views.
response.detailsobject[]List of livestream session-level detail records that returns performance metrics for each selected session within the requested date range.
response.details.regionstringSGRegion code of the shop that owns this livestream session.
response.details.currencystringLOCALCurrency code used for all amount-based metrics of this livestream session item.
response.details.likesint6489Total number of likes in this livestream session.
response.details.commentsint643Total number of comments acquired during this livestream session.
response.details.buyersint642Number of unique buyers who placed orders from this livestream session.
response.details.ordersint642Number of placed orders (paid and unpaid) during this livestream session, including cancelled orders.
response.details.shop_idint64181050132Shop identifier that owns this livestream session.
response.details.shop_namestringHuawei Official StoreShop name that owns this livestream session.
response.details.session_idint641453493Livestream session identifier.
response.details.session_namestringHUAWEI Mid-Month MadnessLivestream session name.
response.details.total_viewsint64575Total views from this livestream session.
response.details.unique_viewersint64441Total unique viewers from this livestream session.
response.details.total_live_durationint647262Total duration of this livestream session.
response.details.average_views_durationfloat44.3968253968254Average time viewers watch this livestream session.
response.details.new_followersint641Total followers gained from this livestream session.
response.details.atc_unitsint6414Number of Add To Cart button clicks for all products in the orange bag during this livestream session.
response.details.units_soldint642Number of items sold from placed orders during this livestream session.
response.details.sales_grossfloat420.0Value of placed orders (paid and unpaid) during this livestream session, reflecting the sales amount received by sellers after deducting seller rebates. Note: This value includes sales from cancelled orders.
response.details.sales_netfloat420.0Value of placed orders (paid and unpaid) during this livestream session, reflecting the sales amount received by sellers after deducting seller rebates. Note: This value excludes the refund amount for all non-cancelled and invalid items.
response.details.conversion_ratefloat0.0034782608695652175Livestream orders / Livestream views.
response.next_cursorint64100Offset to be used in the next request for fetching the next page of detail records.; Notes: - Returned only when session_list is omitted or an empty array.; - Calculated as cursor + returned_detail_count.; - If returned_detail_count is less than page_size, it indicates there may be no more records.; - If the request is already beyond the end of the result set, the API returns 0 detail records and next_cursor remains equal to the input cursor.
#

§5 Common parameters

Common parameters

NameTypeRequiredSampleDescription
partner_idint1Partner ID is assigned upon registration is successful. Required for all requests.
timestamptimestamp1610000000This is to indicate the timestamp of the request. Required for all requests. Expires in 5 minutes.
access_tokenstringc09222e3fc40ffb25fc947f738b1abf1The token for API access, using to identify your permission to the api. Valid for multiple use and expires in 4 hours.
principal_idint1Shopee's unique identifier for a principal.
signstringe318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2Signature generated by(depends on different APIs) partner_id, api path, timestamp, access_token, principal_id and partner_key via HMAC-SHA256 hashing algorithm.
#

§6 Request samples

Request samples

#

§7 Payload

Payload

{
	"start_date": "2026-01-01",
	"end_date": "2026-01-31",
	"timezone": "GMT+8",
	"granularity": "month",
	"page_size": 100,
	"cursor": 0
}
#

§8 Java

Java

Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://partner.shopeemobile.com/api/v2/principal/get_session_livestream_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign&timestamp=timestamp")
.header("Content-Type","application/json")
.body("{
   \"cursor\": 0,
   \"end_date\": \"2026-01-31\",
   \"granularity\": \"month\",
   \"page_size\": 100,
   \"session_list\": [
      {
         \"currency\": \"LOCAL\",
         \"session_ids\": [
            1453493,
            1453494
         ],
         \"shop_id\": 181050132
      }
   ],
   \"start_date\": \"2026-01-01\",
   \"timezone\": \"GMT+8\"
}")
.asString();
#

§9 PHP

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://partner.shopeemobile.com/api/v2/principal/get_session_livestream_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign&timestamp=timestamp',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
    "cursor": 0,
    "end_date": "2026-01-31",
    "granularity": "month",
    "page_size": 100,
    "session_list": [
        {
            "currency": "LOCAL",
            "session_ids": [
                1453493,
                1453494
            ],
            "shop_id": 181050132
        }
    ],
    "start_date": "2026-01-01",
    "timezone": "GMT+8"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
#

§10 cURL

cURL

curl --location --request POST 'https://partner.shopeemobile.com/api/v2/principal/get_session_livestream_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign&timestamp=timestamp' \
--header 'Content-Type: application/json' \
--data-raw '{
   "cursor": 0,
   "end_date": "2026-01-31",
   "granularity": "month",
   "page_size": 100,
   "session_list": [
      {
         "currency": "LOCAL",
         "session_ids": [
            1453493,
            1453494
         ],
         "shop_id": 181050132
      }
   ],
   "start_date": "2026-01-01",
   "timezone": "GMT+8"
}'
#

§11 Python

Python

import requests
import json

url = "https://partner.shopeemobile.com/api/v2/principal/get_session_livestream_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign&timestamp=timestamp"

payload=json.dumps({
  "cursor": 0,
  "end_date": "2026-01-31",
  "granularity": "month",
  "page_size": 100,
  "session_list": [
    {
      "currency": "LOCAL",
      "session_ids": [
        1453493,
        1453494
      ],
      "shop_id": 181050132
    }
  ],
  "start_date": "2026-01-01",
  "timezone": "GMT+8"
})
headers = {
  'Content-Type': 'application/json'
}
response = requests.RPCRequest("POST",url,headers=headers, data=payload, allow_redirects=False)

print(response.text)
#

§12 Response sample

Response sample

#

§13 JSON

JSON

{
	"request_id": "bb8d45e5-db10-4de4-8fb6-56d2fb316996",
	"error": "",
	"message": "",
	"response": {
		"summary": [
			{
				"currency": "USD",
				"likes": 11841,
				"comments": 2007,
				"buyers": 448,
				"orders": 508,
				"total_views": 201558,
				"unique_viewers": 141232,
				"total_live_duration": 1025729,
				"average_views_duration": 47.39170301348136,
				"new_followers": 468,
				"atc_units": 4402,
				"units_sold": 523,
				"sales_gross": 120130.36750199998,
				"sales_net": 90505.17313499999,
				"conversion_rate": 0.002520366346163387
			}
		],
		"details": [
			{
				"region": "SG",
				"currency": "LOCAL",
				"likes": 89,
				"comments": 3,
				"buyers": 2,
				"orders": 2,
				"shop_id": 181050132,
				"shop_name": "Huawei Official Store",
				"session_id": 1453493,
				"session_name": "HUAWEI Mid-Month Madness",
				"total_views": 575,
				"unique_viewers": 441,
				"total_live_duration": 7262,
				"average_views_duration": 44.3968253968254,
				"new_followers": 1,
				"atc_units": 14,
				"units_sold": 2,
				"sales_gross": 420,
				"sales_net": 420,
				"conversion_rate": 0.0034782608695652175
			}
		],
		"next_cursor": 100
	}
}
#

§14 Error example

Error example

#

§15 JSON

JSON

{
    "request_id": "c9f661d8-9fc4-45a8-a327-f3787f8523ab",
    "error": "error_param",
    "message": "page_size must be less than or equal to 200.",
    "response": null
}
#

§16 Errors

Errors

ErrorDescriptionSolution
error_paramtimezone is required
error_paramtimezone is invalid. allowed values: GMT+7, GMT+8, GMT-3.
error_paramgranularity is required
error_paramrequest body is invalid
error_paramshop_id is required
error_paramcurrency is invalid
error_paramsession_ids is required
error_paramend_date is not ready, please retry later
error_paramfor day granularity, start_date must equal end_date.
error_paramday range is outside the allowed selectable range.
error_paramfor week granularity, end_date must be within the selected week range
error_paramfor week granularity, start_date must be a Sunday.
error_parampage_size is only supported when session_list is empty
error_paramweek start_date is earlier than the earliest allowed week.
error_paramstart_date cannot be later than end_date.
error_parammonth range is outside the allowed selectable range.
error_paramfor month granularity, start_date must be the first day of month.
error_paramfor month granularity, end_date must be within the selected month range.
error_paramfor quarter granularity, end_date must be within the selected quarter range.
error_paramyear range is outside the allowed selectable range.
error_paramfor quarter granularity, start_date must be the first day of quarter.
error_paramfor quarter granularity, end_date must be within the selected quarter range.
error_paramstart_date is earlier than the earliest allowed date
error_paramcursor is only supported when session_list is empty.
error_paramfor year granularity, end_date must be within the selected year range.
error_paramend_date must not be later than the latest selectable day.
error_paramcursor must be greater than or equal to 0
error_parampage_size must be between 1 and 200.
error_paramsession_list contains duplicate session_id
error_permissionauth failed
error_paramstart_date is required
error_paramstart_date is required; start_date must use YYYY-MM-DD
error_paramend_date is required
error_paramend_date must use YYYY-MM-DD
#

§17 Common errors

Common errors

ErrorDescriptionSolution
error_authpartner_id is invalid
error_authThe App is deleted, and you'll be unable to make any API call.
error_authApp developer’s permissions for authorizations have been restricted. If you’re a seller, contact the developer for more information. If you’re the developer, refer to the Open Platform Console for details.
error_paramThere is no partner_id in query.
error_paramInvalid partner_id.
error_paramno timestamp
error_paramInvalid timestamp
error_paramThere is no sign in query.
error_signWrong sign.
invalid_partner_idInvalid partner_id, please have a check.
error_authNo permission to current api.
error_api_call_restrictedThe App permission for api call have been restricted. If you’re a seller, contact the developer for more information. If you’re the developer, refer to the Open Platform Console for details.
api_suspendedThe API is offline. Please call v2 API instead.
error_limitThe total API call number made by your APP has reached the daily API call limit, please try again after 00: 00 (UTC+08:00)
error_rate_limitToo many requests. You have reached the rate limit. Please try again later.
source_ip_undeclaredRequest Source IP ({ip}) is undeclared. Please declare all your IP addresses in the Shopee Open Platform Console > App list > IP Address Whitelist
error_paramPermission denied. This API is currently offline or the request path is incorrect.
error_paramPartner_id is invalid, should be an integer between 0 and 4294967295.
error_paramno timestamp.
error_paramTimestamp is invalid, should be an integer between 0 and 4294967295.
error_paramTimestamp is expired.
error_partner_key_expiredYour API partner key has expired, please reset the Live API Partner Key in Console to get a new valid partner key to call open api.
error_api_permissionThis app type has no permission to this API.
#

§18 Update log

Update log

DateChange
2026-07-09New API
#