High Performance Python Library

The Ultimate BIN Database Solution for Python

Unlock lightning-fast, asynchronous BIN lookups with SmartBinDB. Access comprehensive financial data across 228 countries with a database of 30 million+ records.

228 Countries
30M+ Records
<50ms Response
pip install smartbindb
Features

Built for Modern Applications

Everything you need to integrate powerful BIN lookup capabilities into your Python applications.

Superfast Async

Leverages asyncio for high-performance, non-blocking data retrieval.

Global Coverage

Access BIN data for 228 countries with comprehensive coverage.

Low Memory

Optimized caching for minimal memory usage and blazing speed.

Easy Integration

Seamless compatibility with bots, APIs, and Python scripts.

Flexible Lookups

Search by country, bank name, or specific BIN with limits.

Python 3.9+

Compatible with Python 3.9 and all future versions.

Documentation

Quick Start Guide

Get up and running with SmartBinDB in minutes.

basic_example.py
123456789101112131415161718192021222324252627282930
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())
Ready
Python 3.8+
UTF-8
telegram_bot.py
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
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()
Ready
Pyrogram
UTF-8
Developer

Meet the Creator

The architect behind SmartBinDB library.

Abir Arafat Chawdhury

@ISmartCoder

Passionate developer crafting powerful Python libraries and Telegram bots. Building tools that make developers' lives easier.