explaingit

metacubex/mihomo

📈 Trending30,266PythonAudience · developerComplexity · 2/5ActiveLicenseSetup · easy

TLDR

Python library for fetching and managing Honkai: Star Rail player data via an unofficial API, with type-safe data models and async support.

Mindmap

mindmap
  root((repo))
    What it does
      Fetch player data
      Retrieve character info
      Handle API responses
    Key features
      Type-safe models
      Async requests
      Data utilities
    Use cases
      Player stat trackers
      Discord bots
      Profile viewers
    Tech stack
      Python
      Pydantic
      Async support

Things people build with this

USE CASE 1

Build a Discord bot that displays a player's Honkai: Star Rail character roster and stats on demand.

USE CASE 2

Create a stats-tracking website that logs player progression over time and shows character level trends.

USE CASE 3

Make a profile viewer tool that fetches and displays formatted player account info and character details.

Tech stack

PythonPydanticasyncio

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose including commercial, as long as you keep the copyright notice.

In plain English

Mihomo is a Python library that makes it easy to retrieve and work with player data from Honkai: Star Rail, a video game, via an unofficial public API. The API returns information about a player's account and their in-game characters, things like character names, levels, rarities, and image URLs, in a structured format. The library wraps that API response in Python data models built with Pydantic, a tool that enforces data types and provides editor autocompletion. This means when you write Python code against the library, your editor knows exactly what fields are available on each object, which reduces errors. It supports two API response formats (V1 and V2) and handles asynchronous requests, meaning it can fetch data without blocking the rest of a program while waiting for the network response. It also includes small utility functions to clean up the data, for example, removing duplicate character entries or merging two snapshots of a player's character roster. The data can be saved and reloaded in formats like JSON or pickle (a Python-native binary format). Someone would use this library if they are building a bot, a stats-tracking website, or a display tool that shows Honkai: Star Rail player profiles.

Copy-paste prompts

Prompt 1
Show me how to use mihomo to fetch a player's character list from Honkai: Star Rail and print their names and levels.
Prompt 2
How do I set up async requests with mihomo to fetch multiple players' data in parallel without blocking?
Prompt 3
Write a Python script using mihomo that saves a player's character snapshot to JSON and loads it back later.
Prompt 4
How do I handle both V1 and V2 API response formats with mihomo's data models?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.