BIN Lookup API in Python: 424242 as JSON

BIN Lookup API in Python: 424242 as JSON

A BIN lookup API in Python posts the first digits of a card and reads brand, type, and country. On BankDataStack that is POST /api/v1/bin/validate with header X-API-Key. Official homepage BIN: 424242.

Starter is $49.99/mo (1,000 then $0.002) with a 7-day trial. There is no live MCP host (DNS for mcp.bankdatastack.com failed 17/9). Docs: bankdatastack.com/docs.

Request: official 424242

curl -X POST "https://www.bankdatastack.com/api/v1/bin/validate" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{{"bin": "424242"}}

Python

import json, os, urllib.request
req = urllib.request.Request(
"https://www.bankdatastack.com/api/v1/bin/validate",
data=json.dumps({"bin": "424242"}).encode(),
headers={"X-API-Key": os.environ["BANKDATA_KEY"], "Content-Type": "application/json"},
)
print(urllib.request.urlopen(req).read().decode())

Response: official homepage sample

{
"status": "success",
"data": {
"bin": "424242",
"valid": true,
"cardBrand": "VISA",
"cardType": "CREDIT",
"countryName": "UNITED KINGDOM",
"countryCode": "GB"
}
}

This is not a “CC checker” and not an authorization. Gate UX on data.valid and cardBrand.

Go live

1. Register — 7-day trial.

2. Copy X-API-Key (not Bearer).

3. POST {"bin":"424242"}.

4. Read data.cardBrand.

Look up BIN 424242 →

Ready to get started?

Get your API key and start validating bank data in minutes.

Get API Key

Related posts