微博第三方登录,获取用户信息(昵称、头像、地址等信息)

一、微博开发文档

链接: 根据用户ID获取用户信息

二、请求示例

URL

https://api.weibo.com/2/users/show.json

HTTP请求方式

GET

请求参数

请求参数key必选类型及范围说明
access_tokentruestring采用OAuth授权方式为必填参数,OAuth授权后获得。
uidfalseint64需要查询的用户ID。
screen_namefalsestring需要查询的用户昵称。

返回结果JSON示例

{
    "id": 1404376560,
    "screen_name": "zaku",
    "name": "zaku",
    "province": "11",
    "city": "5",
    "location": "北京 朝阳区",
    "description": "人生五十年,乃如梦如幻;有生斯有死,壮士复何憾。",
    "url": "http://blog.sina.com.cn/zaku",
    "profile_image_url": "http://tp1.sinaimg.cn/1404376560/50/0/1",
    "domain": "zaku",
    "gender": "m",
    "followers_count": 1204,
    "friends_count": 447,
    "statuses_count": 2908,
    "favourites_count": 0,
    "created_at": "Fri Aug 28 00:00:00 +0800 2009",
    "following": false,
    "allow_all_act_msg": false,
    "geo_enabled": true,
    "verified": false,
    "status": {
        "created_at": "Tue May 24 18:04:53 +0800 2011",
        "id": 11142488790,
        "text": "我的相机到了。",
        "source": "<a href="http://weibo.com" rel="nofollow">新浪微博</a>",
        "favorited": false,
        "truncated": false,
        "in_reply_to_status_id": "",
        "in_reply_to_user_id": "",
        "in_reply_to_screen_name": "",
        "geo": null,
        "mid": "5610221544300749636",
        "annotations": [],
        "reposts_count": 5,
        "comments_count": 8
    },
    "allow_all_comment": true,
    "avatar_large": "http://tp1.sinaimg.cn/1404376560/180/0/1",
    "verified_reason": "",
    "follow_me": false,
    "online_status": 0,
    "bi_followers_count": 215
}

返回字段说明

返回值字段字段类型字段说明
idint64用户UID
idstrstring字符串型的用户UID
screen_namestring用户昵称
namestring友好显示名称
provinceint用户所在省级ID
cityint用户所在城市ID
locationstring用户所在地
descriptionstring用户个人描述
urlstring用户博客地址
profile_image_urlstring用户头像地址(中图),50×50像素
profile_urlstring用户的微博统一URL地址
domainstring用户的个性化域名
weihaostring用户的微号
genderstring性别,m:男、f:女、n:未知
followers_countint粉丝数
friends_countint关注数
statuses_countint微博数
favourites_countint收藏数
created_atstring用户创建(注册)时间
followingboolean暂未支持
allow_all_act_msgboolean是否允许所有人给我发私信,true:是,false:否
geo_enabledboolean是否允许标识用户的地理位置,true:是,false:否
verifiedboolean是否是微博认证用户,即加V用户,true:是,false:否
verified_typeint暂未支持
remarkstring用户备注信息,只有在查询用户关系时才返回此字段
statusobject用户的最近一条微博信息字段 详细
allow_all_commentboolean是否允许所有人对我的微博进行评论,true:是,false:否
avatar_largestring用户头像地址(大图),180×180像素
avatar_hdstring用户头像地址(高清),高清头像原图
verified_reasonstring认证原因
follow_meboolean该用户是否关注当前登录用户,true:是,false:否
online_statusint用户的在线状态,0:不在线、1:在线
bi_followers_countint用户的互粉数
langstring用户当前的语言版本,zh-cn:简体中文,zh-tw:繁体中文,en:英语
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值