Description of the Genshin impact wish history API
https://hk4e-api-os.hoyoverse.com/event/gacha_info/api/getGachaLog?authkey_ver=1&sign_type=2&auth_appid=webview_gacha&init_type=301&lang=en&authkey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&gacha_type=301&page=1&size=6&end_id=0
Base URL : https://hk4e-api-os.hoyoverse.com/event/gacha_info/api/getGachaLog
(the base URL may differ on chinese version of the game)
Params
mandatory
mandatory
mandatory
mandatory
(Same lang code as the game)mandatory
(vary with time can be obtained from the game or external pages fetch by the game)mandatory
mandatory
{
"retcode": 0,
"message": "OK",
"data":
{
"page": "1",
"size": "6",
"total": "0",
"list":
[
{
"uid": "700000000",
"gacha_type": "301",
"item_id": "",
"count": "1",
"time": "2021-11-24 22:18:45",
"name": "Albedo",
"lang": "en-us",
"item_type": "Character",
"rank_type": "5",
"id": "1637787960000243756"
},
{
"uid": "700000000",
"gacha_type": "301",
"item_id": "",
"count": "1",
"time": "2021-11-24 22:18:45",
"name": "Rosaria",
"lang": "en-us",
"item_type": "Character",
"rank_type": "4",
"id": "1637787960000243656"
},
{
"uid": "700000000",
"gacha_type": "301",
"item_id": "",
"count": "1",
"time": "2021-11-24 22:18:45",
"name": "Magic Guide",
"lang": "en-us",
"item_type": "Weapon",
"rank_type": "3",
"id": "1637787960000243556"
},
{
"uid": "700000000",
"gacha_type": "301",
"item_id": "",
"count": "1",
"time": "2021-11-24 22:18:45",
"name": "Ferrous Shadow",
"lang": "en-us",
"item_type": "Weapon",
"rank_type": "3",
"id": "1637787960000243456"
},
{
"uid": "700000000",
"gacha_type": "301",
"item_id": "",
"count": "1",
"time": "2021-11-24 22:18:45",
"name": "Magic Guide",
"lang": "en-us",
"item_type": "Weapon",
"rank_type": "3",
"id": "1637787960000243356"
},
{
"uid": "700000000",
"gacha_type": "400",
"item_id": "",
"count": "1",
"time": "2021-11-24 22:18:28",
"name": "Sharpshooter's Oath",
"lang": "en-us",
"item_type": "Weapon",
"rank_type": "3",
"id": "1637787960000237756"
}
],
"region": "os_euro"
}
}
item_id
is no longer filled in response
Mihoyo has changed the pagination mechanic. They added an id
for each wish and a parameter end_id
in the url. To get the wishes in a page you need to provide the last wish id from the previous page in the end_id
parameter. If you do not provide a valid end_id
or end_id
is missing the API will return the first page.
gacha_type
can now be 301 or 400. (301 will be for wishes made on “Character event wish” banners and 400 will be for “Character event wish - 2”.)API domain changed from hk4e-api-os.mihoyo.com
to hk4e-api-os.hoyoverse.com