Back to Guides

API Documentation

June 04, 2025 Updated: June 16, 2025 17 views 3 min read

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

    PlanRequests/MinuteRequests/HourRequests/Day
    Free1001,00010,000
    Pro1,00010,000100,000
    EnterpriseCustomCustomCustom

    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 invalid
  • RATE_LIMIT_EXCEEDED: Too many requests
  • INVALID_BIN: BIN format is incorrect
  • BIN_NOT_FOUND: BIN not in database
  • INVALID_CARD_NUMBER: Card number format is incorrect
  • SDKs and Libraries

    We provide official SDKs for popular programming languages:

  • PHP: composer require binsu/php-sdk
  • JavaScript: npm install binsu-sdk
  • Python: pip install binsu-sdk
  • Ruby: 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:

  • Account updates
  • Usage alerts
  • Security events
  • Support

    For API support, contact us:

  • Email: [email protected]
  • Telegram: @binsu_contact
  • Documentation: binsu.com/docs
  • Changelog

    v1.2 (2025-01-15)

  • Added card generation endpoint
  • Improved error handling
  • Enhanced rate limiting
  • v1.1 (2024-12-01)

  • Added card validation endpoint
  • Improved response times
  • Added more card brands
  • v1.0 (2024-10-01)

  • Initial API release
  • BIN lookup endpoint
  • Basic authentication

Related Topics

API documentation REST API BIN lookup API credit card validation API developer tools

Share this guide

More Guides

Getting Started with BIN Lookup

Learn the basics of BIN lookup and how to use our tools effectively.

API Integration Guide

Step-by-step guide to integrate our API into your application.