该接口能够获取评分细则,包括不同等级评分的数量、总量等。
import requests
url = 'https://itunes.apple.com/cn/customer-reviews/id1467190251?dataOnly=true&displayable-kind=11&appVersion=current'
# User-Agent 固定死
headers = {
'User-Agent':'iTunes/12.11 (Windows; Microsoft Windows 10 x64 Professional Edition (Build 17763); x64) AppleWebKit/7610.2011.1003.3 (dt:2)',
}
r = requests.get(url,headers=headers)
print(r.text)
""""
数据样例
{
"adamId": 1467190251,
"clickToRateUrl": "https://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/userRateContent?displayable-kind=11&id=1467190251",
"writeUserReviewUrl": "https://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/writeUserReview?cc=cn&displayable-kind=11&id=1467190251",
"totalNumberOfReviews": 3362,
"userReviewsRowUrl": "https://itunes.apple.com/WebObjects/MZStore.woa/wa/userReviewsRow",
"userReviewsSortOptions": [{
"sortId": 1,
"name": "最有帮助"
}, {
"sortId": 2,
"name": "最高评价"
}, {
"sortId": 3,
"name": "最低评价"
}, {
"sortId": 4,
"name": "最新发表"
}],
"kindId": 11,
"kindExtId": "iosSoftware",
"kindName": "software",
"saveUserReviewUrl": "https://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/saveUserReview?displayable-kind=11",
"ariaLabelForRatings": "4星",
"ratingCount": 86128,
"ratingCountList": [20057, 2696, 4074, 8314, 50987],
"ratingAverage": 4
}
"""
- url中cn切换到目标国家,换成目标国家代码
- url中的id1467190251切换成你自己的app id
网友评论