Code Monkey home page Code Monkey logo

mei-cards's Introduction

mei-cards

Use your HoYoLAB data to generate cards with your Genshin Impact, Honkai Impact 3rd and Honkai: Star Rail stats!
This project is not affiliated with miHoYo, they could decide to ban you for using it. [2.3.vii HoYoVerse Account - Terms of Service]

Examples

Honkai Impact 3rd

Example

Genshin Impact

Example

Honkai: Star Rail

Example

Usage

This project has been built around running on Vercel, but with some work it should run on Express or any other Node.js server.

Currently three of HoYoVerses' games are supported: Honkai Impact 3rd, Genshin Impact and Honkai: Star Rail. Each are accessed with the same URL but with a different "game" parameter.

Game URL Parameter
Honkai Impact 3rd /api/v1/getCard?game=honkai3rd honkai3rd
Genshin Impact /api/v1/getCard?game=genshin genshin
Honkai: Star Rail /api/v1/getCard?game=starrail starrail

Deploying

1. Forking the repository

Click the fork button in the top right of the repository page.
deploy-0.png

2. Getting your HoYoLAB cookies

  • Go to HoYoLAB (https://www.hoyolab.com/) and log in.
  • Go to your profile page.
  • Open the developer tools (F12 or Ctrl+Shift+I).
  • Go to the "Network" tab.
  • Click on the "Preserve Log" / "Persist Logs" button.
  • Refresh the page.
  • Click on the getGameRecordCard request where the method is "GET" (it should be named "getGameRecordCard" with your HoYoLab UID).
  • Go to the "Cookies" tab.
  • Copy the "ltoken" or "ltoken_v2" cookie value.
  • Copy the "ltuid" or "ltuid_v2" cookie value.

deploy-1.png

3. Deploying to Vercel

Before you deploy to Vercel you'll need to create a new project and link it to your GitHub repository. Then you'll need to add the following environment variables:

Variable Description Optional Example
HOYOLAB_TOKENV2 If the cookie you copied from HoYoLAB was "ltoken_v2" then set this to true, otherwise skip adding this variable. Yes true
HOYOLAB_TOKEN The value of the "ltoken" or "ltoken_v2" cookie. No aXDNHHbL8FVbvbv1d4AVuD
HOYOLAB_ID The value of the "ltuid" or "ltuid_v2" cookie. No 123456789

deploy-2.png

4. Using the API

You can now use the API by sending a GET request to the URL of your Vercel project with the game parameter set to the game you want to get the card for.

Game URL Parameter
Honkai Impact 3rd /api/v1/getCard?game=honkai3rd honkai3rd
Genshin Impact /api/v1/getCard?game=genshin genshin
Honkai: Star Rail /api/v1/getCard?game=starrail starrail

mei-cards's People

Contributors

imgbotapp avatar joshua-noakes1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.