Get nature
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/nature/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/nature/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/nature/1/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/nature/1/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/nature/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/nature/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/nature/1/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/nature/1/Natures influence how a Pokémon’s stats grow. 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.
A list of Pokéathlon stats this nature effects and how much it effects them.
object
The amount of change.
The stat being affected.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of battle styles and how likely a Pokémon with this nature is to use them in the Battle Palace or Battle Tent.
object
Chance of using the move, in percent, if HP is under one half.
Chance of using the move, in percent, if HP is over one half.
The move battle style.
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.
Example
{ "id": 1, "name": "hardy", "decreased_stat": null, "increased_stat": null, "likes_flavor": null, "hates_flavor": null, "pokeathlon_stat_changes": [ { "max_change": -1, "pokeathlon_stat": { "name": "speed", "url": "https://pokeapi.co/api/v2/pokeathlon-stat/1/" } }, { "max_change": 1, "pokeathlon_stat": { "name": "power", "url": "https://pokeapi.co/api/v2/pokeathlon-stat/2/" } } ], "move_battle_style_preferences": [ { "low_hp_preference": 61, "high_hp_preference": 61, "move_battle_style": { "name": "attack", "url": "https://pokeapi.co/api/v2/move-battle-style/1/" } }, { "low_hp_preference": 7, "high_hp_preference": 7, "move_battle_style": { "name": "defense", "url": "https://pokeapi.co/api/v2/move-battle-style/2/" } } ], "names": [ { "name": "Hardy", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } } ]}