Get stat
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/stat/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/stat/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/stat/1/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/stat/1/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/stat/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/stat/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/stat/1/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/stat/1/Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.
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.
ID the games use for this stat.
Whether this stat only exists within a battle.
A detail of moves which affect this stat positively or negatively.
object
A list of moves and how they change the referenced stat.
object
The maximum amount of change to the referenced stat.
The move causing the change.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of moves and how they change the referenced stat.
object
The maximum amount of change to the referenced stat.
The move causing the change.
object
The name of the referenced resource.
The URL of the referenced resource.
A detail of natures which affect this stat positively or negatively.
object
A list of natures and how they change the referenced stat.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of nature sand how they change the referenced stat.
object
The name of the referenced resource.
The URL of the referenced resource.
Items that affect this stat, such as vitamins and battle items.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of characteristics that are set on a Pokémon when its highest base stat is this stat.
object
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": "hp", "game_index": 1, "is_battle_only": false, "affecting_moves": { "increase": [], "decrease": [] }, "affecting_natures": { "increase": [], "decrease": [] }, "affecting_items": [ { "name": "hp-up", "url": "https://pokeapi.co/api/v2/item/45/" } ], "characteristics": [ { "url": "https://pokeapi.co/api/v2/characteristic/1/" }, { "url": "https://pokeapi.co/api/v2/characteristic/7/" } ], "move_damage_class": null, "names": [ { "name": "HP", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } } ]}