终端中未获取Json数据&;获取错误->;(SyntaxError:JSON输入意外结束)

终端中未获取Json数据&;获取错误->;(SyntaxError:JSON输入意外结束),json,express,youtube-api,Json,Express,Youtube Api,我试图从Youtube Api中获得一些价值。现在,我的快递代码是-> https.get("https://www.googleapis.com/youtube/v3/videos?part=snippet&id=qW_SWM1wpMA&key=MYAPIKEY",function(res){ res.on("data",function(data){ const da=JSON.parse(data);

我试图从Youtube Api中获得一些价值。现在,我的快递代码是->

    https.get("https://www.googleapis.com/youtube/v3/videos?part=snippet&id=qW_SWM1wpMA&key=MYAPIKEY",function(res){
    res.on("data",function(data){
    const da=JSON.parse(data); 
    console.log(da);  
})
});
现在,我正在记录来自api的数据。但是我得到了这个错误->

 $ node app.js
Port is running
undefined:13
        "description": "\"Bang Bhaja\" shows how Nonte and Fonte makes a trick to punish Keltu for punishing them from Superintendent Sir for eating the Ilish Maach.\n\nNonte Fonte is a Bengali comic-strip creation of Narayan Debnath which originally was serialized for the childre



SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at IncomingMessage.<anonymous> (C:\Users\LENOVO\Desktop\youtube\app.js:13:19)
    at IncomingMessage.emit (events.js:314:20)
    at IncomingMessage.Readable.read (_stream_readable.js:514:10)
    at flow (_stream_readable.js:987:34)
    at resume_ (_stream_readable.js:968:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
$node app.js
端口正在运行
未定义:13
“描述”:“\“Bang Bhaja\”展示了Nonte和Fonte如何通过警司先生惩罚他们吃了Ilish Maach来惩罚Keltu。\n\n Nonte Fonte是Narayan Debnath的孟加拉漫画创作,最初是为《儿童》连载的
SyntaxError:JSON输入意外结束
在JSON.parse()处
在IncomingMessage。(C:\Users\LENOVO\Desktop\youtube\app.js:13:19)
在IncomingMessage.emit(events.js:314:20)
在IncomingMessage.Readable.read(_stream_Readable.js:514:10)
流动时(_stream_readable.js:987:34)
在resume上(_stream_readable.js:968:3)
在处理和拒绝时(内部/process/task_queues.js:80:21)
但是,当在chrome中粘贴API链接(上面https.get方法中提到的内容)时,我成功地获取了json数据。那么为什么不在终端中获取json数据呢?


为什么您不使用google api Node js客户端库?为什么您要手动调用?我查看了googleapis Node.js客户端库的文档部分,但使用blogger。但是我使用的是youtube api v3,而不是blogger api。此外,我使用的是googleapis,但我得到错误403(他们告诉我需要一个blogger api v3并激活它)。那么我应该怎么做?我应该只使用youtube api v3获取特定视频的信息。此外,为什么我不手动调用?