Twitter follower count number

后端 未结 4 1614
伪装坚强ぢ
伪装坚强ぢ 2021-02-08 03:44

Is the only way to get the follower count number in plain text is using cURL? or does the twitter API provides any such option?

4条回答
  •  温柔的废话
    2021-02-08 04:36

    https://api.twitter.com/1/users/lookup.json?screen_name=tvdw (my profile, just replace the screen name)

    Also available as XML: https://api.twitter.com/1/users/lookup.xml?screen_name=tvdw

    Obtaining it in PHP:

    $data = json_decode(file_get_contents('https://api.twitter.com/1/users/lookup.json?screen_name=tvdw'), true);
    echo $data[0]['followers_count'];
    

提交回复
热议问题