DEV Community

Nima Akbarzadeh
Nima Akbarzadeh

Posted on • Updated on API Library (TON - Telegram) Library (TON - Telegram)
Last week, I was trying to scrape data from, But I didn't find any Official API. main page
After that, I decided to make my scripts open-source, and then suddenly I asked myself "Why not make a library?"
So, I made an UnOfficial Fragment (Telegram - Ton Coin) Python library, so everyone can easily scrape what he/she needs.
Today's markets use the power of AI and robot traders. Classic trading methods are going to be deprecated as soon as possible.
For making trader robots, firstly you need data from the target's auctions and prices, etc.
This library can help you to grab and scrape what you need.

You can install it easily via Pip python package manager

pip install ton-fragment
Enter fullscreen mode Exit fullscreen mode

Let's see some examples.
For example, you need to get recently listed for-sale numbers
You get fetch this data like that:

from ton_fragment.numbers.numbers import Numbers
all_numbers = Numbers('sale', 'listed')
Enter fullscreen mode Exit fullscreen mode

Or you need to get the status of a username or a number to realize it's still on sale or what's the highest bid price for it or when the auction will end:

from ton_fragment.numbers.number import Number
my_number = Number('8888888')
Enter fullscreen mode Exit fullscreen mode

This library is still under development, and it's a little buggy.
Contributions are welcome and feel free to submit issues and enhancement requests.

Top comments (0)

50 CLI Tools You Can't Live Without

>> Check out this classic DEV post <<