Validate Card

GEThttps://api-bin-lookup.dataandapis.com/v1/validate

Validate Card is an endpoint of the BIN & Card Validator API. Card scheme from a BIN and full-number validation with Luhn and length rules, nothing stored.

Send your key in the X-Api-Key header. Each call costs 1 token; a free key includes 500 tokens a month.

Request

Query parameters

ParameterExample
number4532015112830366Required

Example request

curl
curl "https://api-bin-lookup.dataandapis.com/v1/validate?number=4532015112830366" \
  -H "X-Api-Key: YOUR_API_KEY"
JavaScript / TypeScript (dataandapis package)
// npm install dataandapis
import { DataAndApis } from "dataandapis";

const client = new DataAndApis(); // reads DATAANDAPIS_API_KEY

const data = await client.binCardValidator.validateCard({ number: "4532015112830366" });
Node.js (fetch)
const res = await fetch("https://api-bin-lookup.dataandapis.com/v1/validate?number=4532015112830366", {
  headers: { "X-Api-Key": process.env.DATAANDAPIS_KEY },
});
const data = await res.json();
Python (dataandapis package)
# pip install dataandapis
from dataandapis import DataAndApis

client = DataAndApis()  # reads DATAANDAPIS_API_KEY

data = client.bin_card_validator.validate_card(number="4532015112830366")
Python (requests)
import os, requests

r = requests.get(
    "https://api-bin-lookup.dataandapis.com/v1/validate?number=4532015112830366",
    headers={"X-Api-Key": os.environ["DATAANDAPIS_KEY"]},
)
data = r.json()

Guide to the dataandapis npm package →Guide to the dataandapis Python package →

Example response

Example response
{
  "card": "453201******0366",
  "last4": "0366",
  "bin": "453201",
  "scheme": "visa",
  "length": 16,
  "expected_lengths": [
    13,
    16,
    19
  ],
  "luhn_valid": true,
  "length_valid": true,
  "valid": true
}