Get pokemon form
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/pokemon-form/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-form/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-form/1/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/pokemon-form/1/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/pokemon-form/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-form/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-form/1/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/pokemon-form/1/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
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 forms should be sorted within all forms. Multiple forms may have equal order, in which case they should fall back on sorting by name.
The order in which forms should be sorted within a species’ forms.
True for exactly one form used as the default for each Pokémon.
Whether or not this form can only happen during battle.
Whether or not this form requires mega evolution.
The name of this form.
The Pokémon that can take on this form.
object
The name of the referenced resource.
The URL of the referenced resource.
A set of sprites used to depict this Pokémon form in the game.
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
The version group this Pokémon form was introduced in.
object
The name of the referenced resource.
The URL of the referenced resource.
The form specific form name of this Pokémon form, or empty if the form does not have a specific name.
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.
The form specific full name of this Pokémon form, or empty if the form does not have a specific name.
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 details showing types this Pokémon form has.
object
The order the Pokémon’s types are listed in.
The type the referenced Form has.
object
The name of the referenced resource.
The URL of the referenced resource.
The conditions that trigger this form. Resource names and URLs are included when the trigger requires a resource.
object
The trigger for this form change.
The name of the required item, ability, or move. Only present for a resource-based trigger.
The URL of the required item, ability, or move. Only present for a resource-based trigger.
The required base form. Only present when the trigger specifies one.
object
The name of the referenced resource.
The URL of the referenced resource.
The flavor text of this form listed in different languages and versions.
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.
Example
{ "id": 1, "name": "bulbasaur", "order": 1, "form_order": 1, "is_default": true, "is_battle_only": false, "is_mega": false, "form_name": "", "pokemon": { "name": "bulbasaur", "url": "https://pokeapi.co/api/v2/pokemon/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 }, "version_group": { "name": "red-green-japan", "url": "https://pokeapi.co/api/v2/version-group/28/" }, "form_names": [], "names": [], "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/" } } ], "trigger_conditions": [], "flavor_text_entries": []}