You need to verify card details fast, reduce fraudulent attempts, and route payments correctly—all without building a full card intelligence stack. By the end of this article, you’ll be able to validate a credit card’s BIN (first 6 digits) and read back issuer, brand, type, and country signals with the Credit Card Validator - BIN Checker API on Zyla API Hub.
What this API does and when to use it
The Credit Card Validator - BIN Checker API lets you validate a credit card’s BIN (the first six digits) and retrieve structured data points useful for finance and payments workflows. From a single GET request, you can learn whether a BIN is valid and receive data like card brand, card type, level, issuer name (when available), and issuer country signals. Typical uses include:
- Pre-validation in checkout flows to reduce declines later in the transaction lifecycle.
- Routing logic for PSP or acquirer selection by brand or issuer region.
- Risk and fraud scoring pipelines combining BIN intel with geolocation, device, and velocity checks.
- Enrichment on stored payment methods to support customer service or analytics dashboards.
You can browse more finance and payments APIs on Zyla API Hub, which provides one account, one API key, and a subscription model that covers thousands of APIs.
Getting started on Zyla API Hub
To ship your integration this week:
- Open the API listing: Start 7-day trial on Credit Card Validator - BIN Checker API.
- Click Subscribe or Start Free Trial (when available) to get your API key. Zyla uses subscription + quota, not pay-per-call.
- Authenticate requests with the header Authorization: Bearer YOUR_API_KEY.
Access options typically include a 7-day trial or 50 requests for a first API; check the API page for current access options and pricing.
Endpoint reference
The Credit Card Validator - BIN Checker API exposes a single endpoint on Zyla:
-
BIN Checker
Method: GET
URL: https://zylalabs.com/api/40/credit-card-validator-bin-checker-api/1885/bin-checker
Purpose: Validate a credit card based on its first six digits (BIN/IIN) and receive card and issuer details.
Required query parameter:- bin (string, required): The first 6 digits of the card number. Example: 346350
The response indicates whether the BIN is valid and returns associated metadata such as brand, type, level, issuer data, and country information (if available).
Copy-paste cURL you can run now
Replace YOUR_API_KEY with the key from your Zyla dashboard and execute:
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"
Official JSON response example
This is the official example payload for the BIN Checker endpoint. Your actual values will depend on the BIN you query.
{
"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
}
}
Field notes:
- status: HTTP-style status code included in the body.
- success: Boolean indicating request success.
- isValid: Whether the BIN is recognized as valid.
- message: Human-readable status message.
- data.bin_iin: Echoes the BIN you queried.
- data.card_brand: Scheme/network (e.g., AMERICAN EXPRESS, VISA, MASTERCARD).
- data.card_type: CREDIT/DEBIT or similar classification.
- data.card_level: Product level if available (e.g., Platinum). Dashes indicate not provided.
- data.issuer_name_bank / issuer_bank_website / issuer_bank_phone: Issuer metadata when available. “API Only” or dashes indicate availability via API.
- data.iso_country_name / iso_country_code: Country metadata when available; null when not provided.
Same response (compact form)
Here is the same example as a single line for log snapshots or tests:
{"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}}
Python example: query a BIN and branch on result
The following Python snippet calls the endpoint, checks validity, and extracts a few high-value fields for routing or risk decisions.
import requests
API_KEY = "YOUR_API_KEY"
BIN = "346350"
url = "https://zylalabs.com/api/40/credit-card-validator-bin-checker-api/1885/bin-checker"
headers = {
"Authorization": f"Bearer {API_KEY}"
}
params = {"bin": BIN}
resp = requests.get(url, headers=headers, params=params, timeout=10)
resp.raise_for_status()
data = resp.json()
if not data.get("success"):
raise RuntimeError(f"BIN check failed: {data}")
is_valid = data.get("isValid")
message = data.get("message")
card_info = data.get("data", {}) or {}
brand = card_info.get("card_brand")
card_type = card_info.get("card_type")
issuer = card_info.get("issuer_name_bank")
country_code = card_info.get("iso_country_code")
print(f"isValid={is_valid} message={message}")
print(f"brand={brand} type={card_type} issuer={issuer} country={country_code}")
# Example branching:
if is_valid and brand == "AMERICAN EXPRESS":
# Route to a specific acquirer or PSP for Amex
pass
elif is_valid and card_type == "DEBIT":
# Apply different SCA logic or risk weights
pass
else:
# Fallback handling for invalid or unknown BINs
pass
Field mapping you’ll likely use
- data.card_brand → Payment routing, surcharge rules, or UI tweaks (e.g., show brand logo).
- data.card_type → Risk policy differences for credit vs. debit cards.
- data.issuer_name_bank → Customer service tooling or issuer-based routing.
- data.iso_country_code → Region-based compliance, 3DS vs. non-3DS flows, and KYC heuristics.
Many teams persist only a subset of these fields, especially brand, type, and country code, alongside the BIN for later enrichment.
Idempotency, retries, and caching
- Idempotency: GET is safe to retry on transport errors. Add backoff and jitter.
- Caching: BIN metadata changes infrequently. Cache responses by BIN (e.g., 24 hours or your ops policy) to reduce latency and calls.
- Handling nulls: Some fields can be null or masked (e.g., “API Only”). Treat missing values as unknown and avoid brittle assumptions.
- Quotas: Zyla uses subscription + quota. See the API page for your plan’s allocation and current access options.
Real-world finance use cases
- Checkout BIN pre-check: As soon as the customer types six digits, query the API and decide whether to show an Amex-specific CVV hint or a distinct SCA path.
- Acquirer selection: Prefer different acquirers by brand or issuer region to optimize approval rates.
- Fraud defenses: Flag mismatched regions (e.g., BIN country vs. shipping IP country) for step-up verification.
- Customer support: When a payment fails, display the detected brand and issuer based on BIN to speed triage.
Contract example (for tests and mocks)
When writing contract tests, you can assert against this known-good structure to ensure parsers and downstream validators are stable.
{
"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
}
}
Calling the API from AI agents via MCP
You can orchestrate this API inside AI coding environments that support the Model Context Protocol (MCP), such as Claude Code, Cursor, or Windsurf. The Zyla MCP endpoint centralizes access to any API you’ve subscribed to using your Zyla key.
- Endpoint: MCP
- Approach: Configure your MCP-compatible client with the Zyla MCP endpoint and your key. Instruct the agent to perform an HTTP GET to the BIN Checker URL with the Authorization header set to Bearer YOUR_API_KEY and query parameter bin=346350.
- Validation: Parse isValid and data fields from the JSON to branch agent logic (e.g., explain to the developer which acquirer routing to use based on brand).
Because MCP centralizes credentials, you avoid embedding keys in prompts and keep calls consistent across tools.
Operational checklist
- Security: Never log full PANs. You only need the first six digits (BIN) for this API.
- Timeouts: Set reasonable timeouts (e.g., 5–10 seconds). Retry on transient network errors only.
- Observability: Log request ID, BIN, and response summary (status, success, isValid, brand, type). Avoid logging PII beyond BIN where policy requires.
- Resilience: If fields are null, default to conservative flows (e.g., require 3DS or step-up verification).
- Release: Feature-flag BIN gating rules so product teams can tune logic without redeploying.
Troubleshooting and validation
If you encounter unexpected nulls or masked values, confirm your integration is reading the JSON correctly and not assuming missing fields. Use the known-good example to verify your parser:
{
"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
}
}
Common checks:
- Header spelling: Ensure “Authorization: Bearer YOUR_API_KEY” is exact.
- Query parameter: The key must be “bin” and the value must be the first six digits only.
- HTTP method: Must be GET for this endpoint.
End-to-end example flow
- User enters card number; as soon as six digits are present, extract BIN.
- GET the BIN Checker endpoint with ?bin=346350 and your Authorization header.
- On response: if success and isValid:
- Store brand and type for routing and UI.
- If brand is AMERICAN EXPRESS, adjust CVV label and acquirer route.
- If iso_country_code is null, do not assume domestic routing; handle as unknown.
- If not valid, prompt the user early or request an alternative payment method.
- Cache the response keyed by BIN to reduce duplicate lookups.
Another official cURL and JSON pairing for quick testing
Use this exact request and expect the same shape below (values will vary for other BINs):
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"
{
"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
}
}
Why build on Zyla API Hub
Zyla API Hub centralizes authentication and billing across more than 10,000 public APIs. You use one account, one key, and subscription + quota billing to integrate multiple services quickly. Explore finance and payments APIs, including the BIN Checker, from a single place: zylalabs.com.
FAQ
Does this API return a full PAN validation?
No. It validates and enriches the BIN (first six digits) and returns card/issuer metadata. PAN and CVV validation are handled by payment gateways or acquirers during authorization.
What authentication is required?
Use the header Authorization: Bearer YOUR_API_KEY on each request. Get your key from the API listing after subscribing.
Can I cache results?
Yes. BIN metadata is relatively stable. Cache by BIN (e.g., 24 hours) to reduce latency and calls, then refresh periodically.
What are the plan limits and pricing?
Zyla uses subscription + quota, not pay-per-call. The first API typically offers a 7-day trial or 50 requests. Check the API page for current access options and pricing.
How do I use this from an AI coding agent?
Configure your MCP-compatible client to use the Zyla MCP endpoint and your API key. Prompt the agent to make a GET request to the BIN Checker URL with the Authorization header and the bin query parameter. Parse isValid and data fields to guide decisions.
Get your key and ship
Spin up BIN validation in minutes. Subscribe and get your key on the API listing: Start 7-day trial on Credit Card Validator - BIN Checker API. Then call the endpoint, cache results by BIN, and plug the fields into your payments routing and risk logic.