{"id":27215369,"url":"https://github.com/aliafuji/enkadotnet","last_synced_at":"2025-04-11T13:19:16.279Z","repository":{"id":286321316,"uuid":"961034010","full_name":"aliafuji/EnkaDotnet","owner":"aliafuji","description":"Enka.DotNet is a wrapper for accessing and processing character data from the Enka.Network API. It provides a simple interface to retrieve detailed information about Genshin Impact characters, artifacts, weapons, and player profiles.","archived":false,"fork":false,"pushed_at":"2025-04-08T20:56:20.000Z","size":164,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T04:15:19.445Z","etag":null,"topics":["api-wrapper","csharp","dotnet","enka-network","enkanetwork","genshin-impact","zenless-zone-zero"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/EnkaDotNet","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aliafuji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-05T15:59:54.000Z","updated_at":"2025-04-08T20:49:57.000Z","dependencies_parsed_at":"2025-04-05T18:35:47.310Z","dependency_job_id":null,"html_url":"https://github.com/aliafuji/EnkaDotnet","commit_stats":null,"previous_names":["aliafuji/enkadotnet"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliafuji%2FEnkaDotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliafuji%2FEnkaDotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliafuji%2FEnkaDotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliafuji%2FEnkaDotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliafuji","download_url":"https://codeload.github.com/aliafuji/EnkaDotnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154988,"owners_count":21056543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","csharp","dotnet","enka-network","enkanetwork","genshin-impact","zenless-zone-zero"],"created_at":"2025-04-10T04:15:23.785Z","updated_at":"2025-04-10T04:15:24.406Z","avatar_url":"https://github.com/aliafuji.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Enka.DotNet\n\nEnka.DotNet is a wrapper for accessing and processing character data from the Enka.Network API. It provides a simple interface to retrieve detailed information about Genshin Impact characters, artifacts, weapons, and player profiles.\n\n[![NuGet](https://img.shields.io/nuget/v/EnkaDotNet.svg)](https://www.nuget.org/packages/EnkaDotNet/)\n\n## Features\n\n- Fetch detailed character builds including artifacts, weapons, and stats\n- Access player profile information\n- Strong typing for all Genshin Impact game entities\n\n## Supported Games\n\n| Game              | Status         | API Support |\n| ----------------- | -------------- | ----------- |\n| Genshin Impact    | ✅ Ready       | Full        |\n| Honkai: Star Rail | ⏳ Coming Soon | Planned     |\n| Zenless Zone Zero | ✅ Ready       | Full        |\n\n## Installation\n\nInstall EnkaDotNet via NuGet package manager:\n\n```\nInstall-Package EnkaDotNet\n```\n\nOr via the .NET CLI:\n\n```\ndotnet add package EnkaDotNet\n```\n\n## Example Code for Genshin Impact\n\n```csharp\nusing EnkaDotNet;\nusing EnkaDotNet.Enums.Genshin;\n\nvar options = new EnkaClientOptions\n{\n    Language = \"ja\",\n    UserAgent = \"EnkaDotNet/1.5\",\n};\n\nusing var client = new EnkaClient(options);\n\ntry\n{\n    int uid = 829344442;\n\n    Console.OutputEncoding = System.Text.Encoding.UTF8;\n\n    Console.WriteLine($\"Fetching profile for UID {uid}...\");\n\n    var (player, characters) = await client.GetUserProfile(uid);\n\n    Console.WriteLine($\"\\nPlayer: {player.Nickname} (AR {player.Level})\");\n    Console.WriteLine($\"World Level: {player.WorldLevel}\");\n    Console.WriteLine($\"Signature: {player.Signature}\");\n    Console.WriteLine($\"IconUrl: {player.IconUrl}\");\n    Console.WriteLine($\"NameCard: {player.NameCardIcon} | {player.NameCardId}\");\n    Console.WriteLine($\"Characters in profile: {characters.Count}\");\n\n    // Print Abyss data\n    Console.WriteLine(\"\\nAbyss data:\");\n    Console.WriteLine($\"Spiral Abyss Floor: {player.Challenge?.SpiralAbyss?.Floor}\");\n    Console.WriteLine($\"Spiral Abyss Chamber: {player.Challenge?.SpiralAbyss?.Chamber}\");\n    Console.WriteLine($\"Spiral Abyss Stars: {player.Challenge?.SpiralAbyss?.Star}\");\n\n    // Print Theater data\n    Console.WriteLine(\"\\nTheater data:\");\n    Console.WriteLine($\"Theater Mechanicus Act: {player.Challenge?.Theater?.Act}\");\n    Console.WriteLine($\"Theater Mechanicus Stars: {player.Challenge?.Theater?.Star}\");\n\n    // Print Namecards\n    Console.WriteLine(\"\\nNamecards Showcase:\");\n    foreach (var namecard in player.ShowcaseNameCards)\n    {\n        Console.WriteLine($\"Icon: {namecard.IconUrl} | ID: {namecard.Id}\");\n    }\n\n    Console.WriteLine(\"\\nCharacter Details:\");\n    foreach (var character in characters)\n    {\n        Console.WriteLine($\"\\n{character.Name} | Level {character.Level} | C{character.ConstellationLevel}\");\n\n        if (character.Weapon != null)\n        {\n            Console.WriteLine($\"Weapon: {character.Weapon.Name} | R{character.Weapon.Refinement} | Level {character.Weapon.Level}\");\n            Console.WriteLine($\"Base ATK: {character.Weapon.BaseAttack} | Substat: {character.Weapon.SecondaryStat?.Value} | Type: {character.Weapon.SecondaryStat?.Type}\");\n            Console.WriteLine($\"Icon: {character.Weapon.IconUrl}\");\n        }\n\n        // Print all stats\n        Console.WriteLine(\"\\nStats:\");\n        var stats = character.GetStats();\n        foreach (var category in stats)\n        {\n            Console.WriteLine($\"{category.Key}:\");\n            foreach (var stat in category.Value)\n            {\n                Console.WriteLine($\"  {stat.Key}: {stat.Value.Formatted} ({stat.Value.Raw})\");\n            }\n        }\n\n        // Print artifact sets\n        Console.WriteLine(\"\\nArtifact Sets:\");\n        var artifactSets = character.Artifacts\n            .GroupBy(a =\u003e a.SetName)\n            .Select(g =\u003e new { SetName = g.Key, Count = g.Count() })\n            .OrderByDescending(x =\u003e x.Count);\n\n        foreach (var set in artifactSets)\n        {\n            Console.WriteLine($\"Set: {set.SetName} ({set.Count}pc)\");\n        }\n\n        // Print all artifacts\n        Console.WriteLine(\"\\nArtifacts:\");\n        foreach (var artifact in character.Artifacts)\n        {\n            Console.WriteLine($\"Artifact: {artifact.Name} | Level {artifact.Level} | Rarity {artifact.Rarity} | Set {artifact.SetName}\");\n            Console.WriteLine($\"Main Stat: {artifact.MainStat?.Type} | {artifact.MainStat?.Value}\");\n            Console.WriteLine($\"Substats: {string.Join(\", \", artifact.SubStats.Select(s =\u003e $\"{s.Type}: {s.Value}\"))}\");\n            Console.WriteLine($\"Icon: {artifact.IconUrl}\");\n        }\n\n        // Print specific stats\n        Console.WriteLine(\"\\nSpecific Stats:\");\n        character.GetStatValue(StatType.BaseAttack, out var value);\n        Console.WriteLine($\"Base Attack: {value}\");\n        character.GetStatValue(StatType.BaseHP, out value);\n        Console.WriteLine($\"Base HP: {value}\");\n        character.GetStatValue(StatType.BaseDefense, out value);\n        Console.WriteLine($\"Base Defense: {value}\");\n        character.GetStatValue(StatType.CriticalRate, out value);\n        Console.WriteLine($\"Critical Rate: {value}\");\n        character.GetStatValue(StatType.CriticalDamage, out value);\n        Console.WriteLine($\"Critical Damage: {value}\");\n\n        // Constellation data\n        Console.WriteLine(\"\\nConstellations:\");\n        foreach (var constellation in character.Constellations)\n        {\n            Console.WriteLine($\"Name: {constellation.Name}\");\n            Console.WriteLine($\"Icon: {constellation.IconUrl}\");\n            Console.WriteLine($\"Position: {constellation.Position}\");\n            Console.WriteLine($\"ID: {constellation.Id}\");\n        }\n\n    }\n}\ncatch (Exception ex) when (\n        ex is EnkaDotNet.Exceptions.PlayerNotFoundException ||\n        ex is EnkaDotNet.Exceptions.ProfilePrivateException ||\n        ex is EnkaDotNet.Exceptions.EnkaNetworkException)\n{\n    Console.WriteLine($\"Error: {ex.Message}\");\n}\n```\n\n## Example Code for Zenless Zone Zero\n\n```csharp\nusing EnkaDotNet;\nusing EnkaDotNet.Enums;\n\nnamespace ZZZStatsViewer\n{\n    class Program\n    {\n        static async Task Main(string[] args)\n        {\n            try\n            {\n                Console.OutputEncoding = System.Text.Encoding.UTF8;\n\n                var options = new EnkaClientOptions\n                {\n                    GameType = GameType.ZZZ,\n                    Language = \"en\",\n                    EnableCaching = true,\n                    UserAgent = \"EnkaDotNet/5.0\",\n                };\n\n                using var client = new EnkaClient(options);\n\n                int uid = args.Length \u003e 0 \u0026\u0026 int.TryParse(args[0], out int parsedUid) ? parsedUid : 1302375046;\n\n                Console.WriteLine($\"Fetching player data for UID: {uid}...\");\n                var playerInfo = await client.GetZZZPlayerInfo(uid);\n\n                Console.WriteLine($\"Player: {playerInfo.Nickname} (Lv.{playerInfo.Level})\");\n                Console.WriteLine($\"Title: {playerInfo.TitleText}\");\n                Console.WriteLine($\"Signature: {playerInfo.Signature}\");\n                Console.WriteLine($\"Player Icon: {playerInfo.ProfilePictureIcon}\");\n                Console.WriteLine($\"Player Namecard Icon: {playerInfo.NameCardIcon}\");\n\n                if (playerInfo.ShowcaseAgents.Count == 0)\n                {\n                    Console.WriteLine(\"\\nNo showcase agents found.\");\n                    return;\n                }\n\n                // Display medals\n                Console.WriteLine(\"\\nMEDALS:\");\n                foreach (var medal in playerInfo.Medals)\n                {\n                    Console.WriteLine($\"Name: {medal.Name} (Lv.{medal.Value})\");\n                    Console.WriteLine($\"Icon: {medal.Icon}\");\n                    Console.WriteLine($\"Type: {medal.Type}\");\n                }\n\n                // Display agent's info\n                var agent = playerInfo.ShowcaseAgents[0];\n                Console.WriteLine($\"\\nAGENT: {agent.Name} (Lv.{agent.Level})\");\n                Console.WriteLine($\"Rarity: {agent.Rarity} | Profession: {agent.ProfessionType}\");\n                Console.WriteLine($\"Elements: {string.Join(\", \", agent.ElementTypes)}\");\n\n                // Display Mindscapes\n                Console.WriteLine($\"Mindscapes: M{agent.TalentLevel}\");\n\n                // Display agent's image URL\n                Console.WriteLine($\"Image URL: {agent.ImageUrl}\");\n                Console.WriteLine($\"Circle Icon URL: {agent.CircleIconUrl}\");\n                Console.WriteLine($\"Promotion Level: {agent.PromotionLevel}\");\n\n                // Display agent's obtained timestamp\n                Console.WriteLine($\"Obtained Time: {agent.ObtainmentTimestamp.ToLocalTime()}\");\n\n                // Display agent's weapon effect state\n                Console.WriteLine($\"Weapon Effect State: {agent.WeaponEffectState}\");\n\n                // Display agent's stats\n                Console.WriteLine(\"\\nAGENT STATS:\");\n                var stats = agent.GetAllStats();\n                foreach (var stat in stats)\n                {\n                    Console.WriteLine($\"{stat.Key}: {stat.Value}\");\n                }\n\n                // Display weapon\n                if (agent.Weapon != null)\n                {\n                    Console.WriteLine(\"\\nW-ENGINE:\");\n                    Console.WriteLine($\"Name: {agent.Weapon.Name} (Lv.{agent.Weapon.Level}/{agent.Weapon.BreakLevel})\");\n                    Console.WriteLine($\"Rarity: {agent.Weapon.Rarity}\");\n                    Console.WriteLine($\"Main Stat: {agent.Weapon.MainStat}\");\n                    Console.WriteLine($\"Secondary Stat: {agent.Weapon.SecondaryStat}\");\n                    Console.WriteLine($\"Effect State: {agent.WeaponEffectState}\");\n                    \n                    Console.WriteLine($\"Overclock: {agent.Weapon.UpgradeLevel}\");\n                    Console.WriteLine($\"Icon URL: {agent.Weapon.ImageUrl}\");\n                }\n\n                // Display equipped disc sets\n                var discSets = agent.GetEquippedDiscSets();\n                if (discSets.Count \u003e 0)\n                {\n                    Console.WriteLine(\"\\nDRIVE DISC SETS:\");\n                    foreach (var set in discSets)\n                    {\n                        Console.WriteLine($\"- {set.SuitName} ({set.PieceCount} pieces)\");\n                        foreach (var disc in set.BonusStats)\n                        {\n                            Console.WriteLine($\"  - {disc.StatType}: {disc.Value}\");\n                        }\n                    }\n                }\n\n                // Display equipped discs\n                if (agent.EquippedDiscs.Count \u003e 0)\n                {\n                    Console.WriteLine(\"\\nEQUIPPED DISCS:\");\n                    foreach (var disc in agent.EquippedDiscs)\n                    {\n                        Console.WriteLine($\"- {disc.SuitName} (Lv.{disc.Level})\");\n                        Console.WriteLine($\"  - Main Stats: {disc.MainStat}\");\n                        Console.WriteLine($\"  - Rarity: {disc.Rarity}\");\n                        Console.WriteLine($\"  - Slot: {disc.Slot}\");\n                        Console.WriteLine($\"  - Icon URL: {disc.IconUrl}\");\n                        Console.WriteLine($\"  - Locked: {disc.IsLocked}\");\n                        Console.WriteLine($\"  - Available: {disc.IsAvailable}\");\n                        Console.WriteLine($\"  - Trash: {disc.IsTrash}\");\n\n                        foreach (var stat in disc.SubStats)\n                        {\n                            if (stat.IsPercentage)\n                            {\n                                Console.WriteLine($\"  - {stat.Type}: {stat.Value * stat.Level:F1}% +{stat.Level}\");\n                            }\n                            else\n                            {\n                                Console.WriteLine($\"  - {stat.Type}: {(int)stat.Value * stat.Level} +{stat.Level}\");\n                            }\n                        }\n                    }\n                }\n\n                // Display core skills\n                if (agent.CoreSkillEnhancements.Count \u003e 0)\n                {\n                    Console.WriteLine(\"\\nCORE SKILLS:\");\n                    foreach (var skill in agent.CoreSkillEnhancements)\n                    {\n                        if (agent.CoreSkillEnhancements.Count \u003e 0)\n                        {\n                            char skillLetter = (char)('A' + skill);\n                            Console.WriteLine($\"- {skillLetter} ({skill})\");\n                        }\n                    }\n                }\n\n                // Display skill levels\n                Console.WriteLine(\"\\nSKILL LEVELS:\");\n                foreach (var skill in agent.SkillLevels)\n                {\n                    Console.WriteLine($\"- {skill.Key}: {skill.Value}\");\n                }\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"Error: {ex.Message}\");\n            }\n        }\n    }\n}\n```\n\n## Requirements\n\n- .NET 8.0 or higher\n\n## Support\n\nHaving questions or issues? Join our Discord server: [Alg's Dev Env](https://discord.gg/d4UgxagmwF)\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- [Enka.Network](https://enka.network/) for providing the API\n- [seriaati](https://github.com/seriaati) for the inspiration\n\n---\n\n## Disclaimer\n\nThis project is not affiliated with or endorsed by HoYoverse (miHoYo) or Enka.Network. Genshin Impact is a trademark of HoYoverse.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliafuji%2Fenkadotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliafuji%2Fenkadotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliafuji%2Fenkadotnet/lists"}