Skip to content

Instantly share code, notes, and snippets.

@BobbyWibowo
Last active May 13, 2025 16:11
Show Gist options
  • Save BobbyWibowo/e9ce2f8bea3a4cdcf7bdfd4454f8369d to your computer and use it in GitHub Desktop.
Save BobbyWibowo/e9ce2f8bea3a4cdcf7bdfd4454f8369d to your computer and use it in GitHub Desktop.
javascript:(function () {
fetch(`https://sg-public-api.hoyolab.com/common/badge/v1/login/info?game_biz=hkrpg_global&lang=en-us&ts=${Date.now()}`, { credentials: 'include' })
.then(res => res.json())
.then(body => {
fetch(`https://sg-public-api.hoyolab.com/event/rpgcultivate/achievement/list?game=hkrpg&game_biz=hkrpg_global&badge_region=${body.data.region}&badge_uid=${body.data.game_uid}&show_hide=false&need_all=true`, { credentials: 'include' })
.then(res => res.json())
.then(body => {
const data = {
hsr_achievements: body.data.achievement_list
.filter(a => a.finished)
.map(a => Number(a.id))
};
const json = JSON.stringify(data, null, 2);
const blob = new Blob([json], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'stardb-achievements.json';
a.click();
a.remove();
alert(`Exported ${data.hsr_achievements.length} achievement(s).`);
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment