Polyv Help Center

Help Center

Query Channel Information

Updated: 2025-12-04 13:53:36

API Description

1、查询频道基本信息
2、接口支持https协议

API URL

http://api.polyv.net/live/v3/channel/basic/get

Request Method

GET

API Constraints

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

Request Parameter Description

Parameter Required Type Description
appId true String Account appId See Obtaining Secret Key
timestamp true Long Current 13-digit millisecond timestamp, valid for 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 never be saved 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 and obtain response data. See Signature Generation Rules
channelId true String Channel ID

Example

http://api.polyv.net/live/v3/channel/basic/get?appId=frlr1zazn3&sign=A80D0E7115D0D1BF5648AE2AB123C0FD&channelId=1958888&timestamp=1621839827266

Response Parameter Description

Parameter Type Description
code Integer Response status code. 200 indicates success, non-200 indicates failure See Global Error Description
status String Response status text
message String Response description. When code is 400 or 500, provides auxiliary error reason
data Object Empty on failure. On success, contains detailed channel settings See data field description

data Field Description

Parameter Type Description
channelId String Channel ID
name String Channel name
scene String Live streaming scene. Not used for new version live streaming.
alone: Event live
topclass: Large class
ppt: Three-screen
seminar: Seminar
newScene String New backend live streaming scene. If undefined, uses scene.
undefined: Undefined
topclass: Large class
double: Dual-teacher class (requires permission)
train: Enterprise training
seminar: Seminar
alone: Event marketing
template String New backend live streaming template. For older channels, this field is undefined.
undefined: Undefined
ppt: Three-screen (landscape)
portrait_ppt: Three-screen (portrait)
alone: Pure video (landscape)
portrait_alone: Pure video (portrait)
topclass: Pure video - Express (landscape)
portrait_topclass: Pure video - Express (portrait)
seminar: Seminar
channelPasswd String Channel password
publisher String Host name
startTime Long Live start time set in the room (countdown appears after setting). 0 if not set or reset. 13-digit millisecond timestamp when set and active.
pageView Integer Cumulative page views
likes Integer Number of likes on the watch page
coverImg String Player cover URL
splashImg String Live room cover URL
splashEnabled String Splash page toggle
Y: Enabled
N: Disabled
desc String Live stream description
pureRtcEnabled String No-latency toggle
Y: Enabled
N: Disabled
consultingMenuEnabled String Consultation/Question toggle
Y: Enabled
N: Disabled
maxViewerRestrict String Maximum online viewer limit toggle
Y: Enabled
N: Disabled
maxViewer Integer Maximum online viewers. 0 and -1 indicate no limit
watchUrl String Live watch URL, e.g., https://xxx.live.polyv.cn/watch/xxxx
watchStatus String Watch page status
live: Live
playback: Playback
end: Ended
waiting: Waiting
watchStatusText String Watch page status description
userCategory Object Channel category information See userCategory field description
authSettings Array List of live watch conditions See authSettings field description

userCategory Field Description

Parameter Type Description
categoryId String Category ID
categoryName String Category name
userId String POLYV user ID, same as on the official website. Path: Official website -> Login -> Live (Development Settings)
rank Integer Category sort value

authSettings Field Description

Parameter Type Description
channelId String Channel ID
rank Integer Channel live watch condition. Primary condition is 1, secondary condition is 2
userId String POLYV user ID, same as on the official website. Path: Official website -> Login -> Live (Development Settings)
globalSettingEnabled String Global settings toggle
Y: Enabled
N: Disabled
enabled String Watch condition toggle
Y: Enabled
N: Disabled
authType String Watch condition type
none: No restriction
code: Verification code
pay: Paid
phone: Whitelist
info: Registration
wxshare: Share
custom: Custom authorization
external: External authorization
direct: Independent authorization
authTips String Whitelist watch prompt
payAuthTips String Paid watch prompt
codeAuthTips String Verification code watch prompt
infoAuthTips String Registration watch prompt
authCode String Verification code for verification code watch
qcodeTips String QR code prompt for verification code watch
qcodeImg String QR code image for verification code watch
price Float Price for paid watch
watchEndTime Long Paid watch end time, 13-digit millisecond timestamp. null indicates one-time payment, permanently valid
validTimePeriod Integer Paid watch duration in days
customKey String Custom authorization watch key
customUri String Custom authorization watch API URL
externalKey String External authorization watch key
externalUri String External authorization watch API URL
externalRedirectUri String External authorization watch redirect URL when users directly access the watch page
directKey String Independent authorization key
trialWatchEnabled String Paid watch trial toggle, disabled by default
Y: Enabled
N: Disabled
trialWatchTime Integer Trial watch time in minutes
trialWatchEndTime Long Trial watch end date, 13-digit millisecond timestamp. null indicates permanently valid for this channel
whiteListInputTips String Whitelist input prompt
whiteListEntryText String Whitelist entry text
infoDesc String Registration watch description field

Java Request Example

For quick integration of basic code, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own source project. The test cases HttpUtil.java and LiveSignUtil.java are included in the download 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 pools.

private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
 * 查询频道基本信息
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void testGetChannelDetailSetting() 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/basic/get";
    String channelId = "2139283";
    
    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 system error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "channelId": 1958888,
        "name": "Junit测试(勿删)888",
        "scene": "alone",
        "channelPasswd": "xxxxxx",
        "pureRtcEnabled":"N",
        "publisher": "sadboy主讲",
        "startTime": 0,
        "pageView": 1000,
        "likes": 2000,
        "coverImg": "//liveimages.videocc.net/uploaded/images/2021/03/fx6955h3q6.net",
        "splashImg": null,
        "splashEnabled": "N",
        "desc": "这是一个描述",
        "consultingMenuEnabled": "Y",
        "maxViewerRestrict": "N",
        "maxViewer": 0,
        "watchUrl": "https://1b448be323.live.polyv.cn/watch/1958888",
        "watchStatus": "end",
        "watchStatusText": "已结束",
        "userCategory": {
            "categoryId": 340019,
            "categoryName": "默认分类",
            "userId": "1b448be323",
            "rank": 0
        },
        "authSettings": [
            {
                "channelId": 1958888,
                "rank": 1,
                "userId": "1b448be323",
                "globalSettingEnabled": "N",
                "enabled": "Y",
                "authType": "pay",
                "authTips": "欢迎观看本次直播",
                "payAuthTips": "欢迎观看本次直播",
                "codeAuthTips": "欢迎观看本次直播",
                "infoAuthTips": "欢迎观看本次直播",
                "authCode": "xxxx",
                "qcodeTips": "提示文案",
                "qcodeImg": "//liveimages.videocc.net/uploaded/images/2021/03/fx69556szv.png",
                "price": 0.01,
                "watchEndTime": 1617077460000,
                "validTimePeriod": null,
                "customKey": "xxxxgn",
                "customUri": null,
                "externalKey": "xxxxxxxx",
                "externalUri": null,
                "externalRedirectUri": null,
                "directKey": "xxxxxxxx",
                "trialWatchEnabled": "Y",
                "trialWatchTime": 3,
                "trialWatchEndTime": 1617119999000,
                "whiteListInputTips": null,
                "whiteListEntryText": "会员入口",
                "infoDesc": null
            },
            {
                "channelId": 1958888,
                "rank": 2,
                "userId": "1b448be323",
                "globalSettingEnabled": "N",
                "enabled": "N",
                "authType": "none",
                "authTips": "欢迎观看本次直播",
                "payAuthTips": "欢迎观看本次直播",
                "codeAuthTips": "欢迎观看本次直播",
                "infoAuthTips": "欢迎观看本次直播",
                "authCode": null,
                "qcodeTips": null,
                "qcodeImg": null,
                "price": 0,
                "watchEndTime": null,
                "validTimePeriod": null,
                "customKey": "xxxxxxxx",
                "customUri": null,
                "externalKey": "xxxxxxxx",
                "externalUri": null,
                "externalRedirectUri": null,
                "directKey": "xxxxxxxx",
                "trialWatchEnabled": "N",
                "trialWatchTime": null,
                "trialWatchEndTime": null,
                "whiteListInputTips": null,
                "whiteListEntryText": "会员入口",
                "infoDesc": null
            }
        ],
        "bgImg": "https://car3.autoimg.cn/cardfs/product/g25/M08/C7/57/1024x0_1_q95_autohomecar__ChsEmF8EOK-AB5uaAAfsj_iwPdE906.jpg",
        "creatorChildId": null,
        "creatorName": null
    }
}

Error Example

{
    "code": 400,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询