How to Use an API in Python to get Bitcoin's Price Live - Along with other Cryptocurrencies

Поділитися
Вставка

КОМЕНТАРІ • 45

  • @statescustefan1396
    @statescustefan1396 3 роки тому +2

    for x in coins :
    if x['symbol'] == 'BTC':
    print (x['symbol'], x['quote']['USD']['price'])

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

      Yes, he skipped that step. Thanks for the comment.

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

    wow... I can't believe I found someone who explains this in such a way that I can understand it and reproduce it! every other video I've watched always goes out of their way to make the most complicated requests, when all I need is something so basic like obtain 1 or 2 cryptos! Thank you! you made my day!

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

    Clearly passionate about the stuff u do man. Thanks for the tutorial. subbed and smashed like button.

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

    Any advice on how to call BTC price directly rather than pulling through a json of the top x coins?

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

      Found out now, just need to use the url ending in /quotes/latest and call the id, symbol or slug parameter.

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

    Im getting an error called "AttributeError: module 'apikey' has no attribute 'key'" Could you please let me know the fix?

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

      @Everest Galbraith im in the same problem

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

    I FINALLY UNDERSTAND APIS

  • @RP_SVN9
    @RP_SVN9 3 роки тому +2

    Thanks for this video! I'm a complete novice and was hoping you could give me some help. When I run the code I get an error, coins = json['data']
    KeyError: 'data'
    Any guidance on getting around this would be appreciated

  • @yanju6439
    @yanju6439 3 роки тому +2

    Thank you! Simple and awesome

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

    This is amazing. Thanks. Is there a way I can use this to update a Table in Notion.

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

    what version of python are you using?

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

    if I try to run this in a loop it will only return the price of a currency at the point in which I ran the code, I am using scheduler to use schedule.run.every.... ext, however whenever it runs every 5 minutes the the only value returned is the price when I first ran the code, it never updates or changes. Any ideas?

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

    Hi I have a API key how can i (test ) see my link in the browser? (so that it is the complete loink?

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

    Is it possible to implement this on Django and have real-time charts (1m, 5m, 1d, etc.) like in Tradingview ?

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

    What does this
    for x in coins:
    print(x["symbol"], x["quote"]["CHF"]["price"])
    mean? Im new and I want to know what this "for x in coins" does. What is x? I dont quite understand.

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

      c'est une boucle qui va prendre les informations du fichier json dans chaque "sous dossier"

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

    in the api key file, what is written?

    • @codingunderpressure7818
      @codingunderpressure7818  3 роки тому +2

      Just a variable with the value being my key

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

      @@codingunderpressure7818 thanks for answering, i guessed that and when i run it if it worked hahaha thanks for the video, very useful

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

    can you specify a specific list of crypto instead?

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

    For anyone wondering the free version allows about 1 call every 5min

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

    10,000th view! Thanks for the video :)

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

    How can I make it to send a message everytime the price of BTC change?

  • @2MuchSwag4Wow
    @2MuchSwag4Wow 3 роки тому +3

    Can you please post the code on github?

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

    Thanks for the great video. Is code on Github? If so, where do I find it?

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

    how to get the day change too

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

    BOOM! ;-) It's exactly what I was searching for these days... Very good video and efficient code. Thanks, man!

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

    thanks man, i loved it :)

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

    Amazing. Thank you very much.

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

    That was really helpful, thanks

  • @GurwinderSingh-ol2ku
    @GurwinderSingh-ol2ku 3 роки тому +1

    Could you please share code? I will be thankful for this

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

    brilliant, thank you !

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

    Hi,
    I appreciate the great video.
    However, I am getting an error that python says...
    "AttributeError: module 'apikey' has no attribute 'key'"
    Do you know what might cause the error?
    Thank you,

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

      I fixed it by writting 'X-CMC_PRO_API_KEY' : 'insertYourPersonnalKeyHere',

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

      Make sure you import you "key file" into your "main" file
      #List this on top at the top
      >>> from 'fileThatContainsKey' import 'keyVarName'
      #Atlernative
      >>>from 'fileThatContainsKey' import *
      You can do it how @mikemaster_ has said, however you are giving away your private key in your source code.
      The only reason to keep you key in a separate file is to not expose your private key to anyone.
      Also these files must be placed in the same directory.

  • @ঋতুপর্ণা
    @ঋতুপর্ণা 7 місяців тому

    Thanks a lot🙂

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

    hi , please create a video like this in C# console. thanks in advance

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

    Can you post this on github?

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

    Someone , whats with that apikey file . Somebody explaim

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

    don't chew a gum while recording pls, video itself is amazing tho!

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

    Please work on your voice. It's extra husky in the video causing discomfort while listening. Sound it clear without extra breathing and husky noises we hear usually in Hollywood late night
    romantic movies.

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

    its possible for whatsapp?