API documentation
One base URL, three REST endpoints, and an MCP server — all pure compute. Authenticate with ?key= or an Authorization: Bearer header. Get a free key →
BIN / IIN lookup
Returns the scheme, valid lengths, and CVV length for a BIN. Issuer/country are returned for known sample BINs only — this is a QA helper, not a comprehensive BIN database.
GET /api/v1/bin?bin=424242&key=YOUR_KEY
{
"bin": "424242",
"scheme": "visa",
"brand": "Visa",
"type": "credit",
"bank": "Stripe test",
"country": "US",
"lengths": [13, 16, 19],
"cvvLength": 3
}Luhn validation
Checks the mod-10 checksum and detects the scheme.
GET /api/v1/luhn?number=4242424242424242&key=YOUR_KEY
{ "number": "4242424242424242", "luhnValid": true, "scheme": "visa", "brand": "Visa", "lengthValid": true }Generate test cards
Returns Luhn-valid, non-functional QA fixtures. These are declined by real processors.
GET /api/v1/generate?network=visa&count=5&key=YOUR_KEYMCP server (for AI agents)
Streamable-HTTP MCP endpoint exposing the validate_card, lookup_bin, and generate_test_cards tools. Add it to Claude / Cursor / any MCP client; pass your key via the Authorization header, ?key=, or an apiKey tool argument.
MCP endpoint: https://www.testcards.io/mcp (POST, JSON-RPC 2.0)
{ "mcpServers": {
"testcards": {
"url": "https://www.testcards.io/mcp?key=YOUR_KEY"
}
} }Parameters
| Param | Applies to | Description |
|---|---|---|
| key | required | Your API key (or send as Authorization: Bearer <key>). |
| bin | required for /bin | A BIN/IIN or full card number. Scheme & length are computed; issuer fields fill in for known sample BINs. |
| number | required for /luhn | The card number to validate against the Luhn checksum. |
| network | for /generate | visa | mastercard | amex | discover | diners | jcb | unionpay | maestro. Default visa. |
| count | for /generate | How many numbers to generate, 1–50. Default 1. |
Errors
401 invalid/missing key · 429 monthly limit reached · 400 bad parameter · 422 unrecognized card number.