Get pokemon
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/pokemon/1/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://pokeapi.co/api/v2/pokemon/1/")) .method("GET", HttpRequest.BodyPublishers.noBody()) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://pokeapi.co/api/v2/pokemon/1/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/pokemon/1/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/pokemon/1/';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use reqwest;
#[tokio::main]pub async fn main() { let url = "https://pokeapi.co/api/v2/pokemon/1/";
let client = reqwest::Client::new(); let response = client.get(url) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request GET \ --url https://pokeapi.co/api/v2/pokemon/1/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/pokemon/1/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
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”This parameter can be a string or an integer.
Examples
1Responses
Section titled “Responses”object
The identifier for this resource.
The name for this resource.
The base experience gained for defeating this Pokémon.
The height of this Pokémon in decimetres.
Set for exactly one Pokémon used as the default for each species.
Order for sorting. Almost national order, except families are grouped together.
The weight of this Pokémon in hectograms.
A list of abilities this Pokémon could potentially have.
object
Whether or not this is a hidden ability.
The slot this ability occupies in this Pokémon species.
The ability the Pokémon may have.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of details showing abilities this pokémon had in previous generations
object
The abilities the referenced pokémon had up to and including the listed generation. If null, the slot was previously empty.
object
Whether or not this is a hidden ability.
The slot this ability occupies in this Pokémon species.
The last generation in which the referenced pokémon had the listed abilities.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of forms this Pokémon can take on.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of game indices relevent to Pokémon item by generation.
object
The internal id of an API resource within game data.
The version relevent to this game index.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of items this Pokémon may be holding when encountered.
object
The item the referenced Pokémon holds.
object
The name of the referenced resource.
The URL of the referenced resource.
The details of the different versions in which the item is held.
object
How often the item is held.
The version in which the item is held.
object
The name of the referenced resource.
The URL of the referenced resource.
A link to a list of location areas, as well as encounter details pertaining to specific versions.
A list of moves along with learn methods and level details pertaining to specific version groups.
object
The move the Pokémon can learn.
object
The name of the referenced resource.
The URL of the referenced resource.
The details of the version in which the Pokémon can learn the move.
object
The minimum level to learn the move.
The method by which the move is learned.
object
The name of the referenced resource.
The URL of the referenced resource.
The version group in which the move is learned.
object
The name of the referenced resource.
The URL of the referenced resource.
Order by which the pokemon will learn the move. A newly learnt move will replace the move with lowest order.
The level at which move styles unlock in Pokémon Legends: Arceus or Plus Moves unlock in Pokémon Legends: Z-A. Null when no natural unlock level is recorded.
The species this Pokémon belongs to.
object
The name of the referenced resource.
The URL of the referenced resource.
A set of sprites used to depict this Pokémon in the game. A visual representation of the various sprites can be found at PokeAPI/sprites
object
The default depiction of this Pokémon from the front in battle.
The shiny depiction of this Pokémon from the front in battle.
The female depiction of this Pokémon from the front in battle.
The shiny female depiction of this Pokémon from the front in battle.
The default depiction of this Pokémon from the back in battle.
The shiny depiction of this Pokémon from the back in battle.
The female depiction of this Pokémon from the back in battle.
The shiny female depiction of this Pokémon from the back in battle.
Additional sprites grouped by source, such as official artwork, HOME, and Showdown. Available keys vary by resource.
object
Pokémon Dream World artwork URLs.
object
The URL of the default Pokémon Dream World front image, or null if unavailable.
The URL of the female Pokémon Dream World front image, or null if unavailable.
Pokémon HOME sprite URLs.
object
The URL of the default Pokémon HOME front image, or null if unavailable.
The URL of the female Pokémon HOME front image, or null if unavailable.
The URL of the shiny Pokémon HOME front image, or null if unavailable.
The URL of the shiny female Pokémon HOME front image, or null if unavailable.
Pokémon Showdown sprite URLs.
object
The URL of the default Pokémon Showdown front image, or null if unavailable.
The URL of the female Pokémon Showdown front image, or null if unavailable.
The URL of the shiny Pokémon Showdown front image, or null if unavailable.
The URL of the shiny female Pokémon Showdown front image, or null if unavailable.
The URL of the default Pokémon Showdown back image, or null if unavailable.
The URL of the female Pokémon Showdown back image, or null if unavailable.
The URL of the shiny Pokémon Showdown back image, or null if unavailable.
The URL of the shiny female Pokémon Showdown back image, or null if unavailable.
Official Pokémon artwork URLs, including shiny artwork and version-specific variants.
object
The URL of the default front official artwork, or null if unavailable.
The URL of the shiny front official artwork, or null if unavailable.
Additional official artwork grouped by version. Available keys vary by resource.
object
object
Sprites grouped by generation and game. Available keys vary by resource.
object
object
A set of cries used to depict this Pokémon in the game. A visual representation of the various cries can be found at PokeAPI/cries
object
The latest depiction of this Pokémon’s cry.
The legacy depiction of this Pokémon’s cry.
A list of base stat values for this Pokémon.
object
The base value of the stat.
The effort points (EV) the Pokémon has in the stat.
The stat the Pokémon has.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of details showing stats this pokémon had in previous generations
object
The last generation in which the referenced pokémon had the listed stats.
object
The name of the referenced resource.
The URL of the referenced resource.
The stat the Pokémon had up to and including the listed generation.
object
The base value of the stat.
The effort points (EV) the Pokémon has in the stat.
The stat the Pokémon has.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of details showing types this Pokémon has.
object
The order the Pokémon’s types are listed in.
The type the referenced Pokémon has.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of details showing types this pokémon had in previous generations
object
The last generation in which the referenced pokémon had the listed types.
object
The name of the referenced resource.
The URL of the referenced resource.
The types the referenced pokémon had up to and including the listed generation.
object
The order the Pokémon’s types are listed in.
The type the referenced Pokémon has.
object
The name of the referenced resource.
The URL of the referenced resource.
Example
{ "id": 1, "name": "bulbasaur", "base_experience": 64, "height": 7, "is_default": true, "order": 1, "weight": 69, "abilities": [ { "is_hidden": false, "slot": 1, "ability": { "name": "overgrow", "url": "https://pokeapi.co/api/v2/ability/65/" } }, { "is_hidden": true, "slot": 3, "ability": { "name": "chlorophyll", "url": "https://pokeapi.co/api/v2/ability/34/" } } ], "past_abilities": [ { "generation": { "name": "generation-iv", "url": "https://pokeapi.co/api/v2/generation/4/" }, "abilities": [ { "is_hidden": true, "slot": 3, "ability": null } ] } ], "forms": [ { "name": "bulbasaur", "url": "https://pokeapi.co/api/v2/pokemon-form/1/" } ], "game_indices": [ { "game_index": 153, "version": { "name": "red", "url": "https://pokeapi.co/api/v2/version/1/" } }, { "game_index": 153, "version": { "name": "blue", "url": "https://pokeapi.co/api/v2/version/2/" } } ], "held_items": [], "location_area_encounters": "https://pokeapi.co/api/v2/pokemon/1/encounters", "moves": [ { "move": { "name": "razor-wind", "url": "https://pokeapi.co/api/v2/move/13/" }, "version_group_details": [ { "level_learned_at": 0, "version_group": { "name": "gold-silver", "url": "https://pokeapi.co/api/v2/version-group/3/" }, "move_learn_method": { "name": "egg", "url": "https://pokeapi.co/api/v2/move-learn-method/2/" }, "order": null, "enhancement_level": null }, { "level_learned_at": 0, "version_group": { "name": "crystal", "url": "https://pokeapi.co/api/v2/version-group/4/" }, "move_learn_method": { "name": "egg", "url": "https://pokeapi.co/api/v2/move-learn-method/2/" }, "order": null, "enhancement_level": null } ] }, { "move": { "name": "swords-dance", "url": "https://pokeapi.co/api/v2/move/14/" }, "version_group_details": [ { "level_learned_at": 0, "version_group": { "name": "red-blue", "url": "https://pokeapi.co/api/v2/version-group/1/" }, "move_learn_method": { "name": "machine", "url": "https://pokeapi.co/api/v2/move-learn-method/4/" }, "order": null, "enhancement_level": null }, { "level_learned_at": 0, "version_group": { "name": "yellow", "url": "https://pokeapi.co/api/v2/version-group/2/" }, "move_learn_method": { "name": "machine", "url": "https://pokeapi.co/api/v2/move-learn-method/4/" }, "order": null, "enhancement_level": null } ] } ], "species": { "name": "bulbasaur", "url": "https://pokeapi.co/api/v2/pokemon-species/1/" }, "sprites": { "other": { "home": { "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/home/shiny/1.png", "front_female": null, "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/home/1.png", "front_shiny_female": null }, "showdown": { "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/showdown/back/shiny/1.gif", "back_female": null, "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/showdown/shiny/1.gif", "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/showdown/back/1.gif", "front_female": null, "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/showdown/1.gif", "back_shiny_female": null, "front_shiny_female": null } }, "versions": { "generation-i": { "yellow": { "back_gbc": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/yellow/back/gbc/1.png", "back_gray": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/yellow/back/gray/1.png", "front_gbc": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/yellow/gbc/1.png", "front_gray": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/yellow/gray/1.png", "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/yellow/back/1.png", "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/yellow/1.png", "back_transparent": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/yellow/transparent/back/1.png", "front_transparent": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/yellow/transparent/1.png", "back_transparent_gray": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/yellow/transparent/back/gray/1.png", "front_transparent_gray": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/yellow/transparent/gray/1.png" }, "red-blue": { "back_gray": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/red-blue/back/gray/1.png", "front_gray": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/red-blue/gray/1.png", "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/red-blue/back/1.png", "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/red-blue/1.png", "back_transparent": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/red-blue/transparent/back/1.png", "front_transparent": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/red-blue/transparent/1.png", "back_transparent_gray": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/red-blue/transparent/back/gray/1.png", "front_transparent_gray": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-i/red-blue/transparent/gray/1.png" } }, "generation-v": { "icons": { "animated": { "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/icons/animated/1.png" }, "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/icons/1.png" }, "black-white": { "animated": { "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/back/shiny/1.gif", "back_female": null, "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/shiny/1.gif", "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/back/1.gif", "front_female": null, "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/1.gif", "back_shiny_female": null, "front_shiny_female": null }, "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/back/shiny/1.png", "back_female": null, "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/shiny/1.png", "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/back/1.png", "front_female": null, "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/1.png", "back_shiny_female": null, "front_shiny_female": null } } }, "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png", "back_female": null, "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png", "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png", "front_female": null, "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png", "back_shiny_female": null, "front_shiny_female": null }, "cries": { "latest": "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/1.ogg", "legacy": "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/1.ogg" }, "stats": [ { "base_stat": 45, "effort": 0, "stat": { "name": "hp", "url": "https://pokeapi.co/api/v2/stat/1/" } }, { "base_stat": 49, "effort": 0, "stat": { "name": "attack", "url": "https://pokeapi.co/api/v2/stat/2/" } } ], "past_stats": [ { "generation": { "name": "generation-i", "url": "https://pokeapi.co/api/v2/generation/1/" }, "stats": [ { "base_stat": 65, "effort": 0, "stat": { "name": "special", "url": "https://pokeapi.co/api/v2/stat/9/" } } ] } ], "types": [ { "slot": 1, "type": { "name": "grass", "url": "https://pokeapi.co/api/v2/type/12/" } }, { "slot": 2, "type": { "name": "poison", "url": "https://pokeapi.co/api/v2/type/4/" } } ], "past_types": []}