# pokeapi.co/ #How to connect to an API using Python import requests base_url = "pokeapi.co/api/v2/" def get_pokemon_info(name): url = f"{base_url}/pokemon/{name}" response = requests.get(url) if response.status_code == 200: pokemon_data = response.json() return pokemon_data else: print(f"Failed to retrieve data {response.status_code}") pokemon_name = "pikachu" pokemon_info = get_pokemon_info(pokemon_name) if pokemon_info: print(f"Name: {pokemon_info["name"].capitalize()}") print(f"Id: {pokemon_info["id"]}") print(f"Height: {pokemon_info["height"]}") print(f"Weight: {pokemon_info["weight"]}")
@acexpanda092 ай бұрын
Do request. Status_code is in built? Only the status_code
@yourkidelias2 ай бұрын
Yo, I've finished what I needed from your Python 2024 course and I want to say that ur way of explaining these concepts was much better than any other course I could find, and much more quicker! Thank you very much ^^.
@APL3302519 күн бұрын
This was an excellent example of displaying API data, thank you
@sohailali32745 ай бұрын
THIS IS EXACTLY WHAT I NEEDED, THANK YOU SO MUCH MAN
@andredubbs48545 ай бұрын
the king is back! im glad youre making content again man you have no idea how useful and helpful it is! i get that it takes a huge chunk of time and ur not even profiting from it, but its much appreciated
@GigelBosket5 ай бұрын
Bro , you have the best programming tutorials!
@freelance-writer3 ай бұрын
6:49 You've got nested double quotes in the print function, which throws me an error. So it's better to use single quotes inside double quotes.
@szybkafoka695 ай бұрын
Nice tutorial, I'm waiting for PyGame
@sleepingforest2047Ай бұрын
wonderful, simple to explain and easy to understand.
@oliya_bАй бұрын
Thank you a lot! That's exactly what i needed! Thank you a looooot!!!!! 😊😊
@courtneycurtis3 ай бұрын
Really fun tutorial, thank you!
@HassanFakhry-x5x5 ай бұрын
I keep atleast one video at a time of yours on in the background at all times just to boost the algorithm
@materwelone60265 ай бұрын
i love bro code
@winxmondsecure2 ай бұрын
kiss bro code challenges
@wombozombo2 ай бұрын
This helped a lot, thanks!
@ranataha85005 ай бұрын
Brother, I really want to know, with all these skills, at what stage are you in your career? Are you working a job? Do you have your own software house? Or are you in a big tech company? Please tell me so I can get the motivation to learn.
@israelrios19163 ай бұрын
You have an extra slash (/) on the base_url, the output is going to have a double slash. It still works good anyways. Thank you 😄
@cross_guy14 күн бұрын
so helpful, thanks.
@talhaalmamun607324 күн бұрын
Bro, you are the boss
@johnneisler65525 ай бұрын
Love your channel
@seanmorley26013 ай бұрын
Love it! Any similar videos for oauth2 authentication before we can use api?
@notofthematrix10 күн бұрын
very helpful at first I got the 404 error and you didn't explain how to fix it the I realized I made a small yet crucial mistake to no put a / somewhere in the code. Thanks
@Bezxywny2 ай бұрын
Name: Charizard ID: 6 Height: 17 Weight: 905 someone in the comments below explaind units of pikachu "height: 0.4m(1'04") , weight: 6.o kg (13.2 lbs) " so it looks that Charizard is 1.7m tall and weights around 90kg btw pikachu could weight 60kg, I remember that Ash was carrying him on his back xD Bro, thank you for your work :)
@SanjaySankar-b1t5 ай бұрын
Mr.Bro is every api's arcitecture different ?
@jmac20504 ай бұрын
height: 0.4m(1'04") , weight: 6.o kg (13.2 lbs) pika pkia
@kapibara24405 ай бұрын
Greetings from Poland Bro 🎉🎉🎉
@Mr1524780002 ай бұрын
APIkachu, thanks Bro !!!
@أملاكعبدالله-س3ع18 күн бұрын
I want call all data and save in files , without pass parameters how can do that? The api is soap
@kashifrana6798Ай бұрын
How to handle authentication for rest API and using session?
@Fireman91435 ай бұрын
I don't know pokemon. I know when it comes to BroCode videos, gotta catch em all!
@SumitRanjanBahalia5 ай бұрын
I'm your big fan sir, can u please start the mern stack development
@EthanWinters176Ай бұрын
"I will pick my favorite pokemon of Typhlosion"💀
@dhiyanabdurazack5257Ай бұрын
NICE
@digital_down3 ай бұрын
… Do a video on creating an API. That would be interesting
@ahmedashraf43715 ай бұрын
hmm , i think Mewtwo is my favourite pokemon
@mohsenmk25375 ай бұрын
Please teach us api in JavaScript
@joebucket147123 күн бұрын
Is this pycharm ?
@kedarppopuri27765 ай бұрын
Bro please me pandas tutorial too
@BishanTamang-hl3pn5 ай бұрын
Hello Brother make java with Data Structure and Algorithms course
@zakariaabdulrauf4 ай бұрын
Help mine shows errors
@MusaddikulIslam-r7i11 күн бұрын
Me!: gardeviour My bro: arcious
@unknownk19925 ай бұрын
Day 1 : Asking to walkthrough Rust language
@Bobble25204 ай бұрын
This is the only bro code vid that failed me :(
@patrickwheeler7107Ай бұрын
Jiggly Puff errrrr jigglypuff
@darthnihilus7773 ай бұрын
Yes Pikachu's height is probably 4 inches
@andrewanderson92614 ай бұрын
Could you please show how to pull the entire list of Pokemon and generate a csv or excel table with specific attributes?
@irvinrodriguez9312 ай бұрын
not sure if you have gotten your answer to this yet, but look into using pandas, once you have your dictionary from this pokemon api you can use pandas to write into your csv or excel file