Get ability
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/ability/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/ability/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/ability/1/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/ability/1/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/ability/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/ability/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/ability/1/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/ability/1/Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out 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.
Whether or not this ability originated in the main series of the video games.
The generation this ability originated 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.
The effect of this ability listed in different languages.
object
The localized effect text for an API resource in a specific language.
The localized effect text in brief.
The language this effect is in.
object
The name of the referenced resource.
The URL of the referenced resource.
The list of previous effects this ability has had across version groups.
object
The version group in which the previous effect of this ability originated.
object
The name of the referenced resource.
The URL of the referenced resource.
The previous effect of this ability listed in different languages.
object
The localized effect text for an API resource in a specific language.
The language this effect is in.
object
The name of the referenced resource.
The URL of the referenced resource.
The flavor text of this ability listed in different languages.
object
The localized name for an API resource in a specific language.
The language this text resource is in.
object
The name of the referenced resource.
The URL of the referenced resource.
The version group that uses this flavor text.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of Pokémon that could potentially have this ability.
object
Whether or not this a hidden ability for the referenced Pokémon.
Pokémon have 3 ability ‘slots’ which hold references to possible abilities they could have. This is the slot of this ability for the referenced pokemon.
The Pokémon this ability could belong to.
object
The name of the referenced resource.
The URL of the referenced resource.
Example
{ "id": 1, "name": "stench", "is_main_series": true, "generation": { "name": "generation-iii", "url": "https://pokeapi.co/api/v2/generation/3/" }, "names": [ { "name": "Stench", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } } ], "effect_entries": [ { "effect": "This Pokémon's damaging moves have a 10% chance to make the target flinch with each hit if they do not already cause flinching as a secondary effect.\n\nThis ability does not stack with a held item.\n\nOverworld: The wild encounter rate is halved while this Pokémon is first in the party.", "short_effect": "Has a 10% chance of making target Pokémon flinch with each hit.", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } } ], "effect_changes": [ { "version_group": { "name": "black-white", "url": "https://pokeapi.co/api/v2/version-group/11/" }, "effect_entries": [ { "effect": "Has no effect in battle.", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } } ] } ], "flavor_text_entries": [ { "flavor_text": "Helps repel wild POKéMON.", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" }, "version_group": { "name": "ruby-sapphire", "url": "https://pokeapi.co/api/v2/version-group/5/" } }, { "flavor_text": "Helps repel wild POKéMON.", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" }, "version_group": { "name": "emerald", "url": "https://pokeapi.co/api/v2/version-group/6/" } } ], "pokemon": [ { "is_hidden": true, "slot": 3, "pokemon": { "name": "gloom", "url": "https://pokeapi.co/api/v2/pokemon/44/" } }, { "is_hidden": false, "slot": 1, "pokemon": { "name": "grimer", "url": "https://pokeapi.co/api/v2/pokemon/88/" } } ]}