Skip to main content

binsearchlookup

Official Python client for the BinSearchLookup API. Look up card BINs/IINs, search the dataset by issuer, brand, category, type or country, batch lookups, and Luhn-validate card numbers.

Requires Python 3.8+. Only dependency is requests.

Install

pip install binsearchlookup

Setup

Get your API key and user ID from your dashboard.

from binsearchlookup import BinSearchLookup

bsl = BinSearchLookup(api_key="...", user_id="...")

Usage

Single lookup

result = bsl.lookup("551029")
print(result["data"]["Issuer"], result["data"]["Brand"], result["data"]["Prepaid"])
print(result["data"]["similarBins"])  # up to 10 other BINs from the same issuer

Batch lookup

Up to 50 BINs per call, still counts as a single request against your quota.

batch = bsl.lookup_batch(["551029", "424242", "400005"])

Search / filter

Filter the dataset by category, issuer, brand, type or country. At least one filter is required. limit is capped by your plan's requests-per-minute if you pass a higher number or omit it.

results = bsl.search(issuer="LEWIS & CLARK BANK", limit=50)
prepaid_cards = bsl.search(category="PREPAID", country="US")

Card validation

Luhn and length checks, enriched with BIN data. The full card number is never logged or stored server-side, only the first 8 digits go into your request history.

check = bsl.validate("4111111111111111")
print(check["valid"], check["data"])

Error handling

Every non-2xx response raises BinSearchLookupError with code, status_code, and the raw response body attached.

from binsearchlookup import BinSearchLookup, BinSearchLookupError

try:
    bsl.lookup("123")  # too short
except BinSearchLookupError as err:
    print(err.status_code, err.code, err)

Sandbox / test mode

Build and test against realistic fake data with a fixed key pair. No auth, no rate limit, no effect on your real account or quota.

sandbox = BinSearchLookup(api_key="bsl_" + "a" * 64, user_id="00000000-0000-4000-8000-000000000000")
sandbox.lookup("551029")  # -> {"sandbox": True, "data": {...}}

API reference

Method Endpoint Notes
lookup(bin) GET /lookup Single BIN, 6-8 digits
lookup_batch(bins) POST /lookup/batch Up to 50 BINs, 1 request against quota
search(...) GET /lookup/search category, issuer, brand, type, country, limit
validate(card_number) POST /validate Luhn + length check, BIN-enriched

Full endpoint and field reference: binsearchlookup.com/development/docs

Support

support@binsearchlookup.com

License

MIT

Metadata

Release files for binsearchlookup 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for binsearchlookup 0.1.1
File Size Uploaded
binsearchlookup-0.1.1.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for binsearchlookup 0.1.1
File Interpreter ABI Platform
binsearchlookup-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / binsearchlookup-0.1.1.tar.gz

Download URL binsearchlookup-0.1.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
dd5d7249f201efe6b82b1bcfc824075c8488af9980086ce2b39fcbc0e67a937f
BLAKE2b-256 checksum
How to use checksums
0b5f687e6ad698651de91e33e4303b27853313fc16e45a29798cf2167ec586d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Release files / binsearchlookup-0.1.1-py3-none-any.whl

Download URL binsearchlookup-0.1.1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0363a5737be7153854513cf21ccf638b925f80d78e2758983125efbabd877cc9
BLAKE2b-256 checksum
How to use checksums
d06634acc91e7f8935794948e3e69dfef70b7868039e7dbeb10fa46f43e11ebf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page