HoYoLab_API 1.0.1-hotfix
See the version list below for details.
dotnet add package HoYoLab_API --version 1.0.1-hotfix
NuGet\Install-Package HoYoLab_API -Version 1.0.1-hotfix
<PackageReference Include="HoYoLab_API" Version="1.0.1-hotfix" />
paket add HoYoLab_API --version 1.0.1-hotfix
#r "nuget: HoYoLab_API, 1.0.1-hotfix"
// Install HoYoLab_API as a Cake Addin #addin nuget:?package=HoYoLab_API&version=1.0.1-hotfix&prerelease // Install HoYoLab_API as a Cake Tool #tool nuget:?package=HoYoLab_API&version=1.0.1-hotfix&prerelease
HoYoLab-API
A small API for working with HoYoLab. Primarily developed for daily rewards in Genshin Impact
Usage:
Getting HoYoLab account cookies
To use the API, you will need HoYoLab cookies. To get them, go to www.hoyolab.com, authorize and press F12 → Console → Enter this in text field:
copy(document.cookie);
Done! Cookies copied in your clipboard.
<img src="preview-cookies.jpg" alt="Copy cookie preview"/>
Creating a new HoYoLab Account instance
To create a new account instance, you need to have cookies string (formatted like a example below).
using HoYoLab_API;
public void SomeMethod()
{
var account = new HoyolabAccount(
rawCookies: "ltoken=12AOxlS0gnNGqQ2kOgJR2C2g28S1uU6dgBT0qgKa; ltuid=52606212", language: "en-us", userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0");
}
Supported account languages:
Language | Code |
---|---|
English | en-us |
Pусский | ru-ru |
日本語 | ja-jp |
한국어 | ko-kr |
Deutsch | de-de |
Español | es-es |
Français | fr-fr |
Indonesia | id-id |
Português | pt-pt |
ภาษาไทย | th-th |
Tiếng Việt | vi-vn |
简体中文 | zh-cn |
繁體中文 | zh-tw |
How to check is the authentication in HoYoLab success:
if (account.IsValid)
{
<...>
}
Examples:
Console.WriteLine(string.Join(", ", account.GameAccounts));
Console.WriteLine(account.DailyCheckIn.CurrentMonthlyRewards);
Console.WriteLine(account.DailyCheckIn.CurrentRewardInformation);
Console.WriteLine(account.DailyCheckIn.ClaimReward());
Preview: <img src="https://github.com/No738/HoYoLab-API/blob/master/preview-examples.png" alt="Using examples preview"/>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.1 | 447 | 5/27/2022 |
1.0.1-hotfix | 160 | 5/28/2022 |