# Bindex API guide (Markdown)

Base URL: https://bindex.cc/

## Quickstart
Get an API key, then look up the first 6-8 digits of a card with the X-API-Key header.

```bash
curl -sS "https://bindex.cc/api/v1/bins/45717360" -H "X-API-Key: $BINDEX_API_KEY" -H "X-API-Version: 2"
```

## Endpoints (public customer paths)

| Method | Path | Summary |
| --- | --- | --- |
| POST | `/api/v1/auth/login` | Login Account |
| POST | `/api/v1/auth/logout` | Logout |
| GET | `/api/v1/auth/me` | Whoami |
| POST | `/api/v1/auth/me/checkout/finalize` | Finalize Checkout |
| GET | `/api/v1/auth/me/keys` | My Keys |
| POST | `/api/v1/auth/me/keys` | Create My Key |
| DELETE | `/api/v1/auth/me/keys/{key_id}` | Revoke My Key |
| GET | `/api/v1/auth/me/limits` | My Limits |
| POST | `/api/v1/auth/me/password` | Change Password |
| GET | `/api/v1/auth/me/payment-methods` | My Payment Methods |
| DELETE | `/api/v1/auth/me/payment-methods/{method_id}` | Remove Payment Method |
| POST | `/api/v1/auth/me/redeem` | Redeem |
| GET | `/api/v1/auth/me/subscription` | My Subscription |
| POST | `/api/v1/auth/me/subscription/cancel` | Cancel Subscription |
| POST | `/api/v1/auth/me/subscription/subscribe` | Subscribe |
| GET | `/api/v1/auth/me/tokens` | My Tokens |
| GET | `/api/v1/auth/me/topups` | My Topups |
| GET | `/api/v1/auth/me/usage` | My Usage |
| POST | `/api/v1/auth/register` | Register Account |
| GET | `/api/v1/billing/balance` | Balance |
| GET | `/api/v1/billing/topups` | List Topups Endpoint |
| POST | `/api/v1/billing/topups` | Create Topup Endpoint |
| GET | `/api/v1/billing/topups/{topup_id}` | Get Topup Endpoint |
| GET | `/api/v1/billing/transactions` | Transactions |
| GET | `/api/v1/bins` | Search |
| POST | `/api/v1/bins/batch` | Batch Lookup |
| GET | `/api/v1/bins/{prefix}` | Get Bin |
| GET | `/api/v1/checkout/{topup_id}` | Checkout Details |
| POST | `/api/v1/checkout/{topup_id}/verify` | Verify Checkout |
| GET | `/api/v1/dataset` | Dataset |
| GET | `/api/v1/me` | Me |
| GET | `/api/v1/me/usage` | Me Usage |
| GET | `/api/v1/packs` | List Token Packs |
| POST | `/api/v1/packs/{pack_name}/purchase` | Buy Token Pack |
| GET | `/api/v1/plans` | List Public Plans |
| POST | `/api/v1/public/bins/batch` | Public Batch |
| GET | `/api/v1/public/bins/{prefix}` | Public Lookup |
| GET | `/api/v1/public/dataset` | Public Dataset |
| GET | `/api/v1/public/packs` | List Token Packs Public |
| GET | `/api/v1/public/plans` | List Public Plans Keyless |
| GET | `/api/v1/public/site-config` | Public Site Config |
| GET | `/api/v1/subscriptions/locales` | Locales |
| GET | `/api/v1/subscriptions/plans` | Recurring Plans |
| GET | `/api/v1/tokens` | Token Balance |
| GET | `/api/v1/tokens/ledger` | Token Ledger |
| GET | `/healthz` | Healthz |

## Canonical response field dictionary (X-API-Version: 2)

| Field | Meaning |
| --- | --- |
| `bin` | canonical flat response field |
| `matched_on` | canonical flat response field |
| `scheme` | canonical flat response field |
| `brand` | canonical flat response field |
| `funding_type` | canonical flat response field |
| `type` | canonical flat response field |
| `product_level` | canonical flat response field |
| `level` | canonical flat response field |
| `issuer.name` | canonical flat response field |
| `issuer.slug` | canonical flat response field |
| `issuer.phone` | canonical flat response field |
| `issuer.website` | canonical flat response field |
| `issuer.city` | canonical flat response field |
| `bank_name` | canonical flat response field |
| `country.name` | canonical flat response field |
| `country.code` | canonical flat response field |
| `country.numeric` | canonical flat response field |
| `country.emoji` | canonical flat response field |
| `country.currency` | canonical flat response field |
| `country.latitude` | canonical flat response field |
| `country.longitude` | canonical flat response field |
| `country_name` | canonical flat response field |
| `country_code` | canonical flat response field |
| `prepaid` | canonical flat response field |
| `number.length` | canonical flat response field |
| `number.luhn` | canonical flat response field |
| `record_date` | canonical flat response field |
| `last_verified` | canonical flat response field |
| `source` | canonical flat response field |
| `confidence` | canonical flat response field |

## Dataset coverage (counts only)

- rows: 458081
- countries: 225
- issuers: 19388
- schemes: 75
- synced_at: 2026-11-26T22:22:46+00:00

## Code examples (6 languages, one shared shape)

### cURL

```bash
curl -sS "https://bindex.cc/api/v1/bins/45717360" -H "X-API-Key: $BINDEX_API_KEY"
```

### Python

```python
import os, requests
r = requests.get("https://bindex.cc/api/v1/bins/45717360", headers={"X-API-Key": os.environ["BINDEX_API_KEY"]}, timeout=10)
print(r.json().get("matched_on"))
```

### JavaScript

```javascript
const r = await fetch("https://bindex.cc/api/v1/bins/45717360", {headers: {"X-API-Key": key}});
const data = await r.json();
```

### Node.js

```javascript
const r = await fetch("https://bindex.cc/api/v1/bins/45717360", {headers: {"X-API-Key": process.env.BINDEX_API_KEY}});
const data = await r.json();
```

### PHP

```php
$ctx = stream_context_create(["http" => ["header" => "X-API-Key: " . getenv("BINDEX_API_KEY")]]);
$data = json_decode(file_get_contents("https://bindex.cc/api/v1/bins/45717360", false, $ctx), true);
```

### Go

```go
req, _ := http.NewRequest("GET", "https://bindex.cc/api/v1/bins/45717360", nil)
req.Header.Set("X-API-Key", os.Getenv("BINDEX_API_KEY"))
resp, _ := (&http.Client{Timeout: 10 * time.Second}).Do(req)
```

## Pricing

Token packs have a 1000-token minimum. Current prices are served live by GET https://bindex.cc/api/v1/packs and /api/v1/plans -- never hardcode or invent a price.

## Errors

- 402 = out of tokens; 429 = quota (honour Retry-After); 422 = invalid request or FULL_PAN_REJECTED.
- A 13-19 digit full card number is rejected before metering with 422 FULL_PAN_REJECTED.
