Get pokemon species
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/pokemon-species/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-species/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-species/1/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/pokemon-species/1/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/pokemon-species/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-species/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-species/1/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/pokemon-species/1/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
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 order in which species should be sorted. Based on National Dex order, except families are grouped together and sorted by stage.
The chance of this Pokémon being female, in eighths; or -1 for genderless.
The base capture rate; up to 255. The higher the number, the easier the catch.
The happiness when caught by a normal Pokéball; up to 255. The higher the number, the happier the Pokémon.
Whether or not this is a baby Pokémon.
Whether or not this is a legendary Pokémon.
Whether or not this is a mythical Pokémon.
Initial hatch counter: one must walk Y × (hatch_counter + 1) steps before this Pokémon’s egg hatches, unless utilizing bonuses like Flame Body’s. Y varies per generation. In Generations II, III, and VII, Egg cycles are 256 steps long. In Generation IV, Egg cycles are 255 steps long. In Pokémon Brilliant Diamond and Shining Pearl, Egg cycles are also 255 steps long, but are shorter on special dates. In Generations V and VI, Egg cycles are 257 steps long. In Pokémon Sword and Shield, and in Pokémon Scarlet and Violet, Egg cycles are 128 steps long.
Whether or not this Pokémon has visual gender differences.
Whether or not this Pokémon has multiple forms and can switch between them.
The rate at which this Pokémon species gains levels.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of Pokedexes and the indexes reserved within them for this Pokémon species.
object
The index number within the Pokédex.
The Pokédex the referenced Pokémon species can be found in.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of egg groups this Pokémon species is a member of.
object
The name of the referenced resource.
The URL of the referenced resource.
The color of this Pokémon for Pokédex search.
object
The name of the referenced resource.
The URL of the referenced resource.
The shape of this Pokémon for Pokédex search.
object
The name of the referenced resource.
The URL of the referenced resource.
The evolution chain this Pokémon species is a member of.
object
The URL of the referenced resource.
The generation this Pokémon species was introduced in.
object
The name of the referenced resource.
The URL of the referenced resource.
The name of this resource listed in different languages.
object
The localized name for an API resource in a specific language.
The language this name is in.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of encounters that can be had with this Pokémon species in pal park.
object
The base score given to the player when the referenced Pokémon is caught during a pal park run.
The base rate for encountering the referenced Pokémon in this pal park area.
The pal park area where this encounter happens.
object
The name of the referenced resource.
The URL of the referenced resource.
Descriptions of different forms Pokémon take on within the Pokémon species.
object
The localized description for an API resource in a specific language.
The language this name is in.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of flavor text entries for this Pokémon species.
object
The localized flavor text for an API resource in a specific language. Note that this text is left unprocessed as it is found in game files. This means that it contains special characters that one might want to replace with their visible decodable version. Please check out this issue to find out more.
The language this name is in.
object
The name of the referenced resource.
The URL of the referenced resource.
The game version this flavor text is extracted from.
object
The name of the referenced resource.
The URL of the referenced resource.
The genus of this Pokémon species listed in multiple languages.
object
The localized genus for the referenced Pokémon species
The language this genus is in.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of the Pokémon that exist within this Pokémon species.
object
Whether this variety is the default variety.
The Pokémon variety.
object
The name of the referenced resource.
The URL of the referenced resource.
Example
{ "id": 1, "name": "bulbasaur", "order": 1, "gender_rate": 1, "capture_rate": 45, "base_happiness": 70, "is_baby": false, "is_legendary": false, "is_mythical": false, "hatch_counter": 20, "has_gender_differences": false, "forms_switchable": false, "growth_rate": { "name": "medium-slow", "url": "https://pokeapi.co/api/v2/growth-rate/4/" }, "pokedex_numbers": [ { "entry_number": 1, "pokedex": { "name": "national", "url": "https://pokeapi.co/api/v2/pokedex/1/" } }, { "entry_number": 1, "pokedex": { "name": "kanto", "url": "https://pokeapi.co/api/v2/pokedex/2/" } } ], "egg_groups": [ { "name": "monster", "url": "https://pokeapi.co/api/v2/egg-group/1/" }, { "name": "plant", "url": "https://pokeapi.co/api/v2/egg-group/7/" } ], "color": { "name": "green", "url": "https://pokeapi.co/api/v2/pokemon-color/5/" }, "shape": { "name": "quadruped", "url": "https://pokeapi.co/api/v2/pokemon-shape/8/" }, "evolves_from_species": null, "evolution_chain": { "url": "https://pokeapi.co/api/v2/evolution-chain/1/" }, "habitat": { "name": "grassland", "url": "https://pokeapi.co/api/v2/pokemon-habitat/3/" }, "generation": { "name": "generation-i", "url": "https://pokeapi.co/api/v2/generation/1/" }, "names": [ { "name": "Bulbasaur", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } } ], "pal_park_encounters": [ { "base_score": 50, "rate": 30, "area": { "name": "field", "url": "https://pokeapi.co/api/v2/pal-park-area/2/" } } ], "form_descriptions": [], "flavor_text_entries": [ { "flavor_text": "A strange seed was\nplanted on its\nback at birth.\fThe plant sprouts\nand grows with\nthis POKéMON.", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" }, "version": { "name": "red", "url": "https://pokeapi.co/api/v2/version/1/" } }, { "flavor_text": "A strange seed was\nplanted on its\nback at birth.\fThe plant sprouts\nand grows with\nthis POKéMON.", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" }, "version": { "name": "blue", "url": "https://pokeapi.co/api/v2/version/2/" } } ], "genera": [ { "genus": "Seed Pokémon", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } } ], "varieties": [ { "is_default": true, "pokemon": { "name": "bulbasaur", "url": "https://pokeapi.co/api/v2/pokemon/1/" } } ]}