stable本次发布有变化全部展示
来自 Shopee 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
资料正文
§1 v2.principal.get_principal_livestream_performance
Queries livestream performance data for the specified principal within the selected time range. Supports request granularity by day, week, month, quarter, year, or customize, and returns both overall summary metrics and region-level detailed metrics.
§2 Overview
Overview
| Field | Value |
|---|---|
| Module | BrandPortal |
| API type | Principal |
| HTTP method | POST |
| Path | /api/v2/principal/get_principal_livestream_performance |
| Production URL | https://partner.shopeemobile.com/api/v2/principal/get_principal_livestream_performance |
| Sandbox URL | https://partner.test-stable.shopeemobile.com/api/v2/principal/get_principal_livestream_performance |
| Permission | Brand Portal Service |
§3 Request parameters
Request parameters
| Name | Type | Required | Sample | Description |
|---|---|---|---|---|
| start_date | string | Yes | 2026-01-01 | Start 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_date | string | Yes | 2026-01-31 | End 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). |
| timezone | string | Yes | GMT+8 | Timezone 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. |
| granularity | string | Yes | month | Aggregation 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. |
| region_list | object[] | No | Optional list of principal regions to be queried.; Limitations: - When omitted or empty, the API queries all regions belonging to the specified principal_id except the aggregate regional bucket.; - Must contain at most 100 region objects.; - Every region must belong to the specified principal_id.; - Duplicate region values are merged for filtering purposes.; - Currency defaults to USD when omitted.; - When the same region appears multiple times, the first provided currency is used. | |
| region_list.region | string | Yes | MY | Region code to be queried. Limitations: - Required for every region object in region_list.; - Must be a valid region code supported by the API.; - Must belong to the specified principal_id. |
| region_list.currency | string | No | USD | Currency used for amount-based metrics for the region. Limitations: - Optional for every region object in region_list.; - Supported values are LOCAL and USD.; - Invalid currency values are rejected as invalid_parameter.; - Defaults to USD when omitted. |
§4 Response parameters
Response parameters
| Name | Type | Required | Sample | Description |
|---|---|---|---|---|
| request_id | string | ad13785b-402c-4896-84df-6dc6c008f90d | The identifier for an API request, used for troubleshooting and log tracing. | |
| error | string | Indicate error type if any error happened. Empty string if no error. | ||
| message | string | Indicate error details if any error happened. Empty string if no error. | ||
| response | object | Business response payload. See Business Response Parameters below. | ||
| response.summary | object[] | Aggregated summary metrics for the requested date range, representing the overall livestream performance of the selected principal. Summary values are returned in USD when data exists. | ||
| response.summary.currency | string | USD | Currency code used for all amount-based metrics in the summary. Summary values are returned in USD. | |
| response.summary.orders | int64 | 24544 | Number of placed orders (paid and unpaid) during your Livestream, including cancelled orders. | |
| response.summary.buyers | int64 | 20011 | Number of unique buyers who placed order from your Livestream. | |
| response.summary.likes | int64 | 822271 | Total number of likes in your Livestream. | |
| response.summary.comments | int64 | 122356 | Total number of comments acquired during your Livestream. | |
| response.summary.sales_gross | float | 4939417.062404577 | Value of placed orders (paid and unpaid) during your Livestream, reflecting the sales amount received by sellers after deducting seller rebates. Note: This value includes sales from cancelled orders. | |
| response.summary.units_sold | int64 | 25027 | Number of items sold from placed orders during your Livestream. | |
| response.summary.total_views | int64 | 6041612 | Total views from your Livestream. | |
| response.summary.total_live_duration | int64 | 8061951 | Total duration of your Livestream. | |
| response.summary.unique_viewers | int64 | 3850270 | Total unique viewers from your Livestream. | |
| response.summary.atc_units | int64 | 220831 | Number of Add To Cart button clicks for all products in the orange bag during your Livestream. | |
| response.summary.total_livestreams | int64 | 472 | Total count of Livestream sessions in the selected period. | |
| response.summary.average_live_duration | float | 17080.40466101695 | Average duration of your Livestream. | |
| response.summary.average_views_duration | float | 47.91673441083353 | Average time viewers watch your Livestreams. | |
| response.summary.new_followers | int64 | 30726 | Total followers gained from your Livestream. | |
| response.summary.new_buyers | int64 | 19188 | Number of buyers who have not had placed orders (including paid and unpaid) via your Livestream in the past 365 days. | |
| response.summary.existing_buyers | int64 | 823 | Number of buyers who have already had placed orders (including paid and unpaid) via your Livestream in the past 365 days. | |
| response.summary.sales_net | float | 3478017.9173450004 | Value of placed orders (paid and unpaid) during your Livestream, 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_rate | float | 0.004062491930961472 | Livestream orders / Livestream views. | |
| response.details | object[] | List of region-level detail records that returns livestream performance metrics for each selected region within the requested date range.; Details are produced by aggregating shop-level livestream data into region-level results in the service layer. | ||
| response.details.region | string | MY | Region code of this detail item. | |
| response.details.currency | string | USD | Currency code used for all amount-based metrics of this region item. | |
| response.details.orders | int64 | 23767 | Number of placed orders (paid and unpaid) during your Livestream, including cancelled orders. | |
| response.details.buyers | int64 | 19345 | Number of unique buyers who placed order from your Livestream. | |
| response.details.likes | int64 | 800789 | Total number of likes in your Livestream. | |
| response.details.comments | int64 | 119351 | Total number of comments acquired during your Livestream. | |
| response.details.sales_gross | float | 4747505.5402737735 | Value of placed orders (paid and unpaid) during your Livestream, reflecting the sales amount received by sellers after deducting seller rebates. Note: This value includes sales from cancelled orders. | |
| response.details.units_sold | int64 | 24226 | Number of items sold from placed orders during your Livestream. | |
| response.details.total_views | int64 | 5702168 | Total views from your Livestream. | |
| response.details.total_live_duration | int64 | 6565127 | Total duration of your Livestream. | |
| response.details.unique_viewers | int64 | 3616306 | Total unique viewers from your Livestream. | |
| response.details.atc_units | int64 | 214603 | Number of Add To Cart button clicks for all products in the orange bag during your Livestream. | |
| response.details.total_livestreams | int64 | 313 | Total count of Livestream sessions in the selected period. | |
| response.details.average_live_duration | float | 20974.846645367412 | Average duration of your Livestream. | |
| response.details.average_views_duration | float | 47.33443242911413 | Average time viewers watch your Livestreams. | |
| response.details.new_followers | int64 | 30022 | Total followers gained from your Livestream. | |
| response.details.new_buyers | int64 | 18535 | Number of buyers who have not had placed orders (including paid and unpaid) via your Livestream in the past 365 days. | |
| response.details.existing_buyers | int64 | 810 | Number of buyers who have already had placed orders (including paid and unpaid) via your Livestream in the past 365 days. | |
| response.details.sales_net | float | 3332254.597736 | Value of placed orders (paid and unpaid) during your Livestream, 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_rate | float | 0.00416806379608598 | Livestream orders / Livestream views. |
§5 Common parameters
Common parameters
| Name | Type | Required | Sample | Description |
|---|---|---|---|---|
| partner_id | int | 1 | Partner ID is assigned upon registration is successful. Required for all requests. | |
| timestamp | timestamp | 1610000000 | This is to indicate the timestamp of the request. Required for all requests. Expires in 5 minutes. | |
| access_token | string | c09222e3fc40ffb25fc947f738b1abf1 | The token for API access, using to identify your permission to the api. Valid for multiple use and expires in 4 hours. | |
| principal_id | int | 1 | Shopee's unique identifier for a principal. | |
| sign | string | e318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2 | Signature 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",
"region_list": [
{
"region": "MY",
"currency": "USD"
},
{
"region": "SG",
"currency": "USD"
}
]
}
§8 Java
Java
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://partner.shopeemobile.com/api/v2/principal/get_principal_livestream_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign×tamp=timestamp")
.header("Content-Type","application/json")
.body("{
\"end_date\": \"2026-01-31\",
\"granularity\": \"month\",
\"region_list\": [
{
\"currency\": \"USD\",
\"region\": \"MY\"
}
],
\"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_principal_livestream_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign×tamp=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 => '{
"end_date": "2026-01-31",
"granularity": "month",
"region_list": [
{
"currency": "USD",
"region": "MY"
}
],
"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_principal_livestream_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign×tamp=timestamp' \
--header 'Content-Type: application/json' \
--data-raw '{
"end_date": "2026-01-31",
"granularity": "month",
"region_list": [
{
"currency": "USD",
"region": "MY"
}
],
"start_date": "2026-01-01",
"timezone": "GMT+8"
}'
§11 Python
Python
import requests
import json
url = "https://partner.shopeemobile.com/api/v2/principal/get_principal_livestream_performance?access_token=access_token&partner_id=partner_id&principal_id=principal_id&sign=sign×tamp=timestamp"
payload=json.dumps({
"end_date": "2026-01-31",
"granularity": "month",
"region_list": [
{
"currency": "USD",
"region": "MY"
}
],
"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
{
"error": "",
"message": "",
"response": {
"summary": [
{
"currency": "USD",
"orders": 24544,
"buyers": 20011,
"likes": 822271,
"comments": 122356,
"sales_gross": 4939417.062404577,
"units_sold": 25027,
"total_views": 6041612,
"total_live_duration": 8061951,
"unique_viewers": 3850270,
"atc_units": 220831,
"total_livestreams": 472,
"average_live_duration": 17080.40466101695,
"average_views_duration": 47.91673441083353,
"new_followers": 30726,
"new_buyers": 19188,
"existing_buyers": 823,
"sales_net": 3478017.9173450004,
"conversion_rate": 0.004062491930961472
}
],
"details": [
{
"region": "MY",
"currency": "USD",
"orders": 23767,
"buyers": 19345,
"likes": 800789,
"comments": 119351,
"sales_gross": 4747505.5402737735,
"units_sold": 24226,
"total_views": 5702168,
"total_live_duration": 6565127,
"unique_viewers": 3616306,
"atc_units": 214603,
"total_livestreams": 313,
"average_live_duration": 20974.846645367412,
"average_views_duration": 47.33443242911413,
"new_followers": 30022,
"new_buyers": 18535,
"existing_buyers": 810,
"sales_net": 3332254.597736,
"conversion_rate": 0.00416806379608598
},
{
"region": "SG",
"currency": "LOCAL",
"orders": 777,
"buyers": 666,
"likes": 21482,
"comments": 3005,
"sales_gross": 245043.32999999996,
"units_sold": 801,
"total_views": 339444,
"total_live_duration": 1496824,
"unique_viewers": 233964,
"atc_units": 6228,
"total_livestreams": 159,
"average_live_duration": 9413.987421383648,
"average_views_duration": 56.91718811441076,
"new_followers": 704,
"new_buyers": 653,
"existing_buyers": 13,
"sales_net": 186087.52,
"conversion_rate": 0.0022890373669883692
}
]
},
"request_id": "ad13785b-402c-4896-84df-6dc6c008f90d"
}
§14 Error example
Error example
§15 JSON
JSON
{
"request_id": "a1bb6a69-b5b4-408a-9e9a-4b1c36229c95",
"error": "error_param",
"message": "for month granularity, start_date must be the first day of month.",
"response": null
}
§16 Errors
Errors
| Error | Description | Solution |
|---|---|---|
| error_param | timezone is required | |
| error_param | granularity is required | |
| error_param | request body is invalid | |
| error_param | currency is invalid | |
| error_param | region_list contains invalid region. | |
| error_param | region is required | |
| error_param | end_date is not ready, please retry later | |
| error_param | for day granularity, start_date must equal end_date. | |
| error_param | day range is outside the allowed selectable range. | |
| error_param | for week granularity, end_date must be within the selected week range | |
| error_param | for week granularity, start_date must be a Sunday. | |
| error_param | week start_date is earlier than the earliest allowed week. | |
| error_param | start_date cannot be later than end_date. | |
| error_param | month range is outside the allowed selectable range. | |
| error_param | for month granularity, start_date must be the first day of month. | |
| error_param | for month granularity, end_date must be within the selected month range. | |
| error_param | for quarter granularity, end_date must be within the selected quarter range. | |
| error_param | year range is outside the allowed selectable range. | |
| error_param | for quarter granularity, start_date must be the first day of quarter. | |
| error_param | for quarter granularity, end_date must be within the selected quarter range. | |
| error_param | start_date is earlier than the earliest allowed date | |
| error_param | for year granularity, end_date must be within the selected year range. | |
| error_param | end_date must not be later than the latest selectable day. | |
| error_permission | auth failed | |
| error_param | start_date is required | |
| error_param | start_date is required; start_date must use YYYY-MM-DD | |
| error_param | end_date is required | |
| error_param | end_date must use YYYY-MM-DD |
§17 Common errors
Common errors
| Error | Description | Solution |
|---|---|---|
| error_auth | partner_id is invalid | |
| error_auth | The App is deleted, and you'll be unable to make any API call. | |
| error_auth | App 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_param | There is no partner_id in query. | |
| error_param | Invalid partner_id. | |
| error_param | no timestamp | |
| error_param | Invalid timestamp | |
| error_param | There is no sign in query. | |
| error_sign | Wrong sign. | |
| invalid_partner_id | Invalid partner_id, please have a check. | |
| error_auth | No permission to current api. | |
| error_api_call_restricted | The 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_suspended | The API is offline. Please call v2 API instead. | |
| error_limit | The 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_limit | Too many requests. You have reached the rate limit. Please try again later. | |
| source_ip_undeclared | Request Source IP ({ip}) is undeclared. Please declare all your IP addresses in the Shopee Open Platform Console > App list > IP Address Whitelist | |
| error_param | Permission denied. This API is currently offline or the request path is incorrect. | |
| error_param | Partner_id is invalid, should be an integer between 0 and 4294967295. | |
| error_param | no timestamp. | |
| error_param | Timestamp is invalid, should be an integer between 0 and 4294967295. | |
| error_param | Timestamp is expired. | |
| error_partner_key_expired | Your 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_permission | This app type has no permission to this API. |
§18 Update log
Update log
| Date | Change |
|---|---|
| 2026-07-09 | New API |
