RepositoryRust
torikushiii

torikushiii/hoyoverse-api

A high-performance fan made API for HoYoverse games

54stars
8forks
0issues
3views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: hoyolab-api

#1 Repository of the week

1
TINIX TRENDING·Topic: honkai-star-rail

#1 Repository of the week

1
TINIX TRENDING·Topic: hoyolab

#1 Repository of the week

HoYoverse API

A REST API that provides redemption codes, event calendars, and news for HoYoverse games.

Supported Games

GameSlug
Genshin Impactgenshin
Honkai: Star Railstarrail
Zenless Zone Zerozenless
Honkai Impact 3rdhonkai
Tears of Themisthemis

Base URL

All endpoints are prefixed with /mihoyo.

Endpoints

API Info

GET /mihoyo/

Returns API version, uptime, and a list of available endpoints.

Response:

{
  "message": "HoYoverse Redemption Code API",
  "version": "1.0.0",
  "uptime": 3600,
  "endpoints": [...]
}

Redemption Codes

GET /mihoyo/{game}/codes

Returns active and inactive redemption codes for the specified game.

Path Parameters:

ParameterTypeDescription
gamestringGame slug (see supported games table)

Response:

{
  "active": [
    {
      "code": "GENSHINGIFT",
      "rewards": ["Primogems x60", "Mora x10000"]
    }
  ],
  "inactive": [
    {
      "code": "OLDCODE123",
      "rewards": ["Primogems x30"]
    }
  ]
}

Event Calendar

Available for Genshin Impact, Honkai: Star Rail, and Zenless Zone Zero.

GET /mihoyo/genshin/calendar
GET /mihoyo/starrail/calendar
GET /mihoyo/zenless/calendar

Returns current events, character/weapon banners, and challenges.

Query Parameters:

ParameterTypeDefaultDescription
langstringen-usLanguage for calendar content

Example:

GET /mihoyo/genshin/calendar?lang=ja-jp
GET /mihoyo/starrail/calendar?lang=ja
GET /mihoyo/zenless/calendar?lang=zh-cn

Supported language codes and aliases are the same as the News endpoints.

Genshin Impact Response:

{
  "events": [
    {
      "id": 1,
      "name": "Event Name",
      "description": "Event description",
      "image_url": "https://...",
      "type_name": "In-Game",
      "start_time": 1700000000,
      "end_time": 1700100000,
      "rewards": [
        {
          "id": 1,
          "name": "Primogem",
          "icon": "https://...",
          "rarity": "5",
          "amount": 420
        }
      ],
      "special_reward": null
    }
  ],
  "banners": [
    {
      "id": 1,
      "name": "Banner Name",
      "version": "4.5",
      "characters": [
        {
          "id": 1,
          "name": "Character Name",
          "icon": "https://...",
          "element": "Pyro",
          "rarity": 5
        }
      ],
      "weapons": [
        {
          "id": 1,
          "name": "Weapon Name",
          "icon": "https://...",
          "rarity": 5
        }
      ],
      "start_time": 1700000000,
      "end_time": 1700100000
    }
  ],
  "challenges": [
    {
      "id": 1,
      "name": "Spiral Abyss",
      "type_name": "Abyss",
      "start_time": 1700000000,
      "end_time": 1700100000,
      "rewards": [],
      "special_reward": null
    }
  ]
}

The Star Rail calendar response follows the same structure but with light_cones instead of weapons, and characters/light cones include an additional path field.

Zenless Zone Zero Response:

{
  "events": [
    {
      "id": 18000003,
      "name": "Event Name",
      "state": "STATE_IN_PROGRESS",
      "image_url": "https://...",
      "start_time": 1700000000,
      "end_time": 1700100000,
      "polychrome": 400
    }
  ],
  "banners": [
    {
      "banner_type": "GACHA_TYPE_CHARACTER_UP",
      "state": "GACHA_STATE_IN_PROGRESS",
      "version": "3.0",
      "agents": [
        {
          "id": 1561,
          "name": "Agent Name",
          "full_name": "Full Agent Name",
          "icon": "https://...",
          "rarity": "S",
          "profession": "anomaly",
          "element": "Wind"
        }
      ],
      "w_engines": [
        {
          "id": 14156,
          "name": "W-Engine Name",
          "icon": "https://...",
          "rarity": "S",
          "profession": "anomaly"
        }
      ],
      "start_time": 1700000000,
      "end_time": 1700100000
    }
  ],
  "challenges": [
    {
      "id": 1,
      "name": "Deadly Assault",
      "type_name": "deadly_assault",
      "start_time": 1700000000,
      "end_time": 1700100000
    },
    {
      "id": 2,
      "name": "Threshold Simulation",
      "type_name": "threshold_simulation",
      "start_time": 1700000000,
      "end_time": null
    },
    {
      "id": 3,
      "name": "Shiyu Defense",
      "type_name": "shiyu_defense",
      "start_time": null,
      "end_time": null
    },
    {
      "id": 4,
      "name": "Annihilation Simulacrum",
      "type_name": "annihilation_simulacrum",
      "start_time": 1700000000,
      "end_time": 1700100000
    }
  ]
}

Zenless challenge names follow the requested lang where official localization is available; type_name remains stable across languages. Italian and Turkish currently fall back to English challenge names because the official Zenless localization bundle does not provide those locales. Available dates use Unix seconds converted from game server time. Upstream missing, invalid, or inactive period dates return null.


News

GET /mihoyo/{game}/news/events
GET /mihoyo/{game}/news/notices
GET /mihoyo/{game}/news/info

Returns the latest HoYoLab community posts for the specified game, categorized by type.

Path Parameters:

ParameterTypeDescription
gamestringGame slug (see supported games table)

Query Parameters:

ParameterTypeDefaultDescription
langstringen-usLanguage for news content

Supported languages:

CodeFull locale
en / en-usEnglish
zh / zh-cnChinese (Simplified)
zh-twChinese (Traditional)
de / de-deGerman
es / es-esSpanish
fr / fr-frFrench
id / id-idIndonesian
it / it-itItalian
ja / ja-jpJapanese
ko / ko-krKorean
pt / pt-ptPortuguese
ru / ru-ruRussian
th / th-thThai
tr / tr-trTurkish
vi / vi-vnVietnamese

Response:

[
  {
    "id": "12345",
    "title": "Version 4.5 Update Notice",
    "description": "Dear Travelers, below are the details of the Version 4.5 update...",
    "created_at": 1700000000,
    "banner": "https://...",
    "url": "https://www.hoyolab.com/article/12345",
    "type": "notice"
  }
]

The type field matches the endpoint used: "event", "notice", or "info".


Error Handling

All errors follow a consistent format:

{
  "status": "Not Found",
  "error_code": 1000,
  "error": "Unknown game: invalid_game"
}

Error Codes:

CodeNameDescription
404ROUTE_NOT_FOUNDThe requested endpoint does not exist
1000UNKNOWN_GAMEThe game slug is not recognized
1001INVALID_LANGUAGEThe lang parameter is not a supported language
2000DATABASE_ERRORA database operation failed
3000NOT_CONFIGUREDThe requested feature is not configured on the server
3001UPSTREAM_ERRORAn upstream HoYoverse/HoYoLab API call failed

Rate Limiting

The API enforces IP-based rate limiting. Default limits are 2 requests per second with a burst allowance of 120 requests. Requests exceeding the limit will receive a 429 Too Many Requests response.

Caching

Responses are cached in memory to reduce load on upstream services:

  • Redemption codes: 5 minutes
  • Calendar data: 5 minutes
  • News: 15 minutes

Reporting Invalid Codes

If you find any redemption codes that are incorrectly parsed or have wrong reward information, please create an issue and include the following:

  • The redemption code in question
  • The game it belongs to
  • A description of what is incorrect (e.g., wrong rewards listed, code marked as active when expired, etc.)

Similar Projects

Discover other similar projects and AI models.

RepositoryC#
stalomeow/StarRailNPRShader

Fan-made shaders for Unity URP attempting to replicate the shading of Honkai: Star Rail.

985
Feb 12, 2025
RepositoryJavaScript
torikushiii/hoyolab-auto

Auto check-in and others for any Hoyoverse games

291
Nov 21, 2026
RepositoryPython
kel-z/HSR-Scanner

Scanner for exporting light cone, relic, and character data from Honkai: Star Rail to JSON format.

206
Nov 17, 2026
RepositoryC#
stalomeow/DreamTicker

崩坏:星穹铁道 2.0 梦境迷钟,简单复刻。

114
Feb 19, 2024
RepositoryPython
seriaati/genshin.py

API wrapper for HoYoLAB/Miyoushe API built on asyncio and pydantic.

486
Dec 1, 2026
RepositoryPython
seriaati/hoyo-buddy

A feature-rich, easy to use, beautifully designed Discord bot made for Hoyoverse gamers

217
Nov 28, 2026
RepositoryJavaScript
sglkc/hoyolab-auto-daily

Easiest, full free, and no BS Hoyolab daily check-in using GitHub Actions. Supports Zenless Zone Zero, Honkai: Star Rail, Genshin Impact, Honkai Impact 3rd, and Tears of Themis.

137
Aug 12, 2026
RepositoryC#
Escartem/MeiBrowser

All in one tool for browsing and downloading Hoyoverse games packages.

94
Sep 9, 2026
RepositoryC#
Scighost/Starward

Game Launcher for miHoYo - 米家游戏启动器

4.6k
Nov 26, 2026