View Source MaxElixirPokeApi (MaxElixirPokeApi v0.16.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.Request.get(resource, id_or_name).

examples

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.Request.get("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
  }}

Link to this section 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.

Link to this section Types

Link to this section 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

Parameters

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

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/berry/{id or name}/
Link to this function

berry_firmness(id_or_name)

View Source

Berries can be soft or hard. Check out Bulbapedia for greater detail.

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/berry-firmness/{id or name}/
Link to this function

berry_flavor(id_or_name)

View Source

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

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/berry-flavor/{id or name}/

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

Parameters

  • id: Integer that represents the resource identify.

Contest effects refer to the effects of moves when used in contests.

parameters

Parameters

  • id: Integer that represents the resource identify. https://pokeapi.co/api/v2/contest-effect/{id}/
Link to this function

contest_type(id_or_name)

View Source

Contest types are categories judges used to weigh a Pokémon's condition in Pokémon contests. Check out Bulbapedia for greater detail.

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/contest-type/{id or name}/

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

Parameters

Link to this function

encounter_condition(id_or_name)

View Source

Conditions which affect what pokemon might appear in the wild, e.g., day or night.

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/encounter-condition/{id or name}/
Link to this function

encounter_condition_value(id_or_name)

View Source

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

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/encounter-condition-value/{id or name}/
Link to this function

encounter_method(id_or_name)

View Source

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

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/encounter-method/{id or name}/

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

Parameters

  • id: Integer that represents the resource identify. https://pokeapi.co/api/v2/evolution-chain/{id}/
Link to this function

evolution_trigger(id_or_name)

View Source

Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out Bulbapedia for greater detail.

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/evolution-trigger/{id or name}/

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

Parameters

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

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/generation/{id or name}/

Growth rates are the speed with which Pokémon gain levels through experience. Check out Bulbapedia for greater detail.

parameters

Parameters

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

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/item/{id or name}/
Link to this function

item_attribute(id_or_name)

View Source

Item attributes define particular aspects of items, e.g. "usable in battle" or "consumable".

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/item-attribute/{id or name}/
Link to this function

item_category(id_or_name)

View Source

Item categories determine where items will be placed in the players bag.

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/item-category/{id or name}/
Link to this function

item_fling_effect(id_or_name)

View Source

The various effects of the move "Fling" when used with different items.

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/item-fling-effect/{id or name}/

Pockets within the players bag used for storing items by category.

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/item-pocket/{id or name}/

Languages for translations of API resource information.

parameters

Parameters

Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify.
Link to this function

location_area(id_or_name)

View Source

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

Parameters

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

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

Parameters

Link to this function

move_ailment(id_or_name)

View Source

Move Ailments are status conditions caused by moves used during battle. See Bulbapedia for greater detail.

parameters

Parameters

Link to this function

move_battle_style(id_or_name)

View Source

Styles of moves when used in the Battle Palace. See Bulbapedia for greater detail.

parameters

Parameters

Link to this function

move_category(id_or_name)

View Source

Very general categories that loosely group move effects.

parameters

Parameters

Link to this function

move_damage_class(id_or_name)

View Source

Damage classes moves can have, e.g. physical, special, or non-damaging.

parameters

Parameters

Link to this function

move_learn_method(id_or_name)

View Source

Methods by which Pokémon can learn moves.

parameters

Parameters

Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.

parameters

Parameters

Natures influence how a Pokémon's stats grow. See Bulbapedia for greater detail.

parameters

Parameters

Link to this function

pal_park_area(id_or_name)

View Source

Areas used for grouping Pokémon encounters in Pal Park. They're like habitats that are specific to Pal Park.

parameters

Parameters

Link to this function

pokeathlon_stat(id_or_name)

View Source

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

Parameters

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

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/pokedex/{id or name}/

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

Parameters

Link to this function

pokemon_color(id_or_name)

View Source

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

Parameters

Link to this function

pokemon_form(id_or_name)

View Source

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

Parameters

Link to this function

pokemon_habitat(id_or_name)

View Source

Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.

parameters

Parameters

Link to this function

pokemon_shape(id_or_name)

View Source

Shapes used for sorting Pokémon in a Pokédex.

parameters

Parameters

Link to this function

pokemon_species(id_or_name)

View Source

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

Parameters

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

Parameters

Link to this function

resource(name, limit \\ 20, page \\ 0)

View Source

Return a paginated list of available resources for that API. By default, a list "page" will contain up to 20 resources.

parameters

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

Parameters

Link to this function

super_contest_effect(id)

View Source

Super contest effects refer to the effects of moves when used in super contests.

parameters

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

Parameters

Versions of the games, e.g., Red, Blue or Yellow.

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/version/{id or name}/
Link to this function

version_group(id_or_name)

View Source

Version groups categorize highly similar versions of the games.

parameters

Parameters

  • id_or_name: Integer or String that represents the resource identify. https://pokeapi.co/api/v2/version-group/{id or name}/