Query an Ongoing Stream
Function
This API is used to query an ongoing stream.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/realtime/streams
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| publish_domain | Yes | String | Ingest domain name. |
| app | No | String | Application name. |
| offset | No | Integer | Offset, which is the position where the query starts. The value must be greater than or equal to 0. |
| limit | No | Integer | Number of records on each page. The value ranges from 1 to 100 and defaults to 10. Value range: 1~100 Default value: 10 |
| stream | No | String | Stream name. If the stream parameter is carried, the app parameter cannot be left empty. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | No | String | User token. This parameter is mandatory when token authentication is used. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
| Authorization | No | String | Authentication information. This parameter is mandatory for AK/SK authentication. |
| X-Sdk-Date | No | String | Time when a request is sent. This parameter is mandatory for AK/SK authentication. |
| X-Project-Id | No | String | Project ID. This parameter is mandatory for AK/SK authentication. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total_page | Long | Total number of pages. |
| total_num | Long | Total number of items. |
| offset | Long | Offset. |
| limit | Long | Number of items on each page. |
| request_id | String | Unique ID of a request. |
| streams | Array of OnlineInfo objects | Stream statistics. |
| Parameter | Type | Description |
|---|---|---|
| publish_domain | String | Domain name. |
| app | String | Application name. |
| stream | String | Stream name. |
| video_codec | String | Video encoding format. |
| audio_codec | String | Audio encoding format. Value: AAC. |
| video_frame_rate | Long | Video frame rate, in FPS. |
| audio_frame_rate | Long | Audio frame rate, in FPS. |
| video_bitrate | Long | Video bitrate, in kbit/s. |
| audio_bitrate | Long | Audio bitrate, in kbit/s. |
| resolution | String | Video resolution. |
| client_ip | String | IP address of the device that pushes streams. |
| start_time | String | Time when stream pushing starts. The value is in UTC format, for example, 2006-01-02T15:04:05Z. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code |
| error_msg | String | Error description |
Example Requests
GET https://{endpoint}/v1/{project_id}/realtime/streams?publish_domain=push.example.com&app=live&offset=0&limit=10 Example Responses
Status code: 200
Query succeeded.
{
"total_page" : 1,
"total_num" : 10,
"offset" : 0,
"limit" : 10,
"request_id" : "56b9f4dc-b282-48e0-a1a9-c50ffb06b687",
"streams" : [ {
"publish_domain" : "push.example.com",
"app" : "live",
"stream" : "test",
"video_codec" : "H264",
"audio_codec" : "AAC",
"video_frame_rate" : 15,
"audio_frame_rate" : 43,
"video_bitrate" : 588,
"audio_bitrate" : 68,
"resolution" : "640x360",
"client_ip" : "192.168.0.100",
"start_time" : "2006-01-02T15:04:05Z"
} ]
} Status code: 400
Query failed.
{
"error_code" : "LIVE.100011001",
"error_msg" : "Request Illegal"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Query succeeded. |
| 400 | Query failed. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.