API Documentation
API Documentation
Our REST API provides programmatic access to BIN lookup, credit card validation, and generation tools.
Authentication
All API requests require authentication using an API key:
Authorization: Bearer YOUR_API_KEY
Get your API key from your dashboard.
Base URL
https://api.binsu.com/v1/
Endpoints
BIN Lookup
GET /lookup/{bin}
Lookup information for a specific BIN.
#### Parameters
bin
(required): 6-8 digit bank identification number
#### Example Request
curl -X GET "https://api.binsu.com/v1/lookup/424242" \
-H "Authorization: Bearer YOUR_API_KEY"
#### Example Response
{
"success": true,
"data": {
"bin": "424242",
"brand": "Visa",
"type": "Credit",
"level": "Classic",
"bank": "Test Bank",
"country": "United States",
"country_code": "US",
"website": "https://testbank.com",
"phone": "+1-800-TEST"
}
}
Card Validation
POST /validate
Validate a credit card number using the Luhn algorithm.
#### Parameters
number
(required): Credit card number to validate#### Example Request
curl -X POST "https://api.binsu.com/v1/validate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"number": "4242424242424242"
}'
#### Example Response
{
"success": true,
"data": {
"valid": true,
"brand": "Visa",
"type": "Credit",
"luhn_valid": true,
"length_valid": true
}
}
Card Generation
POST /generate
Generate test credit card numbers for development.
#### Parameters
brand
(optional): Card brand (visa, mastercard, amex, etc.)count
(optional): Number of cards to generate (1-100, default: 1)format
(optional): Output format (json, csv, text)#### Example Request
curl -X POST "https://api.binsu.com/v1/generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"brand": "visa",
"count": 5
}'
#### Example Response
{
"success": true,
"data": {
"cards": [
{
"number": "4532015112830366",
"brand": "Visa",
"cvv": "123",
"expiry": "12/25"
},
{
"number": "4485040371536630",
"brand": "Visa",
"cvv": "456",
"expiry": "03/26"
}
]
}
}
Rate Limits
Plan | Requests/Minute | Requests/Hour | Requests/Day |
---|---|---|---|
Free | 100 | 1,000 | 10,000 |
Pro | 1,000 | 10,000 | 100,000 |
Enterprise | Custom | Custom | Custom |
Error Handling
All errors follow a consistent format:
{
"success": false,
"error": {
"code": "INVALID_BIN",
"message": "BIN must be 6-8 digits",
"details": {
"provided_bin": "123",
"required_length": "6-8"
}
}
}
Common Error Codes
INVALID_API_KEY
: API key is missing or invalidRATE_LIMIT_EXCEEDED
: Too many requestsINVALID_BIN
: BIN format is incorrectBIN_NOT_FOUND
: BIN not in databaseINVALID_CARD_NUMBER
: Card number format is incorrectSDKs and Libraries
We provide official SDKs for popular programming languages:
composer require binsu/php-sdk
npm install binsu-sdk
pip install binsu-sdk
gem install binsu-sdk
PHP SDK Example
use Binsu\SDK\Client;$client = new Client('YOUR_API_KEY');
// BIN Lookup
$result = $client->lookup('424242');
// Card Validation
$result = $client->validate('4242424242424242');
// Card Generation
$result = $client->generate([
'brand' => 'visa',
'count' => 5
]);
Webhooks (Coming Soon)
Webhooks will allow you to receive real-time notifications for:
Support
For API support, contact us: