实时获取公众号文章阅读
<h5>简要描述</h5>
<ul>
<li>实时获取公众号文章阅读、点赞、在看数</li>
</ul>
<h5>收费标准</h5>
<ul>
<li><code>按调用次数:1分钱/次</code></li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://data.wxrank.com/weixin/getrk</code></li>
</ul>
<pre><code>// 尽量采用post请求方式,减少url编码出现的问题
curl --location &#039;http://data.wxrank.com/weixin/getrk&#039; \
--header &#039;Content-Type: application/json&#039; \
--data &#039;{
&quot;key&quot;: &quot;xxx&quot;,
&quot;url&quot;: &quot;https://mp.weixin.qq.com/s?__biz=MzAwNDE0ODI4Mg==&amp;mid=2650802020&amp;idx=1&amp;sn=871211a526b20fab9513d93f3e3e124c&amp;chksm=80c4fa31b7b37327272d602bfea5fd0390c880090d74dd996c615867aba151ff0bba9262baa1&amp;scene=126&amp;sessionid=1728479244#rd&quot;
}&#039;</code></pre>
<p>> python语言调用示例</p>
<pre><code>import requests
import json
apikey = &#039;your_api_key&#039;;
url = &#039;http://data.wxrank.com/weixin/getrk&#039;
data = {
&quot;key&quot;: apikey,
&quot;url&quot;: &quot;https://mp.weixin.qq.com/s?__biz=MzAwNDE0ODI4Mg==&amp;mid=2650802020&amp;idx=1&amp;sn=871211a526b20fab9513d93f3e3e124c&amp;chksm=80c4fa31b7b37327272d602bfea5fd0390c880090d74dd996c615867aba151ff0bba9262baa1&amp;scene=126&amp;sessionid=1728479244#rd&quot;
}
headers = {
&#039;Content-Type&#039;: &#039;application/json&#039;
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
</code></pre>
<h5>请求方式</h5>
<ul>
<li>GET / POST</li>
</ul>
<p><code>如果以get方式请求,url务必要做urlencode,因为url链接中往往会有&amp;连接符,需要转义处理</code></p>
<h5>参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">key</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>密钥</td>
</tr>
<tr>
<td style="text-align: left;">url</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>文章链接,仅支持长链接(例如:<a href="https://mp.weixin.qq.com/s?__biz=xxx==&mid=xxx&idx=1&sn=xxx">https://mp.weixin.qq.com/s?__biz=xxx==&mid=xxx&idx=1&sn=xxx</a>)</td>
</tr>
<tr>
<td style="text-align: left;">comment_id</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">string</td>
<td>文章留言id,如果需要返回留言数,需要提供该参数</td>
</tr>
</tbody>
</table>
<p>> url若是短链,需要提前转一下长链,通过文章解析接口:<a href="https://www.showdoc.com.cn/2343746579263506/11558501783383049">https://www.showdoc.com.cn/2343746579263506/11558501783383049</a>
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=5b9e336184fa040a1a34c6fff3868ae1&amp;file=file.png" alt="" /></p>
<h5>返回示例</h5>
<pre><code>{
&quot;code&quot;: 0,
&quot;data&quot;: {
&quot;read_num&quot;: 10623,
&quot;like_num&quot;: 11,
&quot;look_num&quot;: 7,
&quot;share_num&quot;: 33,
&quot;comment_num&quot;: 8
},
&quot;msg&quot;: &quot;剩余32653积分&quot;
}</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">read_num</td>
<td style="text-align: left;">int</td>
<td>阅读数</td>
</tr>
<tr>
<td style="text-align: left;">like_num</td>
<td style="text-align: left;">int</td>
<td>点赞数(大拇指)</td>
</tr>
<tr>
<td style="text-align: left;">look_num</td>
<td style="text-align: left;">int</td>
<td>在看数(爱心图标)</td>
</tr>
<tr>
<td style="text-align: left;">share_num</td>
<td style="text-align: left;">int</td>
<td>分享数(转发图标)</td>
</tr>
<tr>
<td style="text-align: left;">comment_num</td>
<td style="text-align: left;">int</td>
<td>留言数,传comment_id才会返回该数据</td>
</tr>
</tbody>
</table>
<h5>备注</h5>
<p>> <code>code 状态判断</code></p>
<ul>
<li>0:获取成功</li>
<li>1000:积分不足</li>
<li>1001:文章链接为空(必须是公众号文章链接)</li>
<li>1002:文章验证失败(文章链接解析失败)</li>
<li>1003:获取失败,请重试</li>
<li>1004:服务异常,请重试</li>
<li>9999:QPS超过上限,请稍后再试(每秒不能超过10个)</li>
</ul>
<p>> 提醒:code=0,扣积分</p>