When a payment workflow receives a card BIN, you may need to identify the card brand or type before deciding how to present or review a transaction. By the end of this guide, you can call the Credit Card Validator - BIN Checker API, read its response in Python, and distinguish a valid BIN from a verified payment.
What a BIN check can tell you
The Credit Card Validator - BIN Checker API checks a Bank Identification Number (BIN), described by the API as the first six digits of a credit card number. Its BIN Checker endpoint returns a validity result along with card and issuer information, including card brand, card type, card level, issuer details, and issuer country fields.
This is useful for payment interfaces, transaction review tools, and finance applications that need to categorize a card before a payment is processed. For example, an application can use the returned card brand and type to label a transaction in a review screen.
A valid BIN is not proof that a particular card is active or that a transaction will be authorized. The response describes the BIN; it should not replace payment authorization or be treated as a guarantee that funds are available.
Getting started on Zyla API Hub
Open the Credit Card Validator - BIN Checker API listing on Zyla API Hub. Create a free account if you do not already have one, then select Subscribe or Start Free Trial when available to get an API key.
Zyla API Hub uses a subscription and quota model, not pay-per-call billing. For a first API, a 7-day trial or 50 requests may be available; check the API page for current access options and pricing. The marketplace contains more than 10,000 public APIs, with one account and API key for accessing subscribed APIs.
Send the key in the Authorization header as Bearer YOUR_API_KEY. Keep the key on your server or in another controlled environment rather than exposing it in client-side code.
Call the BIN Checker endpoint
The available endpoint is BIN Checker. It uses GET and requires the string parameter bin. The documented example uses the six-digit BIN 346350.
Request URL: https://zylalabs.com/api/40/credit-card-validator-bin-checker-api/1885/bin-checker
Replace YOUR_API_KEY with your Zyla API key and run this request:
curl -s -X GET "https://zylalabs.com/api/40/credit-card-validator-bin-checker-api/1885/bin-checker?bin=346350" \
-H "Authorization: Bearer YOUR_API_KEY"
Read the response
The documented response for that request is:
{
"status": 200,
"success": true,
"isValid": true,
"message": "The BIN number is valid.",
"data": {
"bin_iin": "346350",
"card_brand": "AMERICAN EXPRESS",
"card_type": "CREDIT",
"card_level": "------",
"issuer_name_bank": "------",
"issuer_bank_website": "API Only",
"issuer_bank_phone": "API Only",
"iso_country_name": null,
"iso_country_code": null
}
}
Check success and isValid before using the data as a valid BIN result. In this example, data.bin_iin matches the requested BIN, while card_brand is AMERICAN EXPRESS and card_type is CREDIT.
Not every field in this response is a usable value. The country fields are null, the card level and issuer name contain ------, and the issuer website and phone contain API Only. Treat those values as unavailable in this example rather than displaying them as real contact or country information.
Use the same request in Python
This example uses Python’s standard library, so it does not need an additional HTTP package. It checks for transport errors, reads the documented validity fields, and prints the card details used by the integration.
import json
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
url = (
"https://zylalabs.com/api/40/"
"credit-card-validator-bin-checker-api/1885/"
"bin-checker?bin=346350"
)
request = Request(
url,
headers={"Authorization": "Bearer YOUR_API_KEY"},
method="GET",
)
try:
with urlopen(request) as response:
result = json.load(response)
except HTTPError as error:
raise SystemExit(f"BIN lookup failed with HTTP status {error.code}")
except URLError as error:
raise SystemExit(f"BIN lookup could not reach the API: {error.reason}")
except json.JSONDecodeError:
raise SystemExit("BIN lookup returned a response that was not valid JSON")
if result.get("success") is not True:
raise SystemExit("BIN lookup did not report success")
if result.get("isValid") is not True:
raise SystemExit("The BIN was not reported as valid")
data = result.get("data") or {}
print("BIN:", data.get("bin_iin"))
print("Brand:", data.get("card_brand"))
print("Type:", data.get("card_type"))
print("Issuer country:", data.get("iso_country_name"))
For your integration, obtain the BIN from your payment workflow and send it as the bin parameter. Keep it as a string rather than converting it to a number, and check that your input contains the expected six digits before making the request.
The sample handles an HTTP error separately from a response whose success or isValid value is not true. That distinction matters: a request that cannot be completed should not automatically be labeled an invalid card.
Practical finance use cases
Label transactions for review
A transaction review screen can show the returned card_brand and card_type next to a payment record. For the documented BIN, those fields identify an American Express credit card.
Build the display around the fields that are actually present. If an issuer name or country is unavailable, leave it blank or mark it unavailable instead of turning a placeholder into an issuer label.
Check payment form context
A checkout or payment-entry flow can use the first six digits to request BIN information and show the detected brand or type to the user. Make the lookup a supporting signal: the result concerns the BIN, not the rest of the card number, the cardholder, or the outcome of a payment.
Do not send the full card number to this endpoint. Its documented request needs only bin, and the API description defines that value as the first six digits. Because the BIN is passed in the query string, review any application or proxy logging that records request URLs.
Enrich internal finance records
A finance application can attach BIN-level brand and type information to a record for later filtering or manual review. Store the lookup outcome separately from any payment authorization outcome so that a valid BIN is not confused with a successful payment.
If you cache a result to avoid repeating a lookup, decide how long it remains useful for your application and provide a way to refresh it. Account for quota use when choosing whether to look up every record or reuse a recent result; check the listing for current access and pricing rather than assuming a particular limit.
Call the API from an AI agent
Zyla API Hub APIs can also be called from an AI agent through the MCP endpoint. The connection URL is https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY; replace the placeholder with your key in an MCP-compatible client such as Claude Code, Cursor, or Windsurf.
For example, an agent assisting with transaction review can request a BIN check and report the returned brand and type. It should preserve the distinction between an unavailable issuer field, an unsuccessful lookup, and a valid BIN; none of those results establishes whether a payment will be authorized.
The MCP connection URL contains your API key, so treat it as a secret. Avoid pasting a configured URL into shared prompts, logs, or support tickets.
FAQ
What does the BIN Checker endpoint require?
It requires a GET request with the string parameter bin and an Authorization: Bearer YOUR_API_KEY header. The documented example uses 346350.
Does a valid BIN mean a card payment will succeed?
No. isValid reports the BIN validity result; it does not establish that a particular card is active, that funds are available, or that a transaction has been authorized.
What if issuer or country information is missing?
Handle missing or unusable values explicitly. The documented response includes null country fields and placeholder values for some issuer fields, so a successful lookup does not mean every field is ready to display.
Can I use this API from an MCP-compatible agent?
Yes. Configure the Zyla MCP endpoint with your API key in a compatible client, then use the API’s BIN-checking functionality in the agent workflow. Protect the configured connection URL because it includes the key.
Ready to test the lookup? Create a free Zyla API Hub account, then Start 7-day trial on Credit Card Validator - BIN Checker API when available. Check the listing for current access options and pricing, and use your API key with the request above.