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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

binsearchlookup-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

binsearchlookup-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file binsearchlookup-0.1.1.tar.gz.

File metadata

  • Download URL: binsearchlookup-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.3

File hashes

Hashes for binsearchlookup-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dd5d7249f201efe6b82b1bcfc824075c8488af9980086ce2b39fcbc0e67a937f
MD5 df665ba01d946d81dc108934f918fcee
BLAKE2b-256 0b5f687e6ad698651de91e33e4303b27853313fc16e45a29798cf2167ec586d6

See more details on using hashes here.

File details

Details for the file binsearchlookup-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for binsearchlookup-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0363a5737be7153854513cf21ccf638b925f80d78e2758983125efbabd877cc9
MD5 7c76d7c9f7d3a9e168e83cf4c72b9998
BLAKE2b-256 d06634acc91e7f8935794948e3e69dfef70b7868039e7dbeb10fa46f43e11ebf

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 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