簡體   English   中英

如何使用 twitter v2 ZDB974238714CA8DE634A7ACE1 從 twitter 句柄中檢索 twitter 用戶 ID

[英]How to get retrieve twitter user id from twitter handle using the twitter v2 API

我目前使用的是twitter v2 API,使用下面的npm ZEFE90A8E604A7C840E88D03A6D

const tweets = await client.v2.userTimeline(userId, { exclude: 'replies' });

對於此命令,我需要用戶 ID 而不是 twitter 句柄。

如何使用 twitter ZDB974238714CA8DE4D3AZ 句柄從 twitter 句柄中獲取 twitter 用戶 ID?

您將使用client.v2.userByUsername('handle'); 並從響應中獲取 ID 值。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM