Request API data using Python in 8 minutes! ↩️

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ต.ค. 2024

ความคิดเห็น • 35

  • @BroCodez
    @BroCodez  3 หลายเดือนก่อน +8

    # 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"]}")

    • @acexpanda09
      @acexpanda09 8 วันที่ผ่านมา

      Do request. Status_code is in built? Only the status_code

  • @yourkidelias
    @yourkidelias 4 วันที่ผ่านมา

    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 ^^.

  • @sohailali3274
    @sohailali3274 3 หลายเดือนก่อน +7

    THIS IS EXACTLY WHAT I NEEDED, THANK YOU SO MUCH MAN

  • @andredubbs4854
    @andredubbs4854 3 หลายเดือนก่อน +1

    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

  • @GigelBosket
    @GigelBosket 3 หลายเดือนก่อน +4

    Bro , you have the best programming tutorials!

  • @courtneycurtis
    @courtneycurtis 19 วันที่ผ่านมา

    Really fun tutorial, thank you!

  • @HassanFakhry-x5x
    @HassanFakhry-x5x 3 หลายเดือนก่อน +3

    I keep atleast one video at a time of yours on in the background at all times just to boost the algorithm

  • @szybkafoka69
    @szybkafoka69 3 หลายเดือนก่อน +4

    Nice tutorial,
    I'm waiting for PyGame

  • @freelance-writer
    @freelance-writer 21 วันที่ผ่านมา +3

    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.

  • @materwelone6026
    @materwelone6026 3 หลายเดือนก่อน +18

    i love bro code

  • @israelrios1916
    @israelrios1916 หลายเดือนก่อน

    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 😄

  • @ranataha8500
    @ranataha8500 3 หลายเดือนก่อน +2

    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.

  • @seanmorley2601
    @seanmorley2601 23 วันที่ผ่านมา

    Love it! Any similar videos for oauth2 authentication before we can use api?

  • @jmac2050
    @jmac2050 หลายเดือนก่อน

    height: 0.4m(1'04") , weight: 6.o kg (13.2 lbs)
    pika pkia

  • @johnneisler6552
    @johnneisler6552 3 หลายเดือนก่อน

    Love your channel

  • @Fireman9143
    @Fireman9143 3 หลายเดือนก่อน

    I don't know pokemon. I know when it comes to BroCode videos, gotta catch em all!

  • @digital_down
    @digital_down หลายเดือนก่อน

    … Do a video on creating an API. That would be interesting

  • @SumitRanjanBahalia
    @SumitRanjanBahalia 3 หลายเดือนก่อน

    I'm your big fan sir, can u please start the mern stack development

  • @SanjaySankar-b1t
    @SanjaySankar-b1t 3 หลายเดือนก่อน

    Mr.Bro is every api's arcitecture different ?

  • @andrewanderson9261
    @andrewanderson9261 หลายเดือนก่อน

    Could you please show how to pull the entire list of Pokemon and generate a csv or excel table with specific attributes?

    • @irvinrodriguez931
      @irvinrodriguez931 10 วันที่ผ่านมา +1

      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

  • @BishanTamang-hl3pn
    @BishanTamang-hl3pn 3 หลายเดือนก่อน

    Hello Brother make java with Data Structure and Algorithms course

  • @ahmedashraf4371
    @ahmedashraf4371 3 หลายเดือนก่อน +1

    hmm , i think Mewtwo is my favourite pokemon

  • @mohsenmk2537
    @mohsenmk2537 3 หลายเดือนก่อน +1

    Please teach us api in JavaScript

  • @kedarppopuri2776
    @kedarppopuri2776 3 หลายเดือนก่อน +1

    Bro please me pandas tutorial too

  • @kapibara2440
    @kapibara2440 3 หลายเดือนก่อน

    Greetings from Poland Bro 🎉🎉🎉

  • @darthnihilus777
    @darthnihilus777 24 วันที่ผ่านมา

    Yes Pikachu's height is probably 4 inches

  • @unknownk1992
    @unknownk1992 3 หลายเดือนก่อน

    Day 1 : Asking to walkthrough Rust language

  • @Po7322-6
    @Po7322-6 4 วันที่ผ่านมา

  • @zakariaabdulrauf
    @zakariaabdulrauf 2 หลายเดือนก่อน

    Help mine shows errors

  • @Bobble2520
    @Bobble2520 2 หลายเดือนก่อน

    This is the only bro code vid that failed me :(

  • @user-yackoob
    @user-yackoob 3 หลายเดือนก่อน

    tutorial for django....

  • @okman4300
    @okman4300 20 วันที่ผ่านมา

    thank you so much