【问题标题】:convert Instagram Username to userID without API无需 API 即可将 Instagram 用户名转换为用户 ID
【发布时间】:2021-01-13 13:07:02
【问题描述】:

有没有机会在没有 Api 的情况下将 Instagram 用户名转换为用户 ID,只使用脚本?

我试试这个:

https://www.instagram.com/myusername/?__a=1

它提供了很多信息,但我无法从中提取数据。当我把它放在 PHP 文件中并尝试获取 var_dump 时

var_dump(file_get_contents('https://www.instagram.com/myusername/?__a=1'));

我在输出中得到 bool(false)

有没有办法从 JSON 浏览器复制用户 ID 数据?

或任何其他无需 Instagram API 即可将用户名转换为 USERID 的方法?

【问题讨论】:

    标签: php instagram


    【解决方案1】:

    试试这个代码:

    $response = file_get_contents('https://www.instagram.com/myusername/?__a=1');
    $response = json_decode($response);
    $userId = $response->graphql->user->fbid;
    var_dump($userId);
    

    【讨论】:

    • 感谢您的回答,我尝试了您的代码,它在输出中返回 NULL
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-21
    • 2013-11-15
    • 1970-01-01
    相关资源
    最近更新 更多