genshindev / api

A fan-made Genshin Impact API for easy access to game data.
https://genshin.jmp.blue
Open Software License 3.0
696 stars 188 forks source link

Search via Name #170

Closed ChrisMGeo closed 1 year ago

ChrisMGeo commented 1 year ago

I'm still pretty new to this API and API's in general, but I was wondering if we could add a PUT or POST request to get a resource using a vague name. For example, my use case has a different format for storing character names, e.g. Albedo, HuTao, etc, and I want to search for their corresponding character resource so I would send a post or put request with a json body like

{
  "name": "Albedo", //HuTao
  "type":"character", // or characters if that helps
}

This returns what is basically on api.genshin.dev/characters/albedo and api.genshin.dev/characters/hu-tao.

ChrisMGeo commented 1 year ago

Oh ok I got it now so you do api.genshin.dev/characters/all?name=Albedo