Python for API - Learn how to access any API with Python

Поділитися
Вставка
  • Опубліковано 22 сер 2024

КОМЕНТАРІ • 40

  • @DevOpsJourney
    @DevOpsJourney  3 роки тому +8

    What would you like to see a video of next?

    • @vactum0
      @vactum0 2 роки тому

      python webscrapping for normal web pages and js pages in 1 notebook like a cheat sheet
      Thank you

    • @Rafian1924
      @Rafian1924 Рік тому

      God is so merciful.. I found your channel.

    • @Gregor-gz6pg
      @Gregor-gz6pg 10 місяців тому

      Great video, thank you very much.
      It would be great, if you could make a video with pagination, when the number of pages aren't known, just the number of items ("count").

  • @youstars7101
    @youstars7101 3 роки тому +12

    Very underrated channel, your videos are clear and concise, you also teach things well. As someone just starting to learn devops i learn something from every video.
    I imagine a youtube video teaching basic syntax (at least of with python) is pointless, as there are likely 1000's of these. But real world examples of how to use python/other devops tools is great (pretty much this video and others like it). So more of that, idealy more often so we can consume your content faster.

  • @fredrik354
    @fredrik354 3 роки тому +3

    I'm completely new to Python and learnt more from you in 25 minutes than any other guide about working with API's I've read/watched the last couple of days. Straight to the point, practical example and just simply well done! I'm very grateful and I'm subbing in hopes of being taught more in this manner. FYI: You taught me how to handle REST API, I did. I automated a application that now can communicate with our MDM to manage all that stuff that is utterly useless to do manually (compare MDM with Active Directory to verify functional synchronization f.ex.)

    • @DevOpsJourney
      @DevOpsJourney  2 роки тому

      Awesome! Thank you for the great feedback.

  • @soratron1x
    @soratron1x 2 роки тому

    i am a bignner in Python, and probably heard this before, but your way of explaining is making it so easy to understand the concepts, also the touch on using classes instead of functions is an added bonus, which makes this video very important as classes is not something easy to associate and most of the examples of classes in python are very basic... well done and keep the good work coming. hint, changing this line to this will return the price ;-) ['data'][symbol]['quote']['USD']['price']

  • @puneetsharma3402
    @puneetsharma3402 4 місяці тому

    Superb video to start with API❤

  • @boten9672
    @boten9672 2 роки тому

    Great tutorial! I learnt a lot from this vid and i put a like

  • @scotteyfox
    @scotteyfox 2 роки тому

    Fantastic video, this helped very much in my API journey. Thank you!

  • @phamngocthinh7216
    @phamngocthinh7216 2 роки тому +1

    i like this video it's useful for me. Thankyou

  • @CenterlineStudio
    @CenterlineStudio 2 роки тому +1

    I enjoyed this video very much. I am working on creating a price alert for a specific currency on Coin Market Cap and this video got me nearly there. I too am interested in where you go from here. Specifically how do you go about pulling just one piece of data from the API. I want to pull just the price of a chosen currency. So I am interested in a video on how you would pull a specific price for a specific currency and send an alert. Thanks

    • @rain9011
      @rain9011 2 роки тому

      This is exactly what I am thinking let me know as well how is it done

  • @DileepKumarMB
    @DileepKumarMB 2 роки тому +1

    Nice content. Liked it!!!!

  • @Mai_Tai_Meyers
    @Mai_Tai_Meyers Рік тому

    great video! appreciate the instruction!

  • @gabbe2124
    @gabbe2124 2 роки тому

    Very good and clear video. Thank you

  • @rahulswankhade
    @rahulswankhade 2 роки тому +1

    Great information

  • @johannesperez9548
    @johannesperez9548 2 роки тому

    This is great! Thank you!!!

  • @looklook6075
    @looklook6075 5 місяців тому

    Does not work. Where is token defined in the class? I also used self.headers= headers={'Accepts': 'application/json', 'X-CMC_PRO_API_KEY': secrets.API_KEY} and it does not work. Shouldnt we use self.headers= headers={'Accepts': 'application/json', 'X-CMC_PRO_API_KEY': self.token} ? The right half of the self.header part is cropped off the screen. Not able to see

  • @da1gt
    @da1gt 2 роки тому

    Great content man. Amazing actually. I have one observation and question, when you called the getPrice for "BTC" it actually returned the Data that you shown; since i am learning with you :) , i would like to know how would you "dive" into de json object, the dictionaries and the lists in order to get just the price?
    is there another way to find the key "price" directly?
    >>> price: data["data"][0]["quote"]["USD"]["price"]
    Thanks for your passion.

  • @dressedforsucess
    @dressedforsucess 2 роки тому

    Hi thank you for this awesome vid and tutorial.. I tried so many videos and yours is the only one with code that actually worked. I can make the API call and retrieve the data but now I am having issues iterating through the data.. I keep getting errors saying I can't iterate through the data or data object.. TypeError: 'builtin_function_or_method' object is not iterable I have my code setup to accept the crypto ticker as such: user_input = input("Enter the symbol of a cryptocurrency: ")
    user_input = user_input.upper()
    pp(cmc.getPrice([user_input]))
    I am trying to store the user input as an array to use as input later so i can store their crypto as a portfolio. Thank you.

  • @oireddevils
    @oireddevils 2 роки тому

    i got the error of cmc object has no attribute 'url' in the end trying to run the final portion, thank you for all you're doing!!

  • @biaggiogutierrez207
    @biaggiogutierrez207 2 роки тому +1

    i have thsi error:
    En línea: 1 Carácter: 21
    + r = requests.get(url, headers = headers)
    + ~
    Falta un argumento en la lista de parámetros.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingArgument

  • @matejott
    @matejott 3 роки тому +1

    Hi I really appreciate the time you took to present us all this.
    However the code that you wrote only gets value if you use it for some real case (exception would be only for teaching purposes).
    So I would like to know what you would do from here with this code, I mean the same data we can obtain directly from the CMC site in more friendly manner.
    Just a small example of how would you find use for your code.
    Keep up, you are doing the world (and your dedicated followers base) a big service!

    • @DevOpsJourney
      @DevOpsJourney  3 роки тому +4

      Thank you for the comment, sometimes when I'm making these it's hard to see the forest through the trees. Hopefully I can explain it a bit here:
      Basically API's allow you to pull information programmatically. For this particular API, I could pull the price of any cryptocurrency. Let's pretend I am a super smart trader guy that has some super powerful algorithm that can make a lot of money depending on the price of Bitcoin. I could use this API to pull information on the price, and when it hits a certain price, I could use another API to trigger a trade to buy/sell. Then I would get super rich :)

    • @matejott
      @matejott 3 роки тому +1

      @@DevOpsJourney aha I get it
      well if it's not too much to ask and if it is not too complex, maybe a follow up seris showcasing the second part
      Something basic, for ex when price goes above 55k make buy order
      not sure if this would encompass devops topic but in case it checks some of the marks i would appreciate it
      Have a great day!

  • @ernatercero3974
    @ernatercero3974 2 роки тому +1

    I would like to see how to buy and selll criptocurrencies using several APIs from different portals. :-)

  • @RoyalKend
    @RoyalKend 3 роки тому +1

    Are you online at the current moment? I could really use some help...

  • @swampsity4009
    @swampsity4009 Рік тому

    when doiung r.json() i got an error saying {'message': 'Please use HTTPS protocol'}. What should I do?

  • @AMitch-ve1rl
    @AMitch-ve1rl Рік тому

    Could you do a tutorial like this using Pitchbook?

  • @tan778
    @tan778 3 роки тому +1

    I got this error message, despite following every steps in the video. "AttributeError: module 'secrets' has no attribute 'API_KEY'

    • @DevOpsJourney
      @DevOpsJourney  3 роки тому

      You need a secrets.py file in the same directory that has the variable API_KEY with your coin market cap api key assigned to it

    • @Alex-ki3gn
      @Alex-ki3gn 2 роки тому

      @@DevOpsJourney Thank you for this video, I just get crazy with the secrets.py: Could you please write down the code as an example, please:
      secrets.py (same directory):
      'API_KEY': 'Individual API-Key here' or
      API_KEY = 'Individual API-Key here'
      does not work, I got also the same error as the collegue above. Thank you!

    • @Alex-ki3gn
      @Alex-ki3gn 2 роки тому

      ...to make it more clearly:
      I made the following:
      in secrets.py
      API_KEY = 'Individual API-Key here'
      in my other *.py program, same directory:
      import secrets
      ...
      headers = {
      'Accepts': 'application/json',
      'X-CMC_PRO_API_KEY': secrets.API_KEY,
      # 'X-CMC_PRO_API_KEY': 'my individual key', #coin_marketcap_api_key for me
      }
      --> ERROR-message:
      'X-CMC_PRO_API_KEY': secrets.API_KEY,
      AttributeError: module 'secrets' has no attribute 'API_KEY'
      When comment-out with original key, it works fine.
      Thank you in advance.

    • @culturedmilk789
      @culturedmilk789 2 роки тому

      it's the same for me..

  • @arvindchaudhary2903
    @arvindchaudhary2903 2 роки тому

    Hi bro do you have a bot for fastest coinmarketcap listing

  • @channels.mylove8680
    @channels.mylove8680 2 роки тому

    How to get api loop limit?

    • @channels.mylove8680
      @channels.mylove8680 2 роки тому

      HTTP Request Methods Get Fetch time is limited to 1000 limit and data is still available. I will continue to retrieve data from the 1000 limit. What do you use?