View Source MaxElixirPokeApi (MaxElixirPokeApi v1.1.0)
MaxElixirPokeApi is a Elixir wrapper with auto caching for PokeAPI.
This package has all function explicit in PokeAPI Doc.
To use the resources just call MaxElixirPokeApi.<resource_name>(id_or_name)
.
To list resources use MaxElixirPokeApi.resource(resource_aton, limit, page)
.
If you want to create your own logic for calling resources use MaxElixirPokeApi.PokeAPI.fetch(resource, id_or_name)
.
Examples
iex> MaxElixirPokeApi.berry(1)
{:ok,
%{
"firmness" => %{
"name" => "soft",
"url" => "https://pokeapi.co/api/v2/berry-firmness/2/"
},
"flavors" => [
%{
"flavor" => %{
"name" => "spicy",
"url" => "https://pokeapi.co/api/v2/berry-flavor/1/"
},
"potency" => 10
},
%{
"flavor" => %{
"name" => "dry",
"url" => "https://pokeapi.co/api/v2/berry-flavor/2/"
},
"potency" => 0
},
%{
"flavor" => %{
"name" => "sweet",
"url" => "https://pokeapi.co/api/v2/berry-flavor/3/"
},
"potency" => 0
},
%{
"flavor" => %{
"name" => "bitter",
"url" => "https://pokeapi.co/api/v2/berry-flavor/4/"
},
"potency" => 0
},
%{
"flavor" => %{
"name" => "sour",
"url" => "https://pokeapi.co/api/v2/berry-flavor/5/"
},
"potency" => 0
}
],
"growth_time" => 3,
"id" => 1,
"item" => %{
"name" => "cheri-berry",
"url" => "https://pokeapi.co/api/v2/item/126/"
},
"max_harvest" => 5,
"name" => "cheri",
"natural_gift_power" => 60,
"natural_gift_type" => %{
"name" => "fire",
"url" => "https://pokeapi.co/api/v2/type/10/"
},
"size" => 20,
"smoothness" => 25,
"soil_dryness" => 15
}}
iex> MaxElixirPokeApi.resource(:berry, 5, 5)
{:ok,
%{
"count" => 64,
"next" => "https://pokeapi.co/api/v2/berry?offset=30&limit=5",
"previous" => "https://pokeapi.co/api/v2/berry?offset=20&limit=5",
"results" => [
%{
"name" => "tamato",
"url" => "https://pokeapi.co/api/v2/berry/26/"
},
%{
"name" => "cornn",
"url" => "https://pokeapi.co/api/v2/berry/27/"
},
%{
"name" => "magost",
"url" => "https://pokeapi.co/api/v2/berry/28/"
},
%{
"name" => "rabuta",
"url" => "https://pokeapi.co/api/v2/berry/29/"
},
%{
"name" => "nomel",
"url" => "https://pokeapi.co/api/v2/berry/30/"
}
]
}}
iex> MaxElixirPokeApi.PokeAPI.fetch("berry", 1)
{:ok,
%{
"firmness" => %{
"name" => "soft",
"url" => "https://pokeapi.co/api/v2/berry-firmness/2/"
},
"flavors" => [
%{
"flavor" => %{
"name" => "spicy",
"url" => "https://pokeapi.co/api/v2/berry-flavor/1/"
},
"potency" => 10
},
%{
"flavor" => %{
"name" => "dry",
"url" => "https://pokeapi.co/api/v2/berry-flavor/2/"
},
"potency" => 0
},
%{
"flavor" => %{
"name" => "sweet",
"url" => "https://pokeapi.co/api/v2/berry-flavor/3/"
},
"potency" => 0
},
%{
"flavor" => %{
"name" => "bitter",
"url" => "https://pokeapi.co/api/v2/berry-flavor/4/"
},
"potency" => 0
},
%{
"flavor" => %{
"name" => "sour",
"url" => "https://pokeapi.co/api/v2/berry-flavor/5/"
},
"potency" => 0
}
],
"growth_time" => 3,
"id" => 1,
"item" => %{
"name" => "cheri-berry",
"url" => "https://pokeapi.co/api/v2/item/126/"
},
"max_harvest" => 5,
"name" => "cheri",
"natural_gift_power" => 60,
"natural_gift_type" => %{
"name" => "fire",
"url" => "https://pokeapi.co/api/v2/type/10/"
},
"size" => 20,
"smoothness" => 25,
"soil_dryness" => 15
}}
Summary
Functions
Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out Bulbapedia for greater detail.
Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out Bulbapedia for greater detail.
Berries can be soft or hard. Check out Bulbapedia for greater detail.
Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their nature. Check out Bulbapedia for greater detail.
Characteristics indicate which stat contains a Pokémon's highest IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out Bulbapedia for greater detail.
Contest effects refer to the effects of moves when used in contests.
Contest types are categories judges used to weigh a Pokémon's condition in Pokémon contests. Check out Bulbapedia for greater detail.
Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out Bulbapedia for greater detail.
Conditions which affect what pokemon might appear in the wild, e.g., day or night.
Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night.
Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail.
Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy.
Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out Bulbapedia for greater detail.
Genders were introduced in Generation II for the purposes of breeding Pokémon but can also result in visual differences or even different evolutionary lines. Check out Bulbapedia for greater detail.
A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released.
Growth rates are the speed with which Pokémon gain levels through experience. Check out Bulbapedia for greater detail.
An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area.
Item attributes define particular aspects of items, e.g. "usable in battle" or "consumable".
Item categories determine where items will be placed in the players bag.
The various effects of the move "Fling" when used with different items.
Pockets within the players bag used for storing items by category.
Languages for translations of API resource information.
Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.
Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters.
Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine.
Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas.
Move Ailments are status conditions caused by moves used during battle. See Bulbapedia for greater detail.
Styles of moves when used in the Battle Palace. See Bulbapedia for greater detail.
Very general categories that loosely group move effects.
Damage classes moves can have, e.g. physical, special, or non-damaging.
Methods by which Pokémon can learn moves.
Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.
Natures influence how a Pokémon's stats grow. See Bulbapedia for greater detail.
Areas used for grouping Pokémon encounters in Pal Park. They're like habitats that are specific to Pal Park.
Pokeathlon Stats are different attributes of a Pokémon's performance in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See Bulbapedia for greater detail.
A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See Bulbapedia for greater detail.
Pokémon are the creatures that inhabit the world of the Pokémon games. They can be caught using Pokéballs and trained by battling with other Pokémon. Each Pokémon belongs to a specific species but may take on a variant which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See Bulbapedia for greater detail.
Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown.
Some Pokémon may appear in one of multiple, visually different forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the 'Pokémon' entity is used to represent such a variety.
Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.
Shapes used for sorting Pokémon in a Pokédex.
A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.
A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them.
Return a paginated list of available resources for that API. By default, a list "page" will contain up to 20 resources.
Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.
Super contest effects refer to the effects of moves when used in super contests.
Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.
Versions of the games, e.g., Red, Blue or Yellow.
Version groups categorize highly similar versions of the games.
Types
@type id_or_name() :: MaxElixirPokeApi.Behaviour.id_or_name()
@type response() :: MaxElixirPokeApi.Behaviour.response()
Functions
Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out Bulbapedia for greater detail.
Parameters
- id_or_name:
id_or_name/0
Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out Bulbapedia for greater detail.
Parameters
Berries can be soft or hard. Check out Bulbapedia for greater detail.
Parameters
Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their nature. Check out Bulbapedia for greater detail.
Parameters
Characteristics indicate which stat contains a Pokémon's highest IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out Bulbapedia for greater detail.
Parameters
- id:
Integer
that represents the resource identify.
Contest effects refer to the effects of moves when used in contests.
Parameters
- id:
Integer
that represents the resource identify.https://pokeapi.co/api/v2/contest-effect/{id}/
Contest types are categories judges used to weigh a Pokémon's condition in Pokémon contests. Check out Bulbapedia for greater detail.
Parameters
Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out Bulbapedia for greater detail.
Parameters
- id_or_name:
id_or_name/0
Conditions which affect what pokemon might appear in the wild, e.g., day or night.
Parameters
Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night.
Parameters
Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail.
Parameters
Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy.
Parameters
- id:
Integer
that represents the resource identify.https://pokeapi.co/api/v2/evolution-chain/{id}/
Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out Bulbapedia for greater detail.
Parameters
Genders were introduced in Generation II for the purposes of breeding Pokémon but can also result in visual differences or even different evolutionary lines. Check out Bulbapedia for greater detail.
Parameters
- id_or_name:
id_or_name/0
A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released.
Parameters
Growth rates are the speed with which Pokémon gain levels through experience. Check out Bulbapedia for greater detail.
Parameters
- id_or_name:
id_or_name/0
An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area.
Parameters
Item attributes define particular aspects of items, e.g. "usable in battle" or "consumable".
Parameters
Item categories determine where items will be placed in the players bag.
Parameters
The various effects of the move "Fling" when used with different items.
Parameters
Pockets within the players bag used for storing items by category.
Parameters
Languages for translations of API resource information.
Parameters
- id_or_name:
id_or_name/0
Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.
Parameters
Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters.
Parameters
- id_or_name:
id_or_name/0
Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine.
Parameters
- id:
Integer
that represents the resource identify.
Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas.
Parameters
- id_or_name:
id_or_name/0
Move Ailments are status conditions caused by moves used during battle. See Bulbapedia for greater detail.
Parameters
- id_or_name:
id_or_name/0
Styles of moves when used in the Battle Palace. See Bulbapedia for greater detail.
Parameters
- id_or_name:
id_or_name/0
Very general categories that loosely group move effects.
Parameters
- id_or_name:
id_or_name/0
Damage classes moves can have, e.g. physical, special, or non-damaging.
Parameters
- id_or_name:
id_or_name/0
Methods by which Pokémon can learn moves.
Parameters
- id_or_name:
id_or_name/0
Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.
Parameters
- id_or_name:
id_or_name/0
Natures influence how a Pokémon's stats grow. See Bulbapedia for greater detail.
Parameters
- id_or_name:
id_or_name/0
Areas used for grouping Pokémon encounters in Pal Park. They're like habitats that are specific to Pal Park.
Parameters
- id_or_name:
id_or_name/0
Pokeathlon Stats are different attributes of a Pokémon's performance in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See Bulbapedia for greater detail.
Parameters
- id_or_name:
id_or_name/0
A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See Bulbapedia for greater detail.
Parameters
Pokémon are the creatures that inhabit the world of the Pokémon games. They can be caught using Pokéballs and trained by battling with other Pokémon. Each Pokémon belongs to a specific species but may take on a variant which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See Bulbapedia for greater detail.
Parameters
- id_or_name:
id_or_name/0
Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown.
Parameters
- id_or_name:
id_or_name/0
Some Pokémon may appear in one of multiple, visually different forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the 'Pokémon' entity is used to represent such a variety.
Parameters
- id_or_name:
id_or_name/0
Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.
Parameters
- id_or_name:
id_or_name/0
Shapes used for sorting Pokémon in a Pokédex.
Parameters
- id_or_name:
id_or_name/0
A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.
Parameters
- id_or_name:
id_or_name/0
A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them.
Parameters
- id_or_name:
id_or_name/0
Return a paginated list of available resources for that API. By default, a list "page" will contain up to 20 resources.
Parameters
- name:
Atom
[@resources_list
] that represents the resource from Poke API.
Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.
Parameters
- id_or_name:
id_or_name/0
Super contest effects refer to the effects of moves when used in super contests.
Parameters
- id:
Integer
that represents the resource identify.https://pokeapi.co/api/v2/super-contest-effect/{id}/
Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.
Parameters
- id_or_name:
id_or_name/0
Versions of the games, e.g., Red, Blue or Yellow.
Parameters
Version groups categorize highly similar versions of the games.