Genshin Images API
Mahiru provides you with a cool images API which you can use after connecting your Genshin account. It allows you to create direct links to Genshin images which are updated in real-time.
URL Structure
The base URL of Genshin Images API is:
URL structure looks like this:
-
userId – Telegram ID of the user whose image you want to access. You can get it here.
-
method – The method you want to use. See the table below for the list of all available methods.
Methods
Each method corresponds to a specific genshin command. See the list of all commands that have methods in Genshin Images API below.
Some methods always require authentication. Read about it in Privacy and Security section.
Method | Command | URL Structure | Requires authentication |
---|---|---|---|
profile |
genshin_profile |
https://mahiru.one/g/{userId}/profile |
No |
abyss |
genshin_abyss |
https://mahiru.one/g/{userId}/abyss |
No |
exploration |
genshin_exploration |
https://mahiru.one/g/{userId}/exploration |
No |
notes |
genshin_notes |
https://mahiru.one/g/{userId}/notes |
Yes |
tcg |
genshin_tcg |
https://mahiru.one/g/{userId}/teapot |
No |
teapot |
genshin_teapot |
https://mahiru.one/g/{userId}/teapot |
No |
characters |
genshin_characters |
https://mahiru.one/g/{userId}/characters |
No |
character |
genshin_characters |
https://mahiru.one/g/{userId}/character/{characterId} |
No |
Query Parameters
Query parameters can help you configure the image you want to receive.
Default Parameters
Default parameters are present in every method:
- theme
Literal['light', 'dark'] (optional)
– Theme for the image. Can be eitherlight
ordark
. - language
Literal['ru', 'en'] (optional)
– Language of the image. Can be set toru
(Russian) oren
(English). - authkey
string (optional)
– Yourauthkey
for request authentication. Required for routes that either have authentication enabled by default or ones for which you have disabled «Display to others» setting in Dashboard.
Unique Parameters
Some methods have unique parameters:
Method | Parameters | Type | Parameters description |
---|---|---|---|
abyss |
schedule |
Literal['current', 'previous'] (optional) |
Schedule of the image. Can be set to current or previous |
Adding Parameters
To append query params to the end of a URL, a ?
is added followed immediately by a query parameter:
Privacy and Security
Warning
You must not neither share URLs containing your authkey
with anyone nor upload images using these URLs. Everyone who has your authkey
may have unexpected access to your data stored by Mahiru. If you accidentally leaked your authkey
, please contact us in our Support Group in order to reset it as soon as possible.
If you want to prevent other users from accessing your images, you can do this by disabling «Display to others» for methods you do not want to share. (1)
- Some methods always require authentication. These are the ones you most likely won't want to share, for example, notes. See methods which always require authentication in Methods Table.
In order to authenticate your request you need to add authkey
as a query parameter of the URL:
Rate limits
Every endpoint (method) can be accessed 10 times/1 minute/IP. If you exceed this limit, your IP will be rate limited.
Caching
Each image requires a significant amount of server resources to generate. Therefore, we use caching. Each method except notes
has a cache time of one hour. For notes
it is 3600 seconds (5 minutes).