Because I sometimes need to share off-site information on the blog, I collected some APIs so that the shared cards carry basic information and can be updated in real time. When writing an article, insert the shortcode [share url] [/share] to enable automatic parsing. You only need to fill in the URL to be shared—no extra information is required—very convenient.
Game Information
Steam Game Information
The easiest way to share a Steam game is to embed the official widget with an iframe tag:
However, since Steam is half-blocked, the loading speed is really nothing to brag about; in some networks it simply gives up and never loads (like at my home 😣). The same goes for the Steam info API https://store.steampowered.com/api/appdetails; because of the speed issue, it’s not recommended either.
Xiaoheihe API
I recommend the Xiaoheihe API https://api.xiaoheihe.cn/game/web/get_game_detail.
The required parameters are the current timestamp _time and the Steam game ID appid. Just like this: https://api.xiaoheihe.cn/game/web/get_game_detail/?_time=1663404056&appid=289070.
If you add the parameters os_type=web&version=999.0.2, you must also supply an hkey parameter; otherwise it will complain that hkey cannot be empty. No up-to-date algorithm for calculating hkey is publicly available, and the algorithm changes frequently, so I’m not going to spend time researching it. At present, a small number of games seem to return no price info without the hkey parameter, so be prepared for graceful degradation.
Steam API
The Steam API requires the game ID appids. It’s recommended to add the region parameter cc=cn so the returned price is in CNY, and l=schinese so labels and descriptions are in Chinese (provided the publisher has localized the store page).
Because the Steam API returns a lot of data—almost double that of the Xiaoheihe API—it makes the already slow loading even worse. To mitigate this, Steam provides a filters parameter that lets you specify only the fields you need. Note, however, that this parameter can only filter object collections (data wrapped in {} or []). Once you use filters, any non-collection data such as the game name will be excluded. So far no workaround has been found. Usage: just like this: https://store.steampowered.com/api/appdetails/?appids=814380&cc=cn&l=schinese.
NoteBy the way, the prices and discounts returned by the Xiaoheihe API are Xiaoheihe’s own, not Steam’s.
Parsing result:
Platform-specific Game Links
To obtain the store page link for a game on a given platform, you need to use that platform’s own API (usually the search API).
Steam
For Steam, append the steam_appid to the base URL https://store.steampowered.com/app/.
Example: Overcooked 2’s link is https://store.steampowered.com/app/728880.
Switch
Switch game search can be done via the API https://search.nintendo.jp/nintendo_soft/search.json. The key parameter q is the game name, supporting English or Japanese. Searching with a Chinese name like q=集合啦!动物森友会 returns nothing.
Example: Xenoblade Chronicles 3 API URL: https://search.nintendo.jp/nintendo_soft/search.json?q=Xenoblade3. Use the returned id to build the store link: https://store-jp.nintendo.com/list/software/70010000053335.html.
Ubisoft
Ubisoft’s search API is https://zh-cn.ubisoft.com/news2/search_name, requiring the parameter game_keyword, which supports Chinese names.
Example: searching for Skull and Bones API URL: https://zh-cn.ubisoft.com/news2/search_name?game_keyword=碧海黑帆. Append the returned gameabb to https://zh-cn.ubisoft.com to get the link: https://zh-cn.ubisoft.com/skull_and_bones.
Blizzard
Warning💩 Inaccurate search warning
Blizzard platform searches may return inaccurate results.
Blizzard’s search API is https://tw.shop.battle.net/api/search, requiring q (game name) and l (language code, e.g. en-us or zh-tw).
Example: searching for Warcraft III: Reforged API URL: https://tw.shop.battle.net/api/search?q=Warcraft III: Reforged&l=en-us. Take the destination from the response and prepend https://tw.shop.battle.net/zh-tw to build the link: https://tw.shop.battle.net/zh-tw/product/warcraft-iii-reforged.
Other Platforms
For PlayStation, Xbox, iOS, etc., no direct APIs were found; scraping is usually employed.
As for Epic, it uses encrypted parameters and anti-crawling, while Origin lacks a public API, so we simply use the game links provided by Xiaoheihe.
Bilibili Information
Videos
Similar to Steam game cards, Bilibili videos can be shared via an iframe tag:

Bilibili share
The Bilibili video info API is simple: only a BV or AV number parameter bvid or aid is needed. Example: https://api.bilibili.com/x/web-interface/view?bvid=1NT411u7n9.
Parsing result:
Dynamics
The Bilibili dynamic API is equally simple: it needs a dynamic ID parameter id and an optional timezone offset timezone_offset (in minutes, default -480). Example: https://api.bilibili.com/x/polymer/web-dynamic/v1/detail?id=706453546894098487.
NoteThe dynamic content array
rich_text_nodesuses emoji as delimiters. For example, the sentence 「这是一条文字捏[给心心]更多的文字」 is split into three elements: 这是一条文字捏、[给心心]、更多的文字. You need to iterate and concatenate to get the full text.
Danmaku
The danmaku API needs an oid parameter, which is the video’s cid, obtainable from the video info API. Example: get danmaku for cid 834814323: https://api.bilibili.com/x/v1/dm/list.so?oid=834814323. The returned data is XML.
Note
1.A video’s
cidis not the same as its AV/BV number; e.g. BV1NT411u7n9 corresponds tocid834814323.
- The returned data is deflate-compressed and needs decompression. In PHP you can use
gzinflate().
Key fields to note:
<maxlimit>tag contains the maximum danmaku count for the video.<state>tag indicates whether danmaku is open:0means normal,1means disabled.<d p="114.63900,1,25,16777215,1673445087,0,xxxxxxxx,yyyyyyyyyyyyyyyyyyy,10"> 压力终于给到了二创</d>contains each danmaku’s details; refer to bilibili-API-collect attribute p. From this we can tell that the danmaku 压力终于给到了二创 appears at 114.639 s, is a normal right-to-left scrolling danmaku, standard font size, white color, sent on 2023-01-11 21:51:27 (timestamp 1673445087), type normal, sender mid HASH xxxxxxxx (8 alphanumeric), danmaku dmid yyyyyyyyyyyyyyyyyyy (19 digits), and will be filtered when the shield level is greater than 10.
GitHub Repository Information
The GitHub repo API is also simple: just append {username}/{repo} to https://api.github.com/repos/. Like this: https://api.github.com/repos/SocialSisterYi/bilibili-API-collect.
Parsing result:
Blog Article / Page Information
After Typecho was upgraded to the latest 1.2, the plugin that output article info stopped working, so I had to add the feature myself.
Add to Function.php:
Then create a standalone page template that calls getCustom() via URL parameters.
Finally, add a standalone page in the backend and choose the Article info template. It accepts only one parameter uid, which is either the post cid or the page slug. Article call: https://vinking.top/getInfo.html?uid=67, standalone page call: https://vinking.top/getInfo.html?uid=about.
Article parsing result:
For now these are the most commonly used APIs; more off-site parsing will be added when needed 🙈.
General URL Parsing
I recently wrote an API that can parse ordinary pages, but some URLs still fail to parse—make do for now...
2022-12-03: After optimization, compatibility with different sites has been greatly improved.
Both Title and Description parsed successfully
Title parsing failed
Take the Genshin Impact official site as an example. As shown in the image below, the page’s <title> tag is generated dynamically by the JS file config.54af175465c7448a0fa377d065a2d6da.js, meaning the static HTML does not contain a <title> tag before the page fully loads, so the title cannot be obtained directly.
However, the page defines keywords metadata, so when the <title> tag is missing we fall back to the first value in keywords as the parsed title, because the first keyword usually matches the page title and is a viable fallback when no other obvious title is present.

Example of title parsing failure
Description parsing failed
URL does not exist
URL timeout inside China
When a URL times out inside China, the system automatically retries via proxy; if it still times out, it degrades to “URL does not exist”.