Skip to content

Get pokemom habita

GET
/api/v2/pokemon-habitat/{id}/
const url = 'https://pokeapi.co/api/v2/pokemon-habitat/example/';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.

id
required
string

This parameter can be a string or an integer.

Media typeapplication/json
object
id
required
integer
name
required
string
<= 200 characters
names
required
Array<object>
object
name
required
string
<= 200 characters
language
required
object
name
required
string
<= 200 characters
url
required
string format: uri
pokemon_species
required
Array<object>
object
name
required
string
<= 200 characters
url
required
string format: uri
Examplegenerated
Terminal window
{
"name": "example"
}