Simple cryptocurrency price fetching from 10 top exchanges
Project description
btc2
Simple cryptocurrency price fetching from 10 top exchanges.
Install
pip install btc2
Quick Start
import btc2
# Print price (no parentheses needed for print)
print(btc2.btc) # → 67432.50
print(btc2.eth) # → 2378.92
print(btc2.btc.all) # → {"binance": 67432.50, ...}
# Get price as number (use parentheses)
btc2.btc() # → 67432.50
btc2.btc.binance() # → 67432.50
btc2.btc.binance.fut() # → 67450.00
# For calculations
price = float(btc2.btc) # → 67432.50
Alternative import
from btc2 import btc, eth
print(btc) # → 67432.50
btc() # → 67432.50
Supported Coins
- btc, bitcoin → BTC
- eth, ethereum → ETH
- sol, solana → SOL
- xrp, ripple → XRP
- ada, cardano → ADA
- doge, dogecoin → DOGE
- dot, polkadot → DOT
- avax, avalanche → AVAX
- link, chainlink → LINK
- matic, polygon → MATIC
- shib, shiba → SHIB
- ltc, litecoin → LTC
- trx, tron → TRX
- uni, uniswap → UNI
- atom, cosmos → ATOM
- xlm, stellar → XLM
- bch, bitcoin-cash → BCH
- etc, ethereum-classic → ETC
- fil, filecoin → FIL
- apt, aptos → APT
- arb, arbitrum → ARB
- op, optimism → OP
- near, near-protocol → NEAR
- sui, sui-network → SUI
- pepe, pepecoin → PEPE
- ton, toncoin → TON
- inj, injective → INJ
- rndr, render → RNDR
- imx, immutable → IMX
- vet, vechain → VET
- algo, algorand → ALGO
- ftm, fantom → FTM
- sand, sandbox → SAND
- mana, decentraland → MANA
- axs, axie → AXS
- gala, galaxy → GALA
And more (top 50+ coins supported)
Supported Exchanges
- binance
- bybit
- okx
- coinbase
- kraken
- kucoin
- gate
- bitget
- huobi
- mexc
API Reference
| Syntax | Description |
|---|---|
btc.binance |
BTC on Binance spot (default) |
btc.binance.spot |
BTC on Binance spot |
btc.binance.fut |
BTC on Binance futures |
eth.bybit |
ETH on Bybit spot |
btc.all |
BTC price from all exchanges (spot) |
btc.all.fut |
BTC futures from all exchanges |
btc() |
Same as btc.all |
Notes
- All prices are fetched asynchronously in parallel for speed
- Results are cached for 1 second to avoid rate limiting
- If an exchange is unavailable, it will be skipped in results
- Futures are supported on: binance, bybit, okx, kucoin, gate, bitget, mexc
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
btc2-0.2.0.tar.gz
(8.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
btc2-0.2.0-py3-none-any.whl
(7.1 kB
view details)
File details
Details for the file btc2-0.2.0.tar.gz.
File metadata
- Download URL: btc2-0.2.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb7a9e3c91b73303efbaa55fc3e92756e763e1b1ed39d9aa28409d43177ea432
|
|
| MD5 |
1cd5e654aeba1c90d02e25a5ec9a3514
|
|
| BLAKE2b-256 |
73ba10bca0aeecd7271d2e09c1d0f9792043a8f30d806df5a290a921a5a3f974
|
File details
Details for the file btc2-0.2.0-py3-none-any.whl.
File metadata
- Download URL: btc2-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
462c8736ae094e6b067627251d7bf8c4e33a083ade06c0d246b5e0cddd9d57f3
|
|
| MD5 |
73df189bd18136ecdb183cb1e652a71f
|
|
| BLAKE2b-256 |
72ec3573e9571dafb6b06b6986c9d744474116f2e9c1a1d8230a014930237e3c
|