I am trying to use the Poke
api to create a quick version of a pokedex. I just want the user to input a pokemons name and return the name of the pokemon they choose, and other small details. I can get my code to print out the entire json
file for the pokemon but not just specific info. I am using Python 3.
My current code looks like this:
import requests
import pprint
def main():
poke_base_uri = "https://pokeapi.co/api/v2/pokemon/"
poke_choice = "pidgey"
pokeresponse = requests.get(f"{poke_base_uri}{poke_choice}/")
# Decode the response
poke = pokeresponse.json()
pprint.pprint(poke)
print("\nGreat Choice you chose:")
for name in poke:
name_info = poke.get(pokemon_species)
print(name_info.json().get('name'))