调用Steam appdetails接口后,如何获取评分、标签等更多游戏信息?
Great question! I’ve run into this exact issue before — the official appdetails API is solid for core game info, but it’s definitely missing those store-facing details like user ratings and community tags that show up on the actual store page. Here are a couple reliable ways to grab that data:
1. 用Steam App Reviews API获取评分数据
Steam has a dedicated reviews API that’s perfect for pulling detailed rating metrics. It’s not super prominently documented, but it’s used directly by the Steam store itself, so it’s stable. The basic request format is:
https://store.steampowered.com/appreviews/{APPID}?json=1
For your example app ID 57690, the call would look like this:
https://store.steampowered.com/appreviews/57690?json=1
This returns a JSON object with all the rating details you need: things like review_score (a numerical score), review_score_desc (e.g. "Very Positive"), and raw counts for total_positive/total_negative reviews. You can add extra parameters too — like filter=recent to get only the latest review stats, or language=english to narrow results to a specific language.
2. 提取商店页面嵌入的JSON数据获取标签与更多元数据
The Steam store page for every game embeds a JavaScript variable called rgAppInfo that contains all the community tags, official categories, and even some extra rating data that’s missing from the appdetails API. Here’s how to extract it:
- Make a GET request to the game’s store page (e.g.
https://store.steampowered.com/app/57690) - Parse the HTML response to find the script block that starts with
var rgAppInfo = - Trim off the
var rgAppInfo =prefix and the trailing semicolon to get a valid JSON object
Inside that JSON, you’ll find a tags array with all community-assigned tags (like "Action", "Adventure") and a categories array for official Steam categories. It also has some additional rating breakdowns if you need them.
快速提醒
- The reviews API is pretty reliable since Steam uses it internally, but the
rgAppInfomethod relies on scraping the store page. Steam might tweak their page structure occasionally, so make sure your parser has some error handling built in to avoid breaks. - Don’t forget to respect Steam’s rate limits — avoid spamming requests, or you might get temporarily blocked from accessing their APIs/pages.
内容的提问来源于stack exchange,提问作者ZTefter




