Query Channel Live Streaming Push Information
API Description
1、获取频道直播的实时推流信息
2、deployAddress、inAddress、lfr信息可能无法获取,返回值为null
3、接口支持https协议
API URL
http://api.polyv.net/live/v3/channel/monitor/get-stream-info
Request Method
GET
API Constraints
The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Retrieving channel live stream push information requires the channel to be in a live streaming state.
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId [See details in Get Secret Key] |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. [See details in Signature Generation Rules] |
| channelId | true | String | Channel ID during live streaming |
Example
http://api.polyv.net/live/v3/channel/monitor/get-stream-info?appId=frlr1zazn3&sign=C467BD0B98D6CB6981EB15125C25CBA0&channelId=4184544×tamp=1692322896864
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure [See details in Global Error Description] |
| status | String | Response status text |
| message | String | Response description, assists in describing error reasons when code is 400 or 500 |
| data | Object | Real-time push information of the channel upon successful request, returns null if unavailable [See details in data field description] |
data Field Description
| Parameter | Type | Description |
|---|---|---|
| deployAddress | String | Pushed CDN node IP address |
| inAddress | String | Push stream egress IP address |
| streamName | String | Stream name |
| fps | String | Push stream frame rate |
| lfr | String | Push stream frame loss rate |
| inBandWidth | String | Push stream bitrate, unit: bps |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
private static final Logger log = LoggerFactory.getLogger(ChannelStateTest.class);
/**
* 查询频道实时推流信息
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testGetStreamInfo() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String userId = super.userId;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v3/channel/monitor/get-stream-info";
String channelId = "4184544";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试查询频道实时推流信息,返回值:{}", response);
//do somethings
}
Response Example
For global error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": {
"deployAddress": null,
"inAddress": null,
"streamName": "1b448be32316919995083869e11",
"fps": "15.15",
"lfr": null,
"inBandWidth": "70058.266"
}
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
