C/2/commercial/push/en

Jump to: navigation, search

datapush/status

Connect this API to fetch Weibo statuses and comments. It's a long-lived connection.

URL

https://c.api.weibo.com/2/datapush/status.json

Supported Formats

JSON

HTTP Request Method

GET

Requires Login

False
See the Login and Authorization Mechanism Statement for login and authorization details.

Requests Count Limitation

None

Request Parameters

  Requires Type and Range Description
source false string This parameter is not needed when using OAuth.The value of this parameter is the AppKey.
access_token false string This parameter is required when using OAuth.You will get the access_token after oauth authorization.
subid true int Subscription ID (See the specification for more information).
since_id false long The last data ID before disconnected ( You don't need to pass this parameter when you first send the request).

Notes

  • Use the url: https://c.api.weibo.com/commercial/push to call the API.The url: https://c.api.weibo.com/2/commercial/push.json is invalid.
  • The IP address to call the API must be one of the IP list provided when created the subscription. Otherwise, the error response ‘Ip is limited’ will be returned.
  • Parameter 'source' and 'access_token' are not needed to pass.
  • Data id is the first field returned by this endpoint, and is different from the Weibo id in status field.
  • Speficication for prarameter since_id:
  • When since_is has not been passed, system would push the recent 100 pieces of data;
  • In order to avoid receiving recent 100 pieces of data repetitively or missing data, we strongly support passing this parameter every time;
  • If since_id is passed, system would push the data that is published after since_id;
  • The data from recent 3 days (Including data from today and past 3 days before today ) can be fetched by passing since_id. If the publishing time of since_id ahead of 3 days or the since_id is illegal, system would return data as if the since_id is not passed;
  • In order to avoid long-lived HTTP connection being abnormally disconnected, we suggest that:
  • The long-lived HTTP connection can be as long as 5 minutes. After 5 minutes connection, the connection would be disconnected automatically, developers need to update since_id to send a new request;
  • If there is no data produced after 5 seconds, the long-lived HTTP connection would be disconnected automatically;
  • There are two types of keywords: simple keywords and logical keywords (The keyword containing logical 'AND' and 'NOT');
  • The system would give priority to simple keywords, all the matched simple keywords would be returned. If no simple keywords have been matched and there is logical keywords matched, then all the logical keywords would be returned.

Response

JSON Example

{
    "id": 1703290048692333,              //data ID
    "text": {
        "type": "status",
        "event": "add",
        "status": {
            "isLongText": false,
            "in_reply_to_status_id": "",
            "created_at": "Wed Mar 29 15:59:21 +0800 2017",
            "mid": "4090666516291596",
            "source": "<a href=\"http://app.weibo.com/t/feed/6vtZb0\" rel=\"nofollow\">微博 weibo.com</a>",
            "objectType": "",
            "is_show_bulletin": 2,
            "in_reply_to_screen_name": "",
            "similarity": "0",
            "in_reply_to_user_id": "",
            "id": 4090666516291596,
            "text": "2017年我是微博不是评论 http://t.cn/RXnQSQg",
            "state": 0,
            "reposts_count": 0,
            "favorited": false,
            "is_weibo_video": false,
            "visible": {
                "list_id": 0,
                "type": 0
            },
            "ad_tags": {
                "adv": [
                    "0"
                ]
            },
            "truncated": false,
            "pic_urls": [],
            "pageMarkLevel": 0,
            "api_state": 3,
            "biz_feature": 0,
            "comments_count": 0,
            "mentions": [
                  2084126292        //The uid list that is mentioned,some of users would not return
                                             because of anti-spam strategy or user's setting
            ],
            "source_id": 780,
            "user": {
                "friends_count": 5,
                "gender": "m",
                "allow_all_act_msg": false,
                "city": "8",
                "favourites_count": 0,
                "urank": 4,
                "description": "",
                "created_at": "Thu Jan 21 23:06:04 +0800 2016",
                "avatar_hd": "http://tva2.sinaimg.cn/crop.0.0.1002.1002.1024/006mX07Rjw8f42dg43zuej30ru0run05.jpg",
                "province": "11",
                "screen_name": "西二旗test",
                "id": 5835938223,
                "geo_enabled": true,
                "verified": false,
                "profile_image_url": "http://tva2.sinaimg.cn/crop.0.0.1002.1002.50/006mX07Rjw8f42dg43zuej30ru0run05.jpg",
                "verified_type": -1,
                "url": "",
                "avatar_large": "http://tva2.sinaimg.cn/crop.0.0.1002.1002.180/006mX07Rjw8f42dg43zuej30ru0run05.jpg",
                "pagefriends_count": 0,
                "statuses_count": 55,
                "domain": "",
                "followers_count": 0,
                "following": false,
                "name": "西二旗test",
                "location": "",
                "insecurity": {
                    "sexual_content": false
                }
            }
        }
    }
    "match_info": {
        "subid": 10826, 				
        "keyword_flag": "status",			// the keyword type
        "keyword": "[2017, 微博, 评论]"	       //the keywords that have been matched 
    },
   "url":[
           {
            "long_url":"http://www.weibo.com",   //long url in the weibo text
            "short_url":"http://t.cn/RXnQSQg",    //short url in the weibo text
          }
         ...
    ]
}

}

See the Error Code Description for the error information details.

Field Description

None

Others

None

Language: [[{{{2/uri}}}|中文]]


文档更新时间: 12 April 2018
api评价