Unlock lightning-fast, asynchronous BIN lookups with SmartBinDB. Access comprehensive financial data across 228 countries with a database of 30 million+ records.
pip install smartbindb
Everything you need to integrate powerful BIN lookup capabilities into your Python applications.
Leverages asyncio for high-performance, non-blocking data retrieval.
Access BIN data for 228 countries with comprehensive coverage.
Optimized caching for minimal memory usage and blazing speed.
Seamless compatibility with bots, APIs, and Python scripts.
Search by country, bank name, or specific BIN with limits.
Compatible with Python 3.9 and all future versions.
Get up and running with SmartBinDB in minutes.
import asyncio from smartbindb import SmartBinDB async def main(): smartdb = SmartBinDB() print("What would you like to do?") print("1. BIN lookup") print("2. Bank based search") print("3. Country based search") choice = input("Enter your choice (1, 2, or 3): ") if choice == "1": bin_number = input("Enter BIN number: ") result = await smartdb.get_bin_info(bin_number) print("BIN info:", result) elif choice == "2": bank_name = input("Enter bank name: ") use_limit = input("Use limit? (yes/no): ").lower() limit = None if use_limit == "yes": limit = int(input("Enter limit: ")) result = await smartdb.get_bins_by_bank(bank_name, limit) print("Bank results:", result) elif choice == "3": country_code = input("Enter country code: ").upper() use_limit = input("Use limit? (yes/no): ").lower() limit = None if use_limit == "yes": limit = int(input("Enter limit: ")) result = await smartdb.get_bins_by_country(country_code, limit) print("Country results:", result) else: print("Invalid choice.") if __name__ == "__main__": asyncio.run(main())
import asyncio import json import pycountry from pyrogram import Client, filters from pyrogram.enums import ParseMode from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton from pyrogram.handlers import MessageHandler from smartbindb import SmartBinDB from telegraph import Telegraph def log_error(message): print(f"[ERROR] {message}") COMMAND_PREFIX = ["/", ",", ".", "!", "#"] telegraph = Telegraph() try: telegraph.create_account( short_name="SmartUtilBot", author_name="SmartUtilBot", author_url="https://t.me/TheSmartDevs" ) except Exception as e: log_error(f"Telegraph error: {e}") async def fetch_bins(params, endpoint="country"): try: smartdb = SmartBinDB() bins = [] if endpoint == "country": result = await smartdb.get_bins_by_country( params.get("country", ""), params.get("limit") ) if result.get("status") == "SUCCESS": bins = result.get("data", []) elif endpoint == "bank": result = await smartdb.get_bins_by_bank( params.get("bank", ""), params.get("limit") ) if result.get("status") == "SUCCESS": bins = result.get("data", []) return bins except Exception as e: log_error(f"Fetch error: {e}") return [] def setup_db_handlers(app: Client): app.add_handler(MessageHandler( bindb_handler, filters.command(["bindb"], prefixes=COMMAND_PREFIX) )) if __name__ == "__main__": app = Client( "SmartBinDBBot", api_id=API_ID, api_hash="API_HASH", bot_token="BOT_TOKEN" ) setup_db_handlers(app) app.run()