Polyv Help Center

Help Center

Query Video Information

Updated: 2026-08-28 14:25:14

API Description

1、通过视频id查询视频信息
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议

API URL

http://api.polyv.net/v2/video/{userid}/get-video-info

Online API Call

Request Method

GET

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. API calls have a frequency limit. See details

Request Parameter Description

Parameter Required Type Description
ptime true Long Current time in milliseconds timestamp, valid for 3 minutes
sign true String Signature, a 40-character uppercase SHA1 value. The secretkey 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 signature generation rules
vid true String Video ID (supports multiple IDs separated by commas), up to 100 video IDs at a time

Example

http://api.polyv.net/v2/video/1b448be323/get-video-info

Form Parameters:

vid=1b448be3231361255350f047cd7ed6bb_1,1b448be323b8d9b9489dcd7e8e09f087_1&sign=29D75C8F042389E667A09D10C94F38A90DF05CC6&ptime=1617096538024

Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure See global error description
status String Response status text
message String Response description, assists in describing error reasons when code is 400 or 500
data Array Returns detailed video information on success See data field description

data Parameter Description

Field Type Description
vid String Video ID
basicInfo Object Basic video information See basicInfo parameter description
metaData Object Video metadata See metaData parameter description
transcodeInfos Array Transcoding information See transcodeInfos parameter description
snapshotInfo Object Snapshot information See snapshotInfo parameter description

basicInfo Parameter Description

Field Type Description
title String Video title
description String Video description
duration Integer Video duration, in seconds
coverURL String Cover image URL, large image
miniCoverURL String Cover image URL, small image
largeCoverURL String Cover image URL, large image, same as coverURL
audioUrl String Audio URL, returns empty string if video has no audio
creationTime String Creation time, format: yyyy-MM-dd HH:mm:ss
updateTime String Update time, format: yyyy-MM-dd HH:mm:ss
size Long Source file size, in bytes
status Integer Video status code
60/61: Published
10: Waiting for encoding
20: Encoding
40: Encoding failed
50: Pending review
51: Review failed
-1: Deleted
cateId Long Category ID, e.g., 1 for default category
cateName String Category name
tags String Video tags
uploader String Uploader
courseId String Custom identifier (set in live broadcast channel settings and passed to VOD via replay storage)

metaData Parameter Description

Field Type Description
size Long Source file size, in bytes
format String Video container type, e.g., mp4, flv
duration Integer Source video duration, in seconds
bitrate Integer Video bitrate, in bps
fps Integer Video frame rate
height Integer Resolution height, in pixels
width Integer Resolution width, in pixels
codec String Encoding format, e.g., h264, h265

transcodeInfos Parameter Description

Field Type Description
playUrl String Playback URL
definition String Quality
SOURCE: Original quality
LD: Low definition
SD: Standard definition
HD: High definition
bitrate Integer Video bitrate, in kbps
duration Integer Duration, in seconds
encrypt Boolean Whether the video is encrypted
true: Encrypted video
false: Non-encrypted
format String Transcoding format, e.g., mp4, flv, pdx, hls
fps Integer Video frame rate
height Integer Resolution height, in pixels
width Integer Resolution width, in pixels
status String Video status
normal: Normal playback
unavailable: Cannot play normally
fileSize Long Encoded video size, in bytes

snapshotInfo Parameter Description

Field Type Description
imageUrl String[] Video snapshot URLs

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 project. HttpUtil.java and VodSignUtil.java in the test case are included in the download file.

It is strongly recommended to use the VOD Java SDK for API functionality integration. The VOD Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.

private static final Logger log = LoggerFactory.getLogger(VodVideoManagementTest.class);
/**
 * 查询视频信息
 * @throws Exception
 * @throws NoSuchAlgorithmException
 */
@Test
public void testGetVideoInfo() throws Exception, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String secretKey = super.secretKey;
    String userId = super.userId;
    String ptime = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = String.format("http://api.polyv.net/v2/video/%s/get-video-info", userId);
    String vid = "1b448be3231361255350f047cd7ed6bb_1,1b448be323b8d9b9489dcd7e8e09f087_1";
    
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("ptime", ptime);
    requestMap.put("vid", vid);
    requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
    String response = HttpUtil.postFormBody(url, requestMap);
    log.debug("测试查询视频信息,{}", response);
    //do somethings
    
}

Response Example

For global system error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "message": "success",
    "data": [
        {
            "vid": "1b448be323fddcd3f8823f534918039e_1",
            "basicInfo": {
                "title": "保利威宣传视频",
                "description": "保利威是全球领先的企业直播服务商,隶属于广州易方信息科技股份有限公司,致力于通过可集成、可定制的视频直播技术,为企业搭建自主私域直播系统,并提供直播全流程运营与现场执行服务。",
                "duration": 109,
                "thumbnailURL": "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_0.jpg",
                "coverURL": "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_0_b.jpg",
                "audioUrl": "https://mpv.videocc.net/1b448be323/3/1b448be323efac457efa048ec56ae2a3_1.mp3",
                "creationTime": "2022-12-13 09:14:07",
                "updateTime": "2022-12-13 09:15:15",
                "size": 18839865,
                "status": 61,
                "cateId": 1,
                "cateName": "默认分类",
                "tags": "宣传视频",
                "uploader": "主账号",
                "playTimes": 0,
                "md5Checksum": "4b88804c015da508b5008f95846befc1",
                "extContent": null,
                "courseId": "OA20260813001"
            },
            "metaData": {
                "size": 18839865,
                "format": "mp4",
                "duration": 109,
                "bitrate": 1211,
                "fps": 30,
                "height": 1080,
                "width": 1920,
                "codec": "h264"
            },
            "transcodeInfos": [
                {
                    "playUrl": null,
                    "definition": "LD",
                    "bitrate": 399,
                    "duration": 109,
                    "encrypt": true,
                    "format": "pdx",
                    "fps": 30,
                    "height": 360,
                    "width": 640,
                    "status": "normal",
                    "fileSize": 7770204
                },
                {
                    "playUrl": "https://hls.videocc.net/1b448be323/e/1b448be323fddcd3f8823f534918039e_1.m3u8",
                    "definition": "LD",
                    "bitrate": 399,
                    "duration": 109,
                    "encrypt": true,
                    "format": "hls",
                    "fps": 30,
                    "height": 360,
                    "width": 640,
                    "status": "normal",
                    "fileSize": 7770204
                },
                {
                    "playUrl": null,
                    "definition": "SD",
                    "bitrate": 892,
                    "duration": 109,
                    "encrypt": true,
                    "format": "pdx",
                    "fps": 30,
                    "height": 540,
                    "width": 960,
                    "status": "normal",
                    "fileSize": 14509172
                },
                {
                    "playUrl": "https://hls.videocc.net/1b448be323/e/1b448be323fddcd3f8823f534918039e_2.m3u8",
                    "definition": "SD",
                    "bitrate": 892,
                    "duration": 109,
                    "encrypt": true,
                    "format": "hls",
                    "fps": 30,
                    "height": 540,
                    "width": 960,
                    "status": "normal",
                    "fileSize": 14509172
                },
                {
                    "playUrl": null,
                    "definition": "HD",
                    "bitrate": 1211,
                    "duration": 109,
                    "encrypt": true,
                    "format": "pdx",
                    "fps": 30,
                    "height": 1080,
                    "width": 1920,
                    "status": "normal",
                    "fileSize": 18866914
                },
                {
                    "playUrl": "https://hls.videocc.net/1b448be323/e/1b448be323fddcd3f8823f534918039e_3.m3u8",
                    "definition": "HD",
                    "bitrate": 1211,
                    "duration": 109,
                    "encrypt": true,
                    "format": "hls",
                    "fps": 30,
                    "height": 1080,
                    "width": 1920,
                    "status": "normal",
                    "fileSize": 18866914
                }
            ],
            "snapshotInfo": {
                "imageUrl": [
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_0.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_1.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_2.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_3.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_4.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_5.jpg"
                ],
                "bigImageUrl": [
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_0_b.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_1_b.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_2_b.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_3_b.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_4_b.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/e/1b448be323fddcd3f8823f534918039e_5_b.jpg"
                ]
            }
        },
        {
            "vid": "1b448be323871ffe3d5a84a3638e82c2_1",
            "basicInfo": {
                "title": "保利威宣传视频",
                "description": "保利威是全球领先的企业直播服务商,隶属于广州易方信息科技股份有限公司,致力于通过可集成、可定制的视频直播技术,为企业搭建自主私域直播系统,并提供直播全流程运营与现场执行服务。",
                "duration": 109,
                "thumbnailURL": "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_0.jpg",
                "coverURL": "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_0_b.jpg",
                "audioUrl": "",
                "creationTime": "2022-12-12 17:47:19",
                "updateTime": "2022-12-12 17:52:07",
                "size": 18839865,
                "status": 61,
                "cateId": 1,
                "cateName": "默认分类",
                "tags": "宣传视频",
                "uploader": "主账号",
                "playTimes": 0,
                "md5Checksum": "4b88804c015da508b5008f95846befc1",
                "extContent": null,
                "courseId": "OA20260813001"
            },
            "metaData": {
                "size": 18839865,
                "format": "mp4",
                "duration": 109,
                "bitrate": 1211,
                "fps": 30,
                "height": 1080,
                "width": 1920,
                "codec": "h264"
            },
            "transcodeInfos": [
                {
                    "playUrl": null,
                    "definition": "LD",
                    "bitrate": 399,
                    "duration": 109,
                    "encrypt": true,
                    "format": "pdx",
                    "fps": 30,
                    "height": 360,
                    "width": 640,
                    "status": "normal",
                    "fileSize": 7774918
                },
                {
                    "playUrl": "https://hls.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_1.m3u8",
                    "definition": "LD",
                    "bitrate": 399,
                    "duration": 109,
                    "encrypt": true,
                    "format": "hls",
                    "fps": 30,
                    "height": 360,
                    "width": 640,
                    "status": "normal",
                    "fileSize": 7774918
                },
                {
                    "playUrl": null,
                    "definition": "SD",
                    "bitrate": 892,
                    "duration": 109,
                    "encrypt": true,
                    "format": "pdx",
                    "fps": 30,
                    "height": 540,
                    "width": 960,
                    "status": "normal",
                    "fileSize": 14508330
                },
                {
                    "playUrl": "https://hls.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_2.m3u8",
                    "definition": "SD",
                    "bitrate": 892,
                    "duration": 109,
                    "encrypt": true,
                    "format": "hls",
                    "fps": 30,
                    "height": 540,
                    "width": 960,
                    "status": "normal",
                    "fileSize": 14508330
                },
                {
                    "playUrl": null,
                    "definition": "HD",
                    "bitrate": 1211,
                    "duration": 109,
                    "encrypt": true,
                    "format": "pdx",
                    "fps": 30,
                    "height": 1080,
                    "width": 1920,
                    "status": "normal",
                    "fileSize": 18866914
                },
                {
                    "playUrl": "https://hls.videocc.net/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_3.m3u8",
                    "definition": "HD",
                    "bitrate": 1211,
                    "duration": 109,
                    "encrypt": true,
                    "format": "hls",
                    "fps": 30,
                    "height": 1080,
                    "width": 1920,
                    "status": "normal",
                    "fileSize": 18866914
                }
            ],
            "snapshotInfo": {
                "imageUrl": [
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_0.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_1.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_2.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_3.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_4.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_5.jpg"
                ],
                "bigImageUrl": [
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_0_b.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_1_b.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_2_b.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_3_b.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_4_b.jpg",
                    "https://img.videocc.net/uimage/1/1b448be323/2/1b448be323871ffe3d5a84a3638e82c2_5_b.jpg"
                ]
            }
        }
    ]
}

Error Example

{
    "code": 400,
    "status": "error",
    "message": "找不到视频信息,请确认参数信息正确性",
    "data": ""
}
联系客服,在线咨询
在线咨询