A lightweight, type-safe Go wrapper for the EnkaNetwork API, supporting:
- Genshin Impact
- Honkai: Star Rail
- Zenless Zone Zero
Before using this library, ensure the following:
- API Familiarity: Review the official EnkaNetwork API documentation:
- EnkaNetwork API Documentation
- Genshin Impact API Details
- Zenless Zone Zero API Details
- EnkaNetwork Status (check for API availability)
go get github.com/kirinyoku/enkanetwork-go@latestimport (
"context"
"time"
"github.com/kirinyoku/enkanetwork-go/client/genshin"
)
func main() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
client := genshin.NewClient(nil, nil, "my-app/1.0")
profile, err := client.GetProfile(ctx, "618285856")
if err != nil {
// handle error
}
// use profile.PlayerInfo, profile.AvatarInfoList, etc.
}👉 Full, runnable examples are available in the examples/ directory.
- Multi-game Support: Unified API for all supported games.
- Type Safety: Strongly typed structs.
- Context Integration: Pass
context.Contextfor cancellation and timeouts. - Caching: Plug-in any
Cacheimplementation to reduce API calls. - Error Handling: Rich error types for common scenarios.
View detailed API reference on pkg.go.dev.
Explore examples for each client:
This is my first library, and due to my lack of experience, it is far from perfect, so I would welcome your contributions! Here's how you can help.
-
Bug Reports
- Open an issue for any bugs you find
- Include steps to reproduce the issue
- Provide error messages and relevant code
-
Feature Requests
- Open an issue describing the feature
- Explain why it would be useful
- Provide examples if possible
-
Code Contributions
- Fork the repository
- Create a feature branch
- Submit a pull request
- Include tests for new features
Licensed under the MIT License. See LICENSE for details.
See CHANGELOG.md for a detailed history of changes.