#🔒 How do I use APIs?

17 messages · Page 1 of 1 (latest)

charred isle
#
import requests

pokemon_name = input("Input the Pokemon's Name : ")
if requests.get(f"https://pokeapi.co/api/v2/pokemon/{pokemon_name.lower()}").status_code == 200:
    print("Successful find.")
else:
    print("Unsuccessful find.")
mossy basaltBOT
#

@charred isle

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

signal marten
#

what happens with that code?

charred isle
#

if the pokemon exists, it says successful find

#

else unsuccessful find

crimson citrus
#

What's your question?

charred isle
#

How can I navigate through an API

#

I find them so confusing

crimson citrus
#

You just need to read about how they are implemented.

#

Then do the thing.

#

@charred isle Do you have a specific question? If not you can close the thread with !close or !solved.

charred isle
#

sorry

#

thanks

#

!close

mossy basaltBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.