Get evolution chain
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/evolution-chain/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/evolution-chain/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/evolution-chain/1/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/evolution-chain/1/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/evolution-chain/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/evolution-chain/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/evolution-chain/1/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/evolution-chain/1/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
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 base chain link object. Each link contains evolution details for a Pokémon in the chain. Each link references the next Pokémon in the natural evolution order.
object
Whether or not this link is for a baby Pokémon. This would only ever be true on the base link.
The Pokémon species at this point in the evolution chain.
object
The name of the referenced resource.
The URL of the referenced resource.
All details regarding the specific details of the referenced Pokémon species evolution.
object
The version group in which these evolution requirements apply.
object
The name of the referenced resource.
The URL of the referenced resource.
Whether the evolution is considered as the expected evolution in a main series game. Each unique Pokémon variety of a line capable of evolution should have exactly one ‘default’ evolution. For example, the Meowth species has three default evolutions as there are three distinct varieties it can evolve into: Persian, Alolan Persian, and Perrserker.
The type of event that triggers evolution into this Pokémon species.
object
The name of the referenced resource.
The URL of the referenced resource.
The id of the gender of the evolving Pokémon species must be in order to evolve into this Pokémon species.
The minimum required level of the evolving Pokémon species to evolve into this Pokémon species.
The minimum required level of happiness the evolving Pokémon species to evolve into this Pokémon species.
The minimum required level of beauty the evolving Pokémon species to evolve into this Pokémon species.
The minimum required level of affection the evolving Pokémon species to evolve into this Pokémon species.
Whether or not you need to be near a Moss Rock or Icy Rock to evolve into this Pokémon species.
Whether or not multiplayer link play is needed to evolve into this Pokémon species (e.g. Union Circle).
Whether or not it must be raining in the overworld to cause evolution this Pokémon species.
The player must have a Pokémon of this type in their party during the evolution trigger event in order for the evolving Pokémon species to evolve into this Pokémon species.
object
The name of the referenced resource.
The URL of the referenced resource.
The required relation between the Pokémon’s Attack and Defense stats. 1 means Attack > Defense. 0 means Attack = Defense. -1 means Attack < Defense.
The required time of day. Day or night.
Whether or not the 3DS needs to be turned upside-down as this Pokémon levels up.
The minimum number of times a move must be used in order to evolve into this Pokémon species.
The minimum number of steps that must be taken in order to evolve into this Pokémon species.
The minimum amount of damage taken during the evolution trigger event in order to evolve into this Pokémon species.
The natures that allow this evolution, or null if unrestricted.
object
The name of the referenced resource.
The URL of the referenced resource.
An additional evolution condition expressed in reverse Polish notation, or null if none.
object
Evaluatable RPN condition expression using evolution variables (e.g. ‘EC 100 % 0 ==’)
Percentage chance of evolution under this condition (0-100)
Evolution variables referenced in the expression
object
The name of the referenced resource.
The URL of the referenced resource.
A List of chain objects.
object
Whether or not this link is for a baby Pokémon. This would only ever be true on the base link.
The Pokémon species at this point in the evolution chain.
object
The name of the referenced resource.
The URL of the referenced resource.
All details regarding the specific details of the referenced Pokémon species evolution.
object
The version group in which these evolution requirements apply.
object
The name of the referenced resource.
The URL of the referenced resource.
Whether the evolution is considered as the expected evolution in a main series game. Each unique Pokémon variety of a line capable of evolution should have exactly one ‘default’ evolution. For example, the Meowth species has three default evolutions as there are three distinct varieties it can evolve into: Persian, Alolan Persian, and Perrserker.
The type of event that triggers evolution into this Pokémon species.
object
The name of the referenced resource.
The URL of the referenced resource.
The id of the gender of the evolving Pokémon species must be in order to evolve into this Pokémon species.
The minimum required level of the evolving Pokémon species to evolve into this Pokémon species.
The minimum required level of happiness the evolving Pokémon species to evolve into this Pokémon species.
The minimum required level of beauty the evolving Pokémon species to evolve into this Pokémon species.
The minimum required level of affection the evolving Pokémon species to evolve into this Pokémon species.
Whether or not you need to be near a Moss Rock or Icy Rock to evolve into this Pokémon species.
Whether or not multiplayer link play is needed to evolve into this Pokémon species (e.g. Union Circle).
Whether or not it must be raining in the overworld to cause evolution this Pokémon species.
The player must have a Pokémon of this type in their party during the evolution trigger event in order for the evolving Pokémon species to evolve into this Pokémon species.
object
The name of the referenced resource.
The URL of the referenced resource.
The required relation between the Pokémon’s Attack and Defense stats. 1 means Attack > Defense. 0 means Attack = Defense. -1 means Attack < Defense.
The required time of day. Day or night.
Whether or not the 3DS needs to be turned upside-down as this Pokémon levels up.
The minimum number of times a move must be used in order to evolve into this Pokémon species.
The minimum number of steps that must be taken in order to evolve into this Pokémon species.
The minimum amount of damage taken during the evolution trigger event in order to evolve into this Pokémon species.
The natures that allow this evolution, or null if unrestricted.
object
The name of the referenced resource.
The URL of the referenced resource.
An additional evolution condition expressed in reverse Polish notation, or null if none.
object
Evaluatable RPN condition expression using evolution variables (e.g. ‘EC 100 % 0 ==’)
Percentage chance of evolution under this condition (0-100)
Evolution variables referenced in the expression
object
The name of the referenced resource.
The URL of the referenced resource.
Example
{ "id": 1, "baby_trigger_item": null, "chain": { "is_baby": false, "species": { "name": "bulbasaur", "url": "https://pokeapi.co/api/v2/pokemon-species/1/" }, "evolution_details": [], "evolves_to": [ { "is_baby": false, "species": { "name": "ivysaur", "url": "https://pokeapi.co/api/v2/pokemon-species/2/" }, "evolution_details": [ { "version_group": { "name": "red-blue", "url": "https://pokeapi.co/api/v2/version-group/1/" }, "is_default": true, "item": null, "trigger": { "name": "level-up", "url": "https://pokeapi.co/api/v2/evolution-trigger/1/" }, "gender": null, "held_item": null, "known_move": null, "known_move_type": null, "location": null, "min_level": 16, "min_happiness": null, "min_beauty": null, "min_affection": null, "near_special_rock": false, "needs_multiplayer": false, "needs_overworld_rain": false, "party_species": null, "party_type": null, "relative_physical_stats": null, "time_of_day": "", "trade_species": null, "turn_upside_down": false, "region": null, "required_pokemon_form": null, "evolved_pokemon_form": null, "used_move": null, "min_move_count": null, "min_steps": null, "min_damage_taken": null, "allowed_natures": null, "condition_expression": null } ], "evolves_to": [ { "is_baby": false, "species": { "name": "venusaur", "url": "https://pokeapi.co/api/v2/pokemon-species/3/" }, "evolution_details": [ { "version_group": { "name": "red-blue", "url": "https://pokeapi.co/api/v2/version-group/1/" }, "is_default": true, "item": null, "trigger": { "name": "level-up", "url": "https://pokeapi.co/api/v2/evolution-trigger/1/" }, "gender": null, "held_item": null, "known_move": null, "known_move_type": null, "location": null, "min_level": 32, "min_happiness": null, "min_beauty": null, "min_affection": null, "near_special_rock": false, "needs_multiplayer": false, "needs_overworld_rain": false, "party_species": null, "party_type": null, "relative_physical_stats": null, "time_of_day": "", "trade_species": null, "turn_upside_down": false, "region": null, "required_pokemon_form": null, "evolved_pokemon_form": null, "used_move": null, "min_move_count": null, "min_steps": null, "min_damage_taken": null, "allowed_natures": null, "condition_expression": null } ], "evolves_to": [] } ] } ] }}