Track Ethereum Transactions and Balance Using Python

Поделиться
HTML-код
  • Опубликовано: 7 июн 2024
  • Have you ever wanted to track your Ethereum transactions? Well you've come to the right video! In this video, I am going to show you how to get the balance of any Ethereum account, as well as how to track that balance over time and then make a graph of that using the Etherscan API! I will mention this is not meant for beginner programmers, you're welcome to follow along, but I'm going to assume you are familiar with Python because I'm not going to explain all of the basic syntax. I hope you enjoy and find this video helpful!
    💻Join BackTrace for their virtual game development summit on February 16th from 10am - 5pm EST! hubs.la/Q011RLGz0
    Breakpoint is an open virtual event, free of charge, that provides an opportunity for practitioners in the game development industry to learn from each other, network, share best practices and ideas through technical talks.
    💻 ProgrammingExpert is the best platform to learn how to code and become a software engineer as fast as possible! Check it out here: programmingexpert.io/tim and use code "tim" for a discount!
    📄 Resources 📄
    Etherscan Website: etherscan.io/myapikey
    Etherscan API Docs: docs.etherscan.io/api-endpoin...
    Code In This Video: github.com/techwithtim/Ethere...
    Fix Pip (Windows): • How to Install Pygame ...
    Fix Pip (Mac): www . • How to Install Pygame ...
    ⭐️ Timestamps ⭐️
    00:00 | Ethereum Wallet Tracker
    01:36 | BackTrace Event
    02:30 | Setup & Installation
    05:30 | Understanding Etherscan API
    07:52 | Ethereum Wallet Balance
    19:00 | Ethereum Wallet Transactions
    31:08 | Graphing Wallet Data
    ◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
    👕 Merchandise: teespring.com/stores/tech-wit...
    📸 Instagram: / tech_with_tim
    📱 Twitter: / techwithtimm
    ⭐ Discord: / discord
    📝 LinkedIn: / tim-ruscica-82631b179
    🌎 Website: techwithtim.net
    📂 GitHub: github.com/techwithtim
    🔊 Podcast: anchor.fm/tech-with-tim
    🎬 My RUclips Gear: www.techwithtim.net/gear/
    💵 One-Time Donations: www.paypal.com/donate?hosted_...
    💰 Patreon: / techwithtim
    ◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
    ⭐️ Tags ⭐️
    -Tech With Tim
    -Track Ethereum Transactions
    -Track Ethereum Balance
    -Python
    -Ethereum Wallet Tracker
    ⭐️ Hashtags ⭐️
    #TechWithTim #Python #Ethereum

Комментарии • 74

  • @VideoGrabBag
    @VideoGrabBag 2 года назад +4

    Superb content! You even make it easy for beginners!

  • @vfx7t
    @vfx7t 2 года назад +15

    English is very important, I must studding english first ;))

  • @albertojlorenzorosario2759
    @albertojlorenzorosario2759 2 года назад +2

    Hello from Puerto Rico.
    Great video!
    Can see how powerful doing stuff like this is. Keep it up!

  • @ShivekMaharaj
    @ShivekMaharaj 2 года назад +1

    Congratulations for 900k subscribers Tim! 👌

  • @andrijanamarkovic2990
    @andrijanamarkovic2990 2 года назад +4

    Good stuff. Very well explained. 🤓

  • @massimobuccolieri8532
    @massimobuccolieri8532 Год назад

    Great job, very useful. Thanks for sharing!!!

  • @anthonyschilling7132
    @anthonyschilling7132 2 года назад

    What an awesome tutorial, thank you!

  • @bhalisasodo2369
    @bhalisasodo2369 Год назад

    Great work, Tim!

  • @chriscoote1036
    @chriscoote1036 2 года назад +3

    Great video Tim! for anyone following along at home here is the second address used: address = '0x73bceb1cd57c711feac4224d062b0f6ff338501e'

  • @ryu8777
    @ryu8777 Год назад

    Man you are the greatest! Awesome!

  • @jorgevalencia6651
    @jorgevalencia6651 Год назад

    Awesome video Tim! Do you think you can make one covering Contracts API?

  • @frankjin3832
    @frankjin3832 2 года назад

    Wonderful videos, very helpful! Many thanks. I have one question here. Sometimes the transactions may failed due to many reasons, such as lack of ether to pay gas, etc, but the etherscan still collects them and give them to us. I am trying to eliminate transactions by identifying "isError": 1, since this key pair is involved in both normal transaction lists and internal transaction list. But I am not sure that I can delete all the abnormal transactions by doing this because when I tried this, the result does not match with the balance on etherscan. Do you know how to judge whether the transaction is valid or not?

  • @spyghetti
    @spyghetti 2 года назад +3

    1st off, absolutely love the python and API programming super awesome guide. Second, if that wallet sells we all better dip out quickly.. how to program an API whale wallet sell alarm! aruga aruga aruga.

  • @ryancflam
    @ryancflam 2 года назад +1

    Awesome! I'm adding something like this to my Discord bot

  • @fearzyn
    @fearzyn 2 года назад +1

    Congrats on 900k!

  • @educateyourselfdaily3196
    @educateyourselfdaily3196 2 года назад +3

    Glad to hear about etherium library in python

  • @TheIvanlisi
    @TheIvanlisi Год назад

    Hi Tim. Thank you for the video (Beneficial). I started my own research on a specific wallet address. The sum of the transaction continues after the current balance. I think that you had the same problem, which you solved by taking another address. Do you have any idea how to solve it?

  • @maybelindow3906
    @maybelindow3906 2 года назад +4

    Hey!, It would be really good if you could show us how to use the *Ursina Engine* python for 3d games just like you pygame series!

  • @gloriouz89
    @gloriouz89 2 года назад

    Hi Tim, appreciate your video. Would you be able to throw out some hints how I could get historical data of transactions? This is for a school project, any feedback would be appreciated. :)

  • @lucky4the4turtle
    @lucky4the4turtle 2 года назад +2

    Same process for snowtracer and ftm scanner?

  • @crypto602
    @crypto602 Год назад

    Thanks, if i need to check address from txt list?

  • @technologystalker
    @technologystalker 2 года назад +1

    can anyone tell what language ,plug in , or library to make a website that adds text to images ?

  • @codeWithBala
    @codeWithBala Год назад

    tim i have a doubt why do you add x ="2" in function call while getting the balance of single wallet

  • @jiridofek3079
    @jiridofek3079 2 года назад +3

    Hello Tim, I started with programming 2 months ago and I started with Python. Do you think, that this language is good way these days? Or times changed and there is something new and more powerful?

    • @elvissierra1555
      @elvissierra1555 2 года назад +1

      It is and will continue to be for the foreseeable future, its the best for beginners. There are better languages for specific use cases but its just about getting started and then you'll be ble to understand code in the future.

    • @vansfreshhunta9050
      @vansfreshhunta9050 2 года назад

      Same. Go with Python, learn basics, master that, go on to the advance topics, build projects, continue to learn about other topics, and you'll be fine. Godspeed to you my friend🙏

  • @kintipukintipu3987
    @kintipukintipu3987 2 года назад +1

    Great video ! Thx!
    I hope that make some sense.. 😀

  • @justinknash
    @justinknash Год назад

    Is there a way to do this without relying on the Etherscan abstracition API? e.g. get the data from the raw ledger?

  • @aspiceoflife
    @aspiceoflife Год назад +2

    How to do this for erc-20 token balances and transactions?

  • @jonesbecker3238
    @jonesbecker3238 2 года назад +2

    I get the same graph for the adress you used but when i use this adress for example 0xae4d837caa0c53579f8a156633355df5058b02f3 it goes negative

    • @frankjin3832
      @frankjin3832 2 года назад

      Same thing happen to me, and I am still confused about this. I think it is because not all the transactions are valid. For example, many smart contract cannot afford the gas fee when sending transactions, but etherscan still collects and stores them. Another thing is that when I use the address 0x73bceb1cd57c711feac4224d062b0f6ff338501e, which is the second one in the video, I find that the last few digits of the balance is not equal with that on etherscan. It seems there exists some other issues that we should conclude in doing this calculation. But again, currently I don't know the approach either.

  • @ilaik
    @ilaik 2 года назад +3

    Hi there! very cool video! do you think you could make a tutorial video about DearPyGui? i think it's going to be the most powerful GUI library for python when it's development is done.

  • @user-fe4rv6vc3v
    @user-fe4rv6vc3v 4 месяца назад

    Can you use etherscan with open bullet?

  • @danielsddonan8384
    @danielsddonan8384 6 месяцев назад

    can you get royalty information through etherscan

  • @mihaiilie8539
    @mihaiilie8539 2 года назад +2

    AttributeError: 'str' object has no attribute 'extend'

  • @chikkii1601
    @chikkii1601 2 года назад +1

    First comment 🥳🥳🥳🥳🥳🥳🥳

  • @coolguy7160
    @coolguy7160 2 года назад +2

    I am the first Comment!!!!

    • @TechWithTim
      @TechWithTim  2 года назад

      Yes you are!

    • @coolguy7160
      @coolguy7160 2 года назад

      @@TechWithTim wow I am a big fan and you actually responded! Love the work you do and I hope there are many videos to come out in the future!

  • @ItzGanked
    @ItzGanked 2 года назад

    It would be cool to pipe in the cost of Ethereum at each timestamp to calculate proper cost basis in USD for each tx

    • @ItzGanked
      @ItzGanked 2 года назад

      Looks like it is not included in the free api, only pro, I'm sure you can pipe it in from another source though but wonky

  • @eighteenbitsaday8185
    @eighteenbitsaday8185 2 года назад +1

    Is this only for wallets on main net? or also for addresses in test nets?

  • @Lucek1620
    @Lucek1620 Год назад

    I have two errors in this code. Any idea ?
    "line 71, in get_transactions(address)
    line 39, in get_transactions data.extend(data2) AttributeError: 'str' object has no attribute 'extend'"

    • @kavakkaracalar6228
      @kavakkaracalar6228 Год назад

      u solve ?

    • @jesterthelegend926
      @jesterthelegend926 19 дней назад

      old comment but you can't use .extend() on a string and only on a list (obviously).
      Sounds like some how you assigned data to a value inside the dictionary as everything is a string.
      **Should create the normal transaction url then:**
      response = get(normal_transaction)
      data = response.json()['result']
      **Do the same for internal transactions then:**
      data.extend(data2)
      sorted_data= sorted(data, key=lambda x: int(x['timeStamp']))
      if the wallet does have internal transactions for some reason it always says gasUsed = 0 so you'll need an if else statements to account for it to actually make this work.

  • @olarewajuibijola1549
    @olarewajuibijola1549 2 года назад

    Hi there
    How can I convert it into an Android app

  • @anthonyanalytics
    @anthonyanalytics 2 года назад

    How would you go about putting the data into a pandas dataframe?

    • @TechWithTim
      @TechWithTim  2 года назад +1

      I actually show that In the next video!

    • @anthonyanalytics
      @anthonyanalytics 2 года назад

      @@TechWithTim thank you! I just subbed to your channel, you make really awesome videos! I will check that out right now lol

    • @anthonyanalytics
      @anthonyanalytics 2 года назад

      @@TechWithTim Do you have the link? I am not finding it on the playlists lol

    • @TechWithTim
      @TechWithTim  2 года назад

      @@anthonyanalytics Crap! I thought u were commenting on a different video.... I don't actually show that :/

    • @anthonyanalytics
      @anthonyanalytics 2 года назад

      @@TechWithTim no worries! I’m trying to figure out how to do that haha i think I’m getting close haha

  • @visiblecode5238
    @visiblecode5238 2 года назад +1

    Ok

    • @coolguy7160
      @coolguy7160 2 года назад

      you replied to me right?

  • @user-fe4rv6vc3v
    @user-fe4rv6vc3v 4 месяца назад

    Hello

  • @circlezsquare1626
    @circlezsquare1626 Год назад

    if from_addr.lower() == address.lower() and to.lower() == address.lower():
    current_balance += value - gas
    elif from_addr.lower() != address.lower() and to.lower() == address.lower():
    current_balance += value
    elif from_addr.lower() == address.lower() and to.lower() != address.lower():
    current_balance -= value + gas Is this logic more in line with

  • @absar_ahmad
    @absar_ahmad 2 года назад +1

    Dear Tim, Can I create a Discord bot that can publish these charts on a discord server using this API ?

  • @GolapSk-xw1es
    @GolapSk-xw1es 5 дней назад

    How to track crypto whales using the Etherscan API

  • @rhett2036
    @rhett2036 2 года назад

    ? ???????

  • @mihaiilie8539
    @mihaiilie8539 2 года назад

    to bad the code is bugged

  • @twqwhy6763
    @twqwhy6763 2 года назад +3

    Hope you got payed well to sell your "soul"

  • @techwithkuda8952
    @techwithkuda8952 2 года назад

    I bet you won't pin me

  • @youtubegarbage4u
    @youtubegarbage4u Год назад

    very weird that with over 1 million subs and you still using windows for coding, you can easily buy a mac computer for crying out loud

  • @Frank-rj2te
    @Frank-rj2te 2 года назад +3

    IMPORTANT FOR EVERYONE! IF YOU ARE NOT GETTING THE CORRECT BALANCE READ THIS. Before checking if it’s money in or money out you must check if the transaction did not have an error. You will also want to write out a money_out variable instead of using else. Your code should look like this
    If tx[“isError”] == “0”:
    If moneyin…
    If moneyout…

    • @dusanhajduk7322
      @dusanhajduk7322 Год назад

      Also you cant divide 1e18 before multiplication, because you are losing values in decimal precision. The dividing part should be done at the end of the calculation

    • @oscarlamprecht4758
      @oscarlamprecht4758 Год назад

      Thank you very much, sir. This saved me a lot of time!

  • @lydiapuspita5870
    @lydiapuspita5870 Год назад

    I found some bug here >> because fromtimestamp . I think because I should put in the code first before run it. But, after I get the code and then I run it..I still get a bug :((.
    Is anyone here can help me?

  • @ruggeropiccio9129
    @ruggeropiccio9129 2 года назад +2

    i am a bit of skeptic, but know a lot of aspects about BTC. So, let's make few things straight - BTC is an investment asset - like gold, it's scarce, but it's easier to acquire it and big players like pay-pal and grayscale are holding it, same with a lot of banking institutions, hedge funds and masses of people. ytSelf-host wallet btc owner whales have a hard time selling it without doing KYC and in some cases, this can wreck them financially. People lose access to their btc wallets which makes that btc frozen for all time. The Hype and FOMO is on the rise and most people only buy and hodl with btc. I mean you have to understand that normal stock market fundamentals don't apply here. It's not a 2017 - 2018 scenario. The regulation added to BTC can actually even make it more desirable(although have a minus). Basically, anything that could stop the mooning of btc imo would be extreme regulation restrictions and also better investment opportunities discovered by btc owners. However , it’s is best advice you find a working strategy/daily signals that works well in other to accumulate and grow a very strong portfolio ahead. I have been trading with Mr Mike Lubin daily signals and strategy, him guidance makes trading less stressful and more profit despite the recent fluctuations. I was able to easily increase my portfolio in just 4weeks of trading with Mike Lubin daily signals growing 0.5 BTC to 1.2 BTC. His daily signals are very accurate and yields a great positive return on investment and is available to give assistance to anyone who love crypto trading, you can contact him on Telegram @ LUBfx011 (no added numbers or letters) for inquires and profitable training

    • @zhangcheng5774
      @zhangcheng5774 2 года назад

      I make huge profits on my investment since I started trading with Mrs Carolyn kay, her trading strategies are top notch coupled with the little commission she charges on her trade.

    • @johnedward3947
      @johnedward3947 2 года назад

      lame