Introduction
Everything you need to make your first request to the Genshin API.
The Genshin API is a free, read-only REST API that serves Genshin Impact data as JSON. Every endpoint is a plain GET request you can call from a browser, a server or a terminal, sending your API key in theX-API-Key header. Keys are free and require no sign-up: seeAuthentication to get one.
Base URL
All endpoints live under a single versioned base URL:
https://cdn.genshin-api.com/api/v1Calling the base URL returns the list of available resources:
{
"elements": "https://cdn.genshin-api.com/api/v1/elements",
"regions": "https://cdn.genshin-api.com/api/v1/regions",
"weapon-types": "https://cdn.genshin-api.com/api/v1/weapon-types",
"rarities": "https://cdn.genshin-api.com/api/v1/rarities",
"versions": "https://cdn.genshin-api.com/api/v1/versions",
"weapons": "https://cdn.genshin-api.com/api/v1/weapons",
"characters": "https://cdn.genshin-api.com/api/v1/characters",
"constellations": "https://cdn.genshin-api.com/api/v1/constellations",
"artifact-types": "https://cdn.genshin-api.com/api/v1/artifact-types",
"artifact-sets": "https://cdn.genshin-api.com/api/v1/artifact-sets",
"artifacts": "https://cdn.genshin-api.com/api/v1/artifacts",
"stats": "https://cdn.genshin-api.com/api/v1/stats",
"enemy-types": "https://cdn.genshin-api.com/api/v1/enemy-types",
"enemy-families": "https://cdn.genshin-api.com/api/v1/enemy-families",
"enemy-groups": "https://cdn.genshin-api.com/api/v1/enemy-groups",
"enemies": "https://cdn.genshin-api.com/api/v1/enemies",
"item-types": "https://cdn.genshin-api.com/api/v1/item-types",
"item-groups": "https://cdn.genshin-api.com/api/v1/item-groups",
"items": "https://cdn.genshin-api.com/api/v1/items",
"domain-types": "https://cdn.genshin-api.com/api/v1/domain-types",
"domains": "https://cdn.genshin-api.com/api/v1/domains"
}Three endpoints per resource
Every resource exposes the same three endpoints:
/api/v1/{resource}Paginated list/api/v1/{resource}/randomOne random item/api/v1/{resource}/{id or name}A single itemA single item can be requested by its numeric id or by its name. Names are case and space insensitive, so hu-tao,Hu Tao and HU-TAO all return the same character.
Your first request
Try it right here, or change the path to explore other resources:
Or from your own code:
const res = await fetch("https://cdn.genshin-api.com/api/v1/characters/hu-tao", {
headers: { "X-API-Key": "YOUR_API_KEY" },
});
const character = await res.json();
console.log(character.name, character.element.name);curl -H "X-API-Key: YOUR_API_KEY" https://cdn.genshin-api.com/api/v1/characters/hu-taoAvailable resources
| Resource | Items | Description |
|---|---|---|
artifact-sets | 64 | Artifact sets with the rarities they drop in, their release version and their pieces. |
artifact-types | 5 | The five artifact slots with their possible main stats and sub stats. Each type lists the artifact sets that have a piece for it. |
artifacts | 301 | Individual artifact pieces with their set, slot, description and lore. Rarities come from their set. |
characters | 124 | Playable characters with their element, weapon, region, birthday, materials and constellations. |
constellations | 136 | Character constellations with their meaning, release version and six levels. Each constellation links to its character; travelers have one per element. |
domain-types | 6 | Domain types such as Domains of Blessing, Forgery or Mastery, Trounce Domains, One-Time Domains and Quest Domains. Each type lists its domains. |
domains | 192 | Challenge, trounce, one-time and quest domains with their type, location, recommended elements, difficulty tiers, rewards, bosses and release version. Domains of Forgery and Mastery list the material each level gives and the days it is open. |
elements | 8 | The elemental types of Teyvat. Each element lists the characters that wield it and the enemies that deal its damage. |
enemies | 369 | Common enemies, elites and bosses with their type, family, group, region, damage elements, resistances, drops, release version and archive description. |
enemy-families | 8 | Top-level enemy families such as Hilichurls, The Abyss or Automatons. Each family lists its groups and all its enemies. |
enemy-groups | 55 | Enemy groups inside a family, such as Samachurls or Abyss Mages. Each group lists its family and its enemies. |
enemy-types | 4 | Enemy classifications: common enemies, elites, normal bosses and weekly bosses. Each type lists its enemies. |
item-groups | 122 | Groups of items that are the same material in different rarities, such as Hilichurl Materials or Agnidus Agate. Each group lists its items, the enemies that drop them and, for domain materials, the domain and level that rewards them. |
item-types | 6 | Item types as shown in the in-game inventory, such as Character Ascension Materials or Local Specialties. Each type lists its groups and items. |
items | 509 | Materials such as enemy drops, ascension gems, talent books, weapon ascension materials and local specialties, with their type, source, group, region, rarity, description, release version and farming days. Each item lists the enemies that drop it, the domains that reward it and the characters and weapons that use it. |
rarities | 5 | Star ratings from 1 to 5. Each rarity lists the characters and weapons that have it. |
regions | 9 | The nations and lands of Teyvat. Each region lists its characters, local specialties, bosses and domains. |
stats | 33 | Character attributes such as HP, CRIT Rate or Elemental Mastery. Each stat lists the characters that gain it on ascension, the weapons that have it as secondary stat and the artifact types where it can roll. |
versions | 54 | Game versions with their update title and release date. Each version lists the characters, weapons, constellations, artifact sets, enemies, items and domains released in it. |
weapon-types | 5 | The weapon classes available to characters. Each type lists its characters and weapons. |
weapons | 252 | Every weapon with its rarity, type, secondary stat, series, ascension materials and release version. |
References and images
Related resources are returned as references: small objects with the id, slug, name and fullurl of the related item (plus its icon when it has one), so you can follow links without building URLs yourself.
Image fields always contain absolute URLs, ready to use in an <img> tag.