PAN validator

This API validates credit card numbers using the Luhn algorithm and returns the result in various formats.
1ms

About

The API checks the validity of a provided credit card number using the Luhn algorithm and responds with either ‘valid’ or ‘invalid’. It supports different response formats including plain text, JSON, and JSONP, and allows for customized callback functions in JSONP responses.
by GLOBUS.studio

Endpoint

				
					/**
 * Credit Card PAN Validation API
 * GET https://api.globus.studio/v2/pan?card_number=...&format=json|plain|jsonp
 * Response (json): { card_number, validity: "valid"|"invalid" }
 */

async function checkPan(cardNumber) {
    const res = await fetch(`https://api.globus.studio/v2/pan?card_number=${encodeURIComponent(cardNumber)}&format=json`);
    return res.json();
}

// Valid card (Luhn check passes)
checkPan('4111111111111111').then(d => console.log(d.validity));

// Invalid card
checkPan('1234567812345670').then(d => console.log(d.validity));