2

I need to know the ID of the posts in Weibo, because I want to do a call to the API and the weibo ID is required, so I don't know how to obtain this ID from an URL.

this is an example for a URL: http://www.weibo.com/1833141401/AC1klvp6U?mod=weibotime

I thought that 1833141401 was the ID but the API response that the weibo doesn´t exist.

Has anyone worked with this API?

user2815775
  • 21
  • 1
  • 3

2 Answers2

2

For the url http://www.weibo.com/1833141401/AC1klvp6U :

1833141401 is the user id (uid).

AC1klvp6U is the microblogging id (mid) as weibo calls it. that mid is base62 encoded.

You could call the weibo API to get the id. The endpoint you want is /statuses/queryid/en

Example call:

https://api.weibo.com/2/statuses/queryid.json?mid=AC1klvp6U&type=1&isBase62=1

Or you can add your own function to convert that mid to the id like in this post: http://tech.kawo.com/post/74682997654/using-base62-to-generate-a-sina-weibo-post

thehay
  • 21
  • 3
0

Weibo uses 2 formats for the same id. You can base64 encode that ID to get the id in the same format that the API accepts.

More info and code samples to perform the operation here: http://blog.sina.com.cn/s/blog_4a238ec201012pnb.html

Jeff Tsui
  • 1,266
  • 12
  • 20