fetch('https://dummyapi.online/api/pokemon') .then((response) => response.json()) .then((json) => console.log(json));
import requestsimport json response = requests.get('https://dummyapi.online/api/pokemon')if response.status_code == 200: data = json.loads(response.text) print(data)
[ { "id": 1, "pokemon": "Bulbasaur", "type": "Grass", "abilities": ["Overgrow"], "hitpoints": 45, "evolutions": ["Ivysaur", "Venusaur"], "location": "Kanto region, Route 2", "image_url": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png" }, { "id": 2, "pokemon": "Charmander", "type": "Fire", "abilities": ["Blaze"], "hitpoints": 39, "evolutions": ["Charmeleon", "Charizard"], "location": "Kanto region, Route 24", "image_url": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/4.png" }, ...]
Getting a single Pokemon by ID. In this example, we use the /api/pokemon/1 route.
/api/pokemon/1
fetch('https://dummyapi.online/api/pokemon/1') .then((response) => response.json()) .then((json) => console.log(json));
import requestsimport json response = requests.get('https://dummyapi.online/api/pokemon/1')if response.status_code == 200: data = json.loads(response.text) print(data)
{ "id": 1, "pokemon": "Bulbasaur", "type": "Grass", "abilities": ["Overgrow"], "hitpoints": 45, "evolutions": ["Ivysaur", "Venusaur"], "location": "Kanto region, Route 2", "image_url": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png"}
To view all available Pokemon, you can open the Pokemon Endpoint in your browser.