ServiceResponse wrapper that handles errors gracefully.
getPokemonDetail
Fetches detailed information about a specific Pokemon by slug or ID.Parameters
The Pokemon name or numeric ID (e.g., “pikachu” or “25”)
Whether to include extended data like species info, evolution chain, and varieties
Returns
The adapted Pokemon detail object containing:
id(number): Pokemon IDname(string): Pokemon namegenus(string): Pokemon genus (e.g., “Mouse”)types(PokeType[]): Array of typesabilities(object[]): Array of abilities with hidden flagdescription(string): Flavor text descriptionheight(number): Height in metersweight(number): Weight in kilogramsstats(PokeStat[]): Base stats arrayevolution(object | null): Evolution chain referencevarieties(PokeVariety[]): Alternative formsassets(object): Sprite URLs for official artwork and home sprites
Error information if the request failed, containing:
message(string): Human-readable error messagecode(string | number): Optional error codecontext(string): Optional context string
Usage Example
getPokemonList
Retrieves a simple list of all Pokemon with name and URL references.Returns
Array of Pokemon list items, each containing:
name(string): Pokemon nameurl(string): PokeAPI URL reference
Error information if the request failed
Usage Example
getPokemonListGQL
Fetches a list of Pokemon summaries using GraphQL, including ID, name, types, and image.Returns
Array of Pokemon summaries, each containing:
id(number): Pokemon IDname(string): Pokemon nametypes(string[]): Array of type namesimage(string): Sprite image URL
Error information if the request failed
Usage Example
getPokemonDetailList
Retrieves detailed information for all Pokemon. This is an expensive operation that makes multiple API calls.Returns
Array of full Pokemon detail objects. See
getPokemonDetail for the structure of each item.Error information if the request failed
Usage Example
getEvolutionChain
Fetches the evolution chain for a specific Pokemon.Parameters
The evolution chain ID or Pokemon slug
Returns
Flattened array of evolution steps, each containing:
id(number): Pokemon IDname(string): Pokemon namesprite(string): Sprite image URL
Error information if the request failed