### Install Project Dependencies Source: https://github.com/pokeapi/pokeapi.co/blob/master/README.md Run this command in the project root to install all required dependencies. ```bash npm install ``` -------------------------------- ### Start Development Server Source: https://github.com/pokeapi/pokeapi.co/blob/master/README.md Launches the hot-reloading development server for local testing. ```bash npm run start ``` -------------------------------- ### Get Abilities Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve ability details by name or ID using cURL. ```bash # Get ability by name curl "https://pokeapi.co/api/v2/ability/levitate" # Get ability by ID curl "https://pokeapi.co/api/v2/ability/26" ``` -------------------------------- ### Get Types Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve type information including damage relations and associated Pokémon. ```bash # Get type by name curl "https://pokeapi.co/api/v2/type/fire" # Get type by ID curl "https://pokeapi.co/api/v2/type/10" ``` -------------------------------- ### Get Moves Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve move statistics and effect data by name or ID. ```bash # Get move by name curl "https://pokeapi.co/api/v2/move/thunder" # Get move by ID curl "https://pokeapi.co/api/v2/move/87" ``` -------------------------------- ### Get Evolution Chains Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve the evolution path for a specific chain ID. ```bash # Get evolution chain by ID curl "https://pokeapi.co/api/v2/evolution-chain/1" ``` -------------------------------- ### GET /api/v2/berry/{id_or_name} Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve berry data including growth time, flavors, firmness, and effects. ```APIDOC ## GET /api/v2/berry/{id_or_name} ### Description Retrieve berry data including growth time, flavors, firmness, and effects. ### Method GET ### Endpoint https://pokeapi.co/api/v2/berry/{id_or_name} ### Parameters #### Path Parameters - **id_or_name** (string/integer) - Required - The name or ID of the berry. ### Response #### Success Response (200) - **id** (integer) - The berry ID - **name** (string) - The berry name - **growth_time** (integer) - Time taken to grow - **max_harvest** (integer) - Maximum harvest amount #### Response Example { "id": 1, "name": "cheri", "growth_time": 3, "max_harvest": 5 } ``` -------------------------------- ### Get Abilities Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve Pokémon abilities including effects, flavor text, and which Pokémon can have them. ```APIDOC ## Get Abilities ### Description Retrieve Pokémon abilities including effects, flavor text, and which Pokémon can have them. ### Method GET ### Endpoint `/api/v2/ability/{name_or_id}` ### Parameters #### Path Parameters - **name_or_id** (string) - Required - The name or ID of the ability. ### Request Example ```bash curl "https://pokeapi.co/api/v2/ability/levitate" ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the ability. - **name** (string) - The name of the ability. - **is_main_series** (boolean) - Whether the ability is part of the main series. - **generation** (object) - The generation the ability belongs to. - **effect_entries** (array) - A list of effect entries for the ability. - **flavor_text_entries** (array) - A list of flavor text entries for the ability. - **pokemon** (array) - A list of Pokémon that have this ability. #### Response Example ```json { "id": 26, "name": "levitate", "is_main_series": true, "generation": {"name": "generation-iii", "url": "..."}, "effect_entries": [ { "effect": "This Pokémon is immune to ground-type moves...", "short_effect": "Evades ground moves.", "language": {"name": "en", "url": "..."} } ], "flavor_text_entries": [ {"flavor_text": "Gives full immunity to all Ground-type moves.", "language": {"name": "en", "url": "..."}, "version_group": {"name": "ruby-sapphire", "url": "..."}} ], "pokemon": [ {"is_hidden": false, "slot": 1, "pokemon": {"name": "gastly", "url": "..."}}, {"is_hidden": false, "slot": 1, "pokemon": {"name": "haunter", "url": "..."}} ] } ``` ``` -------------------------------- ### Get Evolution Chains Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve complete evolution chains showing how Pokémon evolve and under what conditions. ```APIDOC ## Get Evolution Chains ### Description Retrieve complete evolution chains showing how Pokémon evolve and under what conditions. ### Method GET ### Endpoint `/api/v2/evolution-chain/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the evolution chain. ### Request Example ```bash curl "https://pokeapi.co/api/v2/evolution-chain/1" ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the evolution chain. - **baby_trigger_item** (object or null) - The item that triggers the evolution of a baby Pokémon, if applicable. - **chain** (object) - The chain object containing species and evolution details. #### Response Example ```json { "id": 1, "baby_trigger_item": null, "chain": { "species": {"name": "bulbasaur", "url": "..."}, "is_baby": false, "evolution_details": [], "evolves_to": [{ "species": {"name": "ivysaur", "url": "..."}, "is_baby": false, "evolution_details": [{"min_level": 16, "trigger": {"name": "level-up", "url": "..."}, "item": null, "held_item": null, "time_of_day": "", "location": null}], "evolves_to": [ { "species": {"name": "venusaur", "url": "..."}, "is_baby": false, "evolution_details": [{"min_level": 32, "trigger": {"name": "level-up", "url": "..."}}], "evolves_to": [] } ] }] } } ``` ``` -------------------------------- ### GET /api/v2/item/{id_or_name} Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve detailed information about a specific item by its name or ID. ```APIDOC ## GET /api/v2/item/{id_or_name} ### Description Retrieve item data including cost, fling power, and effect entries. ### Method GET ### Endpoint https://pokeapi.co/api/v2/item/{id_or_name} ### Parameters #### Path Parameters - **id_or_name** (string/integer) - Required - The name or ID of the item. ### Response #### Success Response (200) - **id** (integer) - The item ID - **name** (string) - The item name - **cost** (integer) - The cost of the item - **fling_power** (integer) - The power of the item when used with Fling #### Response Example { "id": 1, "name": "master-ball", "cost": 0, "fling_power": 10 } ``` -------------------------------- ### Get Pokémon Location Encounters API Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Get all locations where a specific Pokémon can be encountered in the wild. This endpoint requires the Pokémon's ID. ```APIDOC ## Get Pokémon Location Encounters API ### Description Get all locations where a specific Pokémon can be encountered in the wild. ### Method GET ### Endpoint `/api/v2/pokemon/{id}/encounters` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the Pokémon. ### Request Example ```bash # Get encounter locations for a Pokémon curl "https://pokeapi.co/api/v2/pokemon/35/encounters" ``` ### Response #### Success Response (200) - The response is an array of location objects, detailing where the Pokémon can be found. - **location_area** (object) - Information about the location area. - **name** (string) - The name of the location area. - **url** (string) - The URL for the location area resource. - **version_details** (array) - Details about encounters in specific game versions. - **encounter_details** (array) - Specific encounter details. - **chance** (integer) - The chance of encountering the Pokémon. - **method** (object) - The method of encounter. - **name** (string) - The name of the encounter method. - **url** (string) - The URL for the encounter method resource. - **min_level** (integer) - The minimum level the Pokémon can be encountered at. - **max_level** (integer) - The maximum level the Pokémon can be encountered at. - **version** (object) - Information about the game version. - **name** (string) - The name of the version. - **url** (string) - The URL for the version resource. ### Response Example ```json [ { "location_area": {"name": "pallet-town", "url": "..."}, "version_details": [ { "encounter_details": [ { "chance": 10, "method": {"name": "walk", "url": "..."}, "min_level": 3, "max_level": 6 } ], "version": {"name": "red", "url": "..."} } ] } ] ``` ``` -------------------------------- ### Get Items Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve item data including effects, categories, and which Pokémon can hold them. ```APIDOC ## Get Items ### Description Retrieve item data including effects, categories, and which Pokémon can hold them. ### Method GET ### Endpoint `/api/v2/item/{name_or_id}` ### Parameters #### Path Parameters - **name_or_id** (string) - Required - The name or ID of the item. ### Request Example ```bash curl "https://pokeapi.co/api/v2/item/potion" ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the item. - **name** (string) - The name of the item. - **cost** (integer) - The cost of the item in Poké Balls. - **fling_power** (integer or null) - The power of the item when used by fling. - **fling_effect** (object or null) - The effect of the item when used by fling. - **attributes** (array) - A list of attributes associated with the item. - **category** (object) - The category the item belongs to. - **effect_entries** (array) - A list of effect entries for the item. - **flavor_text_entries** (array) - A list of flavor text entries for the item. - **game_indices** (array) - A list of game indices for the item. - **held_by_pokemon** (array) - A list of Pokémon that can hold this item. - **sprites** (object) - Sprites associated with the item. #### Response Example ```json { "id": 2, "name": "potion", "cost": 300, "fling_power": 30, "fling_effect": {"name": "damage", "url": "..."}, "attributes": [ {"name": "consumable", "url": "..."}, {"name": "usable-in-battle", "url": "..."}, {"name": "healing", "url": "..."} ], "category": {"name": "healing", "url": "..."}, "effect_entries": [ {"effect": "Restores 20 HP.", "short_effect": "Restores 20 HP.", "language": {"name": "en", "url": "..."}} ], "flavor_text_entries": [ {"flavor_text": "A spray that restores 20 HP.", "language": {"name": "en", "url": "..."}, "version_group": {"name": "red-blue", "url": "..."}} ], "game_indices": [ {"game_index": 1, "generation": {"name": "generation-i", "url": "..."}} ], "held_by_pokemon": [ {"is_hidden": false, "slot": 1, "pokemon": {"name": "bulbasaur", "url": "..."}} ], "sprites": { "default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/items/potion.png" } } ``` ``` -------------------------------- ### GET /api/v2/pokedex/{id_or_name} Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve Pokédex data including all Pokémon entries. ```APIDOC ## GET /api/v2/pokedex/{id_or_name} ### Description Retrieve Pokédex data including all Pokémon entries. ### Method GET ### Endpoint https://pokeapi.co/api/v2/pokedex/{id_or_name} ### Parameters #### Path Parameters - **id_or_name** (string/integer) - Required - The name or ID of the Pokédex. ### Response #### Success Response (200) - **id** (integer) - The Pokédex ID - **name** (string) - The Pokédex name #### Response Example { "id": 1, "name": "national" } ``` -------------------------------- ### Get Moves Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve detailed move information including power, accuracy, type, effects, and which Pokémon can learn them. ```APIDOC ## Get Moves ### Description Retrieve detailed move information including power, accuracy, type, effects, and which Pokémon can learn them. ### Method GET ### Endpoint `/api/v2/move/{name_or_id}` ### Parameters #### Path Parameters - **name_or_id** (string) - Required - The name or ID of the move. ### Request Example ```bash curl "https://pokeapi.co/api/v2/move/thunder" ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the move. - **name** (string) - The name of the move. - **accuracy** (integer) - The accuracy of the move. - **power** (integer) - The power of the move. - **pp** (integer) - The PP of the move. - **priority** (integer) - The priority of the move. - **type** (object) - The type of the move. - **damage_class** (object) - The damage class of the move. - **target** (object) - The target of the move. - **generation** (object) - The generation the move belongs to. - **effect_entries** (array) - A list of effect entries for the move. - **meta** (object) - Metadata about the move's effects. - **learned_by_pokemon** (array) - A list of Pokémon that can learn this move. #### Response Example ```json { "id": 87, "name": "thunder", "accuracy": 70, "power": 110, "pp": 10, "priority": 0, "type": {"name": "electric", "url": "..."}, "damage_class": {"name": "special", "url": "..."}, "target": {"name": "selected-pokemon", "url": "..."}, "generation": {"name": "generation-i", "url": "..."}, "effect_entries": [ {"effect": "Inflicts regular damage. Has a 30% chance to paralyze the target...", "short_effect": "Has a 30% chance to paralyze the target.", "language": {"name": "en", "url": "..."}} ], "meta": { "ailment": {"name": "paralysis", "url": "..."}, "ailment_chance": 30, "crit_rate": 0, "drain": 0, "flinch_chance": 0, "healing": 0, "category": {"name": "damage+ailment", "url": "..."} }, "learned_by_pokemon": [ {"name": "pikachu", "url": "..."}, {"name": "raichu", "url": "..."} ] } ``` ``` -------------------------------- ### Get Paginated List of Pokémon Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve a paginated list of all Pokémon resources. Default is 20 per page. You can customize the number of results per page and the offset. ```bash curl "https://pokeapi.co/api/v2/pokemon/" # Response: # { # "count": 1302, # "next": "https://pokeapi.co/api/v2/pokemon/?offset=20&limit=20", # "previous": null, # "results": [ # {"name": "bulbasaur", "url": "https://pokeapi.co/api/v2/pokemon/1/"}, # {"name": "ivysaur", "url": "https://pokeapi.co/api/v2/pokemon/2/"}, # ... # ] # } ``` ```bash curl "https://pokeapi.co/api/v2/pokemon/?limit=100&offset=0" ``` ```bash curl "https://pokeapi.co/api/v2/ability/?limit=50" ``` -------------------------------- ### GET /api/v2/location/{id_or_name} Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve game location data including regions, areas, and Pokémon encounters. ```APIDOC ## GET /api/v2/location/{id_or_name} ### Description Retrieve game location data including regions, areas, and Pokémon encounters. ### Method GET ### Endpoint https://pokeapi.co/api/v2/location/{id_or_name} ### Parameters #### Path Parameters - **id_or_name** (string/integer) - Required - The name or ID of the location. ### Response #### Success Response (200) - **id** (integer) - The location ID - **name** (string) - The location name - **region** (object) - The region the location belongs to #### Response Example { "id": 1, "name": "canalave-city", "region": {"name": "sinnoh", "url": "..."} } ``` -------------------------------- ### GET /api/v2/generation/{id_or_name} Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve generation data including Pokémon, moves, abilities, and types introduced. ```APIDOC ## GET /api/v2/generation/{id_or_name} ### Description Retrieve generation data including Pokémon, moves, abilities, and types introduced. ### Method GET ### Endpoint https://pokeapi.co/api/v2/generation/{id_or_name} ### Parameters #### Path Parameters - **id_or_name** (string/integer) - Required - The name or ID of the generation. ### Response #### Success Response (200) - **id** (integer) - The generation ID - **name** (string) - The generation name #### Response Example { "id": 1, "name": "generation-i" } ``` -------------------------------- ### GET /api/v2/region/{id_or_name} Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve region data including locations, generations, and version groups. ```APIDOC ## GET /api/v2/region/{id_or_name} ### Description Retrieve region data including locations, generations, and version groups. ### Method GET ### Endpoint https://pokeapi.co/api/v2/region/{id_or_name} ### Parameters #### Path Parameters - **id_or_name** (string/integer) - Required - The name or ID of the region. ### Response #### Success Response (200) - **id** (integer) - The region ID - **name** (string) - The region name #### Response Example { "id": 1, "name": "kanto" } ``` -------------------------------- ### Get Pokémon Species Data Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Fetch species-level data for a Pokémon, including evolution chains, flavor text, egg groups, and habitat. Use either the Pokémon's name or ID. ```bash curl "https://pokeapi.co/api/v2/pokemon-species/charizard" ``` ```bash curl "https://pokeapi.co/api/v2/pokemon-species/6" ``` -------------------------------- ### Get Pokémon Encounter Locations Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve a list of all locations where a specific Pokémon can be encountered in the wild. This endpoint requires the Pokémon's ID. ```bash curl "https://pokeapi.co/api/v2/pokemon/35/encounters" ``` -------------------------------- ### Get Types Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve Pokémon types including damage relations (super effective, not very effective, immune). ```APIDOC ## Get Types ### Description Retrieve Pokémon types including damage relations (super effective, not very effective, immune). ### Method GET ### Endpoint `/api/v2/type/{name_or_id}` ### Parameters #### Path Parameters - **name_or_id** (string) - Required - The name or ID of the type. ### Request Example ```bash curl "https://pokeapi.co/api/v2/type/fire" ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the type. - **name** (string) - The name of the type. - **generation** (object) - The generation the type belongs to. - **damage_relations** (object) - The damage relations of the type. - **pokemon** (array) - A list of Pokémon that have this type. - **moves** (array) - A list of moves that have this type. #### Response Example ```json { "id": 10, "name": "fire", "generation": {"name": "generation-i", "url": "..."}, "damage_relations": { "double_damage_to": [{"name": "grass", "url": "..."}, {"name": "ice", "url": "..."}, {"name": "bug", "url": "..."}, {"name": "steel", "url": "..."}], "half_damage_to": [{"name": "fire", "url": "..."}, {"name": "water", "url": "..."}, {"name": "rock", "url": "..."}, {"name": "dragon", "url": "..."}], "no_damage_to": [], "double_damage_from": [{"name": "water", "url": "..."}, {"name": "ground", "url": "..."}, {"name": "rock", "url": "..."}], "half_damage_from": [{"name": "fire", "url": "..."}, {"name": "grass", "url": "..."}, {"name": "ice", "url": "..."}, {"name": "bug", "url": "..."}, {"name": "steel", "url": "..."}, {"name": "fairy", "url": "..."}], "no_damage_from": [] }, "pokemon": [{"slot": 1, "pokemon": {"name": "charmander", "url": "..."}}], "moves": [{"name": "ember", "url": "..."}, {"name": "flamethrower", "url": "..."}] } ``` ``` -------------------------------- ### Get Pokémon by Name or ID Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve detailed information for a specific Pokémon using its name or ID. The response includes stats, abilities, types, moves, and sprites. ```bash curl "https://pokeapi.co/api/v2/pokemon/pikachu" ``` ```bash curl "https://pokeapi.co/api/v2/pokemon/25" ``` -------------------------------- ### Get Pokémon API Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve detailed information about a specific Pokémon including stats, abilities, types, moves, and sprites. You can fetch Pokémon by their name or ID. ```APIDOC ## Get Pokémon API ### Description Retrieve detailed information about a specific Pokémon including stats, abilities, types, moves, and sprites. ### Method GET ### Endpoint `/api/v2/pokemon/{name_or_id}` ### Parameters #### Path Parameters - **name_or_id** (string or integer) - Required - The name or ID of the Pokémon. ### Request Example ```bash # Get Pokémon by name curl "https://pokeapi.co/api/v2/pokemon/pikachu" # Get Pokémon by ID curl "https://pokeapi.co/api/v2/pokemon/25" ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the Pokémon. - **name** (string) - The name of the Pokémon. - **height** (integer) - The height of the Pokémon in decimetres. - **weight** (integer) - The weight of the Pokémon in hectograms. - **base_experience** (integer) - The base experience gained when defeating the Pokémon. - **types** (array) - A list of types associated with the Pokémon. - **slot** (integer) - The order of the type. - **type** (object) - Information about the type. - **name** (string) - The name of the type. - **url** (string) - The URL for the type resource. - **abilities** (array) - A list of abilities the Pokémon possesses. - **ability** (object) - Information about the ability. - **name** (string) - The name of the ability. - **url** (string) - The URL for the ability resource. - **is_hidden** (boolean) - Whether the ability is hidden. - **slot** (integer) - The slot the ability occupies. - **stats** (array) - A list of base stats for the Pokémon. - **base_stat** (integer) - The base value of the stat. - **effort** (integer) - The effort value gained when defeating the Pokémon with this stat. - **stat** (object) - Information about the stat. - **name** (string) - The name of the stat. - **url** (string) - The URL for the stat resource. - **sprites** (object) - URLs for various sprites of the Pokémon. - **front_default** (string) - URL for the default front sprite. - **front_shiny** (string) - URL for the shiny front sprite. - **back_default** (string) - URL for the default back sprite. - **other** (object) - Other sprite categories. - **official-artwork** (object) - Official artwork sprites. - **front_default** (string) - URL for the default official artwork sprite. - **moves** (array) - A list of moves the Pokémon can learn. - **move** (object) - Information about the move. - **name** (string) - The name of the move. - **url** (string) - The URL for the move resource. - **version_group_details** (array) - Details about when the move can be learned. - **cries** (object) - URLs for the Pokémon's cries. - **latest** (string) - URL for the latest cry. - **legacy** (string) - URL for the legacy cry. ### Response Example ```json { "id": 25, "name": "pikachu", "height": 4, "weight": 60, "base_experience": 112, "types": [ {"slot": 1, "type": {"name": "electric", "url": "..."}} ], "abilities": [ {"ability": {"name": "static", "url": "..."}, "is_hidden": false, "slot": 1}, {"ability": {"name": "lightning-rod", "url": "..."}, "is_hidden": true, "slot": 3} ], "stats": [ {"base_stat": 35, "effort": 0, "stat": {"name": "hp", "url": "..."}}, {"base_stat": 55, "effort": 0, "stat": {"name": "attack", "url": "..."}}, {"base_stat": 40, "effort": 0, "stat": {"name": "defense", "url": "..."}}, {"base_stat": 50, "effort": 0, "stat": {"name": "special-attack", "url": "..."}}, {"base_stat": 50, "effort": 0, "stat": {"name": "special-defense", "url": "..."}}, {"base_stat": 90, "effort": 2, "stat": {"name": "speed", "url": "..."}} ], "sprites": { "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/25.png", "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/25.png", "back_default": "...", "other": { "official-artwork": {"front_default": "..."} } }, "moves": [{"move": {"name": "mega-punch", "url": "..."}, "version_group_details": []}], "cries": { "latest": "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/25.ogg", "legacy": "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/25.ogg" } } ``` ``` -------------------------------- ### Get Pokémon Species API Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Retrieve species-level data including evolution chains, flavor text, egg groups, and habitat information. You can fetch species by their name or ID. ```APIDOC ## Get Pokémon Species API ### Description Retrieve species-level data including evolution chains, flavor text, egg groups, and habitat information. ### Method GET ### Endpoint `/api/v2/pokemon-species/{name_or_id}` ### Parameters #### Path Parameters - **name_or_id** (string or integer) - Required - The name or ID of the Pokémon species. ### Request Example ```bash # Get species by name curl "https://pokeapi.co/api/v2/pokemon-species/charizard" # Get species by ID curl "https://pokeapi.co/api/v2/pokemon-species/6" ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the Pokémon species. - **name** (string) - The name of the Pokémon species. - **is_legendary** (boolean) - Whether the Pokémon is legendary. - **is_mythical** (boolean) - Whether the Pokémon is mythical. - **is_baby** (boolean) - Whether the Pokémon is a baby Pokémon. - **gender_rate** (integer) - The ratio of males to females in the species. - **capture_rate** (integer) - The base capture rate of the Pokémon. - **base_happiness** (integer) - The base happiness stat of the Pokémon. - **hatch_counter** (integer) - The number of steps required to hatch an egg of this species. - **evolution_chain** (object) - Information about the evolution chain. - **url** (string) - The URL for the evolution chain resource. - **evolves_from_species** (object) - The species this Pokémon evolves from. - **name** (string) - The name of the species it evolves from. - **url** (string) - The URL for the species resource. - **egg_groups** (array) - A list of egg groups the species belongs to. - **name** (string) - The name of the egg group. - **url** (string) - The URL for the egg group resource. - **color** (object) - The color associated with the Pokémon species. - **name** (string) - The name of the color. - **url** (string) - The URL for the color resource. - **shape** (object) - The shape associated with the Pokémon species. - **name** (string) - The name of the shape. - **url** (string) - The URL for the shape resource. - **habitat** (object) - The habitat where the Pokémon species is typically found. - **name** (string) - The name of the habitat. - **url** (string) - The URL for the habitat resource. - **generation** (object) - The generation the Pokémon species belongs to. - **name** (string) - The name of the generation. - **url** (string) - The URL for the generation resource. - **flavor_text_entries** (array) - A list of flavor text entries for the species. - **flavor_text** (string) - The flavor text. - **language** (object) - Information about the language of the flavor text. - **name** (string) - The name of the language. - **url** (string) - The URL for the language resource. - **version** (object) - The game version the flavor text is from. - **name** (string) - The name of the version. - **url** (string) - The URL for the version resource. - **varieties** (array) - A list of different forms or varieties of the Pokémon species. - **is_default** (boolean) - Whether this variety is the default form. - **pokemon** (object) - Information about the Pokémon form. - **name** (string) - The name of the Pokémon form. - **url** (string) - The URL for the Pokémon form resource. ### Response Example ```json { "id": 6, "name": "charizard", "is_legendary": false, "is_mythical": false, "is_baby": false, "gender_rate": 1, "capture_rate": 45, "base_happiness": 50, "hatch_counter": 20, "evolution_chain": {"url": "https://pokeapi.co/api/v2/evolution-chain/2/"}, "evolves_from_species": {"name": "charmeleon", "url": "..."}, "egg_groups": [{"name": "monster", "url": "..."}, {"name": "dragon", "url": "..."}], "color": {"name": "red", "url": "..."}, "shape": {"name": "upright", "url": "..."}, "habitat": {"name": "mountain", "url": "..."}, "generation": {"name": "generation-i", "url": "..."}, "flavor_text_entries": [ {"flavor_text": "Spits fire that is hot enough to melt boulders...", "language": {"name": "en", "url": "..."}, "version": {"name": "red", "url": "..."}} ], "varieties": [ {"is_default": true, "pokemon": {"name": "charizard", "url": "..."}}, {"is_default": false, "pokemon": {"name": "charizard-mega-x", "url": "..."}}, {"is_default": false, "pokemon": {"name": "charizard-mega-y", "url": "..."}} ] } ``` ``` -------------------------------- ### Build and Serve Production Site Source: https://github.com/pokeapi/pokeapi.co/blob/master/README.md Commands to generate production files and serve them locally. ```bash npm run build ``` ```bash npm run serve ``` -------------------------------- ### Retrieve Game Version Data Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Fetch specific game version or version group details. ```bash curl "https://pokeapi.co/api/v2/version/red" ``` ```bash curl "https://pokeapi.co/api/v2/version-group/red-blue" ``` -------------------------------- ### JavaScript PokeAPI Wrapper Usage Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Demonstrates fetching Pokémon details, evolution chains, and type matchups using the pokeapi-js-wrapper library. ```javascript // Install: npm install pokeapi-js-wrapper const Pokedex = require('pokeapi-js-wrapper'); const P = new Pokedex.Pokedex(); // Get a single Pokémon async function getPokemon() { const pokemon = await P.getPokemonByName('pikachu'); console.log(pokemon.name); // "pikachu" console.log(pokemon.types[0].type.name); // "electric" console.log(pokemon.stats); // Array of base stats // Get multiple Pokémon const starters = await P.getPokemonByName(['bulbasaur', 'charmander', 'squirtle']); starters.forEach(p => console.log(p.name)); } // Get evolution chain async function getEvolution() { const species = await P.getPokemonSpeciesByName('eevee'); const chainUrl = species.evolution_chain.url; const chainId = chainUrl.split('/').filter(Boolean).pop(); const chain = await P.getEvolutionChainById(chainId); console.log(chain.chain.evolves_to.length); // Eevee has many evolutions! } // Get type effectiveness async function getTypeMatchup() { const fireType = await P.getTypeByName('fire'); console.log('Super effective against:', fireType.damage_relations.double_damage_to.map(t => t.name)); console.log('Weak to:', fireType.damage_relations.double_damage_from.map(t => t.name)); } ``` -------------------------------- ### Retrieve Berry Data Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Fetch berry details including growth time and flavor profiles using name or ID. ```bash curl "https://pokeapi.co/api/v2/berry/cheri" ``` ```bash curl "https://pokeapi.co/api/v2/berry/1" ``` -------------------------------- ### Python Pokebase Library Usage Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Demonstrates retrieving Pokémon data, species information, evolution chains, and type effectiveness using the pokebase library. ```python # Install: pip install pokebase import pokebase as pb # Get Pokémon data pokemon = pb.pokemon('charizard') print(f"Name: {pokemon.name}") print(f"Height: {pokemon.height / 10}m") print(f"Weight: {pokemon.weight / 10}kg") print(f"Types: {[t.type.name for t in pokemon.types]}") print(f"Abilities: {[a.ability.name for a in pokemon.abilities]}") # Get base stats for stat in pokemon.stats: print(f"{stat.stat.name}: {stat.base_stat}") # Get species data species = pb.pokemon_species('charizard') print(f"Is Legendary: {species.is_legendary}") print(f"Evolves from: {species.evolves_from_species.name}") # Get English flavor text for entry in species.flavor_text_entries: if entry.language.name == 'en': print(f"Pokédex entry: {entry.flavor_text}") break # Get evolution chain evo_chain = pb.evolution_chain(2) # Charizard family def print_chain(chain, level=0): print(" " * level + chain.species.name) for evolution in chain.evolves_to: print_chain(evolution, level + 1) print_chain(evo_chain.chain) # Output: # charmander # charmeleon # charizard # Get type effectiveness fire_type = pb.type_('fire') print("Super effective against:", [t.name for t in fire_type.damage_relations.double_damage_to]) ``` -------------------------------- ### Retrieve Generation Data Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Fetch generation details including introduced Pokémon, moves, and types. ```bash curl "https://pokeapi.co/api/v2/generation/generation-i" ``` -------------------------------- ### Retrieve Item Data Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Fetch item details using either the item name or its unique ID. ```bash curl "https://pokeapi.co/api/v2/item/master-ball" ``` ```bash curl "https://pokeapi.co/api/v2/item/1" ``` -------------------------------- ### Git Workflow Commands Source: https://github.com/pokeapi/pokeapi.co/blob/master/README.md Standard commands for managing repository remotes, branches, and commits. ```bash git remote add upstream https://github.com/PokeAPI/pokeapi.co ``` ```bash git pull upstream master ``` ```bash git checkout -b branch-name ``` ```bash git add -A ``` ```bash git commit -m "My message" ``` ```bash git push my-fork-name branch-name ``` -------------------------------- ### Retrieve Nature Data Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Fetch nature details including stat modifications. ```bash curl "https://pokeapi.co/api/v2/nature/adamant" ``` -------------------------------- ### Retrieve Location Data Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Fetch location and location-area details to view encounter information. ```bash curl "https://pokeapi.co/api/v2/location/canalave-city" ``` ```bash curl "https://pokeapi.co/api/v2/location-area/canalave-city-area" ``` -------------------------------- ### Retrieve Pokédex Data Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Fetch Pokédex entries and metadata. ```bash curl "https://pokeapi.co/api/v2/pokedex/national" ``` -------------------------------- ### Retrieve Region Data Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Fetch region details including associated locations and generations. ```bash curl "https://pokeapi.co/api/v2/region/kanto" ``` -------------------------------- ### Resource Lists API Source: https://context7.com/pokeapi/pokeapi.co/llms.txt Paginated list endpoints return all available resources with pagination support. You can customize the number of items per page and the offset. ```APIDOC ## Resource Lists API ### Description Paginated list endpoints return all available resources with pagination support. ### Method GET ### Endpoint `/api/v2/{resource}/` ### Query Parameters - **limit** (integer) - Optional - The maximum number of resources to return per page. - **offset** (integer) - Optional - The number of resources to skip before starting to collect the result set. ### Request Example ```bash # Get a paginated list of all Pokémon (default: 20 per page) curl "https://pokeapi.co/api/v2/pokemon/" # Custom pagination curl "https://pokeapi.co/api/v2/pokemon/?limit=100&offset=0" # Get all abilities with pagination curl "https://pokeapi.co/api/v2/ability/?limit=50" ``` ### Response #### Success Response (200) - **count** (integer) - The total number of resources available. - **next** (string) - URL for the next page of results. - **previous** (string) - URL for the previous page of results. - **results** (array) - A list of resources, each with a name and URL. - **name** (string) - The name of the resource. - **url** (string) - The URL to retrieve detailed information about the resource. ### Response Example ```json { "count": 1302, "next": "https://pokeapi.co/api/v2/pokemon/?offset=20&limit=20", "previous": null, "results": [ {"name": "bulbasaur", "url": "https://pokeapi.co/api/v2/pokemon/1/"}, {"name": "ivysaur", "url": "https://pokeapi.co/api/v2/pokemon/2/"} ] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.